diff --git a/apps/kimi-code/dist-web/assets/CodeBlockNode-Dh6YGbd1.js b/apps/kimi-code/dist-web/assets/CodeBlockNode-Dh6YGbd1.js new file mode 100644 index 00000000000..862017924e5 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/CodeBlockNode-Dh6YGbd1.js @@ -0,0 +1,29 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-W-09C5Mb.js","assets/index-CiHMlsuo.js","assets/index-CqjkU7Bl.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-CiHMlsuo.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-W-09C5Mb.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(" + + + + + + + + ${P} + +`}),ke=b(()=>{return P=M.htmlPreviewSandbox,H=M.htmlPreviewAllowScripts,typeof P=="string"?((function(re){if(!y||typeof console>"u"||te===re)return;const T=(function(gt){return new Set(gt.trim().toLowerCase().split(/\s+/).filter(Boolean))})(re);T.has("allow-scripts")&&T.has("allow-same-origin")&&(te=re,console.warn("[markstream-vue] htmlPreviewSandbox contains both allow-scripts and allow-same-origin. Use this only for fully trusted content served from an isolated origin."))})(P),P):P!==void 0?"":H===!0?"allow-scripts":"";var P,H});function r(P){var H;P.key!=="Escape"&&P.key!=="Esc"||(H=M.onClose)==null||H.call(M)}return No(()=>{typeof window<"u"&&window.addEventListener("keydown",r)}),To(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(P,H)=>(Y(),Sn(ji,{to:"body"},[w("div",{class:pt(["markstream-vue",{dark:M.isDark}])},[w("div",{class:"html-preview-frame__backdrop",onClick:H[2]||(H[2]=re=>{var T;return(T=M.onClose)==null?void 0:T.call(M)})},[w("div",{class:"html-preview-frame",onClick:H[1]||(H[1]=Do(()=>{},["stop"]))},[w("div",hr,[w("div",gr,[H[3]||(H[3]=w("span",{class:"html-preview-frame__dot"},null,-1)),w("span",yr,Be(M.title||J(ne)("common.preview")||"Preview"),1)]),w("button",{type:"button",class:"html-preview-frame__close",onClick:H[0]||(H[0]=re=>{var T;return(T=M.onClose)==null?void 0:T.call(M)})}," × ")]),w("iframe",{class:"html-preview-frame__iframe",sandbox:ke.value,referrerpolicy:"no-referrer",srcdoc:be.value},null,8,wr)])])],2)]))}}),[["__scopeId","data-v-24e66176"]]),kr=["data-markstream-enhanced","data-markstream-enhancement-state","data-markstream-code-block-state","data-markstream-pending","data-markstream-viewport-pending"],xr={class:"code-header-main"},Sr=["innerHTML"],Cr={class:"code-header-copy"},Mr={class:"code-header-title"},Br={key:0,class:"code-header-caption"},Er=["data-markstream-host-hidden"],zo="__markstreamMonacoPassiveTouchState__",Lr=Ho(pl({__name:"CodeBlockNode",props:{node:{},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},theme:{},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isShowPreview:{type:Boolean,default:!0},monacoOptions:{},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},customId:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},estimatedHeightPx:{},estimatedContentHeightPx:{},estimatedDiffInline:{type:Boolean}},emits:["previewCode","copy"],setup(k,{emit:M}){var y,te,ne,be,ke;const r=k,P=M,H=Ci(),re=fl(Mi,null),T=fl("markstreamHostScrollManaged",null),gt=fl(Bi,void 0),Ge=b(()=>Ii(r,H)),Ee=new Set;function yt(e){return j(this,null,function*(){var t;if(typeof window>"u")return yield e();const n=(t=window.Element)==null?void 0:t.prototype,l=n?.addEventListener;if(!n||!l)return yield e();const o=(function(){const s=window,u=s[zo];if(u)return u;const a={depth:0,original:null};return s[zo]=a,a})();let i=null;try{o.depth===0&&(o.original=l,n.addEventListener=function(u,a,c){var d;const f=(d=o.original)!=null?d:l;return u==="touchstart"&&(function(p,h){if(!p)return!1;const x=p;return!(typeof x.closest!="function"||!x.closest(".monaco-editor, .monaco-diff-editor")||h&&typeof h=="object"&&"passive"in h)})(this,c)?f.call(this,u,a,(function(p){return p==null?{passive:!0}:typeof p=="boolean"?{capture:p,passive:!0}:typeof p=="object"?"passive"in p?p:Me(U({},p),{passive:!0}):{passive:!0}})(c)):f.call(this,u,a,c)}),o.depth++;let s=!1;i=()=>{s||(s=!0,Ee.delete(i),o.depth=Math.max(0,o.depth-1),o.depth===0&&o.original&&n.addEventListener!==o.original&&(n.addEventListener=o.original,o.original=null))},Ee.add(i)}catch{return yield e()}try{return yield e()}finally{i?.()}})}function gl(e,t){}const Jt=Mo(),Yt=b(()=>{const e=Jt?.vnode.props;return!(!e||!e.onPreviewCode&&!e["onPreview-code"])}),{t:Q}=hl(),v=$(null),z=$(null),wt=$(!1),xe=$(ao(r.node.language,r.node.code,Ve())),Cn=b(()=>Eo(xe.value)),Fe=b(()=>Cn.value==="plaintext"?"text":Cn.value),Mn=b(()=>Cn.value==="plaintext"),Pe=$(!1),Se=$(!1),X=$(!1),Ce=$(!1),q=$(!1),bt=$(!1);let B=!1,kt=null,Ft=null,Je=null,Ye=0,Qe=!1,We="";const _e=$(null),ve=$(null);let Bn=null,En=0,Fn=!1;const Ao=Ei(),Qt=Fi(),Pn=Pi(),Ie=$i(null),Z=$(typeof window>"u"||!Pn.value),jo=(ne=(te=(y=Mo())==null?void 0:y.vnode.el)==null?void 0:te.textContent)!=null?ne:"",qo=typeof window<"u"&&String((be=r.node.code)!=null?be:"").length>0&&jo.includes(String(r.node.code)),yl=$(!qo);No(()=>{yl.value=!0}),typeof window<"u"&&ue([()=>z.value,Pn],([e,t],n,l)=>{var o,i,s;if((o=Ie.value)==null||o.destroy(),Ie.value=null,!t||Z.value)return void(Z.value=!0);if(!e)return void(Z.value=!1);let u=!0;const a=(s=(i=Qt?.value.heavyBlockMargin)!=null?i:Qt?.value.rootMargin)!=null?s:"0px",c=Ao(e,{rootMargin:a,allowIdle:!1});Ie.value=c,Z.value=Z.value||c.isVisible.value,c.whenVisible.then(()=>{u&&Ie.value===c&&(Z.value=!0)}).catch(()=>{}),l(()=>{u=!1,c.destroy(),Ie.value===c&&(Ie.value=null)})},{immediate:!0}),Li(()=>{var e;B=!0;for(const t of Array.from(Ee))t();(function(){const t=We;re&&t&&(We="",re.markSettled(t))})(),(e=Ie.value)==null||e.destroy(),Ie.value=null});let se=null,Xt=null,Ln=()=>{},Kt=()=>{},xt=()=>null,de=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),V=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),On=()=>{},Xe=()=>{},$n=()=>{},Ke=null,ze=null,Pt=null,Lt=null,wl=()=>{var e;return String((e=r.node.language)!=null?e:"plaintext")},zn=()=>j(null,null,function*(){}),Hn=!1,Zt=null;const He=[],Nn=[];let Ne=null;const m=b(()=>zi(r.node)),Ze=$({removed:0,added:0}),Wo=b(()=>`-${Ze.value.removed} +${Ze.value.added}`),bl=Object.freeze(Me(U({},Wt),{enabled:!1,revealLineCount:0}));function kl(e){var t,n,l;const o=((n=(t=z.value)==null?void 0:t.getBoundingClientRect)==null?void 0:n.call(t).width)||((l=z.value)==null?void 0:l.clientWidth)||(typeof window>"u"?0:window.innerWidth);return Di(e,o)}function Ot(e,t){return{original:en(e),updated:en(t)}}function en(e){return String(e??"").replace(/\r\n$|\n$|\r$/,"")}function $t(e){var t;return String((t=e?.message)!=null?t:e).includes("no diff result available")}function St(){if(!$e())try{const e=$n();e&&typeof e.catch=="function"&&e.catch(t=>{$t(t)})}catch(e){$t(e)}}const ae=b(()=>{var e,t,n,l;const o=r.monacoOptions?U({},r.monacoOptions):{};if(!m.value)return U({lineDecorationsWidth:0,lineNumbersMinChars:2,glyphMargin:!1},o);const i=o.diffHideUnchangedRegions===void 0?U({},Wt):bn(o.diffHideUnchangedRegions),s=o.hideUnchangedRegions===void 0?void 0:bn(o.hideUnchangedRegions),u=r.stream!==!1&&r.loading!==!1,a=u?U({},bl):i,c=u?U({},bl):s,d=(function(g){return g.diffWordWrap!==void 0?g.diffWordWrap:"off"})(o),f=U({},(e=o.experimental)!=null?e:{}),p=(t=o.diffUnchangedRegionStyle)!=null?t:"line-info",h=(function(g){const N=g.scrollbar&&typeof g.scrollbar=="object"?g.scrollbar:{};return U(Me(U({},N),{verticalScrollbarSize:0,horizontalScrollbarSize:0}),kl(g)?{horizontal:"hidden"}:{})})(o),x={maxComputationTime:0,diffAlgorithm:"legacy",ignoreTrimWhitespace:!1,renderIndicators:!0,diffUpdateThrottleMs:120,renderLineHighlight:"none",renderLineHighlightOnlyWhenFocus:!0,selectionHighlight:!1,occurrencesHighlight:"off",matchBrackets:"never",lineDecorationsWidth:4,lineNumbersMinChars:2,glyphMargin:!1,padding:{top:0,bottom:0},minimap:{enabled:!1},renderOverviewRuler:!1,overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollBeyondLastLine:!1,diffWordWrap:d,renderSideBySide:(n=o.renderSideBySide)==null||n,diffHideUnchangedRegions:a,useInlineViewWhenSpaceIsLimited:(l=o.useInlineViewWhenSpaceIsLimited)!=null&&l,diffLineStyle:"background",diffAppearance:"auto",diffUnchangedRegionStyle:p,diffHunkActionsOnHover:!1,experimental:f};return Me(U(Me(U(U({},x),o),{experimental:f}),c===void 0?{}:{hideUnchangedRegions:c}),{diffHideUnchangedRegions:a,diffWordWrap:d,scrollbar:h})}),Tn=b(()=>(r.theme!==void 0?!po(r.theme):ho(r.darkTheme,r.lightTheme))?(function(e){var t,n;if(e&&typeof e=="object"&&((t=e.colors)!=null&&t["editor.background"])){const o=el(e.colors["editor.background"]);if(o!=null)return o<128}const l=((n=rt(e))!=null?n:"").toLowerCase();return l?["dark","night","moon","black","dracula","mocha","frappe","macchiato","palenight","ocean","poimandres","monokai","laserwave","tokyo","slack-dark","rose-pine","github-dark","material-theme","one-dark","catppuccin-mocha","catppuccin-frappe","catppuccin-macchiato"].some(o=>l.includes(o))&&!["light","latte","dawn","lotus"].some(o=>l.includes(o)):!!r.isDark})(Dt()):!!r.isDark),Rn=b(()=>{var e;if(!m.value)return Tn.value?"dark":"light";const t=(e=ae.value)==null?void 0:e.diffAppearance;return t==="light"||t==="dark"?t:Tn.value?"dark":"light"}),xl=b(()=>m.value?Rn.value==="dark":Tn.value),zt=b(()=>m.value?"diff":"single"),Sl=$(zt.value),ge=$(!1),R=$(!1),Ht=$(!1),me=$(!1),et=$(null),Dn=$(0),Cl=$(0),tn=$(!1);let Nt=null,tt=!1,An=null,jn=!1;const qn=b(()=>{var e,t,n;if(m.value){const o=(e=ae.value)==null?void 0:e.diffWordWrap;if(o==="inherit"){const i=(t=r.monacoOptions)==null?void 0:t.wordWrap;return i==null||String(i)!=="off"}return o==="on"}const l=(n=r.monacoOptions)==null?void 0:n.wordWrap;return l==null||String(l)!=="off"}),Ue=b(()=>{var e;return!!m.value&&kl((e=ae.value)!=null?e:{})}),Wn=b(()=>{var e;const t=(e=r.monacoOptions)==null?void 0:e.diffHideUnchangedRegions;return t===void 0?U({},Wt):bn(t)});function Ml(e){return T?.value===!0||!!e&&(!!e.closest('[data-markstream-virtual-timeline="1"], .markstream-virtual-timeline')||!!e.closest(".vue-recycle-scroller, [data-virtualizer], [data-virtual-scroll-root]"))}const _o=b(()=>Ml(z.value)),Te=b(()=>!(ge.value||!me.value&&R.value)),Bl=b(()=>Te.value),Io=b(()=>Te.value&&!Ht.value),Uo=b(()=>!ge.value&&!me.value&&Te.value),Vo=b(()=>R.value&&!ge.value?"ready":me.value?"fallback":"pending"),nn=$(!1),Re=b(()=>en(r.node.code)),El=b(()=>m.value?r.node.diff===!0?r.node:Me(U({},r.node),{diff:!0}):Re.value===r.node.code?r.node:Me(U({},r.node),{code:Re.value})),pe=$(typeof((ke=r.monacoOptions)==null?void 0:ke.fontSize)=="number"?r.monacoOptions.fontSize:Number.NaN),W=$(pe.value),_n=$(null),ln=$(null),on=$(null),Go=b(()=>{const e=pe.value,t=W.value;return typeof e=="number"&&Number.isFinite(e)&&e>0&&typeof t=="number"&&Number.isFinite(t)&&t>0}),rn=b(()=>{var e;const t=_n.value;if(typeof t=="number"&&Number.isFinite(t)&&t>0)return t;const n=(e=r.monacoOptions)==null?void 0:e.fontSize;if(typeof n=="number"&&Number.isFinite(n)&&n>0)return n;const l=W.value;return typeof l=="number"&&Number.isFinite(l)&&l>0?l:12}),Jo=b(()=>{var e;const t=ln.value;if(typeof t=="number"&&Number.isFinite(t)&&t>0)return t;const n=(e=r.monacoOptions)==null?void 0:e.lineHeight;return typeof n=="number"&&Number.isFinite(n)&&n>0?n:rn.value===12?18:Math.max(12,Math.round(1.5*rn.value))}),an=b(()=>Jo.value),Fl=b(()=>{var e;const t=(e=r.monacoOptions)==null?void 0:e.tabSize;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:4}),un=b(()=>{var e;const t=(e=r.monacoOptions)==null?void 0:e.padding,n=m.value?0:8;return{top:typeof t?.top=="number"&&Number.isFinite(t.top)&&t.top>=0?t.top:n,bottom:typeof t?.bottom=="number"&&Number.isFinite(t.bottom)&&t.bottom>=0?t.bottom:n}}),sn=b(()=>{const e=r.estimatedContentHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null});function dn(e){if(e==null)return null;const t=Math.ceil(e);return!Number.isFinite(t)||t<=0?null:Math.min(t,Math.ceil(Mt()))}function In(){return!m.value&&r.stream!==!1&&r.loading!==!1}const Pl=b(()=>m.value?null:sn.value==null||In()?Math.ceil((e=>{const t=String(e??"");return t?Math.max(1,t.split(/\r\n|\n|\r/).length):1})(Re.value)*an.value+1):null),Ll=b(()=>{if(m.value)return null;const e=sn.value;return e==null||In()?dn(Pl.value):dn(e)}),Yo=b(()=>{const e=r.estimatedHeightPx;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null}),Un=$(null);function nt(){const e=Un.value;return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.round(e):null}const Vn=b(()=>{const e=nt();return e??(!m.value&&tn.value?null:Te.value||!R.value?Ll.value:null)});function Ol(e){const t=e?"hsl(152 42% 60%)":"var(--diff-added-fg)",n=e?"hsl(0 58% 58%)":"var(--diff-removed-fg)",l=e?"hsl(152 42% 60% / 0.18)":"var(--diff-added-bg)",o=e?"hsl(0 58% 58% / 0.18)":"var(--diff-removed-bg)",i=e?"hsl(152 42% 60% / 0.28)":"var(--diff-added-inline-bg)",s=e?"hsl(0 58% 58% / 0.28)":"var(--diff-removed-inline-bg)",u=`linear-gradient(90deg, ${t} 0 4px, transparent 4px 100%)`,a=`linear-gradient(90deg, ${n} 0 4px, transparent 4px 100%)`,c=e?"hsl(0 0% 7% / 0.98)":"hsl(var(--ms-muted) / 0.45)",d="var(--markstream-code-layout-character-width, 1ch)",f=`calc(${d} + ${d})`,p=`calc(${d} + ${d} + ${d} + ${d} + ${d} + 2px)`,h=`calc(${p} + ${d})`;return{"--markstream-diff-line-number-bg":c,"--markstream-diff-added-fg":t,"--markstream-diff-removed-fg":n,"--markstream-diff-added-line":l,"--markstream-diff-removed-line":o,"--markstream-diff-added-line-fill":l,"--markstream-diff-removed-line-fill":o,"--markstream-diff-added-gutter":u,"--markstream-diff-removed-gutter":a,"--markstream-diff-added-inline":i,"--markstream-diff-removed-inline":s,"--stream-monaco-added-fg":t,"--stream-monaco-removed-fg":n,"--stream-monaco-added-line":l,"--stream-monaco-removed-line":o,"--stream-monaco-added-line-fill":l,"--stream-monaco-removed-line-fill":o,"--stream-monaco-added-gutter":u,"--stream-monaco-removed-gutter":a,"--stream-monaco-added-inline":i,"--stream-monaco-removed-inline":s,"--stream-monaco-gutter-marker-width":"4px","--stream-monaco-gutter-gap":"1ch","--stream-monaco-line-number-left":"0px","--stream-monaco-line-number-width":f,"--stream-monaco-line-number-padding-left":f,"--stream-monaco-line-number-padding-right":d,"--stream-monaco-line-number-separator-width":"2px","--stream-monaco-layout-character-width":d,"--stream-monaco-line-number-box-width":p,"--stream-monaco-line-number-gap-to-code":d,"--stream-monaco-line-number-bg":c,"--stream-monaco-diff-code-gap":d,"--stream-monaco-diff-code-padding":"0px","--stream-monaco-original-margin-width":h,"--stream-monaco-original-scrollable-left":h,"--stream-monaco-original-scrollable-width":`calc(100% - ${h})`,"--stream-monaco-modified-margin-width":h,"--stream-monaco-modified-scrollable-left":h,"--stream-monaco-modified-scrollable-width":`calc(100% - ${h})`}}const $l=b(()=>{var e;const t=(e=r.monacoOptions)==null?void 0:e.fontFamily,n=dn(sn.value),l=dn(Pl.value),o=In(),i=U(U({fontSize:`${rn.value}px`,lineHeight:`${an.value}px`,tabSize:Fl.value,boxSizing:"border-box",maxHeight:`${Mt()}px`,overflow:"auto",paddingTop:`${un.value.top}px`,paddingBottom:`${un.value.bottom}px`},m.value||n==null||o?m.value||l==null?{}:{minHeight:`${l}px`}:{height:`${n}px`,minHeight:`${n}px`}),typeof t=="string"&&t.trim()?{"--markstream-code-font-family":t.trim()}:{});return i["--markstream-pre-line-number-top"]=`${un.value.top}px`,i["--markstream-pre-line-number-left"]="0px",i["--markstream-pre-line-number-padding-left"]="2ch",i["--markstream-pre-line-number-padding-right"]="1ch",i["--markstream-pre-line-number-separator-width"]="2px",m.value&&(i["--markstream-pre-diff-line-height"]=`${an.value}px`,i["--markstream-pre-diff-pane-bottom-padding"]=(Ue.value,"0px"),Object.assign(i,Ol(xl.value))),i}),zl=b(()=>Vn.value!=null&&(!R.value||nt()!=null)),Qo=b(()=>{const e=Vn.value;if(e==null)return null;if(m.value)return Math.ceil(e);const t=Yo.value,n=sn.value;if(t==null||n==null)return Math.ceil(e);const l=Math.max(0,Math.ceil(t)-Math.ceil(n));return Math.ceil(e+l)}),Xo=b(()=>{if(m.value&&Te.value)return{};const e=Vn.value;return zl.value&&e!=null?{minHeight:`${e}px`}:{}});function Hl(){var e,t,n,l,o,i,s,u;const a=(e=z.value)==null?void 0:e.querySelector("pre.code-pre-fallback"),c=V(),d=(t=a?.scrollTop)!=null?t:0;(o=(l=(n=c?.getOriginalEditor)==null?void 0:n.call(c))==null?void 0:l.setScrollTop)==null||o.call(l,d),(u=(s=(i=c?.getModifiedEditor)==null?void 0:i.call(c))==null?void 0:s.setScrollTop)==null||u.call(s,d)}function Nl(){return j(this,null,function*(){return m.value?(tl()!=null||cn(),ee(!0),Hl(),he(),Ht.value=!0,yield A(),ee(!0),yield Le(),ee(!0),!(Ke&&!(yield Ke())||(Rt(),cn(),ee(!0),R.value=!0,yield A(),cn(),ee(!0),Rt(),he(),ce(),0))):!(Ke&&!(yield Ke())||(R.value=!0,yield A(),le(!1),ee(),0))})}function cn(){const e=v.value;return e&&mn(e)?(he(),le({preferModelDiffHeight:!0}),it(),Number.parseFloat(e.style.height||"")||null):tl()}function Tl(){if(!m.value||!q.value||!R.value||Te.value)return!1;const e=v.value;return!!e&&Tt(e)}function Rl(e,t=!1,n={}){const l=Math.ceil(e),o=nt();if(o==null)return l;const i=n.allowBelowEstimatedFloor===!0||Tl();return l>=o||i?((t||i)&&q.value&&(Un.value=null),l):o}function Le(){return new Promise(e=>{let t=!1,n=null,l=null;const o=()=>{t||(t=!0,l!=null&&globalThis.clearTimeout(l),n!=null&&kn(n),e())};l=globalThis.setTimeout(o,50),n=fe(o)})}function Dl(){try{const e=v.value;if(!e)return null;const t=e.querySelector(".view-lines .view-line");if(t){const n=Math.ceil(t.getBoundingClientRect().height);if(n>0)return n}}catch{}return null}function Gn(){var e,t,n,l,o;try{const i=m.value?(n=(t=(e=V())==null?void 0:e.getModifiedEditor)==null?void 0:t.call(e))!=null?n:V():de(),s=xt(),u=(l=s?.EditorOption)==null?void 0:l.fontInfo;if(i&&u!=null){const a=(o=i.getOption)==null?void 0:o.call(i,u),c=a?.fontSize;if(typeof c=="number"&&Number.isFinite(c)&&c>0)return c}}catch{}try{const i=v.value;if(i){const s=i.querySelector(".view-lines .view-line");if(s)try{if(typeof window<"u"&&typeof window.getComputedStyle=="function"){const u=window.getComputedStyle(s).fontSize,a=u&&u.match(/^(\d+(?:\.\d+)?)/);if(a)return Number.parseFloat(a[1])}}catch{}}}catch{}return null}function Ct(e){var t,n;try{const i=xt(),s=(t=i?.EditorOption)==null?void 0:t.lineHeight;if(s!=null){const u=(n=e?.getOption)==null?void 0:n.call(e,s);if(typeof u=="number"&&u>0)return u}}catch{}const l=Dl();if(l&&l>0)return l;const o=Number.isFinite(W.value)&&W.value>0?W.value:14;return Math.max(12,Math.round(1.35*o))}function fn(e){var t,n,l;try{const i=xt(),s=(t=i?.EditorOption)==null?void 0:t.padding;if(s!=null){const u=(n=e?.getOption)==null?void 0:n.call(e,s);if(typeof u?.top=="number"||typeof u?.bottom=="number")return(typeof u?.top=="number"&&Number.isFinite(u.top)?Math.max(0,u.top):0)+(typeof u?.bottom=="number"&&Number.isFinite(u.bottom)?Math.max(0,u.bottom):0)}}catch{}const o=(l=ae.value)==null?void 0:l.padding;return typeof o?.top=="number"||typeof o?.bottom=="number"?(typeof o?.top=="number"&&Number.isFinite(o.top)?Math.max(0,o.top):0)+(typeof o?.bottom=="number"&&Number.isFinite(o.bottom)?Math.max(0,o.bottom):0):m.value?24:0}function Al(e,t){return typeof e!="number"||typeof t!="number"||e<1||t=o&&s>=o&&n[i]===l[s];)i--,s--;const u=Math.max(0,i-o+1),a=Math.max(0,s-o+1);if(u===0||a===0)return{removed:u,added:a};if((u+1)*(a+1)<=15e5){const c=a+1;let d=new Uint32Array(c),f=new Uint32Array(c);for(let h=u-1;h>=0;h--){f[a]=0;for(let g=a-1;g>=0;g--)f[g]=n[o+h]===l[o+g]?d[g+1]+1:Math.max(d[g],f[g+1]);const x=d;d=f,f=x}const p=d[0];return{removed:u-p,added:a-p}}return{removed:u,added:a}}function ql(e){var t;if(!(function(){var s,u,a;return!(!m.value||!Ue.value)&&(r.node.originalCode!=null||r.node.updatedCode!=null?vn(String((s=r.node.originalCode)!=null?s:""),String((u=r.node.updatedCode)!=null?u:"")).removed>0:String((a=r.node.code)!=null?a:"").split(/\r\n|\n|\r/).some(c=>(function(d){return d.startsWith("-")&&!d.startsWith("---")})(c)))})())return!0;const n=e?.querySelector(".stream-monaco-fallback-inline-delete-line");if((t=n?.textContent)!=null&&t.trim()&&(n.hasAttribute("data-stream-monaco-colorize-signature")||n.querySelector('[class*="mtk"]')))return!0;const l=e?.querySelector([".editor.modified .view-zones .view-lines.line-delete",".editor.modified .view-lines .view-line.line-delete",".editor.original .view-zones .view-lines.line-delete",".editor.original .view-lines .view-line.line-delete"].join(","));if(!l||!l.matches(".view-line")&&!l.querySelector(".view-line"))return!1;const o=l.getBoundingClientRect(),i=e?.getBoundingClientRect();return i?.width===0&&i.height===0||o.width>0&&o.height>0}function Wl(e,t){if(!e)return!1;const n=t.added<=0||!!e.querySelector([".line-insert",".gutter-insert",".stream-monaco-fallback-line-insert",".stream-monaco-fallback-gutter-insert",".stream-monaco-fallback-line-number-insert"].join(",")),l=t.removed<=0||!!e.querySelector([".line-delete",".gutter-delete",".inline-deleted-margin-view-zone",".stream-monaco-fallback-line-delete",".stream-monaco-fallback-gutter-delete",".stream-monaco-fallback-line-number-delete",".stream-monaco-fallback-inline-delete-line",".stream-monaco-fallback-inline-delete-margin"].join(","));return n&&l}function Jn(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?typeof window>"u"||typeof window.getComputedStyle!="function"?n:window.getComputedStyle(n).display==="none"?null:n:null}function _l(e,t){return Jn(e,t)!==null}function Il(e,t){if(!e)return!1;const n=t.added<=0||[".gutter-insert",".stream-monaco-fallback-gutter-insert"].some(o=>_l(e,o)),l=t.removed<=0||[".gutter-delete",".inline-deleted-margin-view-zone",".stream-monaco-fallback-gutter-delete",".stream-monaco-fallback-inline-delete-margin"].some(o=>_l(e,o));return n&&l}function Ul(e){var t;const n=Array.from((t=e?.querySelectorAll(".monaco-diff-editor .margin-view-overlays .line-numbers"))!=null?t:[]);return!!n.length&&n.some(l=>{var o;if(!((o=l.textContent)!=null&&o.trim()))return!1;if(typeof window>"u"||typeof window.getComputedStyle!="function")return!0;const i=window.getComputedStyle(l);if(i.display==="none")return!1;const s=l.getBoundingClientRect();if(s.width<=0&&s.height<=0)return!0;const u=Number.parseFloat(i.width||""),a=Number.parseFloat(i.paddingLeft||""),c=Number.parseFloat(i.paddingRight||""),d=Math.max(s.width,Number.isFinite(u)?u:0)>=8,f=Number.isFinite(a)&&a>=1&&Number.isFinite(c)&&c>=1;return d&&f})}function Vl(e){const t=Jn(e,".monaco-diff-editor .view-lines .view-line");if(!t)return!1;if(!Qn())return!0;const n=Jn(e,".monaco-diff-editor .margin-view-overlays .line-numbers");if(!n)return!1;if(typeof window>"u"||typeof window.getComputedStyle!="function")return!0;const l=t.getBoundingClientRect(),o=n.getBoundingClientRect();if(l.width<=0&&l.height<=0||o.width<=0&&o.height<=0)return!0;const i=l.left-o.right;return i>=0&&i<=32}function Ko(e,t){return!Ue.value||!(t||e?.querySelector([".line-insert",".line-delete",".gutter-insert",".gutter-delete",".stream-monaco-line-number-insert",".stream-monaco-line-number-delete",".stream-monaco-line-insert-fill",".stream-monaco-line-delete-fill",".stream-monaco-fallback-line-insert",".stream-monaco-fallback-line-delete",".stream-monaco-fallback-inline-delete-line"].join(",")))||!!(e?.classList.contains("stream-monaco-diff-inline-native-ready")&&!e.classList.contains("stream-monaco-diff-native-stale"))}function Gl(e,t,n,l){const o=e?.querySelector(`.monaco-diff-editor .editor.${t}`);if(!o)return!1;const i=Array.from(o.querySelectorAll(`.margin-view-overlays .line-numbers.${n}`));if(!i.length)return!0;const s=Array.from(o.querySelectorAll(".lines-content > .view-lines:not(.line-delete) > .view-line"));return!!s.length&&i.every(u=>{const a=u.getBoundingClientRect();let c=null;for(const d of s){const f=d.getBoundingClientRect(),p=Math.abs(f.top-a.top);(!c||p1.25||c.node.classList.contains(l)})}function Zo(e,t){if(!e)return!1;const n=t.added<=0||Gl(e,"modified","stream-monaco-line-number-insert","stream-monaco-line-insert-fill"),l=t.removed<=0||(Ue.value?!!e.classList.contains("stream-monaco-diff-inline-native-ready"):Gl(e,"original","stream-monaco-line-number-delete","stream-monaco-line-delete-fill"));return n&&l}function Yn(e){if(Mn.value)return!0;if(!e)return!1;const t=Array.from(e.querySelectorAll(".monaco-diff-editor .view-lines .view-line, .monaco-editor .view-lines .view-line")).filter(l=>{var o;if(!((o=l.textContent)!=null&&o.trim()))return!1;const i=l.getBoundingClientRect();return i.width>0||i.height>0});if(!t.length)return!1;const n=t.filter(l=>{var o,i;return i=(o=l.textContent)!=null?o:"",/['"`{}()[\]:;=<>.,]|\/\/|\/\*|\b(?:async|await|class|const|enum|export|for|function|if|import|interface|let|return|switch|type|var|while)\b/.test(i.replace(/\u00A0/g," ").trim())});return!n.length||n.filter(l=>Array.from(l.querySelectorAll("span")).filter(o=>{var i;return(i=o.textContent)==null?void 0:i.trim()}).some(o=>String(o.className||"").split(/\s+/).some(i=>/^mtk\d+$/.test(i)&&i!=="mtk1"))).length>0}function Qn(){const e=ae.value;return e?.lineNumbers!=="off"}function Xn(){var e,t;m.value?Ze.value=vn(String((e=r.node.originalCode)!=null?e:""),String((t=r.node.updatedCode)!=null?t:"")):Ze.value={removed:0,added:0}}function lt(){var e;if(m.value)try{const t=V(),n=(e=t?.getLineChanges)==null?void 0:e.call(t);if(!Array.isArray(n))return void Xn();let l=0,o=0;for(const i of n)l+=Al(i.originalStartLineNumber,i.originalEndLineNumber),o+=Al(i.modifiedStartLineNumber,i.modifiedEndLineNumber);Ze.value={removed:l,added:o}}catch{Xn()}else Ze.value={removed:0,added:0}}function Kn(){var e;if(Number.isFinite(W.value)&&W.value>0&&Number.isFinite(pe.value))return W.value;const t=Gn();return typeof((e=r.monacoOptions)==null?void 0:e.fontSize)=="number"?(pe.value=r.monacoOptions.fontSize,W.value=r.monacoOptions.fontSize,W.value):t&&t>0?(pe.value=t,W.value=t,t):(pe.value=12,W.value=12,12)}function ei(){const e=Kn(),t=Math.min(36,e+1);W.value=t}function ti(){const e=Kn(),t=Math.max(10,e-1);W.value=t}function ni(){Kn(),Number.isFinite(pe.value)&&(W.value=pe.value)}function Jl(){var e,t,n,l,o,i,s,u,a,c,d,f,p,h;try{const x=m.value?V():null,g=m.value?x:de();if(!g)return null;if(x?.getOriginalEditor&&x?.getModifiedEditor){const F=(e=x.getOriginalEditor)==null?void 0:e.call(x),S=(t=x.getModifiedEditor)==null?void 0:t.call(x);(n=F?.layout)==null||n.call(F),(l=S?.layout)==null||l.call(S);const D=((o=F?.getContentHeight)==null?void 0:o.call(F))||0,C=((i=S?.getContentHeight)==null?void 0:i.call(S))||0,L=Math.max(D,C);if(L>0)return Math.ceil(L);const K=((a=(u=(s=F?.getModel)==null?void 0:s.call(F))==null?void 0:u.getLineCount)==null?void 0:a.call(u))||1,_=((f=(d=(c=S?.getModel)==null?void 0:c.call(S))==null?void 0:d.getLineCount)==null?void 0:f.call(d))||1,O=Math.max(K,_),I=Math.max(Ct(F),Ct(S)),G=Math.max(fn(F),fn(S));return Math.ceil(O*I+G+0)}if(g?.getContentHeight){(p=g?.layout)==null||p.call(g);const F=g.getContentHeight();if(F>0)return m.value||(tn.value=!0),Math.ceil(F)}const N=(h=g?.getModel)==null?void 0:h.call(g);let oe=1;N&&typeof N.getLineCount=="function"&&(oe=N.getLineCount());const E=Ct(g);return Math.ceil(oe*(E+1.5)+0)}catch{return null}}function Yl(){var e,t;if(m.value)return!1;try{const n=(t=(e=de())==null?void 0:e.getContentHeight)==null?void 0:t.call(e),l=typeof n=="number"&&Number.isFinite(n)&&n>0;return l&&(tn.value=!0),l}catch{return!1}}function Zn(e){var t,n,l;if(typeof window>"u")return null;try{const o=e.getBoundingClientRect(),i=window.getComputedStyle(e);if(i.display==="none"||i.visibility==="hidden")return null;const s=e.querySelector("diffs-container");if(s instanceof HTMLElement){const c=s.getBoundingClientRect();if(c.height>0&&c.bottom>o.top)return Math.ceil(c.bottom-o.top)}const u=[".editor.original .view-lines .view-line",".editor.modified .view-lines .view-line",".editor.original .view-zones > div",".editor.modified .view-zones > div",".editor.original .margin-view-zones > div",".editor.modified .margin-view-zones > div",".editor.original .diff-hidden-lines",".editor.modified .diff-hidden-lines",".stream-monaco-diff-unchanged-bridge"];let a=0;for(const c of Array.from(e.querySelectorAll(u.join(",")))){if(!(c instanceof HTMLElement)||((t=c.parentElement)!=null&&t.classList.contains("view-zones")||(n=c.parentElement)!=null&&n.classList.contains("margin-view-zones"))&&!((l=c.textContent)!=null&&l.trim()||c.matches(".line-delete, .line-insert, .cdr")||c.querySelector(".diff-hidden-lines, .stream-monaco-diff-unchanged-bridge, .line-delete, .line-insert, .cdr")))continue;const d=window.getComputedStyle(c);if(d.display==="none"||d.visibility==="hidden"||Number.parseFloat(d.opacity||"1")<=.01)continue;const f=c.getBoundingClientRect();f.height<=0||f.bottom<=o.top||(a=Math.max(a,f.bottom-o.top))}return a>0?Math.ceil(a):null}catch{return null}}function Tt(e){if(typeof window>"u")return!1;const t=e.getBoundingClientRect();if(t.width<=0||t.height<=0)return!1;const n=e.querySelectorAll(".editor.modified .diff-hidden-lines, .editor.original .diff-hidden-lines, .stream-monaco-diff-unchanged-bridge");for(const l of Array.from(n)){if(!(l instanceof HTMLElement))continue;const o=window.getComputedStyle(l);if(o.display==="none"||o.visibility==="hidden"||Number.parseFloat(o.opacity||"1")<=.01)continue;const i=l.getBoundingClientRect();if(!(i.width<=0||i.height<=0||i.bottom<=t.top||i.top>=t.bottom))return!0}return!1}function el(e){var t;const n=String(e??"").trim(),l=(t=n.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i))==null?void 0:t[1];if(l){const a=l.length===3?l.split("").map(c=>`${c}${c}`).join(""):l;return .2126*Number.parseInt(a.slice(0,2),16)+.7152*Number.parseInt(a.slice(2,4),16)+.0722*Number.parseInt(a.slice(4,6),16)}const o=n.match(/\d+(?:\.\d+)?/g);if(!o||o.length<3)return null;const[i,s,u]=o.slice(0,3).map(Number);return .2126*i+.7152*s+.0722*u}function Rt(){var e,t,n;if(Ql())return;const l=Gn();l&&l>0&&(_n.value=l,W.value=l,pe.value=l);try{const o=Ct(m.value?(n=(t=(e=V())==null?void 0:e.getModifiedEditor)==null?void 0:t.call(e))!=null?n:V():de());o&&o>0&&(ln.value=o)}catch{}try{const o=Dl();o&&o>0&&(ln.value=o)}catch{}}function Ql(){return m.value&&Bl.value}function tl(){var e;if(!m.value||!Te.value)return null;const t=v.value,n=(e=z.value)==null?void 0:e.querySelector("pre.code-pre-fallback");if(!t||!n)return null;const l=Math.ceil(n.getBoundingClientRect().height);return!Number.isFinite(l)||l<=0?null:(t.style.height=`${l}px`,t.style.minHeight=`${l}px`,t.style.maxHeight=`${Math.ceil(Mt())}px`,t.style.overflow="hidden",l)}function nl(){var e,t,n,l,o,i,s,u,a;const c=v.value,d=z.value;if(!c||!d)return;const f=c;f.style.setProperty("--diffs-tab-size",String(Fl.value));const p=(e=r.monacoOptions)==null?void 0:e.padding;p&&typeof p=="object"?f.style.setProperty("--diffs-gap-block",`${un.value.top}px`):f.style.removeProperty("--diffs-gap-block");const h=c.querySelector(".monaco-editor")||c,x=h.querySelector(".monaco-editor-background")||h,g=h.querySelector(".view-lines")||h;let N=null,oe=null,E=null;try{typeof window<"u"&&typeof window.getComputedStyle=="function"&&(N=window.getComputedStyle(h),oe=x===h?N:window.getComputedStyle(x),E=g===h?N:window.getComputedStyle(g))}catch{N=null,oe=null,E=null}const F=String((t=N?.getPropertyValue("--vscode-editor-foreground"))!=null?t:"").trim(),S=String((n=N?.getPropertyValue("--vscode-editor-background"))!=null?n:"").trim(),D=String((o=(l=N?.getPropertyValue("--vscode-editor-selectionBackground"))!=null?l:N?.getPropertyValue("--vscode-editor-hoverHighlightBackground"))!=null?o:"").trim(),C=F||String((s=(i=E?.color)!=null?i:N?.color)!=null?s:"").trim(),L=S||String((a=(u=oe?.backgroundColor)!=null?u:N?.backgroundColor)!=null?a:"").trim(),K=(function(){var _,O,I,G,ye;try{const st=m.value?(I=(O=(_=V())==null?void 0:_.getModifiedEditor)==null?void 0:O.call(_))!=null?I:V():de(),jt=xt(),Et=(G=jt?.EditorOption)==null?void 0:G.fontInfo;if(st&&Et!=null){const qt=(ye=st.getOption)==null?void 0:ye.call(st,Et),dt=qt?.typicalHalfwidthCharacterWidth;if(typeof dt=="number"&&Number.isFinite(dt)&&dt>0)return dt}}catch{}return null})();if(K!=null&&(on.value=K),m.value){const _=(O,I)=>{I?(d.style.setProperty(O,I),f.style.setProperty(O,I)):(d.style.removeProperty(O),f.style.removeProperty(O))};for(const[O,I]of Object.entries(Ol(d.classList.contains("is-dark"))))_(O,I);return C?(d.style.setProperty("--markstream-diff-editor-fg",C),f.style.setProperty("--vscode-editor-foreground",C),f.style.setProperty("--stream-monaco-editor-fg",C)):(d.style.removeProperty("--markstream-diff-editor-fg"),f.style.removeProperty("--vscode-editor-foreground"),f.style.removeProperty("--stream-monaco-editor-fg")),L?(d.style.setProperty("--markstream-diff-editor-bg",L),d.style.setProperty("--markstream-diff-panel-bg",L),d.style.setProperty("--markstream-diff-panel-bg-soft",L),d.style.setProperty("--markstream-diff-panel-bg-strong",L),f.style.setProperty("--vscode-editor-background",L),f.style.setProperty("--stream-monaco-editor-bg",L),f.style.setProperty("--stream-monaco-fixed-editor-bg",L),f.style.setProperty("--stream-monaco-panel-bg",L),f.style.setProperty("--stream-monaco-panel-bg-soft",L),f.style.setProperty("--stream-monaco-panel-bg-strong",L),f.style.backgroundColor=L):(d.style.removeProperty("--markstream-diff-editor-bg"),d.style.removeProperty("--markstream-diff-panel-bg"),d.style.removeProperty("--markstream-diff-panel-bg-soft"),d.style.removeProperty("--markstream-diff-panel-bg-strong"),f.style.removeProperty("--vscode-editor-background"),f.style.removeProperty("--stream-monaco-editor-bg"),f.style.removeProperty("--stream-monaco-fixed-editor-bg"),f.style.removeProperty("--stream-monaco-panel-bg"),f.style.removeProperty("--stream-monaco-panel-bg-soft"),f.style.removeProperty("--stream-monaco-panel-bg-strong"),f.style.backgroundColor=""),void(D?f.style.setProperty("--vscode-editor-selectionBackground",D):f.style.removeProperty("--vscode-editor-selectionBackground"))}if((function(_,O,I){if(!Mn.value)return!1;const G=el(_),ye=el(O);return I?G!=null&&G>170||ye!=null&&ye<110:G!=null&&G<85||ye!=null&&ye>190})(L,C,d.classList.contains("is-dark")))return f.style.removeProperty("--vscode-editor-foreground"),f.style.removeProperty("--vscode-editor-background"),void f.style.removeProperty("--vscode-editor-selectionBackground");C&&f.style.setProperty("--vscode-editor-foreground",C),L&&f.style.setProperty("--vscode-editor-background",L),D&&f.style.setProperty("--vscode-editor-selectionBackground",D)}let ll=0,ol=0;const Xl=/auto|scroll|overlay/i;function Oe(e,t,n){var l;if(typeof window>"u"||m.value||(function(d){return _o.value||Ml(d)})(e))return;const o=Math.ceil(t),i=Math.ceil(n)-o;if(Math.abs(i)<=1)return;const s=(function(d){var f,p;if(typeof window>"u")return null;const h=(f=d?.ownerDocument)!=null?f:document,x=h.scrollingElement||h.documentElement||h.body;let g=(p=d?.parentElement)!=null?p:null;for(;g&&g!==h.body&&g!==x;){const N=window.getComputedStyle(g),oe=(N.overflowY||"").toLowerCase(),E=(N.overflow||"").toLowerCase();if(Xl.test(oe)||Xl.test(E))return g;g=g.parentElement}return x})(e);if(!s)return;const u=(l=e.ownerDocument)!=null?l:document,a=s===u.body||s===u.documentElement||s===u.scrollingElement,c=a?0:s.getBoundingClientRect().top;e.getBoundingClientRect().top-c>=0||(a&&typeof window.scrollBy=="function"?window.scrollBy(0,i):s.scrollTop+=i)}function il(){try{const e=v.value;if(!e)return;const t=e.getBoundingClientRect().height,n=Jl();if(n!=null&&n>0){const o=Rl(n,!0,{allowBelowEstimatedFloor:!m.value&&q.value&&Yl()}),i=nt();return e.style.minHeight=i!=null?`${i}px`:"0px",e.style.height=`${o}px`,e.style.maxHeight="none",e.style.overflow="visible",void Oe(e,t,o)}const l=nt();l!=null&&(e.style.minHeight=`${l}px`,e.style.height=`${l}px`,e.style.maxHeight="none",e.style.overflow="visible",Oe(e,t,l))}catch{}}function ot(){for(var e,t;He.length>0;)try{(t=(e=He.pop())==null?void 0:e.dispose)==null||t.call(e)}catch{}kt!=null&&(kn(kt),kt=null),Ft!=null&&(kn(Ft),Ft=null),Je!=null&&(kn(Je),Je=null),Ye=0,Qe=!1}function De(){for(var e;Nn.length>0;)try{(e=Nn.pop())==null||e()}catch{}}function le(e=!1){Se.value||(Pe.value?il():(function(t={}){var n,l,o;try{const i=v.value;if(!i)return;const s=i.getBoundingClientRect().height,u=Mt(),a=Math.ceil(((n=i.getBoundingClientRect)==null?void 0:n.call(i).height)||0),c=Number.parseFloat(i.style.height||""),d=a>0?a:Number.isFinite(c)&&c>0?Math.ceil(c):0,f=m.value?(function(){var O,I,G,ye,st,jt,Et,qt,dt,xo,So,Co;if($e())return null;try{const ct=V(),ft=(O=ct?.getOriginalEditor)==null?void 0:O.call(ct),vt=(I=ct?.getModifiedEditor)==null?void 0:I.call(ct);if(!ft||!vt)return null;const hi=((st=(ye=(G=ft.getModel)==null?void 0:G.call(ft))==null?void 0:ye.getLineCount)==null?void 0:st.call(ye))||1,gi=((qt=(Et=(jt=vt.getModel)==null?void 0:jt.call(vt))==null?void 0:Et.getLineCount)==null?void 0:qt.call(Et))||1,yi=Math.max(hi,gi),wi=Math.max(Ct(ft),Ct(vt)),bi=Math.max(fn(ft),fn(vt)),ki=Math.max((xo=(dt=ft.getContentHeight)==null?void 0:dt.call(ft))!=null?xo:0,(Co=(So=vt.getContentHeight)==null?void 0:So.call(vt))!=null?Co:0);return Math.ceil(Math.max(ki,yi*wi+bi+0))}catch{return null}})():null,p=m.value&&Tt(i),h=m.value&&mn(i),x=m.value&&i.classList.contains("stream-monaco-diff-native-stale"),g=p&&q.value&&R.value&&!Te.value;if(p||(ve.value=null),En>0&&(En--,_e.value!=null))return void Oe(i,s,Ae(i,_e.value,u,{allowBelowEstimatedFloor:g,preserveScrollableOverflow:rl(i)}));if(m.value&&!h&&!p&&Te.value){const O=tl();if(O!=null){const I=Ae(i,O,u,{allowBelowEstimatedFloor:!0});return ee(!0),void Oe(i,s,I)}}const N=m.value&&t.preferModelDiffHeight===!0,oe=m.value?Zn(i):null,E=oe,F=!m.value&&q.value&&Yl(),S=m.value&&r.loading!==!1&&(E!=null||f!=null&&a>0&&f0&&f0&&f0?d:null:f;else C=Jl();if(m.value&&r.loading===!1&&x&&!g&&C!=null&&f!=null&&(C=Math.min(C,f)),m.value&&C!=null&&d>0&&(r.loading!==!1||r.loading===!1&&x&&!g||t.holdCurrentDiffHeight===!0&&!g)&&(C=Math.max(C,d)),C!=null&&C>0){const O=p&&ve.value!=null,I=p&&a>0&&a=u-1,G=Ae(i,O?Math.max(ve.value,C):I?a:C,u,{clearEstimatedFloor:!0,allowBelowEstimatedFloor:g||F||S,preserveScrollableOverflow:rl(i)});return p&&G0?f:0);if(L>0){const O=p&&ve.value!=null,I=p&&a>0&&a=u-1,G=Ae(i,O?Math.max(ve.value,L):I?a:L,u,{allowBelowEstimatedFloor:g});return p&&G0?Oe(i,s,Ae(i,_,u,{allowBelowEstimatedFloor:g})):m.value||Oe(i,s,Ae(i,u,u))}catch{}})(typeof e=="object"?e:{}))}function Kl(){ll=0,ol=0}function ee(e=!1){var t,n,l;if(Se.value)return;const o=v.value;if(!o)return;const i=m.value?V():de();if(i&&typeof i.layout=="function")try{const s=(t=o.getBoundingClientRect)==null?void 0:t.call(o),u=Math.ceil(((n=s?.width)!=null?n:0)||o.clientWidth||0),a=Math.ceil(((l=s?.height)!=null?l:0)||o.clientHeight||Number.parseFloat(o.style.height||"")||0);if(u>0&&a>0){if(!e&&u===ll&&a===ol)return;ll=u,ol=a,i.layout({width:u,height:a})}else Kl(),i.layout()}catch{}}function he(){if(!m.value)return void De();const e=v.value;if(!e)return void De();const t=e.querySelector(".monaco-diff-editor");if(!t||t.classList.contains("side-by-side"))return void De();const n=Array.from(t.querySelectorAll(".editor.original .diff-hidden-lines")),l=Array.from(t.querySelectorAll(".editor.modified .diff-hidden-lines")),o=Math.min(n.length,l.length);for(let i=0;i div:first-child"),c=s.querySelector(".center");if(!u||!a||!c||c.querySelector(".markstream-inline-fold-proxy"))continue;const d=document.createElement("button");d.type="button",d.className="markstream-inline-fold-proxy",d.dataset.markstreamInlineFoldProxy="true";const f=u.getAttribute("title")||"Show Unchanged Region";d.title=f,d.setAttribute("aria-label",f);const p=g=>{g.preventDefault(),g.stopPropagation()},h=g=>{g.preventDefault(),g.stopPropagation(),u.click(),fe(()=>ce())},x=g=>{g.key!=="Enter"&&g.key!==" "||(g.preventDefault(),g.stopPropagation(),u.click(),fe(()=>ce()))};d.addEventListener("mousedown",p),d.addEventListener("click",h),d.addEventListener("keydown",x),c.appendChild(d),Nn.push(()=>{d.removeEventListener("mousedown",p),d.removeEventListener("click",h),d.removeEventListener("keydown",x),d.parentElement===c&&c.removeChild(d)})}}function ce(e=!1){if(B||kt!=null)return;const t=()=>{B||(he(),le(e),ee())};kt=fe(()=>{kt=null,t(),Ft=fe(()=>{Ft=null,t()})}),it()}function it(e=!1){if(!m.value||B||!e&&r.loading===!1||(Qe=Qe||e,Ye=Math.max(Ye,e?18:6),Je!=null))return;const t=()=>{if(Je=null,!m.value||B||Ye<=0||!Qe&&r.loading===!1)return Ye=0,void(Qe=!1);Ye--,he(),le({preferModelDiffHeight:!0,holdCurrentDiffHeight:Qe}),ee(),Ye>0?Je=fe(t):Qe=!1};Je=fe(t)}function Ae(e,t,n,l={}){const o=m.value&&r.loading!==!1?Zn(e):null,i=o!=null&&o>t+1?o:t,s=Math.min(i,n),u=l.allowBelowEstimatedFloor===!0||Tl(),a=Rl(s,l.clearEstimatedFloor===!0,{allowBelowEstimatedFloor:u}),c=nt();if(e.style.minHeight=c==null||u?"0px":`${Math.min(c,Math.ceil(n))}px`,e.style.height=`${a}px`,e.style.maxHeight=`${Math.ceil(n)}px`,m.value)e.style.overflow="hidden";else{const d=l.preserveScrollableOverflow===!0||t>n+1;e.style.overflow=d?"auto":"hidden"}return a}function Zl(e,t=0){var n;const l=Math.ceil(((n=e.getBoundingClientRect)==null?void 0:n.call(e).height)||0),o=Math.max(t,e.clientHeight||0,l);return o>0&&e.scrollHeight>o+1}function rl(e){var t;return!m.value&&(Fn||Zl(e,(t=_e.value)!=null?t:0))}function al(e){var t,n,l,o,i,s,u,a;if(!m.value)return;const c=Pe.value||!Tt(e)||e.getBoundingClientRect().height>=Mt()-1;if(Bn===c)return;Bn=c;const d=Me(U({},(n=(t=r.monacoOptions)==null?void 0:t.scrollbar)!=null?n:{}),{handleMouseWheel:c}),f=V();try{(i=(o=(l=f?.getOriginalEditor)==null?void 0:l.call(f))==null?void 0:o.updateOptions)==null||i.call(o,{scrollbar:d}),(a=(u=(s=f?.getModifiedEditor)==null?void 0:s.call(f))==null?void 0:u.updateOptions)==null||a.call(u,{scrollbar:d})}catch{}}function mn(e=v.value){return!!$e(e)||!!e?.querySelector(".monaco-diff-editor .view-lines .view-line")}function eo(e=v.value){return!!$e(e)||!!e?.querySelector(".monaco-editor .view-lines .view-line")}function to(){var e,t;if($e())return!0;const n=(t=(e=de())==null?void 0:e.getModel)==null?void 0:t.call(e);return typeof n?.getValue=="function"&&n.getValue()===Re.value}function no(e=v.value){return!!$e(e)||!!e?.classList.contains("stream-monaco-diff-root")&&!(Ue.value&&!e.classList.contains("stream-monaco-diff-inline"))}function $e(e=v.value){return!!e?.querySelector("diffs-container")}function lo(e){return r.loading!==!1||R.value||e.classList.contains("stream-monaco-diff-native-stale")||Tt(e)}function li(){const e=V();return typeof e?.getOriginalEditor=="function"||typeof e?.getModifiedEditor=="function"||typeof e?.getLineChanges=="function"}function oo(){return j(this,arguments,function*(e={}){var t,n,l;if(!m.value)return!0;if($e())return yield A(),yield Le(),$e();const o=e.requireHighlight!==!1;let i=0,s=Ot(String((t=r.node.originalCode)!=null?t:""),String((n=r.node.updatedCode)!=null?n:"")),u=vn(s.original,s.updated),a=u.added>0||u.removed>0;const c=()=>{var d,f;const p=Ot(String((d=r.node.originalCode)!=null?d:""),String((f=r.node.updatedCode)!=null?f:""));p.original===s.original&&p.updated===s.updated||(s=p,u=vn(s.original,s.updated),a=u.added>0||u.removed>0)};for(let d=0;d<30;d++){if(B)return!1;c();const f=v.value,p=V(),h=Qn();let x=!1;try{const S=(l=p?.getLineChanges)==null?void 0:l.call(p);x=Array.isArray(S)&&(!a||S.length>0)}catch{x=!1}const g=!!f?.querySelector(".monaco-diff-editor"),N=mn(f),oe=!a||Wl(f,u),E=!a||Il(f,u),F=!h||Ul(f);if(g&&N&&x&&oe&&E&&F&&ql(f)){try{St(),he(),lt(),ce()}catch{}if(yield A(),yield Le(),B)return!1;const S=v.value,D=!Qn()||Ul(S),C=!a||Wl(S,u),L=!a||Il(S,u),K=Ko(S,a),_=Zo(S,u),O=!o||Yn(S),I=no(S)&&D&&Vl(S)&&C&&L&&K&&_&&O,G=no(S)&&D&&Vl(S)&&C&&L&&ql(S)&&O;if(I||G){if(i++,i>=2)return!0}else i=0}yield A(),yield Le()}return B||(St(),he(),lt(),ce(),c()),!1})}function io(e,t,n){return j(this,null,function*(){try{return void(yield Kt(e,t,n))}catch(l){if(!$t(l))throw l}if(yield A(),yield Le(),!B&&m.value)try{yield Kt(e,t,n)}catch(l){if(!$t(l))throw l}})}function Mt(){var e,t;const n=(t=(e=r.monacoOptions)==null?void 0:e.MAX_HEIGHT)!=null?t:500;if(typeof n=="number")return n;const l=String(n).match(/^(\d+(?:\.\d+)?)/);return l?Number.parseFloat(l[1]):500}const ul=b(()=>r.isShowPreview&&(xe.value==="html"||xe.value==="svg"));function Ve(){return typeof r.node.loading=="boolean"?r.node.loading:r.loading===!0}function ro(){var e,t,n;if(!Ve())return!0;const l=String((e=r.node.raw)!=null?e:""),o=(n=(t=l.split(/\r\n|\n|\r/,1)[0])==null?void 0:t.trimStart())!=null?n:"";return!/^(?:`{3,}|~{3,})/.test(o)||/\r\n|\n|\r/.test(l)}function ao(e,t,n){return!n||ro()&&String(t??"")?wn(String(e??"")):"plain"}function pn(){return Ve()}let Bt=null,sl=!1,hn=0;function uo(){Bt=null,hn++}function so(){return j(this,arguments,function*(e=hn){if(!sl){sl=!0;try{for(;Bt&&!B&&!m.value&&e===hn;){const t=Bt;Bt=null;try{yield Promise.resolve(Ln(t.code,t.language)),yield A(),B||m.value||(le(!1),ee())}catch{}}}finally{sl=!1,!Bt||B||m.value||so()}}})}function co(e,t){Bt={code:e,language:t},so(hn)}ue(()=>[r.node.language,r.node.code,r.node.raw,r.node.loading,r.loading],([e,t,n,l,o])=>{xe.value=ao(e,t,typeof l=="boolean"?l:o===!0)}),ue(()=>[r.node.originalCode,r.node.updatedCode,m.value],()=>{ve.value=null,Xn(),fe(()=>lt())},{immediate:!0});let gn=0;ue(()=>[r.node.originalCode,r.node.updatedCode,Fe.value,m.value,r.stream],e=>j(null,[e],function*([,,,t,n]){var l,o;const i=++gn;if(!t||Ve()||n===!1&&!X.value)return;if(n!==!1&&se&&!X.value&&v.value)try{yield je(v.value)}catch{}const s=Pt;if(s&&!Ce.value){try{yield s}catch{}if(B||!m.value||i!==gn)return}if(i!==gn)return;const u=Ot(String((l=r.node.originalCode)!=null?l:""),String((o=r.node.updatedCode)!=null?o:"")),a=r.loading===!1;a&&at();try{if(yield io(u.original,u.updated,Fe.value),B||!m.value||i!==gn)return;yield A(),ee(!0),he(),le(r.loading===!1||{preferModelDiffHeight:!0}),ee(!0),ce(!0)}catch{return}if(a){if(B||!m.value)return;St(),he(),lt(),ce(),it(!0)}Pe.value&&fe(()=>il())})),ue(()=>r.node.code,e=>j(null,null,function*(){if(Ve()||r.stream===!1||(xe.value||(xe.value=wn(wl(e))),m.value))return;const t=Pt;if(t&&!Ce.value){try{yield t}catch{}if(B||m.value)return}if(se&&!X.value&&v.value)try{yield je(v.value)}catch{}co(en(r.node.code),Fe.value),Pe.value&&fe(()=>il())}));const oi=b(()=>{const e=xe.value;return e?Fo[e]||e.charAt(0).toUpperCase()+e.slice(1):Fo[""]}),fo=b(()=>{var e;return Ai(String((e=r.node.raw)!=null?e:""),oi.value,m.value)}),ii=b(()=>fo.value.title),vo=b(()=>fo.value.caption),ri=b(()=>(Hi.value,(function(e,t){if(t===void 0)return Ni(e);if(t){const l=t(e);if(l!=null&&l!=="")return l}const n=wn(e);return Ti(n)||Ri()})(xe.value||"",gt))),ai=b(()=>{const e={};e["--markstream-code-layout-character-width"]=on.value==null?"1ch":`${on.value}px`;const t=o=>{if(o!=null)return typeof o=="number"?`${o}px`:String(o)},n=t(r.minWidth),l=t(r.maxWidth);if(n&&(e.minWidth=n),l&&(e.maxWidth=l),zl.value&&!m.value&&!Se.value){const o=Qo.value;o!=null&&(e.minHeight=`${o}px`)}return m.value||(e.color="var(--markstream-code-fallback-fg, var(--code-fg))",e.backgroundColor="var(--markstream-code-fallback-bg, var(--code-bg))",e.borderColor="var(--markstream-code-border-color, var(--code-border))"),e}),ui=b(()=>r.showTooltips!==!1);function si(){return j(this,null,function*(){try{typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(r.node.code)),wt.value=!0,P("copy",r.node.code),setTimeout(()=>{wt.value=!1},1e3)}catch(e){console.error("复制失败:",e)}})}function di(){Pe.value=!Pe.value;const e=m.value?V():de(),t=v.value;e&&t&&(Pe.value?(yn(!0),t.style.maxHeight="none",t.style.overflow="visible",le(!0)):(yn(!1),t.style.overflow=m.value?"hidden":"auto",le(!0)),al(t))}function ci(){var e,t;if(Se.value=!Se.value,Se.value){if(Fn=!1,v.value){const n=Math.ceil(((t=(e=v.value).getBoundingClientRect)==null?void 0:t.call(e).height)||0);Fn=!m.value&&(Zl(v.value,n)||v.value.style.overflow==="auto"||v.value.style.overflowY==="auto"),n>0&&(_e.value=n)}yn(!1)}else Pe.value&&yn(!0),v.value&&_e.value!=null&&(v.value.style.height=`${_e.value}px`),En=2,A(()=>{Se.value||B||(le(!0),ee(!0))})}function fi(){if(!ul.value)return;const e=xe.value;if(Yt.value){const t=e==="html"?"text/html":"image/svg+xml",n=e==="html"?Q("artifacts.htmlPreviewTitle")||"HTML Preview":Q("artifacts.svgPreviewTitle")||"SVG Preview";return void P("previewCode",{node:r.node,artifactType:t,artifactTitle:n,id:`temp-${e}-${Date.now()}`})}e==="html"&&(nn.value=!nn.value)}function yn(e){var t,n;try{if(m.value){const l=V();(t=l?.updateOptions)==null||t.call(l,{automaticLayout:e})}else{const l=de();(n=l?.updateOptions)==null||n.call(l,{automaticLayout:e})}}catch{}}function vi(e){return j(this,null,function*(){var t;if(!se||B)return;const n=zt.value;if(jn=!1,me.value=!1,et.value=null,Ce.value=!1,R.value=!1,Ht.value=!1,Bn=null,_n.value=null,ln.value=null,on.value=null,(function(){const a=(function(){var c;const d=(c=v.value)==null?void 0:c.parentElement;return d instanceof HTMLElement?d:null})();a&&(a.style.removeProperty("--stream-monaco-line-number-left"),a.style.removeProperty("--stream-monaco-line-number-width"),a.style.removeProperty("--stream-monaco-line-number-gap-to-code"),a.style.removeProperty("--stream-monaco-original-line-number-gap-to-code"),a.style.removeProperty("--stream-monaco-modified-line-number-gap-to-code"),a.style.removeProperty("--stream-monaco-original-scrollable-left"),a.style.removeProperty("--stream-monaco-modified-scrollable-left"))})(),Kl(),(function(){tn.value=!1;const a=Ll.value;Un.value=q.value||a==null?null:a})(),ot(),De(),(function(a){a.replaceChildren()})(e),at(),B)return;const l=j(null,null,function*(){var a,c;if(n==="diff"){(function(){if(Hn||typeof window>"u")return;Hn=!0;const f=p=>{var h;$t("reason"in p?p.reason:(h=p.error)!=null?h:p.message)&&(p.preventDefault(),p.stopImmediatePropagation())};window.addEventListener("error",f,!0),window.addEventListener("unhandledrejection",f,!0),Zt=()=>{window.removeEventListener("error",f,!0),window.removeEventListener("unhandledrejection",f,!0),Hn=!1,Zt=null}})(),Xe();const d=Ot(String((a=r.node.originalCode)!=null?a:""),String((c=r.node.updatedCode)!=null?c:""));Xt?yield yt(()=>Xt(e,d.original,d.updated,Fe.value)):yield yt(()=>se(e,r.node.code,Fe.value))}else yield yt(()=>se(e,Re.value,Fe.value));Ce.value=!0}),o=l.finally(()=>{Pt===o&&(Pt=null)});if(Pt=o,yield(function(a){return j(this,null,function*(){if(!m.value)return void(yield a);let c,d=!1;for(a.then(()=>{d=!0},f=>{d=!0,c=f});;){if(B)return;if(d){if(c)throw c;return}if(mn()&&li())return;yield A(),yield Le()}})})(o),B||zt.value!==n)return;Ce.value=!0;const i=n==="diff"?V():de();if(typeof((t=r.monacoOptions)==null?void 0:t.fontSize)=="number")i?.updateOptions({fontSize:r.monacoOptions.fontSize,automaticLayout:!1}),pe.value=r.monacoOptions.fontSize,W.value=r.monacoOptions.fontSize;else if(!Ql()){const a=Gn();a&&a>0?(pe.value=a,W.value=a):(pe.value=12,W.value=12)}Rt(),yield go(),Pe.value||Se.value||le(!1),q.value=!0,Sl.value=n,(function(){var a,c,d,f,p;if(ot(),m.value){const x=V(),g=(a=x?.getOriginalEditor)==null?void 0:a.call(x),N=(c=x?.getModifiedEditor)==null?void 0:c.call(x),oe=(F,S)=>{try{const D=F?.[S];if(typeof D!="function")return;const C=D.call(F,()=>ce());C&&He.push(C)}catch{}};try{const F=(d=x?.onDidUpdateDiff)==null?void 0:d.call(x,()=>{ce(),fe(()=>lt())});F&&He.push(F)}catch{}oe(g,"onDidContentSizeChange"),oe(N,"onDidContentSizeChange");const E=v.value;if(E&&typeof MutationObserver<"u"){const F=[".view-line",".view-lines",".view-zones",".margin-view-zones",".diff-hidden-lines",".stream-monaco-diff-unchanged-bridge",".stream-monaco-fallback-inline-delete-zone",".stream-monaco-fallback-inline-delete-margin"].join(","),S=L=>{var K;const _=L instanceof HTMLElement?L:L.parentElement;return!!((K=_?.closest)!=null&&K.call(_,F))},D=L=>{var K,_;const O=L instanceof HTMLElement?L:L.parentElement;return!!((K=O?.closest)!=null&&K.call(O,F)||(_=O?.querySelector)!=null&&_.call(O,F))},C=new MutationObserver(L=>{m.value&&lo(E)&&L.some(K=>S(K.target)||Array.from(K.addedNodes).some(D)||Array.from(K.removedNodes).some(S))&&(he(),le({preferModelDiffHeight:!0}),ee(),it())});C.observe(E,{attributeFilter:["class"],attributes:!0,childList:!0,characterData:!0,subtree:!0}),He.push({dispose:()=>C.disconnect()})}if(E){const F=S=>{const D=S.target instanceof Element?S.target:null;if(!D?.closest([".stream-monaco-unchanged-summary",".stream-monaco-unchanged-reveal",".stream-monaco-unchanged-expand",".markstream-inline-fold-proxy",".diff-hidden-lines .center"].join(",")))return;const C=Math.ceil(E.getBoundingClientRect().height||0);C>0&&(ve.value=C)};E.addEventListener("click",F,!0),He.push({dispose:()=>E.removeEventListener("click",F,!0)})}if(E&&typeof ResizeObserver<"u"){const F=new ResizeObserver(()=>{if(!m.value||(ee(),!lo(E)))return;const S=Zn(E);if(S==null)return;const D=Math.ceil(E.getBoundingClientRect().height||0),C=ve.value;if(Tt(E)&&C!=null){if(D>C+1)ve.value=D;else if(DF.disconnect()})}return}const h=de();try{const x=(f=h?.onDidContentSizeChange)==null?void 0:f.call(h,()=>ce());x&&He.push(x)}catch{}try{const x=(p=h?.onDidLayoutChange)==null?void 0:p.call(h,()=>ce());x&&He.push(x)}catch{}})(),nl(),Rt(),he(),lt(),ce(),yield A();let s=null;Ke&&(s=yield Ke(),s&&(yield A(),yield Le()));const u=s??(n==="diff"?yield oo({requireHighlight:!0}):yield(function(){return j(this,null,function*(){if($e())return yield A(),yield Le(),$e();for(let a=0;a<30;a++){if(B||m.value)return!1;const c=v.value,d=to(),f=eo(c),p=!Re.value.trim()||Yn(c);if(d&&f&&p&&(yield A(),yield Le(),!B&&!m.value&&to()&&eo(v.value)&&(!Re.value.trim()||Yn(v.value))))return!0;yield A(),yield Le()}return!1})})());B||(u?(Rt(),cn(),(yield Nl())||qe()):qe())})}function je(e,t={}){if(!se||B||r.stream===!1&&r.loading!==!1||(cl(),ko())||ge.value||v.value!==e||pn())return null;if(ze)return ze;if(X.value&&q.value)return Promise.resolve();const n=dl(),l=Dn.value;let o=!1;X.value=!0,(function(){const s=Ge.value;re&&s&&We!==s&&(We&&re.markSettled(We),We=s,re.markPending(s))})();const i=j(null,null,function*(){try{yield vi(e),Nt=null}catch(s){const u=dl(),a=l!==Dn.value,c=t.allowStaleContentRetry!==!1&&a&&Nt!==u;if(n!==u||c)return c&&(Nt=u),o=!0,X.value=!1,q.value=!1,Ce.value=!1,void(R.value=!1);throw qe(n),s}}).finally(()=>{ze===i&&(ze=null),(function(){const s=We;re&&s&&(We="",A(()=>{var u,a;if(!B){const c=(a=(u=z.value)==null?void 0:u.offsetHeight)!=null?a:0;c>0&&re.reportHeight(s,c)}re.markSettled(s)}))})(),o&&!B&&queueMicrotask(()=>{var s;const u=v.value;u&&!B&&((s=je(u))==null||s.catch(a=>{q.value=!1,R.value=!1,qe()}))})});return ze=i,i}ue(ui,e=>{e||mt()}),ue(()=>W.value,(e,t)=>{const n=m.value?V():de();n&&typeof e=="number"&&Number.isFinite(e)&&e>0&&(n.updateOptions({fontSize:e}),Se.value||le(!0))},{flush:"post",immediate:!1});let mo=0;const mi=ue(()=>[v.value,m.value,r.stream,r.loading,bt.value,Z.value,r.node.language,r.node.raw,r.node.code,r.node.loading],e=>j(null,[e],function*([t,n,l,o,i,s]){const u=++mo;if(!t||!s||Ve()||tt||l===!1&&o!==!1||!se&&(yield(function(){return j(this,null,function*(){if(typeof window>"u"||B||bt.value||ge.value)return;if(Lt)return Lt;const c=j(null,null,function*(){try{const d=yield Ui();if(B)return;if(!d)return void(ge.value=!0);const f=d.useMonaco,p=d.detectLanguage;if(typeof p=="function"&&(wl=p),typeof f!="function")return;Ne=yo();const h=f(Ne);se=h.createEditor||se,Xt=h.createDiffEditor||Xt,Ln=h.updateCode||Ln,Kt=h.updateDiff||Kt,xt=h.getEditor||xt,de=h.getEditorView||de,V=h.getDiffEditorView||V,On=h.cleanupEditor||On,Xe=h.safeClean||h.cleanupEditor||Xe,$n=h.refreshDiffPresentation||$n,zn=h.setTheme||zn,Ke=h.whenVisualReady||null,bt.value=!0}catch{if(B)return;ge.value=!0}}).finally(()=>{Lt===c&&(Lt=null)});return Lt=c,c})})(),u!==mo||r.stream===!1&&r.loading!==!1||pn()||!Z.value||!se||ge.value||X.value||ko()||B||v.value!==t)||pn())return;const a=je(t);if(a){try{yield a}catch{q.value=!1,R.value=!1,qe()}q.value&&R.value&&mi()}}));function po(e){return!!e&&typeof e=="object"&&"light"in e&&"dark"in e}function rt(e){return typeof e=="string"?e:e&&typeof e=="object"&&"name"in e?String(e.name):null}function ho(e,t){if(e===t)return!0;const n=rt(e),l=rt(t);return!!n&&n===l}function Dt(){var e;const t=(function(){if(r.theme!==void 0){const a=r.theme;return po(a)?r.isDark?a.dark:a.light:a}return r.isDark?r.darkTheme:r.lightTheme})(),n=(e=ae.value)==null?void 0:e.theme,l=t??n;if(l!=null&&typeof l=="object")return l;const o=Array.isArray(r.themes)?r.themes:[];if(!o.length||l==null)return l;const i=rt(l),s=o.map(a=>rt(a)).filter(a=>!!a);if(!i||s.includes(i))return l;const u=rt(n);return n!=null&&u&&s.includes(u)?n:o[0]}function go(){return j(this,arguments,function*(e={}){at();const t=()=>{m.value&&St(),fe(()=>{nl(),ce()})};if(e.appearanceOnly)return void t();const n=Dt();if(n)try{yield zn(n),t()}catch{}else t()})}function At(e,t){if(typeof t!="string")return;const n=wn(t),l=Eo(n),o=["plain","objectivec","objectivecpp"].includes(n)?l:n;for(const i of[o,l])i&&!e.includes(i)&&e.push(i)}ue(zt,(e,t)=>j(null,null,function*(){if(e===t||me.value||tt||(uo(),!se||!v.value)||!X.value||r.stream===!1&&r.loading!==!1||!Z.value)return;const n=ze;if(n){try{yield n}catch{}if(B||!v.value)return}if(Sl.value!==e||!X.value||!q.value)try{q.value=!1,R.value=!1,X.value=!1,Ce.value=!1,ot(),De(),Xe(),yield A(),yield je(v.value)}catch{q.value=!1,R.value=!1,qe()}}));const pi=b(()=>{var e;const t=[],n=(e=ae.value)==null?void 0:e.languages;if(Array.isArray(n))for(const l of n)At(t,l);return ro()&&At(t,r.node.language),At(t,xe.value),At(t,Fe.value),At(t,"plaintext"),t});function yo(){const e=Me(U(Me(U({wordWrap:"on",wrappingIndent:"same",themes:r.themes},ae.value||{}),{languages:pi.value,stream:!1,fontSize:rn.value,lineHeight:an.value,theme:Dt(),disableFileHeader:!0}),m.value?{diffAppearance:Rn.value}:{}),{onThemeChange(){nl()}}),t=(function(){var l;const o=(l=ae.value)==null?void 0:l.fontFamily;return typeof o=="string"&&o.trim()?o.trim():m.value?(function(){var i;if(typeof window>"u")return;const s=(i=z.value)==null?void 0:i.querySelector("pre.code-pre-fallback");if(s)return window.getComputedStyle(s).fontFamily.trim()||void 0})():void 0})();t&&(e.fontFamily!=null||(e.fontFamily=t));const n=typeof e.unsafeCSS=="string"?e.unsafeCSS:"";if(e.unsafeCSS=`[data-file], [data-diff] { --diffs-min-number-column-width-default: 2ch !important; } +${n}`.trim(),m.value){e.wordWrap=qn.value?"on":"off";const l=(function(){var o,i;const s=Wn.value;if(s===!1||typeof s=="object"&&s.enabled===!1)return null;const u=typeof s=="object"?s:Wt,a=Math.max(0,Math.floor((o=u.contextLineCount)!=null?o:2));return{contextLineCount:a,collapsedContextThreshold:a+Math.max(1,Math.floor((i=u.minimumLineCount)!=null?i:4))-1}})();e.unsafeCSS+=` +pre { column-gap: 0; } +pre > code { column-gap: 0; padding-block: 0; } +[data-separator="line-info"] { margin-top: 0; } +`,l?(e.parseDiffOptions=Me(U({},e.parseDiffOptions),{context:l.contextLineCount}),e.collapsedContextThreshold=l.collapsedContextThreshold,e.expandUnchanged=!1,e.hunkSeparators="line-info",e.unsafeCSS+=`[data-separator="line-info"][data-separator-last] { height: 28px; } +`):(e.expandUnchanged=!0,e.hunkSeparators="simple")}return e}function at(){const e=yo();if(!Ne)return Ne=e,Ne;for(const t of Object.keys(Ne))t in e||delete Ne[t];return Object.assign(Ne,e),Ne}const wo=b(()=>{var e,t,n,l,o,i,s,u,a,c,d,f,p,h,x;return JSON.stringify({diffLineStyle:(t=(e=ae.value)==null?void 0:e.diffLineStyle)!=null?t:"background",diffUnchangedRegionStyle:(l=(n=ae.value)==null?void 0:n.diffUnchangedRegionStyle)!=null?l:"line-info",diffHideUnchangedRegions:((o=r.monacoOptions)==null?void 0:o.diffHideUnchangedRegions)===void 0?U({},Wt):bn(r.monacoOptions.diffHideUnchangedRegions),renderSideBySide:(s=(i=ae.value)==null?void 0:i.renderSideBySide)==null||s,useInlineViewWhenSpaceIsLimited:(a=(u=ae.value)==null?void 0:u.useInlineViewWhenSpaceIsLimited)!=null&&a,enableSplitViewResizing:(d=(c=ae.value)==null?void 0:c.enableSplitViewResizing)==null||d,ignoreTrimWhitespace:(p=(f=ae.value)==null?void 0:f.ignoreTrimWhitespace)==null||p,originalEditable:(x=(h=ae.value)==null?void 0:h.originalEditable)!=null&&x})}),bo=$(0);function dl(){var e;const t=Dt();return JSON.stringify({kind:zt.value,language:Fe.value,structural:wo.value,optionsRevision:bo.value,settledContentGeneration:Cl.value,theme:(e=rt(t))!=null?e:t==null?null:"custom",isDark:r.isDark})}ue(()=>[r.monacoOptions,r.theme,r.themes,r.lightTheme,r.darkTheme],()=>{bo.value+=1},{deep:!0}),ue(()=>[Re.value,r.node.originalCode,r.node.updatedCode],()=>{Dn.value+=1,Ve()||(Cl.value+=1)});const ut=b(()=>dl());function cl(){me.value&&et.value!==ut.value&&(me.value=!1,et.value=null,Nt=null,An=null,X.value=!1,q.value=!1,Ce.value=!1,R.value=!1,Ht.value=!1)}function ko(){return cl(),me.value&&et.value===ut.value}function qe(e=ut.value){et.value=e,me.value=!0,Ht.value=!1}return ue(ut,()=>j(null,null,function*(){if(tt||!me.value||et.value===ut.value||!se||!v.value||ge.value||B||!Z.value||r.stream===!1&&r.loading!==!1||pn())return;const e=ut.value;tt=!0;try{if(cl(),me.value)return;yield je(v.value)}catch{q.value=!1,R.value=!1,qe()}finally{An=e,yield A(),tt=!1}})),ue(()=>[r.monacoOptions,Z.value],()=>{var e,t;if(at(),!se||!Z.value)return;const n=m.value?V():de(),l=typeof((e=r.monacoOptions)==null?void 0:e.fontSize)=="number"?r.monacoOptions.fontSize:Number.isFinite(W.value)?W.value:void 0;typeof l=="number"&&Number.isFinite(l)&&l>0&&((t=n?.updateOptions)==null||t.call(n,{fontSize:l})),le(!1)},{deep:!0}),ue(()=>[Dt(),Rn.value,bt.value,X.value,Z.value],([e],t)=>{bt.value&&q.value&&Z.value&&go({appearanceOnly:t!=null&&ho(e,t[0])})},{flush:"post"}),ue(()=>[wo.value,bt.value,Z.value],(e,t)=>j(null,[e,t],function*([n,l,o],[i]){if(at(),!l||!o||!se||!v.value||!X.value||n===i||r.stream===!1&&r.loading!==!1)return;const s=ze;if(s){try{yield s}catch{}if(B||!v.value)return}try{q.value=!1,R.value=!1,X.value=!1,Ce.value=!1,ot(),De(),Xe(),yield A(),yield je(v.value,{allowStaleContentRetry:!1})}catch{q.value=!1,R.value=!1,qe()}}),{flush:"post"}),ue(()=>[r.loading,Z.value],(e,t)=>j(null,[e,t],function*([n,l],o){if(!l)return;const i=o?.[0];if(i===!1&&n!==!1&&m.value&&X.value&&(yield A(),fe(()=>{j(null,null,function*(){const u=ze;if(u)try{yield u}catch{}!B&&m.value&&r.loading!==!1&&(at(),St(),ce())})})),n)return;const s=i!==void 0&&i!==!1;yield A(),fe(()=>{j(null,null,function*(){var u,a;try{if(s&&(yield(function(){return j(this,null,function*(){if(!me.value||!se||!v.value||ge.value||B||!Z.value)return!1;if(An===ut.value)return!0;tt=!0;try{me.value=!1,et.value=null,Nt=null,X.value=!1,q.value=!1,Ce.value=!1,R.value=!1,ot(),De(),Xe(),yield A();try{yield je(v.value)}catch{q.value=!1,R.value=!1,qe()}}finally{yield A(),tt=!1}return!0})})()))return void le(!1);if(s&&m.value&&X.value&&jn&&v.value)return jn=!1,q.value=!1,R.value=!1,X.value=!1,Ce.value=!1,ot(),De(),Xe(),yield A(),yield je(v.value,{allowStaleContentRetry:!1}),void it(!0);if(s&&X.value)if(m.value&&v.value){const c=ze;if(c)try{yield c}catch{}at();const d=Ot(String((u=r.node.originalCode)!=null?u:""),String((a=r.node.updatedCode)!=null?a:""));if(yield io(d.original,d.updated,Fe.value),B||!m.value)return;St(),ee(!0),Hl(),he(),lt();const f=yield oo({requireHighlight:!0});B||!f||R.value||(yield Nl()),ce(),it(!0)}else uo(),co(Re.value,Fe.value);s&&m.value?(le({preferModelDiffHeight:!0,holdCurrentDiffHeight:!0}),it(!0)):le(!1)}catch{}})})}),{immediate:!0,flush:"post"}),To(()=>{ot(),De(),On(),Zt?.()}),(e,t)=>ge.value?(Y(),Sn(J(Bo),{key:0,class:pt(["code-pre-fallback",{"is-wrap":qn.value}]),style:Vt($l.value),node:El.value,loading:r.loading,"show-line-numbers":!0,"diff-inline":Ue.value,"diff-hide-unchanged-regions":Wn.value},null,8,["class","style","node","loading","diff-inline","diff-hide-unchanged-regions"])):(Y(),ie("div",{key:1,ref_key:"container",ref:z,style:Vt(ai.value),class:pt(["code-block-container rounded-lg border",[{dark:r.isDark,"is-rendering":r.loading,"is-dark":xl.value,"is-diff":m.value,"is-plain-text":Mn.value}]]),"data-markstream-code-block":"1","data-markstream-enhanced":R.value&&!ge.value?"true":"false","data-markstream-enhancement-state":Vo.value,"data-markstream-code-block-state":Ve()?"streaming":"settled","data-markstream-pending":Uo.value?"true":void 0,"data-markstream-viewport-pending":yl.value&&J(Pn)&&!Z.value?"true":void 0},[Ro(pr,{"show-header":r.showHeader,"show-collapse-button":r.showCollapseButton,"show-font-size-buttons":r.showFontSizeButtons,"enable-font-size-control":r.enableFontSizeControl,"show-copy-button":r.showCopyButton,"show-expand-button":r.showExpandButton,"show-preview-button":r.showPreviewButton,"show-tooltips":r.showTooltips,"is-dark":r.isDark,loading:r.loading,stream:k.stream,"is-collapsed":Se.value,"is-expanded":Pe.value,"copy-text":wt.value,"is-previewable":ul.value,"code-font-size":W.value,"code-font-min":10,"code-font-max":36,"default-code-font-size":pe.value,"font-baseline-ready":Go.value,"diff-stats":m.value?Ze.value:null,"diff-stats-aria-label":Wo.value,onToggleCollapse:ci,onDecreaseFont:ti,onResetFont:ni,onIncreaseFont:ei,onCopy:si,onToggleExpand:di,onPreview:fi},Oi({"header-left":Gt(()=>[ht(e.$slots,"header-left",{},()=>[w("div",xr,[w("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:ri.value},null,8,Sr),w("div",Cr,[w("div",Mr,Be(ii.value),1),vo.value?(Y(),ie("div",Br,Be(vo.value),1)):we("",!0)])])],!0)]),loading:Gt(()=>[ht(e.$slots,"loading",{loading:k.loading,stream:k.stream},()=>[t[0]||(t[0]=w("div",{class:"loading-skeleton"},[w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line short"})],-1))],!0)]),default:Gt(()=>[vl(w("div",{class:pt(["code-editor-layer",{"code-editor-layer--collapsed":Se.value}])},[w("div",{ref_key:"codeEditor",ref:v,class:pt(["code-editor-container",k.stream?"":"code-height-placeholder"]),"data-markstream-host-hidden":Io.value?"true":void 0,style:Vt(Xo.value)},null,14,Er),Bl.value?(Y(),Sn(J(Bo),{key:0,class:pt(["code-pre-fallback",{"is-wrap":qn.value}]),style:Vt($l.value),node:El.value,"show-line-numbers":!0,"diff-inline":Ue.value,"diff-hide-unchanged-regions":Wn.value},null,8,["class","style","node","diff-inline","diff-hide-unchanged-regions"])):we("",!0)],2),[[ml,!!k.stream||!k.loading]]),nn.value&&!Yt.value&&ul.value&&xe.value==="html"?(Y(),Sn(br,{key:0,code:r.node.code,"html-preview-allow-scripts":r.htmlPreviewAllowScripts,"html-preview-sandbox":r.htmlPreviewSandbox,"is-dark":r.isDark,"on-close":()=>nn.value=!1},null,8,["code","html-preview-allow-scripts","html-preview-sandbox","is-dark","on-close"])):we("",!0)]),_:2},[e.$slots["header-right"]?{name:"header-right",fn:Gt(()=>[ht(e.$slots,"header-right",{},void 0,!0)]),key:"0"}:void 0]),1032,["show-header","show-collapse-button","show-font-size-buttons","enable-font-size-control","show-copy-button","show-expand-button","show-preview-button","show-tooltips","is-dark","loading","stream","is-collapsed","is-expanded","copy-text","is-previewable","code-font-size","default-code-font-size","font-baseline-ready","diff-stats","diff-stats-aria-label"])],14,kr))}}),[["__scopeId","data-v-ef6e4bb8"]]);export{Lr as default}; diff --git a/apps/kimi-code/dist-web/assets/Tooltip-Da35cfam.js b/apps/kimi-code/dist-web/assets/Tooltip-Da35cfam.js new file mode 100644 index 00000000000..9723d6798c2 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/Tooltip-Da35cfam.js @@ -0,0 +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-CiHMlsuo.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-C6R_sAbc.js b/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-C6R_sAbc.js new file mode 100644 index 00000000000..5d9414f74aa --- /dev/null +++ b/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-C6R_sAbc.js @@ -0,0 +1 @@ +import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-DmVMZHwQ.js";import{p as f}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{_ as n,l as o}from"./mermaid.core-WW7RuneT.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.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-CPC2gY0w.js b/apps/kimi-code/dist-web/assets/arc-CPC2gY0w.js new file mode 100644 index 00000000000..ecd4bdd5077 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/arc-CPC2gY0w.js @@ -0,0 +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-WW7RuneT.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),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=>` + .edge { + stroke-width: ${L.archEdgeWidth}; + stroke: ${L.archEdgeColor}; + fill: none; + } + + .arrow { + fill: ${L.archEdgeArrowColor}; + } + + .node-bkg { + fill: none; + stroke: ${L.archGroupBorderColor}; + stroke-width: ${L.archGroupBorderWidth}; + stroke-dasharray: 8; + } + .node-icon-text { + display: flex; + align-items: center; + } + + .node-icon-text > div { + color: #fff; + margin: 1px; + height: fit-content; + text-align: center; + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + } +`,"getStyles"),Rr=Ir;function ye(L,b){if(L===0)return b();const A=Math.random;let G=L>>>0;Math.random=function(){G=G+1831565813>>>0;let N=G;return N=Math.imul(N^N>>>15,N|1),N^=N+Math.imul(N^N>>>7,N|61),((N^N>>>14)>>>0)/4294967296};try{return b()}finally{Math.random=A}}gt(ye,"withSeededRandom");var re=gt(L=>`${L}`,"wrapIcon"),ae={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('')},server:{body:re('')},disk:{body:re('')},internet:{body:re('')},cloud:{body:re('')},unknown:lr,blank:{body:re("")}}},Sr=gt(async function(L,b,A,G){const N=A.getConfigField("padding"),v=A.getConfigField("iconSize"),h=v/2,i=v/6,r=i/2;await Promise.all(b.edges().map(async a=>{const{source:f,sourceDir:e,sourceArrow:u,sourceGroup:t,target:s,targetDir:o,targetArrow:c,targetGroup:l,label:T}=be(a);let{x:g,y:d}=a[0].sourceEndpoint();const{x:C,y:S}=a[0].midpoint();let{x:w,y:P}=a[0].targetEndpoint();const B=N+4;if(t&&(Wt(e)?g+=e==="L"?-B:B:d+=e==="T"?-B:B+18),l&&(Wt(o)?w+=o==="L"?-B:B:P+=o==="T"?-B:B+18),!t&&A.getNode(f)?.type==="junction"&&(Wt(e)?g+=e==="L"?h:-h:d+=e==="T"?h:-h),!l&&A.getNode(s)?.type==="junction"&&(Wt(o)?w+=o==="L"?h:-h:P+=o==="T"?h:-h),a[0]._private.rscratch){const U=L.insert("g");if(U.insert("path").attr("d",`M ${g},${d} L ${C},${S} L${w},${P} `).attr("class","edge").attr("id",`${G}-${sr(f,s,{prefix:"L"})}`),u){const V=Wt(e)?oe[e](g,i):g-r,M=qt(e)?oe[e](d,i):d-r;U.insert("polygon").attr("points",Ie[e](i)).attr("transform",`translate(${V},${M})`).attr("class","arrow")}if(c){const V=Wt(o)?oe[o](w,i):w-r,M=qt(o)?oe[o](P,i):P-r;U.insert("polygon").attr("points",Ie[o](i)).attr("transform",`translate(${V},${M})`).attr("class","arrow")}if(T){const V=Te(e,o)?"XY":Wt(e)?"X":"Y";let M=0;V==="X"?M=Math.abs(g-w):V==="Y"?M=Math.abs(d-P)/1.5:M=Math.abs(g-w)/2;const _=U.append("g");if(await Ee(_,T,{useHtmlLabels:!1,width:M,classes:"architecture-service-label"},me()),_.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),V==="X")_.attr("transform","translate("+C+", "+S+")");else if(V==="Y")_.attr("transform","translate("+C+", "+S+") rotate(-90)");else if(V==="XY"){const n=pe(e,o);if(n&&Nr(n)){const E=_.node().getBoundingClientRect(),[p,m]=wr(n);_.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*p*m*45})`);const y=_.node().getBoundingClientRect();_.attr("transform",` + translate(${C}, ${S-E.height/2}) + translate(${p*y.width/2}, ${m*y.height/2}) + rotate(${-1*p*m*45}, 0, ${E.height/2}) + `)}}}}}))},"drawEdges"),Fr=gt(async function(L,b,A,G){const v=A.getConfigField("padding")*.75,h=A.getConfigField("fontSize"),r=A.getConfigField("iconSize")/2;await Promise.all(b.nodes().map(async a=>{const f=ie(a);if(f.type==="group"){const{h:e,w:u,x1:t,y1:s}=a.boundingBox(),o=L.append("rect");o.attr("id",`${G}-group-${f.id}`).attr("x",t+r).attr("y",s+r).attr("width",u).attr("height",e).attr("class","node-bkg");const c=L.append("g");let l=t,T=s;if(f.icon){const g=c.append("g");g.html(`${await ve(f.icon,{height:v,width:v,fallbackPrefix:ae.prefix})}`),g.attr("transform","translate("+(l+r+1)+", "+(T+r+1)+")"),l+=v,T+=h/2-1-2}if(f.label){const g=c.append("g");await Ee(g,f.label,{useHtmlLabels:!1,width:u,classes:"architecture-service-label"},me()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(l+r+4)+", "+(T+r+2)+")")}A.setElementForId(f.id,o)}}))},"drawGroups"),br=gt(async function(L,b,A,G){const N=me();for(const v of A){const h=b.append("g"),i=L.getConfigField("iconSize");if(v.title){const e=h.append("g");await Ee(e,v.title,{useHtmlLabels:!1,width:i*1.5,classes:"architecture-service-label"},N),e.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),e.attr("transform","translate("+i/2+", "+i+")")}const r=h.append("g");if(v.icon)r.html(`${await ve(v.icon,{height:i,width:i,fallbackPrefix:ae.prefix})}`);else if(v.iconText){r.html(`${await ve("blank",{height:i,width:i,fallbackPrefix:ae.prefix})}`);const t=r.append("g").append("foreignObject").attr("width",i).attr("height",i).append("div").attr("class","node-icon-text").attr("style",`height: ${i}px;`).append("div").html(nr(v.iconText,N)),s=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((i-2)/s)};`)}else r.append("path").attr("class","node-bkg").attr("id",`${G}-node-${v.id}`).attr("d",`M0,${i} V5 Q0,0 5,0 H${i-5} Q${i},0 ${i},5 V${i} Z`);h.attr("id",`${G}-service-${v.id}`).attr("class","architecture-service");const{width:a,height:f}=h.node().getBBox();v.width=a,v.height=f,L.setElementForId(v.id,h)}return 0},"drawServices"),Pr=gt(function(L,b,A,G){A.forEach(N=>{const v=b.append("g"),h=L.getConfigField("iconSize");v.append("g").append("rect").attr("id",`${G}-node-${N.id}`).attr("fill-opacity","0").attr("width",h).attr("height",h),v.attr("class","architecture-junction");const{width:r,height:a}=v._groups[0][0].getBBox();v.width=r,v.height=a,L.setElementForId(N.id,v)})},"drawJunctions");hr([{name:ae.prefix,icons:ae}]);Fe.use(Er);function Ue(L,b,A){L.forEach(G=>{b.add({group:"nodes",data:{type:"service",id:G.id,icon:G.icon,label:G.title,parent:G.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-service"})})}gt(Ue,"addServices");function Ye(L,b,A){L.forEach(G=>{b.add({group:"nodes",data:{type:"junction",id:G.id,parent:G.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-junction"})})}gt(Ye,"addJunctions");function Xe(L,b){b.nodes().map(A=>{const G=ie(A);if(G.type==="group")return;G.x=A.position().x,G.y=A.position().y,L.getElementById(G.id).attr("transform","translate("+(G.x||0)+","+(G.y||0)+")")})}gt(Xe,"positionNodes");function He(L,b){L.forEach(A=>{b.add({group:"nodes",data:{type:"group",id:A.id,icon:A.icon,label:A.title,parent:A.in},classes:"node-group"})})}gt(He,"addGroups");function We(L,b){L.forEach(A=>{const{lhsId:G,rhsId:N,lhsInto:v,lhsGroup:h,rhsInto:i,lhsDir:r,rhsDir:a,rhsGroup:f,title:e}=A,u=Te(A.lhsDir,A.rhsDir)?"segments":"straight",t={id:`${G}-${N}`,label:e,source:G,sourceDir:r,sourceArrow:v,sourceGroup:h,sourceEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%",target:N,targetDir:a,targetArrow:i,targetGroup:f,targetEndpoint:a==="L"?"0 50%":a==="R"?"100% 50%":a==="T"?"50% 0":"50% 100%"};b.add({group:"edges",data:t,classes:u})})}gt(We,"addEdges");function Ve(L,b,A,G=[]){const N=gt((u,t)=>Object.entries(u).reduce((s,[o,c])=>{let l=0;const T=Object.entries(c);if(T.length===1)return s[o]=T[0][1],s;for(let g=0;g{const t={},s={};return Object.entries(u).forEach(([o,[c,l]])=>{const T=L.getNode(o)?.in??"default";t[l]??={},t[l][T]??=[],t[l][T].push(o),s[c]??={},s[c][T]??=[],s[c][T].push(o)}),{horiz:Object.values(N(t,"horizontal")).filter(o=>o.length>1),vert:Object.values(N(s,"vertical")).filter(o=>o.length>1)}}),[h,i]=v.reduce(([u,t],{horiz:s,vert:o})=>[[...u,...s],[...t,...o]],[[],[]]),r=new Set;G.forEach(u=>u.members.forEach(t=>r.add(t)));const a=gt(u=>u.filter(t=>!t.some(s=>r.has(s))),"dropOverlapping"),f=a(h),e=a(i);return G.forEach(u=>{u.members.length<2||(u.direction==="row"?f.push([...u.members]):e.push([...u.members]))}),{horizontal:f,vertical:e}}gt(Ve,"getAlignments");function ze(L,b,A=[]){const G=[],N=b.getConfigField("iconSize"),v=b.getConfigField("idealEdgeLengthMultiplier"),h=v*N,i=new Set;A.forEach(f=>{for(let e=0;e`${f[0]},${f[1]}`,"posToStr"),a=gt(f=>f.split(",").map(e=>parseInt(e)),"strToPos");return L.forEach(f=>{const e=Object.fromEntries(Object.entries(f).map(([o,c])=>[r(c),o])),u=[r([0,0])],t={},s={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;u.length>0;){const o=u.shift();if(o){t[o]=1;const c=e[o];if(c){const l=a(o);Object.entries(s).forEach(([T,g])=>{const d=r([l[0]+g[0],l[1]+g[1]]),C=e[d];if(C&&!t[d]){if(u.push(d),i.has(`${c}|${C}`))return;G.push({[xe[T]]:C,[xe[Tr(T)]]:c,gap:v*N})}})}}}}),G}gt(ze,"getRelativeConstraints");function Be(L,b,A,G,N,{spatialMaps:v,groupAlignments:h}){return new Promise(i=>{const r=or("body").append("div").attr("id","cy").attr("style","display:none"),a=Fe({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${N.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${N.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});r.remove(),He(A,a),Ue(L,a,N),Ye(b,a,N),We(G,a);const f=N.getLayoutHints(),e=Ve(N,v,h,f),u=ze(v,N,f),t=N.getConfigField("iconSize"),s=N.getConfigField("idealEdgeLengthMultiplier")*t,o=.5*t,c=N.getConfigField("edgeElasticity"),l=N.getConfigField("seed"),T=a.layout({name:"fcose",quality:"proof",randomize:N.getConfigField("randomize"),nodeSeparation:N.getConfigField("nodeSeparation"),numIter:N.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(g){const[d,C]=g.connectedNodes(),{parent:S}=ie(d),{parent:w}=ie(C);return S===w?s:o},edgeElasticity(g){const[d,C]=g.connectedNodes(),{parent:S}=ie(d),{parent:w}=ie(C);return S===w?c:.001},alignmentConstraint:e,relativePlacementConstraint:u});T.one("layoutstop",()=>{function g(d,C,S,w){let P,B;const{x:U,y:V}=d,{x:M,y:_}=C;B=(w-V+(U-S)*(V-_)/(U-M))/Math.sqrt(1+Math.pow((V-_)/(U-M),2)),P=Math.sqrt(Math.pow(w-V,2)+Math.pow(S-U,2)-Math.pow(B,2));const n=Math.sqrt(Math.pow(M-U,2)+Math.pow(_-V,2));P=P/n;let E=(M-U)*(w-V)-(_-V)*(S-U);switch(!0){case E>=0:E=1;break;case E<0:E=-1;break}let p=(M-U)*(S-U)+(_-V)*(w-V);switch(!0){case p>=0:p=1;break;case p<0:p=-1;break}return B=Math.abs(B)*E,P=P*p,{distances:B,weights:P}}gt(g,"getSegmentWeights"),a.startBatch();for(const d of Object.values(a.edges()))if(d.data?.()){const{x:C,y:S}=d.source().position(),{x:w,y:P}=d.target().position();if(C!==w&&S!==P){const B=d.sourceEndpoint(),U=d.targetEndpoint(),{sourceDir:V}=be(d),[M,_]=qt(V)?[B.x,U.y]:[U.x,B.y],{weights:n,distances:E}=g(B,U,M,_);d.style("segment-distances",E),d.style("segment-weights",n)}}a.endBatch(),ye(l,()=>T.run())});try{ye(l,()=>T.run())}catch(g){throw g instanceof RangeError&&g.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):g}a.ready(g=>{Se.info("Ready",g),i(a)})})}gt(Be,"layoutArchitecture");var Gr=gt(async(L,b,A,G)=>{const N=G.db;N.setDiagramId(b);const v=N.getServices(),h=N.getJunctions(),i=N.getGroups(),r=N.getEdges(),a=N.getDataStructures(),f=Ze(b),e=f.append("g");e.attr("class","architecture-edges");const u=f.append("g");u.attr("class","architecture-services");const t=f.append("g");t.attr("class","architecture-groups"),await br(N,u,v,b),Pr(N,u,h,b);const s=await Be(v,h,i,r,N,a);await Sr(e,s,N,b),await Fr(t,s,N,b),Xe(N,s),qe(void 0,f,N.getConfigField("padding"),N.getConfigField("useMaxWidth"))},"draw"),Ur={draw:Gr},Br={parser:Ge,get db(){return new Pe},renderer:Ur,styles:Rr};export{Br as diagram}; diff --git a/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-fPyJR28f.js b/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-fPyJR28f.js new file mode 100644 index 00000000000..71266bc5f8d --- /dev/null +++ b/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-fPyJR28f.js @@ -0,0 +1,132 @@ +import{g as de}from"./chunk-5VM5RSS4-BJR-VYAu.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-WW7RuneT.js";import{G as Ze}from"./graph-DOmOIIwC.js";import{c as qe}from"./channel-8Bt6a0tz.js";import"./index-CiHMlsuo.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()+` +`+p+"^"},"showPosition"),test_match:g(function(m,p){var x,L,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),L=m[0].match(/(?:\r\n?|\n).*/g),L&&(this.yylineno+=L.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:L?L[L.length-1].length-L[L.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+m[0].length},this.yytext+=m[0],this.match+=m[0],this.matches=m,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(m[0].length),this.matched+=m[0],x=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var o in E)this[o]=E[o];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var m,p,x,L;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),o=0;op[0].length)){if(p=x,L=o,this.options.backtrack_lexer){if(m=this.test_match(x,E[o]),m!==!1)return m;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(m=this.test_match(p,E[L]),m!==!1?m:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:g(function(){var p=this.next();return p||this.lex()},"lex"),begin:g(function(p){this.conditionStack.push(p)},"begin"),popState:g(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:g(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:g(function(p){this.begin(p)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:g(function(p,x,L,E){switch(L){case 0:return p.getLogger().debug("Found block-beta"),10;case 1:return p.getLogger().debug("Found id-block"),29;case 2:return p.getLogger().debug("Found block"),10;case 3:p.getLogger().debug(".",x.yytext);break;case 4:p.getLogger().debug("_",x.yytext);break;case 5:return 5;case 6:return x.yytext=-1,28;case 7:return x.yytext=x.yytext.replace(/columns\s+/,""),p.getLogger().debug("COLUMNS (LEX)",x.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:p.getLogger().debug("LEX: POPPING STR:",x.yytext),this.popState();break;case 13:return p.getLogger().debug("LEX: STR end:",x.yytext),"STR";case 14:return x.yytext=x.yytext.replace(/space\:/,""),p.getLogger().debug("SPACE NUM (LEX)",x.yytext),21;case 15:return x.yytext="1",p.getLogger().debug("COLUMNS (LEX)",x.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),p.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),p.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),p.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),p.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),p.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),p.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),p.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),p.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),p.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),p.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),p.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),p.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),p.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),p.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),p.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),p.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),p.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return p.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return p.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return p.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return p.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return p.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return p.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return p.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return p.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return p.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return p.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return p.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return p.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),p.getLogger().debug("LEX ARR START"),37;case 74:return p.getLogger().debug("Lex: NODE_ID",x.yytext),31;case 75:return p.getLogger().debug("Lex: EOF",x.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:p.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:p.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return p.getLogger().debug("LEX: NODE_DESCR:",x.yytext),"NODE_DESCR";case 83:p.getLogger().debug("LEX POPPING"),this.popState();break;case 84:p.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (right): dir:",x.yytext),"DIR";case 86:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (left):",x.yytext),"DIR";case 87:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (x):",x.yytext),"DIR";case 88:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (y):",x.yytext),"DIR";case 89:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (up):",x.yytext),"DIR";case 90:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (down):",x.yytext),"DIR";case 91:return x.yytext="]>",p.getLogger().debug("Lex (ARROW_DIR end):",x.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return p.getLogger().debug("Lex: LINK","#"+x.yytext+"#"),15;case 93:return p.getLogger().debug("Lex: LINK",x.yytext),15;case 94:return p.getLogger().debug("Lex: LINK",x.yytext),15;case 95:return p.getLogger().debug("Lex: LINK",x.yytext),15;case 96:return p.getLogger().debug("Lex: START_LINK",x.yytext),this.pushState("LLABEL"),16;case 97:return p.getLogger().debug("Lex: START_LINK",x.yytext),this.pushState("LLABEL"),16;case 98:return p.getLogger().debug("Lex: START_LINK",x.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return p.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),p.getLogger().debug("Lex: LINK","#"+x.yytext+"#"),15;case 102:return this.popState(),p.getLogger().debug("Lex: LINK",x.yytext),15;case 103:return this.popState(),p.getLogger().debug("Lex: LINK",x.yytext),15;case 104:return p.getLogger().debug("Lex: COLON",x.yytext),x.yytext=x.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return T})();S.lexer=N;function _(){this.yy={}}return g(_,"Parser"),_.prototype=S,S.Parser=_,new _})();bt.parser=bt;var ar=bt,U=new Map,vt=[],wt=new Map,Rt="color",At="fill",sr="bgFill",Ut=",",ct=new Map,Et="",ir=g(e=>Ve.sanitizeText(e,R()),"sanitizeText"),nr=g(function(e,t=""){let a=ct.get(e);a||(a={id:e,styles:[],textStyles:[]},ct.set(e,a)),t?.split(Ut).forEach(s=>{const i=s.replace(/([^;]*);/,"$1").trim();if(RegExp(Rt).exec(s)){const r=i.replace(At,sr).replace(Rt,At);a.textStyles.push(r)}a.styles.push(i)})},"addStyleClass"),cr=g(function(e,t=""){const a=U.get(e);t!=null&&(a.styles=t.split(Ut))},"addStyle2Node"),lr=g(function(e,t){e.split(",").forEach(function(a){let s=U.get(a);if(s===void 0){const i=a.trim();s={id:i,type:"na",children:[]},U.set(i,s)}s.classes||(s.classes=[]),s.classes.push(t)})},"setCssClass"),Xt=g((e,t)=>{const a=e.flat(),s=[],c=a.find(r=>r?.type==="column-setting")?.columns??-1;for(const r of a){if(typeof c=="number"&&c>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>c&&k.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${c}`),r.label&&(r.label=ir(r.label)),r.type==="classDef"){nr(r.id,r.css);continue}if(r.type==="applyClass"){lr(r.id,r?.styleClass??"");continue}if(r.type==="applyStyles"){r?.stylesStr&&cr(r.id,r?.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){const n=(wt.get(r.id)??0)+1;wt.set(r.id,n),r.id=n+"-"+r.id,vt.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);const n=U.get(r.id);if(n===void 0?U.set(r.id,r):(r.type!=="na"&&(n.type=r.type),r.label!==r.id&&(n.label=r.label)),r.children&&Xt(r.children,r),r.type==="space"){const l=r.width??1;for(let u=0;u{k.debug("Clear called"),Fe(),et={id:"root",type:"composite",children:[],columns:-1},U=new Map([["root",et]]),_t=[],ct=new Map,vt=[],wt=new Map,Et=""},"clear");function Vt(e){switch(k.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return k.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}g(Vt,"typeStr2Type");function jt(e){switch(k.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}g(jt,"edgeTypeStr2Type");function Gt(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}g(Gt,"edgeStrToEdgeData");function Zt(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}g(Zt,"edgeStrToEdgeStartData");function qt(e){return e.includes("==")?"thick":"normal"}g(qt,"edgeStrToThickness");function Jt(e){return e.includes(".-")?"dotted":"solid"}g(Jt,"edgeStrToPattern");var zt=0,hr=g(()=>(zt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+zt),"generateId"),gr=g(e=>{et.children=e,Xt(e,et),_t=et.children},"setHierarchy"),ur=g(e=>{const t=U.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),dr=g(()=>[...U.values()],"getBlocksFlat"),pr=g(()=>_t||[],"getBlocks"),fr=g(()=>vt,"getEdges"),xr=g(e=>U.get(e),"getBlock"),yr=g(e=>{U.set(e.id,e)},"setBlock"),br=g(e=>{Et=e},"setDiagramId"),wr=g(()=>Et,"getDiagramId"),mr=g(()=>k,"getLogger"),Sr=g(function(){return ct},"getClasses"),Lr={getConfig:g(()=>rt().block,"getConfig"),typeStr2Type:Vt,edgeTypeStr2Type:jt,edgeStrToEdgeData:Gt,edgeStrToEdgeStartData:Zt,edgeStrToThickness:qt,edgeStrToPattern:Jt,getLogger:mr,getBlocksFlat:dr,getBlocks:pr,getEdges:fr,setHierarchy:gr,getBlock:xr,setBlock:yr,getColumns:ur,getClasses:Sr,clear:or,generateId:hr,setDiagramId:br,getDiagramId:wr},kr=Lr,yt=g((e,t)=>{const a=qe,s=a(e,"r"),i=a(e,"g"),c=a(e,"b");return We(s,i,c,t)},"fade"),vr=g(e=>`.label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .cluster-label text { + fill: ${e.titleColor}; + } + .cluster-label span,p { + color: ${e.titleColor}; + } + + + + .label text,span,p { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: 1px; + } + .flowchart-label text { + text-anchor: middle; + } + // .flowchart-label .text-outer-tspan { + // text-anchor: middle; + // } + // .flowchart-label .text-inner-tspan { + // text-anchor: start; + // } + + .node .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + .arrowheadPath { + fill: ${e.arrowheadColor}; + } + + .edgePath .path { + stroke: ${e.lineColor}; + stroke-width: 2.0px; + } + + .flowchart-link { + stroke: ${e.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + /* + * This is for backward compatibility with existing code that didn't + * add a \`

\` around edge labels. + * + * TODO: We should probably remove this in a future release. + */ + p { + margin: 0; + padding: 0; + display: inline; + } + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${e.edgeLabelBackground}; + } + + .node .cluster { + // fill: ${yt(e.mainBkg,.5)}; + fill: ${yt(e.clusterBkg,.5)}; + stroke: ${yt(e.clusterBorder,.2)}; + box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor}; + } + + .cluster span,p { + color: ${e.titleColor}; + } + /* .cluster div { + color: ${e.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${e.fontFamily}; + font-size: 12px; + background: ${e.tertiaryColor}; + border: 1px solid ${e.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } + ${de()} +`,"getStyles"),Er=vr,_r=g((e,t,a,s)=>{t.forEach(i=>{zr[i](e,a,s)})},"insertMarkers"),Tr=g((e,t,a)=>{k.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Dr=g((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Br=g((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Nr=g((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Ir=g((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Cr=g((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Or=g((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),Rr=g((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Ar=g((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),zr={extension:Tr,composition:Dr,aggregation:Br,dependency:Nr,lollipop:Ir,point:Cr,circle:Or,cross:Rr,barb:Ar},Mr=_r;function mt(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};const a=t%e,s=Math.floor(t/e);return{px:a,py:s}}g(mt,"calculateBlockPosition");var Pr=g(e=>{let t=0,a=0;for(const s of e.children){const{width:i,height:c,x:r,y:n}=s.size??{width:0,height:0,x:0,y:0};if(k.debug("getMaxChildSize abc95 child:",s.id,"width:",i,"height:",c,"x:",r,"y:",n,s.type),s.type==="space")continue;const l=i/(s.widthInColumns??1);l>t&&(t=l),c>a&&(a=c)}return{width:t,height:a}},"getMaxChildSize");function lt(e,t,a=0,s=0,i=8){k.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",a),e?.size?.width||(e.size={width:a,height:s,x:0,y:0});let c=0,r=0;if(e.children?.length>0){for(const y of e.children)lt(y,t,0,0,i);const n=Pr(e);c=n.width,r=n.height,k.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",c,r);for(const y of e.children)y.size&&(k.debug(`abc95 Setting size of children of ${e.id} id=${y.id} ${c} ${r} ${JSON.stringify(y.size)}`),y.size.width=c*(y.widthInColumns??1)+i*((y.widthInColumns??1)-1),y.size.height=r,y.size.x=0,y.size.y=0,k.debug(`abc95 updating size of ${e.id} children child:${y.id} maxWidth:${c} maxHeight:${r}`));for(const y of e.children)lt(y,t,c,r,i);const l=e.columns??-1;let u=0;for(const y of e.children)u+=y.widthInColumns??1;let h=e.children.length;l>0&&l0?Math.min(e.children.length,l):e.children.length;if(y>0){const v=(b-y*i-i)/y;k.debug("abc95 (growing to fit) width",e.id,b,e.size?.width,v);for(const S of e.children)S.size&&(S.size.width=v)}}e.size={width:b,height:w,x:0,y:0}}k.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}g(lt,"setBlockSizes");function Tt(e,t,a=8){k.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const s=e.columns??-1;if(k.debug("layoutBlocks columns abc95",e.id,"=>",s,e),e.children&&e.children.length>0){const i=e?.children[0]?.size?.width??0,c=e.children.length*i+(e.children.length-1)*a;k.debug("widthOfChildren 88",c,"posX");const r=new Map;{let d=0;for(const b of e.children){if(!b.size)continue;const{py:w}=mt(s,d),y=r.get(w)??0;b.size.height>y&&r.set(w,b.size.height);let v=b?.widthInColumns??1;s>0&&(v=Math.min(v,s-d%s)),d+=v}}const n=new Map;{let d=0;const b=[...r.keys()].sort((w,y)=>w-y);for(const w of b)n.set(w,d),d+=(r.get(w)??0)+a}let l=0;k.debug("abc91 block?.size?.x",e.id,e?.size?.x);let u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-a,h=0;for(const d of e.children){const b=e;if(!d.size)continue;const{width:w,height:y}=d.size,{px:v,py:S}=mt(s,l);if(S!=h&&(h=S,u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-a,k.debug("New row in layout for block",e.id," and child ",d.id,h)),k.debug(`abc89 layout blocks (child) id: ${d.id} Pos: ${l} (px, py) ${v},${S} (${b?.size?.x},${b?.size?.y}) parent: ${b.id} width: ${w}${a}`),b.size){const _=w/2;d.size.x=u+a+_,k.debug(`abc91 layout blocks (calc) px, pyid:${d.id} startingPos=X${u} new startingPosX${d.size.x} ${_} padding=${a} width=${w} halfWidth=${_} => x:${d.size.x} y:${d.size.y} ${d.widthInColumns} (width * (child?.w || 1)) / 2 ${w*(d?.widthInColumns??1)/2}`),u=d.size.x+_;const T=n.get(S)??0,m=r.get(S)??y;d.size.y=b.size.y-b.size.height/2+T+m/2+a,k.debug(`abc88 layout blocks (calc) px, pyid:${d.id}startingPosX${u}${a}${_}=>x:${d.size.x}y:${d.size.y}${d.widthInColumns}(width * (child?.w || 1)) / 2${w*(d?.widthInColumns??1)/2}`)}d.children&&Tt(d,t,a);let N=d?.widthInColumns??1;s>0&&(N=Math.min(N,s-l%s)),l+=N,k.debug("abc88 columnsPos",d,l)}}k.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}g(Tt,"layoutBlocks");function Dt(e,{minX:t,minY:a,maxX:s,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:c,y:r,width:n,height:l}=e.size;c-n/2s&&(s=c+n/2),r+l/2>i&&(i=r+l/2)}if(e.children)for(const c of e.children)({minX:t,minY:a,maxX:s,maxY:i}=Dt(c,{minX:t,minY:a,maxX:s,maxY:i}));return{minX:t,minY:a,maxX:s,maxY:i}}g(Dt,"findBounds");function Qt(e){const t=e.getBlock("root");if(!t)return;const a=R()?.block?.padding??8;lt(t,e,0,0,a),Tt(t,e,a),k.debug("getBlocks",JSON.stringify(t,null,2));const{minX:s,minY:i,maxX:c,maxY:r}=Dt(t),n=r-i,l=c-s;return{x:s,y:i,width:l,height:n}}g(Qt,"layout");var Fr=g(async(e,t,a,s=!1,i=!1)=>{let c=t||"";typeof c=="object"&&(c=c[0]);const r=R(),n=M(r);return await kt(e,c,{style:a,isTitle:s,useHtmlLabels:n,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},r)},"createLabel"),K=Fr,Wr=g((e,t,a,s,i)=>{t.arrowTypeStart&&Mt(e,"start",t.arrowTypeStart,a,s,i),t.arrowTypeEnd&&Mt(e,"end",t.arrowTypeEnd,a,s,i)},"addEdgeMarkers"),Yr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Mt=g((e,t,a,s,i,c)=>{const r=Yr[a];if(!r){k.warn(`Unknown arrow type: ${a}`);return}const n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${s}#${i}_${c}-${r}${n})`)},"addEdgeMarker"),St={},z={},Hr=g(async(e,t)=>{const a=R(),s=M(a),i=e.insert("g").attr("class","edgeLabel"),c=i.insert("g").attr("class","label"),r=t.labelType==="markdown",n=await kt(e,t.label,{style:t.labelStyle,useHtmlLabels:s,addSvgBackground:r,isNode:!1,markdown:r,width:r?void 0:Number.POSITIVE_INFINITY},a);c.node().appendChild(n);let l=n.getBBox(),u=l;if(s){const d=n.children[0],b=D(n);l=d.getBoundingClientRect(),u=l,b.attr("width",l.width),b.attr("height",l.height)}else{const d=D(n).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}c.attr("transform",Q(u,s)),St[t.id]=i,t.width=l.width,t.height=l.height;let h;if(t.startLabelLeft){const d=e.insert("g").attr("class","edgeTerminals"),b=d.insert("g").attr("class","inner"),w=await K(b,t.startLabelLeft,t.labelStyle);h=w;let y=w.getBBox();if(s){const v=w.children[0],S=D(w);y=v.getBoundingClientRect(),S.attr("width",y.width),S.attr("height",y.height)}b.attr("transform",Q(y,s)),z[t.id]||(z[t.id]={}),z[t.id].startLeft=d,tt(h,t.startLabelLeft)}if(t.startLabelRight){const d=e.insert("g").attr("class","edgeTerminals"),b=d.insert("g").attr("class","inner"),w=await K(b,t.startLabelRight,t.labelStyle);h=w;let y=w.getBBox();if(s){const v=w.children[0],S=D(w);y=v.getBoundingClientRect(),S.attr("width",y.width),S.attr("height",y.height)}b.attr("transform",Q(y,s)),z[t.id]||(z[t.id]={}),z[t.id].startRight=d,tt(h,t.startLabelRight)}if(t.endLabelLeft){const d=e.insert("g").attr("class","edgeTerminals"),b=d.insert("g").attr("class","inner"),w=await K(d,t.endLabelLeft,t.labelStyle);h=w;let y=w.getBBox();if(s){const v=w.children[0],S=D(w);y=v.getBoundingClientRect(),S.attr("width",y.width),S.attr("height",y.height)}b.attr("transform",Q(y,s)),z[t.id]||(z[t.id]={}),z[t.id].endLeft=d,tt(h,t.endLabelLeft)}if(t.endLabelRight){const d=e.insert("g").attr("class","edgeTerminals"),b=d.insert("g").attr("class","inner"),w=await K(d,t.endLabelRight,t.labelStyle);h=w;let y=w.getBBox();if(s){const v=w.children[0],S=D(w);y=v.getBoundingClientRect(),S.attr("width",y.width),S.attr("height",y.height)}b.attr("transform",Q(y,s)),z[t.id]||(z[t.id]={}),z[t.id].endRight=d,tt(h,t.endLabelRight)}return n},"insertEdgeLabel");function tt(e,t){M(R())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}g(tt,"setTerminalWidth");var Kr=g((e,t)=>{k.debug("Moving label abc88 ",e.id,e.label,St[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath;const s=R(),{subGraphTitleTotalMargin:i}=Xe(s);if(e.label){const c=St[e.id];let r=e.x,n=e.y;if(a){const l=$.calcLabelPosition(a);k.debug("Moving label "+e.label+" from (",r,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(r=l.x,n=l.y)}c.attr("transform",`translate(${r}, ${n+i/2})`)}if(e.startLabelLeft){const c=z[e.id].startLeft;let r=e.x,n=e.y;if(a){const l=$.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.startLabelRight){const c=z[e.id].startRight;let r=e.x,n=e.y;if(a){const l=$.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelLeft){const c=z[e.id].endLeft;let r=e.x,n=e.y;if(a){const l=$.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelRight){const c=z[e.id].endRight;let r=e.x,n=e.y;if(a){const l=$.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);r=l.x,n=l.y}c.attr("transform",`translate(${r}, ${n})`)}},"positionEdgeLabel"),Ur=g((e,t)=>{const a=e.x,s=e.y,i=Math.abs(t.x-a),c=Math.abs(t.y-s),r=e.width/2,n=e.height/2;return i>=r||c>=n},"outsideNode"),Xr=g((e,t,a)=>{k.debug(`intersection calc abc89: + outsidePoint: ${JSON.stringify(t)} + insidePoint : ${JSON.stringify(a)} + node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const s=e.x,i=e.y,c=Math.abs(s-a.x),r=e.width/2;let n=a.xMath.abs(s-t.x)*l){let d=a.y{k.debug("abc88 cutPathAtIntersect",e,t);let a=[],s=e[0],i=!1;return e.forEach(c=>{if(!Ur(t,c)&&!i){const r=Xr(t,s,c);let n=!1;a.forEach(l=>{n=n||l.x===r.x&&l.y===r.y}),a.some(l=>l.x===r.x&&l.y===r.y)||a.push(r),i=!0}else s=c,i||a.push(c)}),a},"cutPathAtIntersect"),Vr=g(function(e,t,a,s,i,c,r){let n=a.points;k.debug("abc88 InsertEdge: edge=",a,"e=",t);let l=!1;const u=c.node(t.v);var h=c.node(t.w);h?.intersect&&u?.intersect&&(n=n.slice(1,a.points.length-1),n.unshift(u.intersect(n[0])),n.push(h.intersect(n[n.length-1]))),a.toCluster&&(k.debug("to cluster abc88",s[a.toCluster]),n=Pt(a.points,s[a.toCluster].node),l=!0),a.fromCluster&&(k.debug("from cluster abc88",s[a.fromCluster]),n=Pt(n.reverse(),s[a.fromCluster].node).reverse(),l=!0);const d=n.filter(m=>!Number.isNaN(m.y));let b=Ke;a.curve&&(i==="graph"||i==="flowchart")&&(b=a.curve);const{x:w,y}=Ye(a),v=He().x(w).y(y).curve(b);let S;switch(a.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-thick";break;default:S=""}switch(a.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break}const N=e.append("path").attr("d",v(d)).attr("id",a.id).attr("class"," "+S+(a.classes?" "+a.classes:"")).attr("style",a.style);let _="";(R().flowchart.arrowMarkerAbsolute||R().state.arrowMarkerAbsolute)&&(_=Ue(!0)),Wr(N,a,_,r,i);let T={};return l&&(T.updatedPath=n),T.originalPath=a.points,T},"insertEdge"),jr=g(e=>{const t=new Set;for(const a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},"expandAndDeduplicateDirections"),Gr=g((e,t,a,s)=>{const i=jr(e),c=2,r=t.height+2*a.padding,n=r/c,l=s??t.width+2*n+a.padding,u=a.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:l/2,y:2*u},{x:l-n,y:0},{x:l,y:0},{x:l,y:-r/3},{x:l+2*u,y:-r/2},{x:l,y:-2*r/3},{x:l,y:-r},{x:l-n,y:-r},{x:l/2,y:-r-2*u},{x:n,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*u,y:-r/2},{x:0,y:-r/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:n,y:0},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:n,y:-r},{x:0,y:-r/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:n,y:-r},{x:l-n,y:-r},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-n},{x:l,y:-r+n},{x:0,y:-r}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-n},{x:0,y:-r+n},{x:l,y:-r}]:i.has("right")&&i.has("left")?[{x:n,y:0},{x:n,y:-u},{x:l-n,y:-u},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:l-n,y:-r+u},{x:n,y:-r+u},{x:n,y:-r},{x:0,y:-r/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:n,y:-u},{x:n,y:-r+u},{x:0,y:-r+u},{x:l/2,y:-r},{x:l,y:-r+u},{x:l-n,y:-r+u},{x:l-n,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-n},{x:0,y:-r}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-r}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-n},{x:l,y:-r}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-r}]:i.has("right")?[{x:n,y:-u},{x:n,y:-u},{x:l-n,y:-u},{x:l-n,y:0},{x:l,y:-r/2},{x:l-n,y:-r},{x:l-n,y:-r+u},{x:n,y:-r+u},{x:n,y:-r+u}]:i.has("left")?[{x:n,y:0},{x:n,y:-u},{x:l-n,y:-u},{x:l-n,y:-r+u},{x:n,y:-r+u},{x:n,y:-r},{x:0,y:-r/2}]:i.has("up")?[{x:n,y:-u},{x:n,y:-r+u},{x:0,y:-r+u},{x:l/2,y:-r},{x:l,y:-r+u},{x:l-n,y:-r+u},{x:l-n,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:n,y:-u},{x:n,y:-r+u},{x:l-n,y:-r+u},{x:l-n,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function $t(e,t){return e.intersect(t)}g($t,"intersectNode");var Zr=$t;function te(e,t,a,s){var i=e.x,c=e.y,r=i-s.x,n=c-s.y,l=Math.sqrt(t*t*n*n+a*a*r*r),u=Math.abs(t*a*r/l);s.x0}g(Lt,"sameSign");var Jr=ae,Qr=se;function se(e,t,a){var s=e.x,i=e.y,c=[],r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(y){r=Math.min(r,y.x),n=Math.min(n,y.y)}):(r=Math.min(r,t.x),n=Math.min(n,t.y));for(var l=s-e.width/2-r,u=i-e.height/2-n,h=0;h1&&c.sort(function(y,v){var S=y.x-a.x,N=y.y-a.y,_=Math.sqrt(S*S+N*N),T=v.x-a.x,m=v.y-a.y,p=Math.sqrt(T*T+m*m);return _{var a=e.x,s=e.y,i=t.x-a,c=t.y-s,r=e.width/2,n=e.height/2,l,u;return Math.abs(c)*r>Math.abs(i)*n?(c<0&&(n=-n),l=c===0?0:n*i/c,u=n):(i<0&&(r=-r),l=r,u=i===0?0:r*c/i),{x:a+l,y:s+u}},"intersectRect"),ta=$r,B={node:Zr,circle:qr,ellipse:ee,polygon:Qr,rect:ta},A=g(async(e,t,a,s)=>{const i=R();let c;const r=t.useHtmlLabels||M(i);a?c=a:c="node default";const n=e.insert("g").attr("class",c).attr("id",t.domId||t.id),l=n.insert("g").attr("class","label").attr("style",t.labelStyle);let u;t.labelText===void 0?u="":u=typeof t.labelText=="string"?t.labelText:t.labelText[0];let h;t.labelType==="markdown"?h=kt(l,Ct(Ot(u),i),{useHtmlLabels:r,width:t.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await K(l,Ct(Ot(u),i),t.labelStyle,!1,s);let d=h.getBBox();const b=t.padding/2;if(M(i)){const w=h.children[0],y=D(h);await Ge(w,u),d=w.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height)}return r?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:n,bbox:d,halfPadding:b,label:l}},"labelHelper"),I=g((e,t)=>{const a=t.node().getBBox();e.width=a.width,e.height=a.height},"updateNodeBounds");function X(e,t,a,s){return e.insert("polygon",":first-child").attr("points",s.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}g(X,"insertPolygonShape");var ea=g(async(e,t)=>{t.useHtmlLabels||M(R())||(t.centerLabel=!0);const{shapeSvg:s,bbox:i,halfPadding:c}=await A(e,t,"node "+t.classes,!0);k.info("Classes = ",t.classes);const r=s.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-i.width/2-c).attr("y",-i.height/2-c).attr("width",i.width+t.padding).attr("height",i.height+t.padding),I(t,r),t.intersect=function(n){return B.rect(t,n)},s},"note"),ra=ea,Ft=g(e=>e?" "+e:"","formatClass"),Y=g((e,t)=>`${t||"node default"}${Ft(e.classes)} ${Ft(e.class)}`,"getClassesFromNode"),Wt=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=i+c,n=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];k.info("Question main (Circle)");const l=X(a,r,r,n);return l.attr("style",t.style),I(t,l),t.intersect=function(u){return k.warn("Intersect called"),B.polygon(t,n,u)},a},"question"),aa=g((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=28,i=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}];return a.insert("polygon",":first-child").attr("points",i.map(function(r){return r.x+","+r.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(r){return B.circle(t,14,r)},a},"choice"),sa=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=4,c=t.positioned?t.height:s.height+t.padding,r=c/i,n=t.positioned?t.width:s.width+2*r+t.padding,l=[{x:r,y:0},{x:n-r,y:0},{x:n,y:-c/2},{x:n-r,y:-c},{x:r,y:-c},{x:0,y:-c/2}],u=X(a,n,c,l);return u.attr("style",t.style),I(t,u),t.intersect=function(h){return B.polygon(t,l,h)},a},"hexagon"),ia=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,void 0,!0),i=2,c=s.height+2*t.padding,r=c/i,n=s.width+2*r+t.padding,u=t.positioned&&(t.widthInColumns??1)>1&&t.width>n?t.width:n,h=Gr(t.directions,s,t,u),d=X(a,u,c,h);return d.attr("style",t.style),I(t,d),t.intersect=function(b){return B.polygon(t,h,b)},a},"block_arrow"),na=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-c/2,y:0},{x:i,y:0},{x:i,y:-c},{x:-c/2,y:-c},{x:0,y:-c/2}];return X(a,i,c,r).attr("style",t.style),t.width=i+c,t.height=c,t.intersect=function(l){return B.polygon(t,r,l)},a},"rect_left_inv_arrow"),ca=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-2*c/6,y:0},{x:i-c/6,y:0},{x:i+2*c/6,y:-c},{x:c/6,y:-c}],n=X(a,i,c,r);return n.attr("style",t.style),I(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"lean_right"),la=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:2*c/6,y:0},{x:i+c/6,y:0},{x:i-2*c/6,y:-c},{x:-c/6,y:-c}],n=X(a,i,c,r);return n.attr("style",t.style),I(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"lean_left"),oa=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:-2*c/6,y:0},{x:i+2*c/6,y:0},{x:i-c/6,y:-c},{x:c/6,y:-c}],n=X(a,i,c,r);return n.attr("style",t.style),I(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"trapezoid"),ha=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:c/6,y:0},{x:i-c/6,y:0},{x:i+2*c/6,y:-c},{x:-2*c/6,y:-c}],n=X(a,i,c,r);return n.attr("style",t.style),I(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"inv_trapezoid"),ga=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:0,y:0},{x:i+c/2,y:0},{x:i,y:-c/2},{x:i+c/2,y:-c},{x:0,y:-c}],n=X(a,i,c,r);return n.attr("style",t.style),I(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"rect_right_inv_arrow"),ua=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.width+t.padding,c=i/2,r=c/(2.5+i/50),n=s.height+r+t.padding,l="M 0,"+r+" a "+c+","+r+" 0,0,0 "+i+" 0 a "+c+","+r+" 0,0,0 "+-i+" 0 l 0,"+n+" a "+c+","+r+" 0,0,0 "+i+" 0 l 0,"+-n,u=a.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",l).attr("transform","translate("+-i/2+","+-(n/2+r)+")");return I(t,u),t.intersect=function(h){const d=B.rect(t,h),b=d.x-t.x;if(c!=0&&(Math.abs(b)t.height/2-r)){let w=r*r*(1-b*b/(c*c));w!=0&&(w=Math.sqrt(w)),w=r-w,h.y-t.y>0&&(w=-w),d.y+=w}return d},a},"cylinder"),da=g(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await A(e,t,"node "+t.classes+" "+t.class,!0),c=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,l=t.positioned?-r/2:-s.width/2-i,u=t.positioned?-n/2:-s.height/2-i;if(c.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",u).attr("width",r).attr("height",n),t.props){const h=new Set(Object.keys(t.props));t.props.borders&&(ot(c,t.props.borders,r,n),h.delete("borders")),h.forEach(d=>{k.warn(`Unknown node property ${d}`)})}return I(t,c),t.intersect=function(h){return B.rect(t,h)},a},"rect"),pa=g(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await A(e,t,"node "+t.classes,!0),c=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,l=t.positioned?-r/2:-s.width/2-i,u=t.positioned?-n/2:-s.height/2-i;if(c.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",u).attr("width",r).attr("height",n),t.props){const h=new Set(Object.keys(t.props));t.props.borders&&(ot(c,t.props.borders,r,n),h.delete("borders")),h.forEach(d=>{k.warn(`Unknown node property ${d}`)})}return I(t,c),t.intersect=function(h){return B.rect(t,h)},a},"composite"),fa=g(async(e,t)=>{const{shapeSvg:a}=await A(e,t,"label",!0);k.trace("Classes = ",t.class);const s=a.insert("rect",":first-child"),i=0,c=0;if(s.attr("width",i).attr("height",c),a.attr("class","label edgeLabel"),t.props){const r=new Set(Object.keys(t.props));t.props.borders&&(ot(s,t.props.borders,i,c),r.delete("borders")),r.forEach(n=>{k.warn(`Unknown node property ${n}`)})}return I(t,s),t.intersect=function(r){return B.rect(t,r)},a},"labelRect");function ot(e,t,a,s){const i=[],c=g(n=>{i.push(n,0)},"addBorder"),r=g(n=>{i.push(0,n)},"skipBorder");t.includes("t")?(k.debug("add top border"),c(a)):r(a),t.includes("r")?(k.debug("add right border"),c(s)):r(s),t.includes("b")?(k.debug("add bottom border"),c(a)):r(a),t.includes("l")?(k.debug("add left border"),c(s)):r(s),e.attr("stroke-dasharray",i.join(" "))}g(ot,"applyNodePropertyBorders");var xa=g(async(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";const s=e.insert("g").attr("class",a).attr("id",t.domId||t.id),i=s.insert("rect",":first-child"),c=s.insert("line"),r=s.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText;let l="";typeof n=="object"?l=n[0]:l=n,k.info("Label text abc79",l,n,typeof n=="object");const u=await K(r,l,t.labelStyle,!0,!0);let h={width:0,height:0};if(M(R())){const v=u.children[0],S=D(u);h=v.getBoundingClientRect(),S.attr("width",h.width),S.attr("height",h.height)}k.info("Text 2",n);const d=n.slice(1,n.length);let b=u.getBBox();const w=await K(r,d.join?d.join("
"):d,t.labelStyle,!0,!0);if(M(R())){const v=w.children[0],S=D(w);h=v.getBoundingClientRect(),S.attr("width",h.width),S.attr("height",h.height)}const y=t.padding/2;return D(w).attr("transform","translate( "+(h.width>b.width?0:(b.width-h.width)/2)+", "+(b.height+y+5)+")"),D(u).attr("transform","translate( "+(h.width{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.height+t.padding,c=s.width+i/4+t.padding,r=a.insert("rect",":first-child").attr("style",t.style).attr("rx",i/2).attr("ry",i/2).attr("x",-c/2).attr("y",-i/2).attr("width",c).attr("height",i);return I(t,r),t.intersect=function(n){return B.rect(t,n)},a},"stadium"),ba=g(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await A(e,t,Y(t,void 0),!0),c=a.insert("circle",":first-child");return c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i).attr("width",s.width+t.padding).attr("height",s.height+t.padding),k.info("Circle main"),I(t,c),t.intersect=function(r){return k.info("Circle intersect",t,s.width/2+i,r),B.circle(t,s.width/2+i,r)},a},"circle"),wa=g(async(e,t)=>{const{shapeSvg:a,bbox:s,halfPadding:i}=await A(e,t,Y(t,void 0),!0),c=5,r=a.insert("g",":first-child"),n=r.insert("circle"),l=r.insert("circle");return r.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i+c).attr("width",s.width+t.padding+c*2).attr("height",s.height+t.padding+c*2),l.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+i).attr("width",s.width+t.padding).attr("height",s.height+t.padding),k.info("DoubleCircle main"),I(t,n),t.intersect=function(u){return k.info("DoubleCircle intersect",t,s.width/2+i+c,u),B.circle(t,s.width/2+i+c,u)},a},"doublecircle"),ma=g(async(e,t)=>{const{shapeSvg:a,bbox:s}=await A(e,t,Y(t,void 0),!0),i=s.width+t.padding,c=s.height+t.padding,r=[{x:0,y:0},{x:i,y:0},{x:i,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-c},{x:-8,y:-c},{x:-8,y:0}],n=X(a,i,c,r);return n.attr("style",t.style),I(t,n),t.intersect=function(l){return B.polygon(t,r,l)},a},"subroutine"),Sa=g((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child");return s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),I(t,s),t.intersect=function(i){return B.circle(t,7,i)},a},"start"),Yt=g((e,t,a)=>{const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let i=70,c=10;a==="LR"&&(i=10,c=70);const r=s.append("rect").attr("x",-1*i/2).attr("y",-1*c/2).attr("width",i).attr("height",c).attr("class","fork-join");return I(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return B.rect(t,n)},s},"forkJoin"),La=g((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child"),i=a.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),s.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),I(t,i),t.intersect=function(c){return B.circle(t,7,c)},a},"end"),ka=g(async(e,t)=>{const a=t.padding/2,s=4,i=8;let c;t.classes?c="node "+t.classes:c="node default";const r=e.insert("g").attr("class",c).attr("id",t.domId||t.id),n=r.insert("rect",":first-child"),l=r.insert("line"),u=r.insert("line");let h=0,d=s;const b=r.insert("g").attr("class","label");let w=0;const y=t.classData.annotations?.[0],v=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",S=await K(b,v,t.labelStyle,!0,!0);let N=S.getBBox();if(M(R())){const E=S.children[0],o=D(S);N=E.getBoundingClientRect(),o.attr("width",N.width),o.attr("height",N.height)}t.classData.annotations[0]&&(d+=N.height+s,h+=N.width);let _=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(M(R())?_+="<"+t.classData.type+">":_+="<"+t.classData.type+">");const T=await K(b,_,t.labelStyle,!0,!0);D(T).attr("class","classTitle");let m=T.getBBox();if(M(R())){const E=T.children[0],o=D(T);m=E.getBoundingClientRect(),o.attr("width",m.width),o.attr("height",m.height)}d+=m.height+s,m.width>h&&(h=m.width);const p=[];t.classData.members.forEach(async E=>{const o=E.getDisplayDetails();let F=o.displayText;M(R())&&(F=F.replace(//g,">"));const f=await K(b,F,o.cssStyle?o.cssStyle:t.labelStyle,!0,!0);let C=f.getBBox();if(M(R())){const Z=f.children[0],V=D(f);C=Z.getBoundingClientRect(),V.attr("width",C.width),V.attr("height",C.height)}C.width>h&&(h=C.width),d+=C.height+s,p.push(f)}),d+=i;const x=[];if(t.classData.methods.forEach(async E=>{const o=E.getDisplayDetails();let F=o.displayText;M(R())&&(F=F.replace(//g,">"));const f=await K(b,F,o.cssStyle?o.cssStyle:t.labelStyle,!0,!0);let C=f.getBBox();if(M(R())){const Z=f.children[0],V=D(f);C=Z.getBoundingClientRect(),V.attr("width",C.width),V.attr("height",C.height)}C.width>h&&(h=C.width),d+=C.height+s,x.push(f)}),d+=i,y){let E=(h-N.width)/2;D(S).attr("transform","translate( "+(-1*h/2+E)+", "+-1*d/2+")"),w=N.height+s}let L=(h-m.width)/2;return D(T).attr("transform","translate( "+(-1*h/2+L)+", "+(-1*d/2+w)+")"),w+=m.height+s,l.attr("class","divider").attr("x1",-h/2-a).attr("x2",h/2+a).attr("y1",-d/2-a+i+w).attr("y2",-d/2-a+i+w),w+=i,p.forEach(E=>{D(E).attr("transform","translate( "+-h/2+", "+(-1*d/2+w+i/2)+")");const o=E?.getBBox();w+=(o?.height??0)+s}),w+=i,u.attr("class","divider").attr("x1",-h/2-a).attr("x2",h/2+a).attr("y1",-d/2-a+i+w).attr("y2",-d/2-a+i+w),w+=i,x.forEach(E=>{D(E).attr("transform","translate( "+-h/2+", "+(-1*d/2+w)+")");const o=E?.getBBox();w+=(o?.height??0)+s}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-h/2-a).attr("y",-(d/2)-a).attr("width",h+t.padding).attr("height",d+t.padding),I(t,n),t.intersect=function(E){return B.rect(t,E)},r},"class_box"),Ht={rhombus:Wt,composite:pa,question:Wt,rect:da,labelRect:fa,rectWithTitle:xa,choice:aa,circle:ba,doublecircle:wa,stadium:ya,hexagon:sa,block_arrow:ia,rect_left_inv_arrow:na,lean_right:ca,lean_left:la,trapezoid:oa,inv_trapezoid:ha,rect_right_inv_arrow:ga,cylinder:ua,start:Sa,end:La,note:ra,subroutine:ma,fork:Yt,join:Yt,class_box:ka},nt={},ie=g(async(e,t,a)=>{let s,i;if(t.link){let c;R().securityLevel==="sandbox"?c="_top":t.linkTarget&&(c=t.linkTarget||"_blank"),s=e.insert("svg:a").attr("xlink:href",t.link).attr("target",c),i=await Ht[t.shape](s,t,a)}else i=await Ht[t.shape](e,t,a),s=i;return t.tooltip&&i.attr("title",t.tooltip),t.class&&i.attr("class","node default "+t.class),nt[t.id]=s,t.haveCallback&&nt[t.id].attr("class",nt[t.id].attr("class")+" clickable"),s},"insertNode"),va=g(e=>{const t=nt[e.id];k.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const a=8,s=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+s-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),s},"positionNode");function Bt(e,t,a=!1){const s=e;let i="default";(s?.classes?.length||0)>0&&(i=(s?.classes??[]).join(" ")),i=i+" flowchart-label";let c=0,r="",n;switch(s.type){case"round":c=5,r="rect";break;case"composite":c=0,r="composite",n=0;break;case"square":r="rect";break;case"diamond":r="question";break;case"hexagon":r="hexagon";break;case"block_arrow":r="block_arrow";break;case"odd":r="rect_left_inv_arrow";break;case"lean_right":r="lean_right";break;case"lean_left":r="lean_left";break;case"trapezoid":r="trapezoid";break;case"inv_trapezoid":r="inv_trapezoid";break;case"rect_left_inv_arrow":r="rect_left_inv_arrow";break;case"circle":r="circle";break;case"ellipse":r="ellipse";break;case"stadium":r="stadium";break;case"subroutine":r="subroutine";break;case"cylinder":r="cylinder";break;case"group":r="rect";break;case"doublecircle":r="doublecircle";break;default:r="rect"}const l=je(s?.styles??[]),u=s.label,h=s.size??{width:0,height:0,x:0,y:0},d=t.getDiagramId();return{labelStyle:l.labelStyle,shape:r,labelText:u,rx:c,ry:c,class:i,style:l.style,id:s.id,domId:d?`${d}-${s.id}`:s.id,directions:s.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:a,intersect:void 0,type:s.type,padding:n??rt()?.block?.padding??0,widthInColumns:s.widthInColumns??1}}g(Bt,"getNodeFromBlock");async function ne(e,t,a){const s=Bt(t,a,!1);if(s.type==="group")return;const i=rt(),c=await ie(e,s,{config:i}),r=c.node().getBBox(),n=a.getBlock(s.id);n.size={width:r.width,height:r.height,x:0,y:0,node:c},a.setBlock(n),c.remove()}g(ne,"calculateBlockSize");async function ce(e,t,a){const s=Bt(t,a,!0);if(a.getBlock(s.id).type!=="space"){const c=rt();await ie(e,s,{config:c}),t.intersect=s?.intersect,va(s)}}g(ce,"insertBlockPositioned");async function ht(e,t,a,s){for(const i of t)await s(e,i,a),i.children&&await ht(e,i.children,a,s)}g(ht,"performOperations");async function le(e,t,a){await ht(e,t,a,ne)}g(le,"calculateBlockSizes");async function oe(e,t,a){await ht(e,t,a,ce)}g(oe,"insertBlocks");async function he(e,t,a,s,i){const c=new Ze({multigraph:!0,compound:!0});c.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const r of a)r.size&&c.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(const r of t)if(r.start&&r.end){const n=s.getBlock(r.start),l=s.getBlock(r.end);if(n?.size&&l?.size){const u=n.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}],b=i?`${i}-${r.id}`:r.id,w=r.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",y=r.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",v=`${w} ${y} flowchart-link LS-a1 LE-b1`;Vr(e,{v:r.start,w:r.end,name:b},{...r,id:b,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:d,classes:v},void 0,"block",c,i),r.label&&(await Hr(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:d,classes:v}),Kr({...r,x:d[1].x,y:d[1].y},{originalPath:d}))}}}g(he,"insertEdges");var Ea=g(function(e,t){return t.db.getClasses()},"getClasses"),_a=g(async function(e,t,a,s){const{securityLevel:i,block:c}=rt(),r=s.db;r.setDiagramId(t);let n;i==="sandbox"&&(n=D("#i"+t));const l=i==="sandbox"?D(n.nodes()[0].contentDocument.body):D("body"),u=i==="sandbox"?l.select(`[id="${t}"]`):D(`[id="${t}"]`);Mr(u,["point","circle","cross"],s.type,t);const d=r.getBlocks(),b=r.getBlocksFlat(),w=r.getEdges(),y=u.insert("g").attr("class","block");await le(y,d,r);const v=Qt(r);if(await oe(y,d,r),await he(y,w,b,r,t),v){const S=v,N=Math.max(1,Math.round(.125*(S.width/S.height))),_=S.height+N+10,T=S.width+10,{useMaxWidth:m}=c;Pe(u,_,T,!!m),k.debug("Here Bounds",v,S),u.attr("viewBox",`${S.x-5} ${S.y-5} ${S.width+10} ${S.height+10}`)}},"draw"),Ta={draw:_a,getClasses:Ea},Ra={parser:ar,db:kr,renderer:Ta,styles:Er};export{Ra as diagram}; diff --git a/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BAAq1RMs.js b/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BAAq1RMs.js new file mode 100644 index 00000000000..5395daf7eeb --- /dev/null +++ b/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BAAq1RMs.js @@ -0,0 +1,10 @@ +import{g as Oe,d as Re}from"./chunk-32BRIVSS-CRTrWqUr.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-WW7RuneT.js";import"./index-CiHMlsuo.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()+` +`+v+"^"},"showPosition"),test_match:y(function(x,v){var E,b,R;if(this.options.backtrack_lexer&&(R={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(R.yylloc.range=this.yylloc.range.slice(0))),b=x[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(x[0].length),this.matched+=x[0],E=this.performAction.call(this,this.yy,this,v,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var h in R)this[h]=R[h];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,v,E,b;this._more||(this.yytext="",this.match="");for(var R=this._currentRules(),h=0;hv[0].length)){if(v=E,b=h,this.options.backtrack_lexer){if(x=this.test_match(E,R[h]),x!==!1)return x;if(this._backtrack){v=!1;continue}else return!1}else if(!this.options.flex)break}return v?(x=this.test_match(v,R[b]),x!==!1?x:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:y(function(){var v=this.next();return v||this.lex()},"lex"),begin:y(function(v){this.conditionStack.push(v)},"begin"),popState:y(function(){var v=this.conditionStack.length-1;return v>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:y(function(v){return v=this.conditionStack.length-1-Math.abs(v||0),v>=0?this.conditionStack[v]:"INITIAL"},"topState"),pushState:y(function(v){this.begin(v)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:y(function(v,E,b,R){switch(b){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return _t})();Qt.lexer=Ae;function It(){this.yy={}}return y(It,"Parser"),It.prototype=Qt,Qt.Parser=It,new It})();jt.parser=jt;var Ye=jt,V=[],xt=[""],B="global",F="",X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Pt=[],ee="",ae=!1,Ut=4,Ft=2,ye,je=y(function(){return ye},"getC4Type"),Ue=y(function(e){ye=pe(e,Dt())},"setC4Type"),Fe=y(function(e,t,s,o,l,r,a,n,i){if(e==null||t===void 0||t===null||s===void 0||s===null||o===void 0||o===null)return;let u={};const d=Pt.find(p=>p.from===t&&p.to===s);if(d?u=d:Pt.push(u),u.type=e,u.from=t,u.to=s,u.label={text:o},l==null)u.techn={text:""};else if(typeof l=="object"){let[p,g]=Object.entries(l)[0];u[p]={text:g}}else u.techn={text:l};if(r==null)u.descr={text:""};else if(typeof r=="object"){let[p,g]=Object.entries(r)[0];u[p]={text:g}}else u.descr={text:r};if(typeof a=="object"){let[p,g]=Object.entries(a)[0];u[p]=g}else u.sprite=a;if(typeof n=="object"){let[p,g]=Object.entries(n)[0];u[p]=g}else u.tags=n;if(typeof i=="object"){let[p,g]=Object.entries(i)[0];u[p]=g}else u.link=i;u.wrap=mt()},"addRel"),Ve=y(function(e,t,s,o,l,r,a){if(t===null||s===null)return;let n={};const i=V.find(u=>u.alias===t);if(i&&t===i.alias?n=i:(n.alias=t,V.push(n)),s==null?n.label={text:""}:n.label={text:s},o==null)n.descr={text:""};else if(typeof o=="object"){let[u,d]=Object.entries(o)[0];n[u]={text:d}}else n.descr={text:o};if(typeof l=="object"){let[u,d]=Object.entries(l)[0];n[u]=d}else n.sprite=l;if(typeof r=="object"){let[u,d]=Object.entries(r)[0];n[u]=d}else n.tags=r;if(typeof a=="object"){let[u,d]=Object.entries(a)[0];n[u]=d}else n.link=a;n.typeC4Shape={text:e},n.parentBoundary=B,n.wrap=mt()},"addPersonOrSystem"),ze=y(function(e,t,s,o,l,r,a,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.techn={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]={text:p}}else i.descr={text:l};if(typeof r=="object"){let[d,p]=Object.entries(r)[0];i[d]=p}else i.sprite=r;if(typeof a=="object"){let[d,p]=Object.entries(a)[0];i[d]=p}else i.tags=a;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:e},i.parentBoundary=B},"addContainer"),Xe=y(function(e,t,s,o,l,r,a,n){if(t===null||s===null)return;let i={};const u=V.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,V.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.techn={text:""};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.techn={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]={text:p}}else i.descr={text:l};if(typeof r=="object"){let[d,p]=Object.entries(r)[0];i[d]=p}else i.sprite=r;if(typeof a=="object"){let[d,p]=Object.entries(a)[0];i[d]=p}else i.tags=a;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.wrap=mt(),i.typeC4Shape={text:e},i.parentBoundary=B},"addComponent"),We=y(function(e,t,s,o,l){if(e===null||t===null)return;let r={};const a=X.find(n=>n.alias===e);if(a&&e===a.alias?r=a:(r.alias=e,X.push(r)),t==null?r.label={text:""}:r.label={text:t},s==null)r.type={text:"system"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];r[n]={text:i}}else r.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];r[n]=i}else r.tags=o;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];r[n]=i}else r.link=l;r.parentBoundary=B,r.wrap=mt(),F=B,B=e,xt.push(F)},"addPersonOrSystemBoundary"),Qe=y(function(e,t,s,o,l){if(e===null||t===null)return;let r={};const a=X.find(n=>n.alias===e);if(a&&e===a.alias?r=a:(r.alias=e,X.push(r)),t==null?r.label={text:""}:r.label={text:t},s==null)r.type={text:"container"};else if(typeof s=="object"){let[n,i]=Object.entries(s)[0];r[n]={text:i}}else r.type={text:s};if(typeof o=="object"){let[n,i]=Object.entries(o)[0];r[n]=i}else r.tags=o;if(typeof l=="object"){let[n,i]=Object.entries(l)[0];r[n]=i}else r.link=l;r.parentBoundary=B,r.wrap=mt(),F=B,B=e,xt.push(F)},"addContainerBoundary"),He=y(function(e,t,s,o,l,r,a,n){if(t===null||s===null)return;let i={};const u=X.find(d=>d.alias===t);if(u&&t===u.alias?i=u:(i.alias=t,X.push(i)),s==null?i.label={text:""}:i.label={text:s},o==null)i.type={text:"node"};else if(typeof o=="object"){let[d,p]=Object.entries(o)[0];i[d]={text:p}}else i.type={text:o};if(l==null)i.descr={text:""};else if(typeof l=="object"){let[d,p]=Object.entries(l)[0];i[d]={text:p}}else i.descr={text:l};if(typeof a=="object"){let[d,p]=Object.entries(a)[0];i[d]=p}else i.tags=a;if(typeof n=="object"){let[d,p]=Object.entries(n)[0];i[d]=p}else i.link=n;i.nodeType=e,i.parentBoundary=B,i.wrap=mt(),F=B,B=t,xt.push(F)},"addDeploymentNode"),qe=y(function(){B=F,xt.pop(),F=xt.pop(),xt.push(F)},"popBoundaryParseStack"),Ge=y(function(e,t,s,o,l,r,a,n,i,u,d){let p=V.find(g=>g.alias===t);if(!(p===void 0&&(p=X.find(g=>g.alias===t),p===void 0))){if(s!=null)if(typeof s=="object"){let[g,m]=Object.entries(s)[0];p[g]=m}else p.bgColor=s;if(o!=null)if(typeof o=="object"){let[g,m]=Object.entries(o)[0];p[g]=m}else p.fontColor=o;if(l!=null)if(typeof l=="object"){let[g,m]=Object.entries(l)[0];p[g]=m}else p.borderColor=l;if(r!=null)if(typeof r=="object"){let[g,m]=Object.entries(r)[0];p[g]=m}else p.shadowing=r;if(a!=null)if(typeof a=="object"){let[g,m]=Object.entries(a)[0];p[g]=m}else p.shape=a;if(n!=null)if(typeof n=="object"){let[g,m]=Object.entries(n)[0];p[g]=m}else p.sprite=n;if(i!=null)if(typeof i=="object"){let[g,m]=Object.entries(i)[0];p[g]=m}else p.techn=i;if(u!=null)if(typeof u=="object"){let[g,m]=Object.entries(u)[0];p[g]=m}else p.legendText=u;if(d!=null)if(typeof d=="object"){let[g,m]=Object.entries(d)[0];p[g]=m}else p.legendSprite=d}},"updateElStyle"),Ke=y(function(e,t,s,o,l,r,a){const n=Pt.find(i=>i.from===t&&i.to===s);if(n!==void 0){if(o!=null)if(typeof o=="object"){let[i,u]=Object.entries(o)[0];n[i]=u}else n.textColor=o;if(l!=null)if(typeof l=="object"){let[i,u]=Object.entries(l)[0];n[i]=u}else n.lineColor=l;if(r!=null)if(typeof r=="object"){let[i,u]=Object.entries(r)[0];n[i]=parseInt(u)}else n.offsetX=parseInt(r);if(a!=null)if(typeof a=="object"){let[i,u]=Object.entries(a)[0];n[i]=parseInt(u)}else n.offsetY=parseInt(a)}},"updateRelStyle"),Je=y(function(e,t,s){let o=Ut,l=Ft;if(typeof t=="object"){const r=Object.values(t)[0];o=parseInt(r)}else o=parseInt(t);if(typeof s=="object"){const r=Object.values(s)[0];l=parseInt(r)}else l=parseInt(s);o>=1&&(Ut=o),l>=1&&(Ft=l)},"updateLayoutConfig"),Ze=y(function(){return Ut},"getC4ShapeInRow"),$e=y(function(){return Ft},"getC4BoundaryInRow"),t0=y(function(){return B},"getCurrentBoundaryParse"),e0=y(function(){return F},"getParentBoundaryParse"),ge=y(function(e){return e==null?V:V.filter(t=>t.parentBoundary===e)},"getC4ShapeArray"),a0=y(function(e){return V.find(t=>t.alias===e)},"getC4Shape"),i0=y(function(e){return Object.keys(ge(e))},"getC4ShapeKeys"),be=y(function(e){return e==null?X:X.filter(t=>t.parentBoundary===e)},"getBoundaries"),n0=be,s0=y(function(){return Pt},"getRels"),r0=y(function(){return ee},"getTitle"),l0=y(function(e){ae=e},"setWrap"),mt=y(function(){return ae},"autoWrap"),o0=y(function(){V=[],X=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],F="",B="global",xt=[""],Pt=[],xt=[""],ee="",ae=!1,Ut=4,Ft=2},"clear"),c0={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},h0={FILLED:0,OPEN:1},u0={LEFTOF:0,RIGHTOF:1,OVER:2},d0=y(function(e){ee=pe(e,Dt())},"setTitle"),Zt={addPersonOrSystem:Ve,addPersonOrSystemBoundary:We,addContainer:ze,addContainerBoundary:Qe,addComponent:Xe,addDeploymentNode:He,popBoundaryParseStack:qe,addRel:Fe,updateElStyle:Ge,updateRelStyle:Ke,updateLayoutConfig:Je,autoWrap:mt,setWrap:l0,getC4ShapeArray:ge,getC4Shape:a0,getC4ShapeKeys:i0,getBoundaries:be,getBoundarys:n0,getCurrentBoundaryParse:t0,getParentBoundaryParse:e0,getRels:s0,getTitle:r0,getC4Type:je,getC4ShapeInRow:Ze,getC4BoundaryInRow:$e,setAccTitle:Be,getAccTitle:Pe,getAccDescription:De,setAccDescription:Se,getConfig:y(()=>Dt().c4,"getConfig"),clear:o0,LINETYPE:c0,ARROWTYPE:h0,PLACEMENT:u0,setTitle:d0,setC4Type:Ue},ie=y(function(e,t){return Re(e,t)},"drawRect"),_e=y(function(e,t,s,o,l,r){const a=e.append("image");a.attr("width",t),a.attr("height",s),a.attr("x",o),a.attr("y",l);let n=r.startsWith("data:image/png;base64")?r:Le.sanitizeUrl(r);a.attr("xlink:href",n)},"drawImage"),f0=y((e,t,s,o)=>{const l=e.append("g");let r=0;for(let a of t){let n=a.textColor?a.textColor:"#444444",i=a.lineColor?a.lineColor:"#444444",u=a.offsetX?parseInt(a.offsetX):0,d=a.offsetY?parseInt(a.offsetY):0,p="";if(r===0){let m=l.append("line");m.attr("x1",a.startPoint.x),m.attr("y1",a.startPoint.y),m.attr("x2",a.endPoint.x),m.attr("y2",a.endPoint.y),m.attr("stroke-width","1"),m.attr("stroke",i),m.style("fill","none"),a.type!=="rel_b"&&m.attr("marker-end","url("+p+"#"+o+"-arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&m.attr("marker-start","url("+p+"#"+o+"-arrowend)"),r=-1}else{let m=l.append("path");m.attr("fill","none").attr("stroke-width","1").attr("stroke",i).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",a.startPoint.x).replaceAll("starty",a.startPoint.y).replaceAll("controlx",a.startPoint.x+(a.endPoint.x-a.startPoint.x)/2-(a.endPoint.x-a.startPoint.x)/4).replaceAll("controly",a.startPoint.y+(a.endPoint.y-a.startPoint.y)/2).replaceAll("stopx",a.endPoint.x).replaceAll("stopy",a.endPoint.y)),a.type!=="rel_b"&&m.attr("marker-end","url("+p+"#"+o+"-arrowhead)"),(a.type==="birel"||a.type==="rel_b")&&m.attr("marker-start","url("+p+"#"+o+"-arrowend)")}let g=s.messageFont();Q(s)(a.label.text,l,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+d,a.label.width,a.label.height,{fill:n},g),a.techn&&a.techn.text!==""&&(g=s.messageFont(),Q(s)("["+a.techn.text+"]",l,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+s.messageFontSize+5+d,Math.max(a.label.width,a.techn.width),a.techn.height,{fill:n,"font-style":"italic"},g))}},"drawRels"),p0=y(function(e,t,s){const o=e.append("g");let l=t.bgColor?t.bgColor:"none",r=t.borderColor?t.borderColor:"#444444",a=t.fontColor?t.fontColor:"black",n={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};t.nodeType&&(n={"stroke-width":1});let i={x:t.x,y:t.y,fill:l,stroke:r,width:t.width,height:t.height,rx:2.5,ry:2.5,attrs:n};ie(o,i);let u=s.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=a,Q(s)(t.label.text,o,t.x,t.y+t.label.Y,t.width,t.height,{fill:"#444444"},u),t.type&&t.type.text!==""&&(u=s.boundaryFont(),u.fontColor=a,Q(s)(t.type.text,o,t.x,t.y+t.type.Y,t.width,t.height,{fill:"#444444"},u)),t.descr&&t.descr.text!==""&&(u=s.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=a,Q(s)(t.descr.text,o,t.x,t.y+t.descr.Y,t.width,t.height,{fill:"#444444"},u))},"drawBoundary"),y0=y(function(e,t,s){let o=t.bgColor?t.bgColor:s[t.typeC4Shape.text+"_bg_color"],l=t.borderColor?t.borderColor:s[t.typeC4Shape.text+"_border_color"],r=t.fontColor?t.fontColor:"#FFFFFF",a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(t.typeC4Shape.text){case"person":a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const n=e.append("g");n.attr("class","person-man");const i=Oe();switch(t.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":i.x=t.x,i.y=t.y,i.fill=o,i.width=t.width,i.height=t.height,i.stroke=l,i.rx=2.5,i.ry=2.5,i.attrs={"stroke-width":.5},ie(n,i);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2).replaceAll("height",t.height)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":n.append("path").attr("fill",o).attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("width",t.width).replaceAll("half",t.height/2)),n.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",l).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",t.x+t.width).replaceAll("starty",t.y).replaceAll("half",t.height/2));break}let u=A0(s,t.typeC4Shape.text);switch(n.append("text").attr("fill",r).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",t.typeC4Shape.width).attr("x",t.x+t.width/2-t.typeC4Shape.width/2).attr("y",t.y+t.typeC4Shape.Y).text("<<"+t.typeC4Shape.text+">>"),t.typeC4Shape.text){case"person":case"external_person":_e(n,48,48,t.x+t.width/2-24,t.y+t.image.Y,a);break}let d=s[t.typeC4Shape.text+"Font"]();return d.fontWeight="bold",d.fontSize=d.fontSize+2,d.fontColor=r,Q(s)(t.label.text,n,t.x,t.y+t.label.Y,t.width,t.height,{fill:r},d),d=s[t.typeC4Shape.text+"Font"](),d.fontColor=r,t.techn&&t.techn?.text!==""?Q(s)(t.techn.text,n,t.x,t.y+t.techn.Y,t.width,t.height,{fill:r,"font-style":"italic"},d):t.type&&t.type.text!==""&&Q(s)(t.type.text,n,t.x,t.y+t.type.Y,t.width,t.height,{fill:r,"font-style":"italic"},d),t.descr&&t.descr.text!==""&&(d=s.personFont(),d.fontColor=r,Q(s)(t.descr.text,n,t.x,t.y+t.descr.Y,t.width,t.height,{fill:r},d)),t.height},"drawC4Shape"),g0=y(function(e,t){e.append("defs").append("symbol").attr("id",t+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),b0=y(function(e,t){e.append("defs").append("symbol").attr("id",t+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),_0=y(function(e,t){e.append("defs").append("symbol").attr("id",t+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),x0=y(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),m0=y(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),v0=y(function(e,t){e.append("defs").append("marker").attr("id",t+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),E0=y(function(e,t){const o=e.append("defs").append("marker").attr("id",t+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);o.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),o.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),A0=y((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"getC4ShapeFont"),Q=(function(){function e(l,r,a,n,i,u,d){const p=r.append("text").attr("x",a+i/2).attr("y",n+u/2+5).style("text-anchor","middle").text(l);o(p,d)}y(e,"byText");function t(l,r,a,n,i,u,d,p){const{fontSize:g,fontFamily:m,fontWeight:O}=p,S=l.split(Jt.lineBreakRegex);for(let P=0;P=this.data.widthLimit||s>=this.data.widthLimit||this.nextData.cnt>xe)&&(t=this.nextData.startx+e.margin+_.nextLinePaddingX,o=this.nextData.stopy+e.margin*2,this.nextData.stopx=s=t+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=l=o+e.height,this.nextData.cnt=1),e.x=t,e.y=o,this.updateVal(this.data,"startx",t,Math.min),this.updateVal(this.data,"starty",o,Math.min),this.updateVal(this.data,"stopx",s,Math.max),this.updateVal(this.data,"stopy",l,Math.max),this.updateVal(this.nextData,"startx",t,Math.min),this.updateVal(this.nextData,"starty",o,Math.min),this.updateVal(this.nextData,"stopx",s,Math.max),this.updateVal(this.nextData,"stopy",l,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},te(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},te=y(function(e){Me(_,e),e.fontFamily&&(_.personFontFamily=_.systemFontFamily=_.messageFontFamily=e.fontFamily),e.fontSize&&(_.personFontSize=_.systemFontSize=_.messageFontSize=e.fontSize),e.fontWeight&&(_.personFontWeight=_.systemFontWeight=_.messageFontWeight=e.fontWeight)},"setConf"),St=y((e,t)=>({fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}),"c4ShapeFont"),Yt=y(e=>({fontFamily:e.boundaryFontFamily,fontSize:e.boundaryFontSize,fontWeight:e.boundaryFontWeight}),"boundaryFont"),k0=y(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont");function j(e,t,s,o,l){if(!t[e].width)if(s)t[e].text=Ne(t[e].text,l,o),t[e].textLines=t[e].text.split(Jt.lineBreakRegex).length,t[e].width=l,t[e].height=ue(t[e].text,o);else{let r=t[e].text.split(Jt.lineBreakRegex);t[e].textLines=r.length;let a=0;t[e].height=0,t[e].width=0;for(const n of r)t[e].width=Math.max(Tt(n,o),t[e].width),a=ue(n,o),t[e].height=t[e].height+a}}y(j,"calcC4ShapeTextWH");var ve=y(function(e,t,s){t.x=s.data.startx,t.y=s.data.starty,t.width=s.data.stopx-s.data.startx,t.height=s.data.stopy-s.data.starty,t.label.y=_.c4ShapeMargin-35;let o=t.wrap&&_.wrap,l=Yt(_);l.fontSize=l.fontSize+2,l.fontWeight="bold";let r=Tt(t.label.text,l);j("label",t,o,l,r),z.drawBoundary(e,t,_)},"drawBoundary"),Ee=y(function(e,t,s,o){let l=0;for(const r of o){l=0;const a=s[r];let n=St(_,a.typeC4Shape.text);switch(n.fontSize=n.fontSize-2,a.typeC4Shape.width=Tt("«"+a.typeC4Shape.text+"»",n),a.typeC4Shape.height=n.fontSize+2,a.typeC4Shape.Y=_.c4ShapePadding,l=a.typeC4Shape.Y+a.typeC4Shape.height-4,a.image={width:0,height:0,Y:0},a.typeC4Shape.text){case"person":case"external_person":a.image.width=48,a.image.height=48,a.image.Y=l,l=a.image.Y+a.image.height;break}a.sprite&&(a.image.width=48,a.image.height=48,a.image.Y=l,l=a.image.Y+a.image.height);let i=a.wrap&&_.wrap,u=_.width-_.c4ShapePadding*2,d=St(_,a.typeC4Shape.text);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",a,i,d,u),a.label.Y=l+8,l=a.label.Y+a.label.height,a.type&&a.type.text!==""){a.type.text="["+a.type.text+"]";let m=St(_,a.typeC4Shape.text);j("type",a,i,m,u),a.type.Y=l+5,l=a.type.Y+a.type.height}else if(a.techn&&a.techn.text!==""){a.techn.text="["+a.techn.text+"]";let m=St(_,a.techn.text);j("techn",a,i,m,u),a.techn.Y=l+5,l=a.techn.Y+a.techn.height}let p=l,g=a.label.width;if(a.descr&&a.descr.text!==""){let m=St(_,a.typeC4Shape.text);j("descr",a,i,m,u),a.descr.Y=l+20,l=a.descr.Y+a.descr.height,g=Math.max(a.label.width,a.descr.width),p=l-a.descr.textLines*5}g=g+_.c4ShapePadding,a.width=Math.max(a.width||_.width,g,_.width),a.height=Math.max(a.height||_.height,p,_.height),a.margin=a.margin||_.c4ShapeMargin,e.insert(a),z.drawC4Shape(t,a,_)}e.bumpLastMargin(_.c4ShapeMargin)},"drawC4ShapeArray"),Y=class{static{y(this,"Point")}constructor(e,t){this.x=e,this.y=t}},de=y(function(e,t){let s=e.x,o=e.y,l=t.x,r=t.y,a=s+e.width/2,n=o+e.height/2,i=Math.abs(s-l),u=Math.abs(o-r),d=u/i,p=e.height/e.width,g=null;return o==r&&sl?g=new Y(s,n):s==l&&or&&(g=new Y(a,o)),s>l&&o=d?g=new Y(s,n+d*e.width/2):g=new Y(a-i/u*e.height/2,o+e.height):s=d?g=new Y(s+e.width,n+d*e.width/2):g=new Y(a+i/u*e.height/2,o+e.height):sr?p>=d?g=new Y(s+e.width,n-d*e.width/2):g=new Y(a+e.height/2*i/u,o):s>l&&o>r&&(p>=d?g=new Y(s,n-e.width/2*d):g=new Y(a-e.height/2*i/u,o)),g},"getIntersectPoint"),C0=y(function(e,t){let s={x:0,y:0};s.x=t.x+t.width/2,s.y=t.y+t.height/2;let o=de(e,s);s.x=e.x+e.width/2,s.y=e.y+e.height/2;let l=de(t,s);return{startPoint:o,endPoint:l}},"getIntersectPoints"),w0=y(function(e,t,s,o,l){let r=0;for(let a of t){r=r+1;let n=a.wrap&&_.wrap,i=k0(_);o.db.getC4Type()==="C4Dynamic"&&(a.label.text=r+": "+a.label.text);let d=Tt(a.label.text,i);j("label",a,n,i,d),a.techn&&a.techn.text!==""&&(d=Tt(a.techn.text,i),j("techn",a,n,i,d)),a.descr&&a.descr.text!==""&&(d=Tt(a.descr.text,i),j("descr",a,n,i,d));let p=s(a.from),g=s(a.to),m=C0(p,g);a.startPoint=m.startPoint,a.endPoint=m.endPoint}z.drawRels(e,t,_,l)},"drawRels");function ne(e,t,s,o,l){let r=new me(l);r.data.widthLimit=s.data.widthLimit/Math.min($t,o.length);for(let[a,n]of o.entries()){let i=0;n.image={width:0,height:0,Y:0},n.sprite&&(n.image.width=48,n.image.height=48,n.image.Y=i,i=n.image.Y+n.image.height);let u=n.wrap&&_.wrap,d=Yt(_);if(d.fontSize=d.fontSize+2,d.fontWeight="bold",j("label",n,u,d,r.data.widthLimit),n.label.Y=i+8,i=n.label.Y+n.label.height,n.type&&n.type.text!==""){n.type.text="["+n.type.text+"]";let O=Yt(_);j("type",n,u,O,r.data.widthLimit),n.type.Y=i+5,i=n.type.Y+n.type.height}if(n.descr&&n.descr.text!==""){let O=Yt(_);O.fontSize=O.fontSize-2,j("descr",n,u,O,r.data.widthLimit),n.descr.Y=i+20,i=n.descr.Y+n.descr.height}if(a==0||a%$t===0){let O=s.data.startx+_.diagramMarginX,S=s.data.stopy+_.diagramMarginY+i;r.setData(O,O,S,S)}else{let O=r.data.stopx!==r.data.startx?r.data.stopx+_.diagramMarginX:r.data.startx,S=r.data.starty;r.setData(O,O,S,S)}r.name=n.alias;let p=l.db.getC4ShapeArray(n.alias),g=l.db.getC4ShapeKeys(n.alias);g.length>0&&Ee(r,e,p,g),t=n.alias;let m=l.db.getBoundaries(t);m.length>0&&ne(e,t,r,m,l),n.alias!=="global"&&ve(e,n,r),s.data.stopy=Math.max(r.data.stopy+_.c4ShapeMargin,s.data.stopy),s.data.stopx=Math.max(r.data.stopx+_.c4ShapeMargin,s.data.stopx),Vt=Math.max(Vt,s.data.stopx),zt=Math.max(zt,s.data.stopy)}}y(ne,"drawInsideBoundary");var T0=y(function(e,t,s,o){_=Dt().c4;const l=Dt().securityLevel;let r;l==="sandbox"&&(r=Nt("#i"+t));const a=l==="sandbox"?Nt(r.nodes()[0].contentDocument.body):Nt("body");let n=o.db;o.db.setWrap(_.wrap),xe=n.getC4ShapeInRow(),$t=n.getC4BoundaryInRow(),he.debug(`C:${JSON.stringify(_,null,2)}`);const i=l==="sandbox"?a.select(`[id="${t}"]`):Nt(`[id="${t}"]`);z.insertComputerIcon(i,t),z.insertDatabaseIcon(i,t),z.insertClockIcon(i,t);let u=new me(o);u.setData(_.diagramMarginX,_.diagramMarginX,_.diagramMarginY,_.diagramMarginY),u.data.widthLimit=screen.availWidth,Vt=_.diagramMarginX,zt=_.diagramMarginY;const d=o.db.getTitle();let p=o.db.getBoundaries("");ne(i,"",u,p,o),z.insertArrowHead(i,t),z.insertArrowEnd(i,t),z.insertArrowCrossHead(i,t),z.insertArrowFilledHead(i,t),w0(i,o.db.getRels(),o.db.getC4Shape,o,t),u.data.stopx=Vt,u.data.stopy=zt;const g=u.data;let O=g.stopy-g.starty+2*_.diagramMarginY;const P=g.stopx-g.startx+2*_.diagramMarginX;d&&i.append("text").text(d).attr("x",(g.stopx-g.startx)/2-4*_.diagramMarginX).attr("y",g.starty+_.diagramMarginY),Ie(i,O,P,_.useMaxWidth);const M=d?60:0;i.attr("viewBox",g.startx-_.diagramMarginX+" -"+(_.diagramMarginY+M)+" "+P+" "+(O+M)),he.debug("models:",g)},"draw"),fe={drawPersonOrSystemArray:Ee,drawBoundary:ve,setConf:te,draw:T0},O0=y(e=>`.person { + stroke: ${e.personBorder}; + fill: ${e.personBkg}; + } +`,"getStyles"),R0=O0,I0={parser:Ye,db:Zt,renderer:fe,styles:R0,init:y(({c4:e,wrap:t})=>{fe.setConf(e),Zt.setWrap(t)},"init")};export{I0 as diagram}; diff --git a/apps/kimi-code/dist-web/assets/channel-8Bt6a0tz.js b/apps/kimi-code/dist-web/assets/channel-8Bt6a0tz.js new file mode 100644 index 00000000000..40aeb804126 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/channel-8Bt6a0tz.js @@ -0,0 +1 @@ +import{U as a,O as n}from"./mermaid.core-WW7RuneT.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-NzojNxDT.js b/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-NzojNxDT.js new file mode 100644 index 00000000000..152d15d4229 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-NzojNxDT.js @@ -0,0 +1 @@ +import{_ as i}from"./mermaid.core-WW7RuneT.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-CRTrWqUr.js b/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-CRTrWqUr.js new file mode 100644 index 00000000000..15d85f94f25 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-CRTrWqUr.js @@ -0,0 +1 @@ +import{_ as i,d as l,N as d,j as o}from"./mermaid.core-WW7RuneT.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-BJR-VYAu.js b/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BJR-VYAu.js new file mode 100644 index 00000000000..2668fd1daea --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BJR-VYAu.js @@ -0,0 +1,15 @@ +import{_ as e}from"./mermaid.core-WW7RuneT.js";var l=e(()=>` + /* Font Awesome icon styling - consolidated */ + .label-icon { + display: inline-block; + height: 1em; + overflow: visible; + vertical-align: -0.125em; + } + + .node .label-icon path { + fill: currentColor; + stroke: revert; + stroke-width: revert; + } +`,"getIconStyles");export{l as g}; diff --git a/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-B-vU1qLF.js b/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-B-vU1qLF.js new file mode 100644 index 00000000000..19a0b216cad --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-B-vU1qLF.js @@ -0,0 +1,231 @@ +import{g as te}from"./chunk-XXDRQBXY-D_bv9kM4.js";import{s as ee}from"./chunk-VR4S4FIN-C_RujyXt.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-WW7RuneT.js";import{f as fe}from"./chunk-32BRIVSS-CRTrWqUr.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()+` +`+d+"^"},"showPosition"),test_match:f(function(a,d){var r,g,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),g=a[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],r=this.performAction.call(this,this.yy,this,d,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var i in E)this[i]=E[i];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,d,r,g;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),i=0;id[0].length)){if(d=r,g=i,this.options.backtrack_lexer){if(a=this.test_match(r,E[i]),a!==!1)return a;if(this._backtrack){d=!1;continue}else return!1}else if(!this.options.flex)break}return d?(a=this.test_match(d,E[g]),a!==!1?a:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var d=this.next();return d||this.lex()},"lex"),begin:f(function(d){this.conditionStack.push(d)},"begin"),popState:f(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:f(function(d){this.begin(d)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(d,r,g,E){function i(){const B=r.yytext.indexOf("%%");if(B===0)return!1;if(B>0){const l=r.yytext.slice(0,B),Y=r.yytext.slice(B);Y&&d.lexer.unput(Y),r.yytext=l}return!0}switch(f(i,"processId"),g){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return i()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+r.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:break;case 64:return"NOTE_TEXT";case 65:return i()?(this.popState(),"ID"):void 0;case 66:return i()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),r.yytext=r.yytext.substr(2).trim(),31;case 68:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return i()?24:void 0;case 74:return r.yytext=r.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return V})();yt.lexer=qt;function ct(){this.yy={}}return f(ct,"Parser"),ct.prototype=yt,yt.Parser=ct,new ct})();vt.parser=vt;var Ue=vt,pe="TB",Bt="TB",wt="dir",q="state",J="root",Ct="relation",Se="classDef",ye="style",ge="applyClass",et="default",Yt="divider",Gt="fill:none",Vt="fill: #333",Mt="c",Ut="markdown",Wt="normal",kt="rect",Dt="rectWithTitle",Te="stateStart",Ee="stateEnd",Nt="divider",Ot="roundedWithTitle",_e="note",me="noteGroup",st="statediagram",be="state",ke=`${st}-${be}`,jt="transition",De="note",ve="note-edge",Ce=`${jt} ${ve}`,Ae=`${st}-${De}`,xe="cluster",Le=`${st}-${xe}`,Ie="cluster-alt",we=`${st}-${Ie}`,Ht="parent",zt="note",Ne="state",At="----",Oe=`${At}${zt}`,Rt=`${At}${Ht}`,Kt=f((t,e=Bt)=>{if(!t.doc)return e;let o=e;for(const s of t.doc)s.stmt==="dir"&&(o=s.value);return o},"getDir"),Re=f(function(t,e){return e.db.getClasses()},"getClasses"),$e=f(async function(t,e,o,s){_.info("REF0:"),_.info("Drawing state diagram (v2)",e);const{securityLevel:c,state:h,layout:p}=$();s.db.extract(s.db.getRootDocV2());const y=s.db.getData(),n=te(e,c);y.type=s.type,y.layoutAlgorithm=p,y.nodeSpacing=h?.nodeSpacing||50,y.rankSpacing=h?.rankSpacing||50,$().look==="neo"?y.markers=["barbNeo"]:y.markers=["barb"],y.diagramId=e,await se(y,n);const m=8;try{(typeof s.db.getLinks=="function"?s.db.getLinks():new Map).forEach((x,k)=>{const u=typeof k=="string"?k:typeof k?.id=="string"?k.id:"",L=y.nodes.find(w=>w.id===u);if(!u){_.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(k));return}const I=n.node()?.querySelectorAll("g.node, g.rough-node");let v;if(I?.forEach(w=>{const H=w.textContent?.trim();(w.id===L?.domId||H===u)&&(v=w)}),!v){_.warn("⚠️ Could not find node matching text:",u);return}const F=v.parentNode;if(!F){_.warn("⚠️ Node has no parent, cannot wrap:",u);return}const C=document.createElementNS("http://www.w3.org/2000/svg","a"),P=x.url.replace(/^"+|"+$/g,"");if(C.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",P),C.setAttribute("target","_blank"),x.tooltip){const w=x.tooltip.replace(/^"+|"+$/g,"");C.setAttribute("title",w),v.setAttribute("title",w)}F.replaceChild(C,v),C.appendChild(v),_.info("🔗 Wrapped node in tag for:",u,x.url)})}catch(O){_.error("❌ Error injecting clickable links:",O)}ie.insertTitle(n,"statediagramTitleText",h?.titleTopMargin??25,s.db.getDiagramTitle()),ee(n,m,st,h?.useMaxWidth??!0)},"draw"),We={getClasses:Re,draw:$e,getDir:Kt},pt=new Map,M=0;function St(t="",e=0,o="",s=At){const c=o!==null&&o.length>0?`${s}${o}`:"";return`${Ne}-${t}${c}-${e}`}f(St,"stateDomId");var Fe=f((t,e,o,s,c,h,p,y)=>{_.trace("items",e),e.forEach(n=>{switch(n.stmt){case q:tt(t,n,o,s,c,h,p,y);break;case et:tt(t,n,o,s,c,h,p,y);break;case Ct:{tt(t,n.state1,o,s,c,h,p,y),tt(t,n.state2,o,s,c,h,p,y);const T=p==="neo",m={id:"edge"+M,start:n.state1.id,end:n.state2.id,arrowhead:"normal",arrowTypeEnd:T?"arrow_barb_neo":"arrow_barb",style:Gt,labelStyle:"",label:j.sanitizeText(n.description??"",$()),arrowheadStyle:Vt,labelpos:Mt,labelType:Ut,thickness:Wt,classes:jt,look:p};c.push(m),M++}break}})},"setupDoc"),$t=f((t,e=Bt)=>{let o=e;if(t.doc)for(const s of t.doc)s.stmt==="dir"&&(o=s.value);return o},"getDir");function Z(t,e,o){if(!e.id||e.id===""||e.id==="")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(c=>{const h=o.get(c);h&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...h.styles])}));const s=t.find(c=>c.id===e.id);s?Object.assign(s,e):t.push(e)}f(Z,"insertOrUpdateNode");function Xt(t){return t?.classes?.join(" ")??""}f(Xt,"getClassesFromDbInfo");function Jt(t){return t?.styles??[]}f(Jt,"getStylesFromDbInfo");var tt=f((t,e,o,s,c,h,p,y)=>{const n=e.id,T=o.get(n),m=Xt(T),O=Jt(T),x=$();if(_.info("dataFetcher parsedItem",e,T,O),n!=="root"){let k=kt;e.start===!0?k=Te:e.start===!1&&(k=Ee),e.type!==et&&(k=e.type),pt.get(n)||pt.set(n,{id:n,shape:k,description:j.sanitizeText(n,x),cssClasses:`${m} ${ke}`,cssStyles:O});const u=pt.get(n);e.description&&(Array.isArray(u.description)?(u.shape=Dt,u.description.push(e.description)):u.description?.length&&u.description.length>0?(u.shape=Dt,u.description===n?u.description=[e.description]:u.description=[u.description,e.description]):(u.shape=kt,u.description=e.description),u.description=j.sanitizeTextOrArray(u.description,x)),u.description?.length===1&&u.shape===Dt&&(u.type==="group"?u.shape=Ot:u.shape=kt),!u.type&&e.doc&&(_.info("Setting cluster for XCX",n,$t(e)),u.type="group",u.isGroup=!0,u.dir=$t(e),u.explicitDir=e.doc.some(I=>I.stmt==="dir"),u.shape=e.type===Yt?Nt:Ot,u.cssClasses=`${u.cssClasses} ${Le} ${h?we:""}`);const L={labelStyle:"",shape:u.shape,label:u.description,cssClasses:u.cssClasses,cssCompiledStyles:[],cssStyles:u.cssStyles,id:n,dir:u.dir,domId:St(n,M),type:u.type,isGroup:u.type==="group",padding:8,rx:10,ry:10,look:p,labelType:"markdown"};if(L.shape===Nt&&(L.label=""),t&&t.id!=="root"&&(_.trace("Setting node ",n," to be child of its parent ",t.id),L.parentId=t.id),L.centerLabel=!0,e.note){const I={labelStyle:"",shape:_e,label:e.note.text,labelType:"markdown",cssClasses:Ae,cssStyles:[],cssCompiledStyles:[],id:n+Oe+"-"+M,domId:St(n,M,zt),type:u.type,isGroup:u.type==="group",padding:x.flowchart?.padding,look:p,position:e.note.position},v=n+Rt,F={labelStyle:"",shape:me,label:e.note.text,cssClasses:u.cssClasses,cssStyles:[],id:n+Rt,domId:St(n,M,Ht),type:"group",isGroup:!0,padding:16,look:p,position:e.note.position};M++,F.id=v,I.parentId=v,Z(s,F,y),Z(s,I,y),Z(s,L,y);let C=n,P=I.id;e.note.position==="left of"&&(C=I.id,P=n),c.push({id:C+"-"+P,start:C,end:P,arrowhead:"none",arrowTypeEnd:"",style:Gt,labelStyle:"",classes:Ce,arrowheadStyle:Vt,labelpos:Mt,labelType:Ut,thickness:Wt,look:p})}else Z(s,L,y)}e.doc&&(_.trace("Adding nodes children "),Fe(e,e.doc,o,s,c,!h,p,y))},"dataFetcher"),Pe=f(()=>{pt.clear(),M=0},"reset"),D={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Ft=f(()=>new Map,"newClassesList"),Pt=f(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),ft=f(t=>JSON.parse(JSON.stringify(t)),"clone"),je=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Ft(),this.documents={root:Pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=re,this.setAccTitle=ae,this.getAccDescription=ne,this.setAccDescription=oe,this.setDiagramTitle=le,this.getDiagramTitle=ce,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{f(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(const s of Array.isArray(t)?t:t.doc)switch(s.stmt){case q:this.addState(s.id.trim(),s.type,s.doc,s.description,s.note);break;case Ct:this.addRelation(s.state1,s.state2,s.description);break;case Se:this.addStyleClass(s.id.trim(),s.classes);break;case ye:this.handleStyleDef(s);break;case ge:this.setCssClass(s.id.trim(),s.styleClass);break;case"click":this.addLink(s.id,s.url,s.tooltip);break}const e=this.getStates(),o=$();Pe(),tt(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,o.look,this.classes);for(const s of this.nodes)if(Array.isArray(s.label)){if(s.description=s.label.slice(1),s.isGroup&&s.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${s.id}]`);s.label=s.label[0]}}handleStyleDef(t){const e=t.id.trim().split(","),o=t.styleClass.split(",");for(const s of e){let c=this.getState(s);if(!c){const h=s.trim();this.addState(h),c=this.getState(h)}c&&(c.styles=o.map(h=>h.replace(/;/g,"")?.trim()))}}setRootDoc(t){_.info("Setting root doc",t),this.rootDoc=t,this.version===1?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,o){if(e.stmt===Ct){this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);return}if(e.stmt===q&&(e.id===D.START_NODE?(e.id=t.id+(o?"_start":"_end"),e.start=o):e.id=e.id.trim()),e.stmt!==J&&e.stmt!==q||!e.doc)return;const s=[];let c=[];for(const h of e.doc)if(h.type===Yt){const p=ft(h);p.doc=ft(c),s.push(p),c=[]}else c.push(h);if(s.length>0&&c.length>0){const h={stmt:q,id:he(),type:"divider",doc:ft(c)};s.push(ft(h)),e.doc=s}e.doc.forEach(h=>this.docTranslator(e,h,!0))}getRootDocV2(){return this.docTranslator({id:J,stmt:J},{id:J,stmt:J,doc:this.rootDoc},!0),{id:J,doc:this.rootDoc}}addState(t,e=et,o=void 0,s=void 0,c=void 0,h=void 0,p=void 0,y=void 0){const n=t?.trim();if(!this.currentDocument.states.has(n))_.info("Adding state ",n,s),this.currentDocument.states.set(n,{stmt:q,id:n,descriptions:[],type:e,doc:o,note:c,classes:[],styles:[],textStyles:[]});else{const T=this.currentDocument.states.get(n);if(!T)throw new Error(`State not found: ${n}`);T.doc||(T.doc=o),T.type||(T.type=e)}if(s&&(_.info("Setting state description",n,s),(Array.isArray(s)?s:[s]).forEach(m=>this.addDescription(n,m.trim()))),c){const T=this.currentDocument.states.get(n);if(!T)throw new Error(`State not found: ${n}`);T.note=c,T.note.text=j.sanitizeText(T.note.text,$())}h&&(_.info("Setting state classes",n,h),(Array.isArray(h)?h:[h]).forEach(m=>this.setCssClass(n,m.trim()))),p&&(_.info("Setting state styles",n,p),(Array.isArray(p)?p:[p]).forEach(m=>this.setStyle(n,m.trim()))),y&&(_.info("Setting state styles",n,p),(Array.isArray(y)?y:[y]).forEach(m=>this.setTextStyle(n,m.trim())))}clear(t){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Ft(),t||(this.links=new Map,ue())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){_.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,o){this.links.set(t,{url:e,tooltip:o}),_.warn("Adding link",t,e,o)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===D.START_NODE?(this.startEndCount++,`${D.START_TYPE}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=et){return t===D.START_NODE?D.START_TYPE:e}endIdIfNeeded(t=""){return t===D.END_NODE?(this.startEndCount++,`${D.END_TYPE}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=et){return t===D.END_NODE?D.END_TYPE:e}addRelationObjs(t,e,o=""){const s=this.startIdIfNeeded(t.id.trim()),c=this.startTypeIfNeeded(t.id.trim(),t.type),h=this.startIdIfNeeded(e.id.trim()),p=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(s,c,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(h,p,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:s,id2:h,relationTitle:j.sanitizeText(o,$())})}addRelation(t,e,o){if(typeof t=="object"&&typeof e=="object")this.addRelationObjs(t,e,o);else if(typeof t=="string"&&typeof e=="string"){const s=this.startIdIfNeeded(t.trim()),c=this.startTypeIfNeeded(t),h=this.endIdIfNeeded(e.trim()),p=this.endTypeIfNeeded(e);this.addState(s,c),this.addState(h,p),this.currentDocument.relations.push({id1:s,id2:h,relationTitle:o?j.sanitizeText(o,$()):void 0})}}addDescription(t,e){const o=this.currentDocument.states.get(t),s=e.startsWith(":")?e.replace(":","").trim():e;o?.descriptions?.push(j.sanitizeText(s,$()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const o=this.classes.get(t);e&&o&&e.split(D.STYLECLASS_SEP).forEach(s=>{const c=s.replace(/([^;]*);/,"$1").trim();if(RegExp(D.COLOR_KEYWORD).exec(s)){const p=c.replace(D.FILL_KEYWORD,D.BG_FILL).replace(D.COLOR_KEYWORD,D.FILL_KEYWORD);o.textStyles.push(p)}o.styles.push(c)})}getClasses(){return this.classes}setupToolTips(t){const e=fe();bt(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",c=>{const h=bt(c.currentTarget),p=h.attr("title");if(p===null)return;const y=c.currentTarget?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.style("left",window.scrollX+y.left+(y.right-y.left)/2+"px").style("top",window.scrollY+y.bottom+"px"),e.html(de.sanitize(p)),h.classed("hover",!0)}).on("mouseout",c=>{e.transition().duration(500).style("opacity",0),bt(c.currentTarget).classed("hover",!1)})}setCssClass(t,e){t.split(",").forEach(o=>{let s=this.getState(o);if(!s){const c=o.trim();this.addState(c),s=this.getState(c)}s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirectionStatement(){return this.rootDoc.find(t=>t.stmt===wt)}getDirection(){return this.getDirectionStatement()?.value??pe}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:wt,value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){const t=$();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:Kt(this.getRootDocV2())}}getConfig(){return $().state}},Be=f(t=>` +defs [id$="-barbEnd"] { + fill: ${t.transitionColor}; + stroke: ${t.transitionColor}; + } +g.stateGroup text { + fill: ${t.nodeBorder}; + stroke: none; + font-size: 10px; +} +g.stateGroup text { + fill: ${t.textColor}; + stroke: none; + font-size: 10px; + +} +g.stateGroup .state-title { + font-weight: bolder; + fill: ${t.stateLabelColor}; +} + +g.stateGroup rect { + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; +} + +g.stateGroup line { + stroke: ${t.lineColor}; + stroke-width: ${t.strokeWidth||1}; +} + +.transition { + stroke: ${t.transitionColor}; + stroke-width: ${t.strokeWidth||1}; + fill: none; +} + +.stateGroup .composit { + fill: ${t.background}; + border-bottom: 1px +} + +.stateGroup .alt-composit { + fill: #e0e0e0; + border-bottom: 1px +} + +.state-note { + stroke: ${t.noteBorderColor}; + fill: ${t.noteBkgColor}; + + text { + fill: ${t.noteTextColor}; + stroke: none; + font-size: 10px; + } +} + +.stateLabel .box { + stroke: none; + stroke-width: 0; + fill: ${t.mainBkg}; + opacity: 0.5; +} + +.edgeLabel .label rect { + fill: ${t.labelBackgroundColor}; + opacity: 0.5; +} +.edgeLabel { + background-color: ${t.edgeLabelBackground}; + p { + background-color: ${t.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${t.edgeLabelBackground}; + fill: ${t.edgeLabelBackground}; + } + text-align: center; +} +.edgeLabel .label text { + fill: ${t.transitionLabelColor||t.tertiaryTextColor}; +} +.label div .edgeLabel { + color: ${t.transitionLabelColor||t.tertiaryTextColor}; +} + +.stateLabel text { + fill: ${t.stateLabelColor}; + font-size: 10px; + font-weight: bold; +} + +.node circle.state-start { + fill: ${t.specialStateColor}; + stroke: ${t.specialStateColor}; +} + +.node .fork-join { + fill: ${t.specialStateColor}; + stroke: ${t.specialStateColor}; +} + +.node circle.state-end { + fill: ${t.innerEndBackground}; + stroke: ${t.background}; + stroke-width: 1.5 +} +.end-state-inner { + fill: ${t.compositeBackground||t.background}; + // stroke: ${t.background}; + stroke-width: 1.5 +} + +.node rect { + fill: ${t.stateBkg||t.mainBkg}; + stroke: ${t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth||1}px; +} +.node polygon { + fill: ${t.mainBkg}; + stroke: ${t.stateBorder||t.nodeBorder};; + stroke-width: ${t.strokeWidth||1}px; +} +[id$="-barbEnd"] { + fill: ${t.lineColor}; +} + +.statediagram-cluster rect { + fill: ${t.compositeTitleBackground}; + stroke: ${t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth||1}px; +} + +.cluster-label, .nodeLabel { + color: ${t.stateLabelColor}; + // line-height: 1; +} + +.statediagram-cluster rect.outer { + rx: 5px; + ry: 5px; +} +.statediagram-state .divider { + stroke: ${t.stateBorder||t.nodeBorder}; +} + +.statediagram-state .title-state { + rx: 5px; + ry: 5px; +} +.statediagram-cluster.statediagram-cluster .inner { + fill: ${t.compositeBackground||t.background}; +} +.statediagram-cluster.statediagram-cluster-alt .inner { + fill: ${t.altBackground?t.altBackground:"#efefef"}; +} + +.statediagram-cluster .inner { + rx:0; + ry:0; +} + +.statediagram-state rect.basic { + rx: 5px; + ry: 5px; +} +.statediagram-state rect.divider { + stroke-dasharray: 10,10; + fill: ${t.altBackground?t.altBackground:"#efefef"}; +} + +.note-edge { + stroke-dasharray: 5; +} + +.statediagram-note rect { + fill: ${t.noteBkgColor}; + stroke: ${t.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} +.statediagram-note rect { + fill: ${t.noteBkgColor}; + stroke: ${t.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} + +.statediagram-note text { + fill: ${t.noteTextColor}; +} + +.statediagram-note .nodeLabel { + color: ${t.noteTextColor}; +} +.statediagram .edgeLabel { + color: red; // ${t.noteTextColor}; +} + +[id$="-dependencyStart"], [id$="-dependencyEnd"] { + fill: ${t.lineColor}; + stroke: ${t.lineColor}; + stroke-width: ${t.strokeWidth||1}; +} + +.statediagramTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.textColor}; +} + +[data-look="neo"].statediagram-cluster rect { + fill: ${t.mainBkg}; + stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder}; + stroke-width: ${t.strokeWidth??1}; +} +[data-look="neo"].statediagram-cluster rect.outer { + rx: ${t.radius}px; + ry: ${t.radius}px; + filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} +} +`,"getStyles"),He=Be;export{je as S,Ue as a,We as b,He as s}; diff --git a/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-BJMJfnyy.js b/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-BJMJfnyy.js new file mode 100644 index 00000000000..b7b772f3ef7 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-BJMJfnyy.js @@ -0,0 +1 @@ +import{_ as i}from"./mermaid.core-WW7RuneT.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-DmVMZHwQ.js b/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DmVMZHwQ.js new file mode 100644 index 00000000000..fa350c5091c --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DmVMZHwQ.js @@ -0,0 +1,88 @@ +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-WW7RuneT.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}; + font-size: ${a}px; + } + + .railroad-terminal rect { + fill: ${r}; + stroke: ${t}; + stroke-width: ${c}px; + } + + .railroad-terminal text { + fill: ${n}; + font-family: ${i}; + font-size: ${a}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-nonterminal rect { + fill: ${h}; + stroke: ${s}; + stroke-width: ${c}px; + } + + .railroad-nonterminal text { + fill: ${o}; + font-family: ${i}; + font-size: ${a}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-line { + stroke: ${u}; + stroke-width: ${c}px; + fill: none; + } + + .railroad-start circle, + .railroad-end circle { + fill: ${d}; + } + + .railroad-comment ellipse { + fill: ${x}; + stroke: ${l}; + stroke-width: ${c}px; + } + + .railroad-comment text { + fill: ${f}; + font-style: italic; + font-family: ${i}; + font-size: ${a}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-special rect { + fill: ${y}; + stroke: ${v}; + stroke-width: ${c}px; + stroke-dasharray: 5,3; + } + + .railroad-special text { + fill: ${o}; + font-family: ${i}; + font-size: ${a}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-rule-name { + font-weight: bold; + fill: ${C}; + font-family: ${i}; + font-size: ${a}px; + } + + .railroad-group { + /* Grouping container, no specific styles */ + } +`},"getStyles"),T=class{constructor(){this.d=""}static{p(this,"PathBuilder")}moveTo(e,i){return this.d+=`M ${e} ${i} `,this}lineTo(e,i){return this.d+=`L ${e} ${i} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,i,a,r,t,n,h){return this.d+=`A ${e} ${i} ${a} ${r?1:0} ${t?1:0} ${n} ${h} `,this}build(){return this.d.trim()}},me=class{constructor(e,i=M()){this.textCache=new Map,this.svg=e,this.config=i}static{p(this,"RailroadRenderer")}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const i=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),a=i.node().getBBox(),r={width:a.width,height:a.height};return i.remove(),this.textCache.set(e,r),r}renderTerminal(e,i){const a=this.measureText(i),r=a.width+this.config.padding*2,t=a.height+this.config.padding*2,n=e.append("g").attr("class","railroad-terminal");return n.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",t).attr("rx",10).attr("ry",10),n.append("text").attr("x",r/2).attr("y",t/2).text(i),{element:n.node(),dimensions:{width:r,height:t,up:t/2,down:t/2}}}renderNonTerminal(e,i){const a=this.measureText(i),r=a.width+this.config.padding*2,t=a.height+this.config.padding*2,n=e.append("g").attr("class","railroad-nonterminal");return n.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",t),n.append("text").attr("x",r/2).attr("y",t/2).text(i),{element:n.node(),dimensions:{width:r,height:t,up:t/2,down:t/2}}}renderSequence(e,i){const a=i.map(o=>this.renderExpression(e,o));let r=0,t=0,n=0;for(const o of a)r+=o.dimensions.width,t=Math.max(t,o.dimensions.up),n=Math.max(n,o.dimensions.down);r+=(a.length-1)*this.config.horizontalSeparation;const h=e.append("g").attr("class","railroad-sequence");let s=0;for(let o=0;othis.renderExpression(e,d));let r=0,t=0;for(const d of a)r=Math.max(r,d.dimensions.width),t+=d.dimensions.height;t+=(a.length-1)*this.config.verticalSeparation;const n=this.config.arcRadius,h=n*4,s=r+h,o=e.append("g").attr("class","railroad-choice");let u=0;const c=t/2;for(const d of a){const x=u,l=x+d.dimensions.up,f=n*2+(r-d.dimensions.width)/2;o.node().appendChild(d.element).setAttribute("transform",`translate(${f}, ${x})`);const v=new T,C=l>c;l===c?v.moveTo(0,c).lineTo(f,l):v.moveTo(0,c).arcTo(n,n,0,!1,C,n,c+(C?n:-n)).lineTo(n,l-(C?n:-n)).arcTo(n,n,0,!1,!C,n*2,l).lineTo(f,l),o.append("path").attr("class","railroad-line").attr("d",v.build());const $=new T,O=f+d.dimensions.width,P=s-n*2;l===c?$.moveTo(O,l).lineTo(s,c):$.moveTo(O,l).lineTo(P,l).arcTo(n,n,0,!1,!C,s-n,l+(C?-n:n)).lineTo(s-n,c+(C?n:-n)).arcTo(n,n,0,!1,C,s,c),o.append("path").attr("class","railroad-line").attr("d",$.build()),u+=d.dimensions.height+this.config.verticalSeparation}return{element:o.node(),dimensions:{width:s,height:t,up:c,down:t-c}}}renderOptional(e,i){const a=this.renderExpression(e,i),r=this.config.arcRadius,t=r*2,n=a.dimensions.width+r*4,h=a.dimensions.height+t,s=e.append("g").attr("class","railroad-optional"),o=r*2,u=t;s.node().appendChild(a.element).setAttribute("transform",`translate(${o}, ${u})`);const d=u+a.dimensions.up,x=new T().moveTo(0,d).lineTo(r*2,d);s.append("path").attr("class","railroad-line").attr("d",x.build());const l=new T().moveTo(o+a.dimensions.width,d).lineTo(n,d);s.append("path").attr("class","railroad-line").attr("d",l.build());const f=new T().moveTo(0,d).arcTo(r,r,0,!1,!1,r,d-r).lineTo(r,r).arcTo(r,r,0,!1,!0,r*2,0).lineTo(n-r*2,0).arcTo(r,r,0,!1,!0,n-r,r).lineTo(n-r,d-r).arcTo(r,r,0,!1,!1,n,d);return s.append("path").attr("class","railroad-line").attr("d",f.build()),{element:s.node(),dimensions:{width:n,height:h,up:d,down:h-d}}}renderRepetition(e,i,a){const r=this.renderExpression(e,i),t=this.config.arcRadius,n=t*2,h=r.dimensions.width+t*4,s=a===0,o=r.dimensions.height+n+(s?n:0),u=e.append("g").attr("class","railroad-repetition"),c=t*2,d=s?n:0;u.node().appendChild(r.element).setAttribute("transform",`translate(${c}, ${d})`);const l=d+r.dimensions.up;u.append("path").attr("class","railroad-line").attr("d",new T().moveTo(0,l).lineTo(t*2,l).build()),u.append("path").attr("class","railroad-line").attr("d",new T().moveTo(c+r.dimensions.width,l).lineTo(h,l).build());const f=d+r.dimensions.height+t,y=new T().moveTo(c+r.dimensions.width,l).arcTo(t,t,0,!1,!0,c+r.dimensions.width+t,l+t).lineTo(c+r.dimensions.width+t,f).arcTo(t,t,0,!1,!0,c+r.dimensions.width,f+t).lineTo(t*2,f+t).arcTo(t,t,0,!1,!0,t,f).lineTo(t,l+t).arcTo(t,t,0,!1,!0,t*2,l);if(u.append("path").attr("class","railroad-line").attr("d",y.build()),s){const v=new T().moveTo(0,l).arcTo(t,t,0,!1,!1,t,l-t).lineTo(t,t).arcTo(t,t,0,!1,!0,t*2,0).lineTo(h-t*2,0).arcTo(t,t,0,!1,!0,h-t,t).lineTo(h-t,l-t).arcTo(t,t,0,!1,!1,h,l);u.append("path").attr("class","railroad-line").attr("d",v.build())}return{element:u.node(),dimensions:{width:h,height:o,up:l,down:o-l}}}renderSpecial(e,i){const a=this.measureText("? "+i+" ?"),r=a.width+this.config.padding*2,t=a.height+this.config.padding*2,n=e.append("g").attr("class","railroad-special");return n.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",t),n.append("text").attr("x",r/2).attr("y",t/2).text("? "+i+" ?"),{element:n.node(),dimensions:{width:r,height:t,up:t/2,down:t/2}}}renderExpression(e,i){switch(i.type){case"terminal":return this.renderTerminal(e,i.value);case"nonterminal":return this.renderNonTerminal(e,i.name);case"sequence":return this.renderSequence(e,i.elements);case"choice":return this.renderChoice(e,i.alternatives);case"optional":return this.renderOptional(e,i.element);case"repetition":return this.renderRepetition(e,i.element,i.min);case"special":return this.renderSpecial(e,i.text);default:throw new Error(`Unknown node type: ${i.type}`)}}renderRule(e,i){const a=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${i})`),r=e.name+" =",t=this.measureText(r).width+20,n=t+20,h=a.append("g"),s=this.renderExpression(h,e.definition),o=Math.max(20,s.dimensions.up),u=o-s.dimensions.up;return h.attr("transform",`translate(${n}, ${u})`),a.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",o).text(r),a.append("g").attr("class","railroad-start").append("circle").attr("cx",t).attr("cy",o).attr("r",this.config.markerRadius),a.append("g").attr("class","railroad-end").append("circle").attr("cx",n+s.dimensions.width+10).attr("cy",o).attr("r",this.config.markerRadius),a.append("path").attr("class","railroad-line").attr("d",new T().moveTo(t+this.config.markerRadius,o).lineTo(n,o).build()),a.append("path").attr("class","railroad-line").attr("d",new T().moveTo(n+s.dimensions.width,o).lineTo(n+s.dimensions.width+10-this.config.markerRadius,o).build()),{height:Math.max(40,u+s.dimensions.height+this.config.padding*2),width:n+s.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let i=this.config.padding,a=0;for(const r of e){const t=this.renderRule(r,i);i+=t.height+this.config.verticalSeparation,a=Math.max(a,t.width)}return{width:a+this.config.padding*2,height:i+this.config.padding}}},D=p((e,i,a)=>{H(e,i.height,i.width,a),e.attr("viewBox",`0 0 ${i.width} ${i.height}`)},"configureRailroadSvgSize"),he=p((e,i,a)=>{w.debug(`[Railroad] Rendering diagram +`+e);try{const r=L(i);r.attr("class","railroad-diagram");const n=E().railroad?.useMaxWidth??!0,h=ie.getRules();if(w.debug(`[Railroad] Rendering ${h.length} rules`),h.length===0){w.warn("[Railroad] No rules to render"),D(r,{height:100,width:200},n);return}const o=new me(r,M()).renderDiagram(h);D(r,o,n),w.debug("[Railroad] Render complete")}catch(r){throw w.error("[Railroad] Render error:",r),r}},"draw"),ge={draw:he};export{ie as d,ue as g,ge as r}; diff --git a/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-LhAgalr3.js b/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-LhAgalr3.js new file mode 100644 index 00000000000..e6179843264 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-LhAgalr3.js @@ -0,0 +1 @@ +import{_ as u,l as i}from"./mermaid.core-WW7RuneT.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-BBRs-W-z.js b/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-BBRs-W-z.js new file mode 100644 index 00000000000..4b425774cc5 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-BBRs-W-z.js @@ -0,0 +1,206 @@ +import{g as tt}from"./chunk-5VM5RSS4-BJR-VYAu.js";import{g as st}from"./chunk-XXDRQBXY-D_bv9kM4.js";import{s as it}from"./chunk-VR4S4FIN-C_RujyXt.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-WW7RuneT.js";import{f as gt}from"./chunk-32BRIVSS-CRTrWqUr.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()+` +`+h+"^"},"showPosition"),test_match:f(function(o,h){var p,l,C;if(this.options.backtrack_lexer&&(C={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(C.yylloc.range=this.yylloc.range.slice(0))),l=o[0].match(/(?:\r\n?|\n).*/g),l&&(this.yylineno+=l.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:l?l[l.length-1].length-l[l.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],p=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var e in C)this[e]=C[e];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,h,p,l;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),e=0;eh[0].length)){if(h=p,l=e,this.options.backtrack_lexer){if(o=this.test_match(p,C[e]),o!==!1)return o;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(o=this.test_match(h,C[l]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var h=this.next();return h||this.lex()},"lex"),begin:f(function(h){this.conditionStack.push(h)},"begin"),popState:f(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:f(function(h){this.begin(h)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:f(function(h,p,l,C){switch(l){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return O})();Se.lexer=He;function le(){this.yy={}}return f(le,"Parser"),le.prototype=Se,Se.Parser=le,new le})();we.parser=we;var Bt=we,je=["#","+","~","-",""],Xe=class{static{f(this,"ClassMember")}constructor(t,i){this.memberType=i,this.visibility="",this.classifier="",this.text="";const a=ft(t,F());this.parseMember(a)}getDisplayDetails(){let t=this.visibility+G(this.id);this.memberType==="method"&&(t+=`(${G(this.parameters.trim())})`,this.returnType&&(t+=" : "+G(this.returnType))),t=t.trim();const i=this.parseClassifier();return{displayText:t,cssStyle:i}}parseMember(t){let i="";if(this.memberType==="method"){const r=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(t);if(r){const c=r[1]?r[1].trim():"";if(je.includes(c)&&(this.visibility=c),this.id=r[2],this.parameters=r[3]?r[3].trim():"",i=r[4]?r[4].trim():"",this.returnType=r[5]?r[5].trim():"",i===""){const u=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(u)&&(i=u,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const n=t.length,r=t.substring(0,1),c=t.substring(n-1);je.includes(r)&&(this.visibility=r),/[$*]/.exec(c)&&(i=c),this.id=t.substring(this.visibility===""?0:1,i===""?n:n-1)}this.classifier=i,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const a=`${this.visibility?"\\"+this.visibility:""}${G(this.id)}${this.memberType==="method"?`(${G(this.parameters)})${this.returnType?" : "+G(this.returnType):""}`:""}`;this.text=a.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},pe="classId-",qe=0,P=f(t=>I.sanitizeText(t,F()),"sanitizeText"),_t=class Ve{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=f(i=>{const a=gt();de(i).select("svg").selectAll("g").filter(function(){return de(this).attr("title")!==null}).on("mouseover",c=>{const u=de(c.currentTarget),d=u.attr("title");if(!d)return;const m=c.currentTarget.getBoundingClientRect();a.transition().duration(200).style("opacity",".9"),a.html(rt.sanitize(d)).style("left",`${window.scrollX+m.left+m.width/2}px`).style("top",`${window.scrollY+m.bottom+4}px`),u.classed("hover",!0)}).on("mouseout",c=>{a.transition().duration(500).style("opacity",0),de(c.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=ut,this.getAccTitle=lt,this.setAccDescription=ct,this.getAccDescription=ot,this.setDiagramTitle=ht,this.getDiagramTitle=dt,this.getConfig=f(()=>F().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{f(this,"ClassDB")}splitClassNameAndType(i){const a=I.sanitizeText(i,F());let n="",r=a;if(a.indexOf("~")>0){const c=a.split("~");r=P(c[0]),n=P(c[1])}return{className:r,type:n}}setClassLabel(i,a){const n=I.sanitizeText(i,F());a&&(a=P(a));const{className:r}=this.splitClassNameAndType(n);this.classes.get(r).label=a,this.classes.get(r).text=`${a}${this.classes.get(r).type?`<${this.classes.get(r).type}>`:""}`}addClass(i){const a=I.sanitizeText(i,F()),{className:n,type:r}=this.splitClassNameAndType(a);if(this.classes.has(n))return;const c=I.sanitizeText(n,F());this.classes.set(c,{id:c,type:r,label:c,text:`${c}${r?`<${r}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:pe+c+"-"+qe}),qe++}addInterface(i,a){const n={id:`interface${this.interfaces.length}`,label:i,classId:a};this.interfaces.push(n)}setDiagramId(i){this.diagramId=i}lookUpDomId(i){const a=I.sanitizeText(i,F());if(this.classes.has(a)){const n=this.classes.get(a).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+a)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",pt()}getClass(i){return this.classes.get(i)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(i){const a=typeof i=="number"?`note${i}`:i;return this.notes.get(a)}getNotes(){return this.notes}addRelation(i){Ie.debug("Adding relation: "+JSON.stringify(i));const a=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];i.relation.type1===this.relationType.LOLLIPOP&&!a.includes(i.relation.type2)?(this.addClass(i.id2),this.addInterface(i.id1,i.id2),i.id1=`interface${this.interfaces.length-1}`):i.relation.type2===this.relationType.LOLLIPOP&&!a.includes(i.relation.type1)?(this.addClass(i.id1),this.addInterface(i.id2,i.id1),i.id2=`interface${this.interfaces.length-1}`):(this.addClass(i.id1),this.addClass(i.id2)),i.id1=this.splitClassNameAndType(i.id1).className,i.id2=this.splitClassNameAndType(i.id2).className,i.relationTitle1=I.sanitizeText(i.relationTitle1.trim(),F()),i.relationTitle2=I.sanitizeText(i.relationTitle2.trim(),F()),this.relations.push(i)}addAnnotation(i,a){const n=this.splitClassNameAndType(i).className;this.classes.get(n).annotations.push(a)}addMember(i,a){this.addClass(i);const n=this.splitClassNameAndType(i).className,r=this.classes.get(n);if(typeof a=="string"){const c=a.trim();c.startsWith("<<")&&c.endsWith(">>")?r.annotations.push(P(c.substring(2,c.length-2))):c.indexOf(")")>0?r.methods.push(new Xe(c,"method")):c&&r.members.push(new Xe(c,"attribute"))}}addMembers(i,a){Array.isArray(a)&&(a.reverse(),a.forEach(n=>this.addMember(i,n)))}addNote(i,a){const n=this.notes.size,r={id:`note${n}`,class:a,text:i,index:n};return this.notes.set(r.id,r),r.id}cleanupLabel(i){return i.startsWith(":")&&(i=i.substring(1)),P(i.trim())}setCssClass(i,a){i.split(",").forEach(n=>{let r=n;/\d/.exec(n[0])&&(r=pe+r),r=this.splitClassNameAndType(r).className;const c=this.classes.get(r);c&&(c.cssClasses+=" "+a)})}defineClass(i,a){for(const n of i){let r=this.styleClasses.get(n);r===void 0&&(r={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,r)),a&&a.forEach(c=>{if(/color/.exec(c)){const u=c.replace("fill","bgFill");r.textStyles.push(u)}r.styles.push(c)}),this.classes.forEach(c=>{c.cssClasses.includes(n)&&c.styles.push(...a.flatMap(u=>u.split(",")))})}}setTooltip(i,a){i.split(",").forEach(n=>{if(a!==void 0){const r=this.splitClassNameAndType(n).className,c=this.classes.get(r);c&&(c.tooltip=P(a))}})}getTooltip(i,a){return a&&this.namespaces.has(a)?this.namespaces.get(a).classes.get(i).tooltip:this.classes.get(i).tooltip}setLink(i,a,n){const r=F();i.split(",").forEach(c=>{let u=c;/\d/.exec(c[0])&&(u=pe+u),u=this.splitClassNameAndType(u).className;const d=this.classes.get(u);d&&(d.link=Oe.formatUrl(a,r),r.securityLevel==="sandbox"?d.linkTarget="_top":typeof n=="string"?d.linkTarget=P(n):d.linkTarget="_blank")}),this.setCssClass(i,"clickable")}setClickEvent(i,a,n){i.split(",").forEach(r=>{this.setClickFunc(r,a,n);const c=this.splitClassNameAndType(r).className,u=this.classes.get(c);u&&(u.haveCallback=!0)}),this.setCssClass(i,"clickable")}setClickFunc(i,a,n){const r=I.sanitizeText(i,F());if(F().securityLevel!=="loose"||a===void 0)return;const u=this.splitClassNameAndType(r).className;if(this.classes.has(u)){let d=[];if(typeof n=="string"){d=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let m=0;m{const m=this.lookUpDomId(u),g=document.querySelector(`[id="${m}"]`);g!==null&&g.addEventListener("click",()=>{Oe.runFunc(a,...d)},!1)})}}bindFunctions(i){this.functions.forEach(a=>{a(i)})}escapeHtml(i){return i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(i){this.direction=i}static resolveQualifiedId(i,a){const n=a.at(-1);return n?`${n}.${i}`:i}static getAncestorIds(i){const a=i.split("."),n=new Array(a.length);n[0]=a[0];for(let r=1;r0?c[u-1]:void 0,g=u===c.length-1,N=g&&a?a:r[u];this.namespaces.has(d)?g&&(this.namespaces.get(d).explicit=!0):this.namespaces.set(d,this.createNamespaceNode(d,N,m,g)),m&&this.linkParentChild(m,d)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(i){return this.namespaces.get(i)}getNamespaces(){return this.namespaces}addClassesToNamespace(i,a,n){if(this.namespaces.has(i)){for(const r of a){const{className:c}=this.splitClassNameAndType(r),u=this.getClass(c);u.parent=i,this.namespaces.get(i).classes.set(c,u)}for(const r of n){const c=this.getNote(r);c.parent=i,this.namespaces.get(i).notes.set(r,c)}}}setCssStyle(i,a){const n=this.classes.get(i);if(!(!a||!n))for(const r of a)r.includes(",")?n.styles.push(...r.split(",")):n.styles.push(r)}getArrowMarker(i){let a;switch(i){case 0:a="aggregation";break;case 1:a="extension";break;case 2:a="composition";break;case 3:a="dependency";break;case 4:a="lollipop";break;default:a="none"}return a}resolveExplicitAncestor(i){let a=i;for(;a;){const n=this.namespaces.get(a);if(!n)return;if(n.explicit)return a;a=n.parent}}getData(){const i=[],a=[],n=F(),r=n.class?.hierarchicalNamespaces??!0;for(const u of this.namespaces.values()){if(!r&&!u.explicit)continue;const d={id:u.id,label:r?u.label:u.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:r?u.parent:void 0};i.push(d)}for(const u of this.classes.values()){const d=r?u.parent:this.resolveExplicitAncestor(u.parent),m={...u,type:void 0,isGroup:!1,parentId:d,look:n.look};i.push(m)}for(const u of this.notes.values()){const d=r?u.parent:this.resolveExplicitAncestor(u.parent),m={id:u.id,label:u.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:d,labelType:"markdown"};i.push(m);const g=this.classes.get(u.class)?.id;if(g){const N={id:`edgeNote${u.index}`,start:u.id,end:g,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};a.push(N)}}for(const u of this.interfaces){const d={id:u.id,label:u.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};i.push(d)}let c=0;for(const u of this.relations){c++;const d={id:At(u.id1,u.id2,{prefix:"id",counter:c}),start:u.id1,end:u.id2,type:"normal",label:u.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(u.relation.type1),arrowTypeEnd:this.getArrowMarker(u.relation.type2),startLabelRight:u.relationTitle1==="none"?"":u.relationTitle1,endLabelLeft:u.relationTitle2==="none"?"":u.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:u.style||"",pattern:u.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};a.push(d)}return{nodes:i,edges:a,other:{},config:n,direction:this.getDirection()}}},mt=f(t=>`g.classGroup text { + fill: ${t.nodeBorder||t.classText}; + stroke: none; + font-family: ${t.fontFamily}; + font-size: 10px; + + .title { + font-weight: bolder; + } + +} + + .cluster-label text { + fill: ${t.titleColor}; + } + .cluster-label span { + color: ${t.titleColor}; + } + .cluster-label span p { + background-color: transparent; + } + + .cluster rect { + fill: ${t.clusterBkg}; + stroke: ${t.clusterBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${t.titleColor}; + } + + .cluster span { + color: ${t.titleColor}; + } + +.nodeLabel, .edgeLabel { + color: ${t.classText}; +} + +.noteLabel .nodeLabel, .noteLabel .edgeLabel { + color: ${t.noteTextColor}; +} +.edgeLabel .label rect { + fill: ${t.mainBkg}; +} +.label text { + fill: ${t.classText}; +} + +.labelBkg { + background: ${t.mainBkg}; +} +.edgeLabel .label span { + background: ${t.mainBkg}; +} + +.classTitle { + font-weight: bolder; +} +.node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; + stroke-width: ${t.strokeWidth}; + } + + +.divider { + stroke: ${t.nodeBorder}; + stroke-width: 1; +} + +g.clickable { + cursor: pointer; +} + +g.classGroup rect { + fill: ${t.mainBkg}; + stroke: ${t.nodeBorder}; +} + +g.classGroup line { + stroke: ${t.nodeBorder}; + stroke-width: 1; +} + +.classLabel .box { + stroke: none; + stroke-width: 0; + fill: ${t.mainBkg}; + opacity: 0.5; +} + +.classLabel .label { + fill: ${t.nodeBorder}; + font-size: 10px; +} + +.relation { + stroke: ${t.lineColor}; + stroke-width: ${t.strokeWidth}; + fill: none; +} + +.dashed-line{ + stroke-dasharray: 3; +} + +.dotted-line{ + stroke-dasharray: 1 2; +} + +[id$="-compositionStart"], .composition { + fill: ${t.lineColor} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-compositionEnd"], .composition { + fill: ${t.lineColor} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-dependencyStart"], .dependency { + fill: ${t.lineColor} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-dependencyEnd"], .dependency { + fill: ${t.lineColor} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-extensionStart"], .extension { + fill: transparent !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-extensionEnd"], .extension { + fill: transparent !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-aggregationStart"], .aggregation { + fill: transparent !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-aggregationEnd"], .aggregation { + fill: transparent !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-lollipopStart"], .lollipop { + fill: ${t.mainBkg} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +[id$="-lollipopEnd"], .lollipop { + fill: ${t.mainBkg} !important; + stroke: ${t.lineColor} !important; + stroke-width: 1; +} + +.edgeTerminals { + font-size: 11px; + line-height: initial; +} + +.classTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.textColor}; +} + +.edgeLabel[data-look="neo"] { + background-color: ${t.edgeLabelBackground}; + p { + background-color: ${t.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${t.edgeLabelBackground}; + fill: ${t.edgeLabelBackground}; + } + text-align: center; +} + ${tt()} +`,"getStyles"),St=mt,Ct=f((t,i="TB")=>{if(!t.doc)return i;let a=i;for(const n of t.doc)n.stmt==="dir"&&(a=n.value);return a},"getDir"),bt=f(function(t,i){return i.db.getClasses()},"getClasses"),kt=f(async function(t,i,a,n){Ie.info("REF0:"),Ie.info("Drawing class diagram (v3)",i);const{securityLevel:r,state:c,layout:u}=F();n.db.setDiagramId(i);const d=n.db.getData(),m=st(i,r);d.type=n.type,d.layoutAlgorithm=at(u),d.nodeSpacing=c?.nodeSpacing||50,d.rankSpacing=c?.rankSpacing||50,d.markers=["aggregation","extension","composition","dependency","lollipop"],d.diagramId=i,await nt(d,m);const g=8;Oe.insertTitle(m,"classDiagramTitleText",c?.titleTopMargin??25,n.db.getDiagramTitle()),it(m,g,"classDiagram",c?.useMaxWidth??!0)},"draw"),Nt={getClasses:bt,draw:kt,getDir:Ct};export{_t as C,Bt as a,Nt as c,St as s}; diff --git a/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-C_RujyXt.js b/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-C_RujyXt.js new file mode 100644 index 00000000000..fdb77d45628 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-C_RujyXt.js @@ -0,0 +1 @@ +import{_ as a,e as w,l as x}from"./mermaid.core-WW7RuneT.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-D_bv9kM4.js b/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-D_bv9kM4.js new file mode 100644 index 00000000000..921e62e77fa --- /dev/null +++ b/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-D_bv9kM4.js @@ -0,0 +1 @@ +import{_ as a,d as o}from"./mermaid.core-WW7RuneT.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-DLwxkoRX.js b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-DLwxkoRX.js new file mode 100644 index 00000000000..931a051ed28 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-DLwxkoRX.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-BBRs-W-z.js";import{_ as i}from"./mermaid.core-WW7RuneT.js";import"./chunk-5VM5RSS4-BJR-VYAu.js";import"./chunk-XXDRQBXY-D_bv9kM4.js";import"./chunk-VR4S4FIN-C_RujyXt.js";import"./chunk-32BRIVSS-CRTrWqUr.js";import"./index-CiHMlsuo.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-DLwxkoRX.js b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-DLwxkoRX.js new file mode 100644 index 00000000000..931a051ed28 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-DLwxkoRX.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-BBRs-W-z.js";import{_ as i}from"./mermaid.core-WW7RuneT.js";import"./chunk-5VM5RSS4-BJR-VYAu.js";import"./chunk-XXDRQBXY-D_bv9kM4.js";import"./chunk-VR4S4FIN-C_RujyXt.js";import"./chunk-32BRIVSS-CRTrWqUr.js";import"./index-CiHMlsuo.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-DzQyBzbl.js b/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-DzQyBzbl.js new file mode 100644 index 00000000000..4fcc151f954 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-DzQyBzbl.js @@ -0,0 +1 @@ +import{_ as V,l as k,d as lt}from"./mermaid.core-WW7RuneT.js";import{c as tt}from"./cytoscape.esm-OyMbaexL.js";import{g as gt}from"./_commonjsHelpers-CqkleIqs.js";import"./index-CiHMlsuo.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-DI-9Z5R0.js b/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DI-9Z5R0.js new file mode 100644 index 00000000000..e219db65b91 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DI-9Z5R0.js @@ -0,0 +1,178 @@ +import{bR as et}from"./index-CiHMlsuo.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(;f0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),r=0,n=t.length;if(n===0)return ie.create(0,e);for(;re?n=s:r=s+1}let a=r-1;return ie.create(a,e-t[a])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let r=t[e.line],n=e.line+1"u"}i(n,"undefined"),e.undefined=n;function a(g){return g===!0||g===!1}i(a,"boolean"),e.boolean=a;function s(g){return t.call(g)==="[object String]"}i(s,"string"),e.string=s;function o(g){return t.call(g)==="[object Number]"}i(o,"number"),e.number=o;function l(g,v,b){return t.call(g)==="[object Number]"&&v<=g&&g<=b}i(l,"numberRange"),e.numberRange=l;function u(g){return t.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}i(u,"integer"),e.integer=u;function c(g){return t.call(g)==="[object Number]"&&0<=g&&g<=2147483647}i(c,"uinteger"),e.uinteger=c;function f(g){return t.call(g)==="[object Function]"}i(f,"func"),e.func=f;function d(g){return g!==null&&typeof g=="object"}i(d,"objectLiteral"),e.objectLiteral=d;function m(g,v){return Array.isArray(g)&&g.every(v)}i(m,"typedArray"),e.typedArray=m})(A||(A={}))}}),Dn=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t;function r(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}i(r,"RAL"),(function(n){function a(s){if(s===void 0)throw new Error("No runtime abstraction layer provided");t=s}i(a,"install"),n.install=a})(r||(r={})),e.default=r}}),Ms=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(u){return u===!0||u===!1}i(t,"boolean"),e.boolean=t;function r(u){return typeof u=="string"||u instanceof String}i(r,"string"),e.string=r;function n(u){return typeof u=="number"||u instanceof Number}i(n,"number"),e.number=n;function a(u){return u instanceof Error}i(a,"error"),e.error=a;function s(u){return typeof u=="function"}i(s,"func"),e.func=s;function o(u){return Array.isArray(u)}i(o,"array"),e.array=o;function l(u){return o(u)&&u.every(c=>r(c))}i(l,"stringArray"),e.stringArray=l}}),ei=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var t=Dn(),r;(function(s){const o={dispose(){}};s.None=function(){return o}})(r||(e.Event=r={}));var n=class{static{i(this,"CallbackList")}add(s,o=null,l){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(o),Array.isArray(l)&&l.push({dispose:i(()=>this.remove(s,o),"dispose")})}remove(s,o=null){if(!this._callbacks)return;let l=!1;for(let u=0,c=this._callbacks.length;u{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(o,l);const c={dispose:i(()=>{this._callbacks&&(this._callbacks.remove(o,l),c.dispose=jg._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(u)&&u.push(c),c}),this._event}fire(o){this._callbacks&&this._callbacks.invoke.call(this._callbacks,o)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};e.Emitter=a,a._noop=function(){}}}),xl=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var t=Dn(),r=Ms(),n=ei(),a;(function(u){u.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),u.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function c(f){const d=f;return d&&(d===u.None||d===u.Cancelled||r.boolean(d.isCancellationRequested)&&!!d.onCancellationRequested)}i(c,"is"),u.is=c})(a||(e.CancellationToken=a={}));var s=Object.freeze(function(u,c){const f=(0,t.default)().timer.setTimeout(u.bind(c),0);return{dispose(){f.dispose()}}}),o=class{static{i(this,"MutableToken")}constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?s:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},l=class{static{i(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new o),this._token}cancel(){this._token?this._token.cancel():this._token=a.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=a.None}};e.CancellationTokenSource=l}}),Bg=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;var t=Ms(),r;(function(y){y.ParseError=-32700,y.InvalidRequest=-32600,y.MethodNotFound=-32601,y.InvalidParams=-32602,y.InternalError=-32603,y.jsonrpcReservedErrorRangeStart=-32099,y.serverErrorStart=-32099,y.MessageWriteError=-32099,y.MessageReadError=-32098,y.PendingResponseRejected=-32097,y.ConnectionInactive=-32096,y.ServerNotInitialized=-32002,y.UnknownErrorCode=-32001,y.jsonrpcReservedErrorRangeEnd=-32e3,y.serverErrorEnd=-32e3})(r||(e.ErrorCodes=r={}));var n=class Ug extends Error{static{i(this,"ResponseError")}constructor(E,T,$){super(T),this.code=t.number(E)?E:r.UnknownErrorCode,this.data=$,Object.setPrototypeOf(this,Ug.prototype)}toJson(){const E={code:this.code,message:this.message};return this.data!==void 0&&(E.data=this.data),E}};e.ResponseError=n;var a=class No{static{i(this,"ParameterStructures")}constructor(E){this.kind=E}static is(E){return E===No.auto||E===No.byName||E===No.byPosition}toString(){return this.kind}};e.ParameterStructures=a,a.auto=new a("auto"),a.byPosition=new a("byPosition"),a.byName=new a("byName");var s=class{static{i(this,"AbstractMessageSignature")}constructor(y,E){this.method=y,this.numberOfParams=E}get parameterStructures(){return a.auto}};e.AbstractMessageSignature=s;var o=class extends s{static{i(this,"RequestType0")}constructor(y){super(y,0)}};e.RequestType0=o;var l=class extends s{static{i(this,"RequestType")}constructor(y,E=a.auto){super(y,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.RequestType=l;var u=class extends s{static{i(this,"RequestType1")}constructor(y,E=a.auto){super(y,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.RequestType1=u;var c=class extends s{static{i(this,"RequestType2")}constructor(y){super(y,2)}};e.RequestType2=c;var f=class extends s{static{i(this,"RequestType3")}constructor(y){super(y,3)}};e.RequestType3=f;var d=class extends s{static{i(this,"RequestType4")}constructor(y){super(y,4)}};e.RequestType4=d;var m=class extends s{static{i(this,"RequestType5")}constructor(y){super(y,5)}};e.RequestType5=m;var g=class extends s{static{i(this,"RequestType6")}constructor(y){super(y,6)}};e.RequestType6=g;var v=class extends s{static{i(this,"RequestType7")}constructor(y){super(y,7)}};e.RequestType7=v;var b=class extends s{static{i(this,"RequestType8")}constructor(y){super(y,8)}};e.RequestType8=b;var S=class extends s{static{i(this,"RequestType9")}constructor(y){super(y,9)}};e.RequestType9=S;var w=class extends s{static{i(this,"NotificationType")}constructor(y,E=a.auto){super(y,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.NotificationType=w;var I=class extends s{static{i(this,"NotificationType0")}constructor(y){super(y,0)}};e.NotificationType0=I;var R=class extends s{static{i(this,"NotificationType1")}constructor(y,E=a.auto){super(y,1),this._parameterStructures=E}get parameterStructures(){return this._parameterStructures}};e.NotificationType1=R;var P=class extends s{static{i(this,"NotificationType2")}constructor(y){super(y,2)}};e.NotificationType2=P;var z=class extends s{static{i(this,"NotificationType3")}constructor(y){super(y,3)}};e.NotificationType3=z;var X=class extends s{static{i(this,"NotificationType4")}constructor(y){super(y,4)}};e.NotificationType4=X;var Z=class extends s{static{i(this,"NotificationType5")}constructor(y){super(y,5)}};e.NotificationType5=Z;var ce=class extends s{static{i(this,"NotificationType6")}constructor(y){super(y,6)}};e.NotificationType6=ce;var se=class extends s{static{i(this,"NotificationType7")}constructor(y){super(y,7)}};e.NotificationType7=se;var Se=class extends s{static{i(this,"NotificationType8")}constructor(y){super(y,8)}};e.NotificationType8=Se;var k=class extends s{static{i(this,"NotificationType9")}constructor(y){super(y,9)}};e.NotificationType9=k;var C;(function(y){function E(_){const O=_;return O&&t.string(O.method)&&(t.string(O.id)||t.number(O.id))}i(E,"isRequest"),y.isRequest=E;function T(_){const O=_;return O&&t.string(O.method)&&_.id===void 0}i(T,"isNotification"),y.isNotification=T;function $(_){const O=_;return O&&(O.result!==void 0||!!O.error)&&(t.string(O.id)||t.number(O.id)||O.id===null)}i($,"isResponse"),y.isResponse=$})(C||(e.Message=C={}))}}),Kg=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var r;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.Last})(r||(e.Touch=r={}));var n=class{static{i(this,"LinkedMap")}constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(s){return this._map.has(s)}get(s,o=r.None){const l=this._map.get(s);if(l)return o!==r.None&&this.touch(l,o),l.value}set(s,o,l=r.None){let u=this._map.get(s);if(u)u.value=o,l!==r.None&&this.touch(u,l);else{switch(u={key:s,value:o,next:void 0,previous:void 0},l){case r.None:this.addItemLast(u);break;case r.First:this.addItemFirst(u);break;case r.Last:this.addItemLast(u);break;default:this.addItemLast(u);break}this._map.set(s,u),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){const o=this._map.get(s);if(o)return this._map.delete(s),this.removeItem(o),this._size--,o.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,o){const l=this._state;let u=this._head;for(;u;){if(o?s.bind(o)(u.value,u.key,this):s(u.value,u.key,this),this._state!==l)throw new Error("LinkedMap got modified during iteration.");u=u.next}}keys(){const s=this._state;let o=this._head;const l={[Symbol.iterator]:()=>l,next:i(()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:o.key,done:!1};return o=o.next,u}else return{value:void 0,done:!0}},"next")};return l}values(){const s=this._state;let o=this._head;const l={[Symbol.iterator]:()=>l,next:i(()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:o.value,done:!1};return o=o.next,u}else return{value:void 0,done:!0}},"next")};return l}entries(){const s=this._state;let o=this._head;const l={[Symbol.iterator]:()=>l,next:i(()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:[o.key,o.value],done:!1};return o=o.next,u}else return{value:void 0,done:!0}},"next")};return l}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let o=this._head,l=this.size;for(;o&&l>s;)this._map.delete(o.key),o=o.next,l--;this._head=o,this._size=l,o&&(o.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw new Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw new Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw new Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw new Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{const o=s.next,l=s.previous;if(!o||!l)throw new Error("Invalid list");o.previous=l,l.next=o}s.next=void 0,s.previous=void 0,this._state++}touch(s,o){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(o!==r.First&&o!==r.Last)){if(o===r.First){if(s===this._head)return;const l=s.next,u=s.previous;s===this._tail?(u.next=void 0,this._tail=u):(l.previous=u,u.next=l),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(o===r.Last){if(s===this._tail)return;const l=s.next,u=s.previous;s===this._head?(l.previous=void 0,this._head=l):(l.previous=u,u.next=l),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){const s=[];return this.forEach((o,l)=>{s.push([l,o])}),s}fromJSON(s){this.clear();for(const[o,l]of s)this.set(o,l)}};e.LinkedMap=n;var a=class extends n{static{i(this,"LRUCache")}constructor(s,o=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,o),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,o=r.AsNew){return super.get(s,o)}peek(s){return super.get(s,r.None)}set(s,o){return super.set(s,o,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};e.LRUCache=a}}),_I=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var t;(function(r){function n(a){return{dispose:a}}i(n,"create"),r.create=n})(t||(e.Disposable=t={}))}}),SI=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var t=xl(),r;(function(l){l.Continue=0,l.Cancelled=1})(r||(r={}));var n=class{static{i(this,"SharedArraySenderStrategy")}constructor(){this.buffers=new Map}enableCancellation(l){if(l.id===null)return;const u=new SharedArrayBuffer(4),c=new Int32Array(u,0,1);c[0]=r.Continue,this.buffers.set(l.id,u),l.$cancellationData=u}async sendCancellation(l,u){const c=this.buffers.get(u);if(c===void 0)return;const f=new Int32Array(c,0,1);Atomics.store(f,0,r.Cancelled)}cleanup(l){this.buffers.delete(l)}dispose(){this.buffers.clear()}};e.SharedArraySenderStrategy=n;var a=class{static{i(this,"SharedArrayBufferCancellationToken")}constructor(l){this.data=new Int32Array(l,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},s=class{static{i(this,"SharedArrayBufferCancellationTokenSource")}constructor(l){this.token=new a(l)}cancel(){}dispose(){}},o=class{static{i(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(l){const u=l.$cancellationData;return u===void 0?new t.CancellationTokenSource:new s(u)}};e.SharedArrayReceiverStrategy=o}}),Wg=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var t=Dn(),r=class{static{i(this,"Semaphore")}constructor(n=1){if(n<=0)throw new Error("Capacity must be greater than 0");this._capacity=n,this._active=0,this._waiting=[]}lock(n){return new Promise((a,s)=>{this._waiting.push({thunk:n,resolve:a,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const n=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const a=n.thunk();a instanceof Promise?a.then(s=>{this._active--,n.resolve(s),this.runNext()},s=>{this._active--,n.reject(s),this.runNext()}):(this._active--,n.resolve(a),this.runNext())}catch(a){this._active--,n.reject(a),this.runNext()}}};e.Semaphore=r}}),wI=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var t=Dn(),r=Ms(),n=ei(),a=Wg(),s;(function(c){function f(d){let m=d;return m&&r.func(m.listen)&&r.func(m.dispose)&&r.func(m.onError)&&r.func(m.onClose)&&r.func(m.onPartialMessage)}i(f,"is"),c.is=f})(s||(e.MessageReader=s={}));var o=class{static{i(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(c){this.errorEmitter.fire(this.asError(c))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(c){this.partialMessageEmitter.fire(c)}asError(c){return c instanceof Error?c:new Error(`Reader received error. Reason: ${r.string(c.message)?c.message:"unknown"}`)}};e.AbstractMessageReader=o;var l;(function(c){function f(d){let m,g;const v=new Map;let b;const S=new Map;if(d===void 0||typeof d=="string")m=d??"utf-8";else{if(m=d.charset??"utf-8",d.contentDecoder!==void 0&&(g=d.contentDecoder,v.set(g.name,g)),d.contentDecoders!==void 0)for(const w of d.contentDecoders)v.set(w.name,w);if(d.contentTypeDecoder!==void 0&&(b=d.contentTypeDecoder,S.set(b.name,b)),d.contentTypeDecoders!==void 0)for(const w of d.contentTypeDecoders)S.set(w.name,w)}return b===void 0&&(b=(0,t.default)().applicationJson.decoder,S.set(b.name,b)),{charset:m,contentDecoder:g,contentDecoders:v,contentTypeDecoder:b,contentTypeDecoders:S}}i(f,"fromOptions"),c.fromOptions=f})(l||(l={}));var u=class extends o{static{i(this,"ReadableStreamMessageReader")}constructor(c,f){super(),this.readable=c,this.options=l.fromOptions(f),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new a.Semaphore(1)}set partialMessageTimeout(c){this._partialMessageTimeout=c}get partialMessageTimeout(){return this._partialMessageTimeout}listen(c){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=c;const f=this.readable.onData(d=>{this.onData(d)});return this.readable.onError(d=>this.fireError(d)),this.readable.onClose(()=>this.fireClose()),f}onData(c){try{for(this.buffer.append(c);;){if(this.nextMessageLength===-1){const d=this.buffer.tryReadHeaders(!0);if(!d)return;const m=d.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(d))}`));return}const g=parseInt(m);if(isNaN(g)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=g}const f=this.buffer.tryReadBody(this.nextMessageLength);if(f===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const d=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(f):f,m=await this.options.contentTypeDecoder.decode(d,this.options);this.callback(m)}).catch(d=>{this.fireError(d)})}}catch(f){this.fireError(f)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((c,f)=>{this.partialMessageTimer=void 0,c===this.messageToken&&(this.firePartialMessage({messageToken:c,waitingTime:f}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};e.ReadableStreamMessageReader=u}}),II=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var t=Dn(),r=Ms(),n=Wg(),a=ei(),s="Content-Length: ",o=`\r +`,l;(function(d){function m(g){let v=g;return v&&r.func(v.dispose)&&r.func(v.onClose)&&r.func(v.onError)&&r.func(v.write)}i(m,"is"),d.is=m})(l||(e.MessageWriter=l={}));var u=class{static{i(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new a.Emitter,this.closeEmitter=new a.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(d,m,g){this.errorEmitter.fire([this.asError(d),m,g])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(d){return d instanceof Error?d:new Error(`Writer received error. Reason: ${r.string(d.message)?d.message:"unknown"}`)}};e.AbstractMessageWriter=u;var c;(function(d){function m(g){return g===void 0||typeof g=="string"?{charset:g??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:g.charset??"utf-8",contentEncoder:g.contentEncoder,contentTypeEncoder:g.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}i(m,"fromOptions"),d.fromOptions=m})(c||(c={}));var f=class extends u{static{i(this,"WriteableStreamMessageWriter")}constructor(d,m){super(),this.writable=d,this.options=c.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(g=>this.fireError(g)),this.writable.onClose(()=>this.fireClose())}async write(d){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(d,this.options).then(g=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(g):g).then(g=>{const v=[];return v.push(s,g.byteLength.toString(),o),v.push(o),this.doWrite(d,v,g)},g=>{throw this.fireError(g),g}))}async doWrite(d,m,g){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(g)}catch(v){return this.handleError(v,d),Promise.reject(v)}}handleError(d,m){this.errorCount++,this.fireError(d,m,this.errorCount)}end(){this.writable.end()}};e.WriteableStreamMessageWriter=f}}),NI=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0;var t=13,r=10,n=`\r +`,a=class{static{i(this,"AbstractMessageBuffer")}constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const o=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(o),this._totalLength+=o.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let o=0,l=0,u=0,c=0;e:for(;lthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){const c=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(c)}if(this._chunks[0].byteLength>s){const c=this._chunks[0],f=this.asNative(c,s);return this._chunks[0]=c.slice(s),this._totalLength-=s,f}const o=this.allocNative(s);let l=0,u=0;for(;s>0;){const c=this._chunks[u];if(c.byteLength>s){const f=c.slice(0,s);o.set(f,l),l+=s,this._chunks[u]=c.slice(s),this._totalLength-=s,s-=s}else o.set(c,l),l+=c.byteLength,this._chunks.shift(),this._totalLength-=c.byteLength,s-=c.byteLength}return o}};e.AbstractMessageBuffer=a}}),PI=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;var t=Dn(),r=Ms(),n=Bg(),a=Kg(),s=ei(),o=xl(),l;(function(y){y.type=new n.NotificationType("$/cancelRequest")})(l||(l={}));var u;(function(y){function E(T){return typeof T=="string"||typeof T=="number"}i(E,"is"),y.is=E})(u||(e.ProgressToken=u={}));var c;(function(y){y.type=new n.NotificationType("$/progress")})(c||(c={}));var f=class{static{i(this,"ProgressType")}constructor(){}};e.ProgressType=f;var d;(function(y){function E(T){return r.func(T)}i(E,"is"),y.is=E})(d||(d={})),e.NullLogger=Object.freeze({error:i(()=>{},"error"),warn:i(()=>{},"warn"),info:i(()=>{},"info"),log:i(()=>{},"log")});var m;(function(y){y[y.Off=0]="Off",y[y.Messages=1]="Messages",y[y.Compact=2]="Compact",y[y.Verbose=3]="Verbose"})(m||(e.Trace=m={}));var g;(function(y){y.Off="off",y.Messages="messages",y.Compact="compact",y.Verbose="verbose"})(g||(e.TraceValues=g={})),(function(y){function E($){if(!r.string($))return y.Off;switch($=$.toLowerCase(),$){case"off":return y.Off;case"messages":return y.Messages;case"compact":return y.Compact;case"verbose":return y.Verbose;default:return y.Off}}i(E,"fromString"),y.fromString=E;function T($){switch($){case y.Off:return"off";case y.Messages:return"messages";case y.Compact:return"compact";case y.Verbose:return"verbose";default:return"off"}}i(T,"toString"),y.toString=T})(m||(e.Trace=m={}));var v;(function(y){y.Text="text",y.JSON="json"})(v||(e.TraceFormat=v={})),(function(y){function E(T){return r.string(T)?(T=T.toLowerCase(),T==="json"?y.JSON:y.Text):y.Text}i(E,"fromString"),y.fromString=E})(v||(e.TraceFormat=v={}));var b;(function(y){y.type=new n.NotificationType("$/setTrace")})(b||(e.SetTraceNotification=b={}));var S;(function(y){y.type=new n.NotificationType("$/logTrace")})(S||(e.LogTraceNotification=S={}));var w;(function(y){y[y.Closed=1]="Closed",y[y.Disposed=2]="Disposed",y[y.AlreadyListening=3]="AlreadyListening"})(w||(e.ConnectionErrors=w={}));var I=class Vg extends Error{static{i(this,"ConnectionError")}constructor(E,T){super(T),this.code=E,Object.setPrototypeOf(this,Vg.prototype)}};e.ConnectionError=I;var R;(function(y){function E(T){const $=T;return $&&r.func($.cancelUndispatched)}i(E,"is"),y.is=E})(R||(e.ConnectionStrategy=R={}));var P;(function(y){function E(T){const $=T;return $&&($.kind===void 0||$.kind==="id")&&r.func($.createCancellationTokenSource)&&($.dispose===void 0||r.func($.dispose))}i(E,"is"),y.is=E})(P||(e.IdCancellationReceiverStrategy=P={}));var z;(function(y){function E(T){const $=T;return $&&$.kind==="request"&&r.func($.createCancellationTokenSource)&&($.dispose===void 0||r.func($.dispose))}i(E,"is"),y.is=E})(z||(e.RequestCancellationReceiverStrategy=z={}));var X;(function(y){y.Message=Object.freeze({createCancellationTokenSource(T){return new o.CancellationTokenSource}});function E(T){return P.is(T)||z.is(T)}i(E,"is"),y.is=E})(X||(e.CancellationReceiverStrategy=X={}));var Z;(function(y){y.Message=Object.freeze({sendCancellation(T,$){return T.sendNotification(l.type,{id:$})},cleanup(T){}});function E(T){const $=T;return $&&r.func($.sendCancellation)&&r.func($.cleanup)}i(E,"is"),y.is=E})(Z||(e.CancellationSenderStrategy=Z={}));var ce;(function(y){y.Message=Object.freeze({receiver:X.Message,sender:Z.Message});function E(T){const $=T;return $&&X.is($.receiver)&&Z.is($.sender)}i(E,"is"),y.is=E})(ce||(e.CancellationStrategy=ce={}));var se;(function(y){function E(T){const $=T;return $&&r.func($.handleMessage)}i(E,"is"),y.is=E})(se||(e.MessageStrategy=se={}));var Se;(function(y){function E(T){const $=T;return $&&(ce.is($.cancellationStrategy)||R.is($.connectionStrategy)||se.is($.messageStrategy))}i(E,"is"),y.is=E})(Se||(e.ConnectionOptions=Se={}));var k;(function(y){y[y.New=1]="New",y[y.Listening=2]="Listening",y[y.Closed=3]="Closed",y[y.Disposed=4]="Disposed"})(k||(k={}));function C(y,E,T,$){const _=T!==void 0?T:e.NullLogger;let O=0,x=0,D=0;const G="2.0";let W;const Y=new Map;let V;const Pe=new Map,oe=new Map;let Le,De=new a.LinkedMap,ke=new Map,Ze=new Set,Je=new Map,ne=m.Off,Kt=v.Text,Ee,kt=k.New;const ra=new s.Emitter,fi=new s.Emitter,di=new s.Emitter,pi=new s.Emitter,mi=new s.Emitter,Ot=$&&$.cancellationStrategy?$.cancellationStrategy:ce.Message;function na(h){if(h===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+h.toString()}i(na,"createRequestQueueKey");function hi(h){return h===null?"res-unknown-"+(++D).toString():"res-"+h.toString()}i(hi,"createResponseQueueKey");function yi(){return"not-"+(++x).toString()}i(yi,"createNotificationQueueKey");function gi(h,N){n.Message.isRequest(N)?h.set(na(N.id),N):n.Message.isResponse(N)?h.set(hi(N.id),N):h.set(yi(),N)}i(gi,"addMessageToQueue");function vi(h){}i(vi,"cancelUndispatched");function aa(){return kt===k.Listening}i(aa,"isListening");function ia(){return kt===k.Closed}i(ia,"isClosed");function Wt(){return kt===k.Disposed}i(Wt,"isDisposed");function sa(){(kt===k.New||kt===k.Listening)&&(kt=k.Closed,fi.fire(void 0))}i(sa,"closeHandler");function Ti(h){ra.fire([h,void 0,void 0])}i(Ti,"readErrorHandler");function $i(h){ra.fire(h)}i($i,"writeErrorHandler"),y.onClose(sa),y.onError(Ti),E.onClose(sa),E.onError($i);function oa(){Le||De.size===0||(Le=(0,t.default)().timer.setImmediate(()=>{Le=void 0,Ri()}))}i(oa,"triggerMessageQueue");function la(h){n.Message.isRequest(h)?Ai(h):n.Message.isNotification(h)?Ci(h):n.Message.isResponse(h)?Ei(h):bi(h)}i(la,"handleMessage");function Ri(){if(De.size===0)return;const h=De.shift();try{const N=$?.messageStrategy;se.is(N)?N.handleMessage(h,la):la(h)}finally{oa()}}i(Ri,"processMessageQueue");const no=i(h=>{try{if(n.Message.isNotification(h)&&h.method===l.type.method){const N=h.params.id,L=na(N),M=De.get(L);if(n.Message.isRequest(M)){const fe=$?.connectionStrategy,Ce=fe&&fe.cancelUndispatched?fe.cancelUndispatched(M,vi):void 0;if(Ce&&(Ce.error!==void 0||Ce.result!==void 0)){De.delete(L),Je.delete(N),Ce.id=M.id,Lr(Ce,h.method,Date.now()),E.write(Ce).catch(()=>_.error("Sending response for canceled message failed."));return}}const he=Je.get(N);if(he!==void 0){he.cancel(),Jr(h);return}else Ze.add(N)}gi(De,h)}finally{oa()}},"callback");function Ai(h){if(Wt())return;function N(te,$e,le){const xe={jsonrpc:G,id:h.id};te instanceof n.ResponseError?xe.error=te.toJson():xe.result=te===void 0?null:te,Lr(xe,$e,le),E.write(xe).catch(()=>_.error("Sending response failed."))}i(N,"reply");function L(te,$e,le){const xe={jsonrpc:G,id:h.id,error:te.toJson()};Lr(xe,$e,le),E.write(xe).catch(()=>_.error("Sending response failed."))}i(L,"replyError");function M(te,$e,le){te===void 0&&(te=null);const xe={jsonrpc:G,id:h.id,result:te};Lr(xe,$e,le),E.write(xe).catch(()=>_.error("Sending response failed."))}i(M,"replySuccess"),wi(h);const he=Y.get(h.method);let fe,Ce;he&&(fe=he.type,Ce=he.handler);const we=Date.now();if(Ce||W){const te=h.id??String(Date.now()),$e=P.is(Ot.receiver)?Ot.receiver.createCancellationTokenSource(te):Ot.receiver.createCancellationTokenSource(h);h.id!==null&&Ze.has(h.id)&&$e.cancel(),h.id!==null&&Je.set(te,$e);try{let le;if(Ce)if(h.params===void 0){if(fe!==void 0&&fe.numberOfParams!==0){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${h.method} defines ${fe.numberOfParams} params but received none.`),h.method,we);return}le=Ce($e.token)}else if(Array.isArray(h.params)){if(fe!==void 0&&fe.parameterStructures===n.ParameterStructures.byName){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${h.method} defines parameters by name but received parameters by position`),h.method,we);return}le=Ce(...h.params,$e.token)}else{if(fe!==void 0&&fe.parameterStructures===n.ParameterStructures.byPosition){L(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${h.method} defines parameters by position but received parameters by name`),h.method,we);return}le=Ce(h.params,$e.token)}else W&&(le=W(h.method,h.params,$e.token));const xe=le;le?xe.then?xe.then(Qe=>{Je.delete(te),N(Qe,h.method,we)},Qe=>{Je.delete(te),Qe instanceof n.ResponseError?L(Qe,h.method,we):Qe&&r.string(Qe.message)?L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${h.method} failed with message: ${Qe.message}`),h.method,we):L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${h.method} failed unexpectedly without providing any details.`),h.method,we)}):(Je.delete(te),N(le,h.method,we)):(Je.delete(te),M(le,h.method,we))}catch(le){Je.delete(te),le instanceof n.ResponseError?N(le,h.method,we):le&&r.string(le.message)?L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${h.method} failed with message: ${le.message}`),h.method,we):L(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${h.method} failed unexpectedly without providing any details.`),h.method,we)}}else L(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${h.method}`),h.method,we)}i(Ai,"handleRequest");function Ei(h){if(!Wt())if(h.id===null)h.error?_.error(`Received response message without id: Error is: +${JSON.stringify(h.error,void 0,4)}`):_.error("Received response message without id. No further error information provided.");else{const N=h.id,L=ke.get(N);if(Ii(h,L),L!==void 0){ke.delete(N);try{if(h.error){const M=h.error;L.reject(new n.ResponseError(M.code,M.message,M.data))}else if(h.result!==void 0)L.resolve(h.result);else throw new Error("Should never happen.")}catch(M){M.message?_.error(`Response handler '${L.method}' failed with message: ${M.message}`):_.error(`Response handler '${L.method}' failed unexpectedly.`)}}}}i(Ei,"handleResponse");function Ci(h){if(Wt())return;let N,L;if(h.method===l.type.method){const M=h.params.id;Ze.delete(M),Jr(h);return}else{const M=Pe.get(h.method);M&&(L=M.handler,N=M.type)}if(L||V)try{if(Jr(h),L)if(h.params===void 0)N!==void 0&&N.numberOfParams!==0&&N.parameterStructures!==n.ParameterStructures.byName&&_.error(`Notification ${h.method} defines ${N.numberOfParams} params but received none.`),L();else if(Array.isArray(h.params)){const M=h.params;h.method===c.type.method&&M.length===2&&u.is(M[0])?L({token:M[0],value:M[1]}):(N!==void 0&&(N.parameterStructures===n.ParameterStructures.byName&&_.error(`Notification ${h.method} defines parameters by name but received parameters by position`),N.numberOfParams!==h.params.length&&_.error(`Notification ${h.method} defines ${N.numberOfParams} params but received ${M.length} arguments`)),L(...M))}else N!==void 0&&N.parameterStructures===n.ParameterStructures.byPosition&&_.error(`Notification ${h.method} defines parameters by position but received parameters by name`),L(h.params);else V&&V(h.method,h.params)}catch(M){M.message?_.error(`Notification handler '${h.method}' failed with message: ${M.message}`):_.error(`Notification handler '${h.method}' failed unexpectedly.`)}else di.fire(h)}i(Ci,"handleNotification");function bi(h){if(!h){_.error("Received empty message.");return}_.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(h,null,4)}`);const N=h;if(r.string(N.id)||r.number(N.id)){const L=N.id,M=ke.get(L);M&&M.reject(new Error("The received response has neither a result nor an error property."))}}i(bi,"handleInvalidMessage");function bt(h){if(h!=null)switch(ne){case m.Verbose:return JSON.stringify(h,null,4);case m.Compact:return JSON.stringify(h);default:return}}i(bt,"stringifyTrace");function _i(h){if(!(ne===m.Off||!Ee))if(Kt===v.Text){let N;(ne===m.Verbose||ne===m.Compact)&&h.params&&(N=`Params: ${bt(h.params)} + +`),Ee.log(`Sending request '${h.method} - (${h.id})'.`,N)}else Vt("send-request",h)}i(_i,"traceSendingRequest");function Si(h){if(!(ne===m.Off||!Ee))if(Kt===v.Text){let N;(ne===m.Verbose||ne===m.Compact)&&(h.params?N=`Params: ${bt(h.params)} + +`:N=`No parameters provided. + +`),Ee.log(`Sending notification '${h.method}'.`,N)}else Vt("send-notification",h)}i(Si,"traceSendingNotification");function Lr(h,N,L){if(!(ne===m.Off||!Ee))if(Kt===v.Text){let M;(ne===m.Verbose||ne===m.Compact)&&(h.error&&h.error.data?M=`Error data: ${bt(h.error.data)} + +`:h.result?M=`Result: ${bt(h.result)} + +`:h.error===void 0&&(M=`No result returned. + +`)),Ee.log(`Sending response '${N} - (${h.id})'. Processing request took ${Date.now()-L}ms`,M)}else Vt("send-response",h)}i(Lr,"traceSendingResponse");function wi(h){if(!(ne===m.Off||!Ee))if(Kt===v.Text){let N;(ne===m.Verbose||ne===m.Compact)&&h.params&&(N=`Params: ${bt(h.params)} + +`),Ee.log(`Received request '${h.method} - (${h.id})'.`,N)}else Vt("receive-request",h)}i(wi,"traceReceivedRequest");function Jr(h){if(!(ne===m.Off||!Ee||h.method===S.type.method))if(Kt===v.Text){let N;(ne===m.Verbose||ne===m.Compact)&&(h.params?N=`Params: ${bt(h.params)} + +`:N=`No parameters provided. + +`),Ee.log(`Received notification '${h.method}'.`,N)}else Vt("receive-notification",h)}i(Jr,"traceReceivedNotification");function Ii(h,N){if(!(ne===m.Off||!Ee))if(Kt===v.Text){let L;if((ne===m.Verbose||ne===m.Compact)&&(h.error&&h.error.data?L=`Error data: ${bt(h.error.data)} + +`:h.result?L=`Result: ${bt(h.result)} + +`:h.error===void 0&&(L=`No result returned. + +`)),N){const M=h.error?` Request failed: ${h.error.message} (${h.error.code}).`:"";Ee.log(`Received response '${N.method} - (${h.id})' in ${Date.now()-N.timerStart}ms.${M}`,L)}else Ee.log(`Received response ${h.id} without active response promise.`,L)}else Vt("receive-response",h)}i(Ii,"traceReceivedResponse");function Vt(h,N){if(!Ee||ne===m.Off)return;const L={isLSPMessage:!0,type:h,message:N,timestamp:Date.now()};Ee.log(L)}i(Vt,"logLSPMessage");function cr(){if(ia())throw new I(w.Closed,"Connection is closed.");if(Wt())throw new I(w.Disposed,"Connection is disposed.")}i(cr,"throwIfClosedOrDisposed");function Ni(){if(aa())throw new I(w.AlreadyListening,"Connection is already listening")}i(Ni,"throwIfListening");function Pi(){if(!aa())throw new Error("Call listen() first.")}i(Pi,"throwIfNotListening");function fr(h){return h===void 0?null:h}i(fr,"undefinedToNull");function ua(h){if(h!==null)return h}i(ua,"nullToUndefined");function p(h){return h!=null&&!Array.isArray(h)&&typeof h=="object"}i(p,"isNamedParam");function ae(h,N){switch(h){case n.ParameterStructures.auto:return p(N)?ua(N):[fr(N)];case n.ParameterStructures.byName:if(!p(N))throw new Error("Received parameters by name but param is not an object literal.");return ua(N);case n.ParameterStructures.byPosition:return[fr(N)];default:throw new Error(`Unknown parameter structure ${h.toString()}`)}}i(ae,"computeSingleParam");function Te(h,N){let L;const M=h.numberOfParams;switch(M){case 0:L=void 0;break;case 1:L=ae(h.parameterStructures,N[0]);break;default:L=[];for(let he=0;he{cr();let L,M;if(r.string(h)){L=h;const fe=N[0];let Ce=0,we=n.ParameterStructures.auto;n.ParameterStructures.is(fe)&&(Ce=1,we=fe);let te=N.length;const $e=te-Ce;switch($e){case 0:M=void 0;break;case 1:M=ae(we,N[Ce]);break;default:if(we===n.ParameterStructures.byName)throw new Error(`Received ${$e} parameters for 'by Name' notification parameter structure.`);M=N.slice(Ce,te).map(le=>fr(le));break}}else{const fe=N;L=h.method,M=Te(h,fe)}const he={jsonrpc:G,method:L,params:M};return Si(he),E.write(he).catch(fe=>{throw _.error("Sending notification failed."),fe})},"sendNotification"),onNotification:i((h,N)=>{cr();let L;return r.func(h)?V=h:N&&(r.string(h)?(L=h,Pe.set(h,{type:void 0,handler:N})):(L=h.method,Pe.set(h.method,{type:h,handler:N}))),{dispose:i(()=>{L!==void 0?Pe.delete(L):V=void 0},"dispose")}},"onNotification"),onProgress:i((h,N,L)=>{if(oe.has(N))throw new Error(`Progress handler for token ${N} already registered`);return oe.set(N,L),{dispose:i(()=>{oe.delete(N)},"dispose")}},"onProgress"),sendProgress:i((h,N,L)=>q.sendNotification(c.type,{token:N,value:L}),"sendProgress"),onUnhandledProgress:pi.event,sendRequest:i((h,...N)=>{cr(),Pi();let L,M,he;if(r.string(h)){L=h;const te=N[0],$e=N[N.length-1];let le=0,xe=n.ParameterStructures.auto;n.ParameterStructures.is(te)&&(le=1,xe=te);let Qe=N.length;o.CancellationToken.is($e)&&(Qe=Qe-1,he=$e);const qt=Qe-le;switch(qt){case 0:M=void 0;break;case 1:M=ae(xe,N[le]);break;default:if(xe===n.ParameterStructures.byName)throw new Error(`Received ${qt} parameters for 'by Name' request parameter structure.`);M=N.slice(le,Qe).map($I=>fr($I));break}}else{const te=N;L=h.method,M=Te(h,te);const $e=h.numberOfParams;he=o.CancellationToken.is(te[$e])?te[$e]:void 0}const fe=O++;let Ce;he&&(Ce=he.onCancellationRequested(()=>{const te=Ot.sender.sendCancellation(q,fe);return te===void 0?(_.log(`Received no promise from cancellation strategy when cancelling id ${fe}`),Promise.resolve()):te.catch(()=>{_.log(`Sending cancellation messages for id ${fe} failed`)})}));const we={jsonrpc:G,id:fe,method:L,params:M};return _i(we),typeof Ot.sender.enableCancellation=="function"&&Ot.sender.enableCancellation(we),new Promise(async(te,$e)=>{const le=i(qt=>{te(qt),Ot.sender.cleanup(fe),Ce?.dispose()},"resolveWithCleanup"),xe=i(qt=>{$e(qt),Ot.sender.cleanup(fe),Ce?.dispose()},"rejectWithCleanup"),Qe={method:L,timerStart:Date.now(),resolve:le,reject:xe};try{await E.write(we),ke.set(fe,Qe)}catch(qt){throw _.error("Sending request failed."),Qe.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,qt.message?qt.message:"Unknown reason")),qt}})},"sendRequest"),onRequest:i((h,N)=>{cr();let L=null;return d.is(h)?(L=void 0,W=h):r.string(h)?(L=null,N!==void 0&&(L=h,Y.set(h,{handler:N,type:void 0}))):N!==void 0&&(L=h.method,Y.set(h.method,{type:h,handler:N})),{dispose:i(()=>{L!==null&&(L!==void 0?Y.delete(L):W=void 0)},"dispose")}},"onRequest"),hasPendingResponse:i(()=>ke.size>0,"hasPendingResponse"),trace:i(async(h,N,L)=>{let M=!1,he=v.Text;L!==void 0&&(r.boolean(L)?M=L:(M=L.sendNotification||!1,he=L.traceFormat||v.Text)),ne=h,Kt=he,ne===m.Off?Ee=void 0:Ee=N,M&&!ia()&&!Wt()&&await q.sendNotification(b.type,{value:m.toString(h)})},"trace"),onError:ra.event,onClose:fi.event,onUnhandledNotification:di.event,onDispose:mi.event,end:i(()=>{E.end()},"end"),dispose:i(()=>{if(Wt())return;kt=k.Disposed,mi.fire(void 0);const h=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const N of ke.values())N.reject(h);ke=new Map,Je=new Map,Ze=new Set,De=new a.LinkedMap,r.func(E.dispose)&&E.dispose(),r.func(y.dispose)&&y.dispose()},"dispose"),listen:i(()=>{cr(),Ni(),kt=k.Listening,y.listen(no)},"listen"),inspect:i(()=>{(0,t.default)().console.log("inspect")},"inspect")};return q.onNotification(S.type,h=>{if(ne===m.Off||!Ee)return;const N=ne===m.Verbose||ne===m.Compact;Ee.log(h.message,N?h.verbose:void 0)}),q.onNotification(c.type,h=>{const N=oe.get(h.token);N?N(h.value):pi.fire(h)}),q}i(C,"createMessageConnection"),e.createMessageConnection=C}}),Af=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;var t=Bg();Object.defineProperty(e,"Message",{enumerable:!0,get:i(function(){return t.Message},"get")}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:i(function(){return t.RequestType},"get")}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:i(function(){return t.RequestType0},"get")}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:i(function(){return t.RequestType1},"get")}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:i(function(){return t.RequestType2},"get")}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:i(function(){return t.RequestType3},"get")}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:i(function(){return t.RequestType4},"get")}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:i(function(){return t.RequestType5},"get")}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:i(function(){return t.RequestType6},"get")}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:i(function(){return t.RequestType7},"get")}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:i(function(){return t.RequestType8},"get")}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:i(function(){return t.RequestType9},"get")}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:i(function(){return t.ResponseError},"get")}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:i(function(){return t.ErrorCodes},"get")}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:i(function(){return t.NotificationType},"get")}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:i(function(){return t.NotificationType0},"get")}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:i(function(){return t.NotificationType1},"get")}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:i(function(){return t.NotificationType2},"get")}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:i(function(){return t.NotificationType3},"get")}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:i(function(){return t.NotificationType4},"get")}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:i(function(){return t.NotificationType5},"get")}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:i(function(){return t.NotificationType6},"get")}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:i(function(){return t.NotificationType7},"get")}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:i(function(){return t.NotificationType8},"get")}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:i(function(){return t.NotificationType9},"get")}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:i(function(){return t.ParameterStructures},"get")});var r=Kg();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:i(function(){return r.LinkedMap},"get")}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:i(function(){return r.LRUCache},"get")}),Object.defineProperty(e,"Touch",{enumerable:!0,get:i(function(){return r.Touch},"get")});var n=_I();Object.defineProperty(e,"Disposable",{enumerable:!0,get:i(function(){return n.Disposable},"get")});var a=ei();Object.defineProperty(e,"Event",{enumerable:!0,get:i(function(){return a.Event},"get")}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:i(function(){return a.Emitter},"get")});var s=xl();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:i(function(){return s.CancellationTokenSource},"get")}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:i(function(){return s.CancellationToken},"get")});var o=SI();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:i(function(){return o.SharedArraySenderStrategy},"get")}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:i(function(){return o.SharedArrayReceiverStrategy},"get")});var l=wI();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:i(function(){return l.MessageReader},"get")}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:i(function(){return l.AbstractMessageReader},"get")}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:i(function(){return l.ReadableStreamMessageReader},"get")});var u=II();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:i(function(){return u.MessageWriter},"get")}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:i(function(){return u.AbstractMessageWriter},"get")}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:i(function(){return u.WriteableStreamMessageWriter},"get")});var c=NI();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:i(function(){return c.AbstractMessageBuffer},"get")});var f=PI();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:i(function(){return f.ConnectionStrategy},"get")}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:i(function(){return f.ConnectionOptions},"get")}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:i(function(){return f.NullLogger},"get")}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:i(function(){return f.createMessageConnection},"get")}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:i(function(){return f.ProgressToken},"get")}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:i(function(){return f.ProgressType},"get")}),Object.defineProperty(e,"Trace",{enumerable:!0,get:i(function(){return f.Trace},"get")}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:i(function(){return f.TraceValues},"get")}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:i(function(){return f.TraceFormat},"get")}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:i(function(){return f.SetTraceNotification},"get")}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:i(function(){return f.LogTraceNotification},"get")}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:i(function(){return f.ConnectionErrors},"get")}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:i(function(){return f.ConnectionError},"get")}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:i(function(){return f.CancellationReceiverStrategy},"get")}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:i(function(){return f.CancellationSenderStrategy},"get")}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:i(function(){return f.CancellationStrategy},"get")}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:i(function(){return f.MessageStrategy},"get")});var d=Dn();e.RAL=d.default}}),kI=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Af(),r=class qg extends t.AbstractMessageBuffer{static{i(this,"MessageBuffer")}constructor(c="utf-8"){super(c),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return qg.emptyBuffer}fromString(c,f){return new TextEncoder().encode(c)}toString(c,f){return f==="ascii"?this.asciiDecoder.decode(c):new TextDecoder(f).decode(c)}asNative(c,f){return f===void 0?c:c.slice(0,f)}allocNative(c){return new Uint8Array(c)}};r.emptyBuffer=new Uint8Array(0);var n=class{static{i(this,"ReadableStreamWrapper")}constructor(u){this.socket=u,this._onData=new t.Emitter,this._messageListener=c=>{c.data.arrayBuffer().then(d=>{this._onData.fire(new Uint8Array(d))},()=>{(0,t.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(u){return this.socket.addEventListener("close",u),t.Disposable.create(()=>this.socket.removeEventListener("close",u))}onError(u){return this.socket.addEventListener("error",u),t.Disposable.create(()=>this.socket.removeEventListener("error",u))}onEnd(u){return this.socket.addEventListener("end",u),t.Disposable.create(()=>this.socket.removeEventListener("end",u))}onData(u){return this._onData.event(u)}},a=class{static{i(this,"WritableStreamWrapper")}constructor(u){this.socket=u}onClose(u){return this.socket.addEventListener("close",u),t.Disposable.create(()=>this.socket.removeEventListener("close",u))}onError(u){return this.socket.addEventListener("error",u),t.Disposable.create(()=>this.socket.removeEventListener("error",u))}onEnd(u){return this.socket.addEventListener("end",u),t.Disposable.create(()=>this.socket.removeEventListener("end",u))}write(u,c){if(typeof u=="string"){if(c!==void 0&&c!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${c}`);this.socket.send(u)}else this.socket.send(u);return Promise.resolve()}end(){this.socket.close()}},s=new TextEncoder,o=Object.freeze({messageBuffer:Object.freeze({create:i(u=>new r(u),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:i((u,c)=>{if(c.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${c.charset}`);return Promise.resolve(s.encode(JSON.stringify(u,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:i((u,c)=>{if(!(u instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(c.charset).decode(u)))},"decode")})}),stream:Object.freeze({asReadableStream:i(u=>new n(u),"asReadableStream"),asWritableStream:i(u=>new a(u),"asWritableStream")}),console,timer:Object.freeze({setTimeout(u,c,...f){const d=setTimeout(u,c,...f);return{dispose:i(()=>clearTimeout(d),"dispose")}},setImmediate(u,...c){const f=setTimeout(u,0,...c);return{dispose:i(()=>clearTimeout(f),"dispose")}},setInterval(u,c,...f){const d=setInterval(u,c,...f);return{dispose:i(()=>clearInterval(d),"dispose")}}})});function l(){return o}i(l,"RIL"),(function(u){function c(){t.RAL.install(o)}i(c,"install"),u.install=c})(l||(l={})),e.default=l}}),ti=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(e){var t=e&&e.__createBinding||(Object.create?(function(u,c,f,d){d===void 0&&(d=f);var m=Object.getOwnPropertyDescriptor(c,f);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:i(function(){return c[f]},"get")}),Object.defineProperty(u,d,m)}):(function(u,c,f,d){d===void 0&&(d=f),u[d]=c[f]})),r=e&&e.__exportStar||function(u,c){for(var f in u)f!=="default"&&!Object.prototype.hasOwnProperty.call(c,f)&&t(c,u,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0;var n=kI();n.default.install();var a=Af();r(Af(),e);var s=class extends a.AbstractMessageReader{static{i(this,"BrowserMessageReader")}constructor(u){super(),this._onData=new a.Emitter,this._messageListener=c=>{this._onData.fire(c.data)},u.addEventListener("error",c=>this.fireError(c)),u.onmessage=this._messageListener}listen(u){return this._onData.event(u)}};e.BrowserMessageReader=s;var o=class extends a.AbstractMessageWriter{static{i(this,"BrowserMessageWriter")}constructor(u){super(),this.port=u,this.errorCount=0,u.addEventListener("error",c=>this.fireError(c))}write(u){try{return this.port.postMessage(u),Promise.resolve()}catch(c){return this.handleError(c,u),Promise.reject(c)}}handleError(u,c){this.errorCount++,this.fireError(u,c,this.errorCount)}end(){}};e.BrowserMessageWriter=o;function l(u,c,f,d){return f===void 0&&(f=a.NullLogger),a.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,a.createMessageConnection)(u,c,f,d)}i(l,"createMessageConnection"),e.createMessageConnection=l}}),uh=H({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(e,t){t.exports=ti()}}),Ae=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var t=ti(),r;(function(u){u.clientToServer="clientToServer",u.serverToClient="serverToClient",u.both="both"})(r||(e.MessageDirection=r={}));var n=class{static{i(this,"RegistrationType")}constructor(u){this.method=u}};e.RegistrationType=n;var a=class extends t.RequestType0{static{i(this,"ProtocolRequestType0")}constructor(u){super(u)}};e.ProtocolRequestType0=a;var s=class extends t.RequestType{static{i(this,"ProtocolRequestType")}constructor(u){super(u,t.ParameterStructures.byName)}};e.ProtocolRequestType=s;var o=class extends t.NotificationType0{static{i(this,"ProtocolNotificationType0")}constructor(u){super(u)}};e.ProtocolNotificationType0=o;var l=class extends t.NotificationType{static{i(this,"ProtocolNotificationType")}constructor(u){super(u,t.ParameterStructures.byName)}};e.ProtocolNotificationType=l}}),_d=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(f){return f===!0||f===!1}i(t,"boolean"),e.boolean=t;function r(f){return typeof f=="string"||f instanceof String}i(r,"string"),e.string=r;function n(f){return typeof f=="number"||f instanceof Number}i(n,"number"),e.number=n;function a(f){return f instanceof Error}i(a,"error"),e.error=a;function s(f){return typeof f=="function"}i(s,"func"),e.func=s;function o(f){return Array.isArray(f)}i(o,"array"),e.array=o;function l(f){return o(f)&&f.every(d=>r(d))}i(l,"stringArray"),e.stringArray=l;function u(f,d){return Array.isArray(f)&&f.every(d)}i(u,"typedArray"),e.typedArray=u;function c(f){return f!==null&&typeof f=="object"}i(c,"objectLiteral"),e.objectLiteral=c}}),OI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var t=Ae(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ImplementationRequest=r={}))}}),LI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var t=Ae(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.TypeDefinitionRequest=r={}))}}),DI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var t=Ae(),r;(function(a){a.method="workspace/workspaceFolders",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)})(r||(e.WorkspaceFoldersRequest=r={}));var n;(function(a){a.method="workspace/didChangeWorkspaceFolders",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolNotificationType(a.method)})(n||(e.DidChangeWorkspaceFoldersNotification=n={}))}}),xI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var t=Ae(),r;(function(n){n.method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ConfigurationRequest=r={}))}}),MI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var t=Ae(),r;(function(a){a.method="textDocument/documentColor",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.DocumentColorRequest=r={}));var n;(function(a){a.method="textDocument/colorPresentation",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(n||(e.ColorPresentationRequest=n={}))}}),GI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var t=Ae(),r;(function(a){a.method="textDocument/foldingRange",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.FoldingRangeRequest=r={}));var n;(function(a){a.method="workspace/foldingRange/refresh",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)})(n||(e.FoldingRangeRefreshRequest=n={}))}}),FI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var t=Ae(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.DeclarationRequest=r={}))}}),zI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var t=Ae(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.SelectionRangeRequest=r={}))}}),jI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var t=ti(),r=Ae(),n;(function(o){o.type=new t.ProgressType;function l(u){return u===o.type}i(l,"is"),o.is=l})(n||(e.WorkDoneProgress=n={}));var a;(function(o){o.method="window/workDoneProgress/create",o.messageDirection=r.MessageDirection.serverToClient,o.type=new r.ProtocolRequestType(o.method)})(a||(e.WorkDoneProgressCreateRequest=a={}));var s;(function(o){o.method="window/workDoneProgress/cancel",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolNotificationType(o.method)})(s||(e.WorkDoneProgressCancelNotification=s={}))}}),BI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var t=Ae(),r;(function(s){s.method="textDocument/prepareCallHierarchy",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(r||(e.CallHierarchyPrepareRequest=r={}));var n;(function(s){s.method="callHierarchy/incomingCalls",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(n||(e.CallHierarchyIncomingCallsRequest=n={}));var a;(function(s){s.method="callHierarchy/outgoingCalls",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(a||(e.CallHierarchyOutgoingCallsRequest=a={}))}}),UI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var t=Ae(),r;(function(u){u.Relative="relative"})(r||(e.TokenFormat=r={}));var n;(function(u){u.method="textDocument/semanticTokens",u.type=new t.RegistrationType(u.method)})(n||(e.SemanticTokensRegistrationType=n={}));var a;(function(u){u.method="textDocument/semanticTokens/full",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method),u.registrationMethod=n.method})(a||(e.SemanticTokensRequest=a={}));var s;(function(u){u.method="textDocument/semanticTokens/full/delta",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method),u.registrationMethod=n.method})(s||(e.SemanticTokensDeltaRequest=s={}));var o;(function(u){u.method="textDocument/semanticTokens/range",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method),u.registrationMethod=n.method})(o||(e.SemanticTokensRangeRequest=o={}));var l;(function(u){u.method="workspace/semanticTokens/refresh",u.messageDirection=t.MessageDirection.serverToClient,u.type=new t.ProtocolRequestType0(u.method)})(l||(e.SemanticTokensRefreshRequest=l={}))}}),KI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var t=Ae(),r;(function(n){n.method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)})(r||(e.ShowDocumentRequest=r={}))}}),WI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var t=Ae(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(r||(e.LinkedEditingRangeRequest=r={}))}}),VI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;var t=Ae(),r;(function(c){c.file="file",c.folder="folder"})(r||(e.FileOperationPatternKind=r={}));var n;(function(c){c.method="workspace/willCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(n||(e.WillCreateFilesRequest=n={}));var a;(function(c){c.method="workspace/didCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(a||(e.DidCreateFilesNotification=a={}));var s;(function(c){c.method="workspace/willRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(s||(e.WillRenameFilesRequest=s={}));var o;(function(c){c.method="workspace/didRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(o||(e.DidRenameFilesNotification=o={}));var l;(function(c){c.method="workspace/didDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(l||(e.DidDeleteFilesNotification=l={}));var u;(function(c){c.method="workspace/willDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(u||(e.WillDeleteFilesRequest=u={}))}}),qI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var t=Ae(),r;(function(s){s.document="document",s.project="project",s.group="group",s.scheme="scheme",s.global="global"})(r||(e.UniquenessLevel=r={}));var n;(function(s){s.$import="import",s.$export="export",s.local="local"})(n||(e.MonikerKind=n={}));var a;(function(s){s.method="textDocument/moniker",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(a||(e.MonikerRequest=a={}))}}),HI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var t=Ae(),r;(function(s){s.method="textDocument/prepareTypeHierarchy",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(r||(e.TypeHierarchyPrepareRequest=r={}));var n;(function(s){s.method="typeHierarchy/supertypes",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(n||(e.TypeHierarchySupertypesRequest=n={}));var a;(function(s){s.method="typeHierarchy/subtypes",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(a||(e.TypeHierarchySubtypesRequest=a={}))}}),YI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var t=Ae(),r;(function(a){a.method="textDocument/inlineValue",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method)})(r||(e.InlineValueRequest=r={}));var n;(function(a){a.method="workspace/inlineValue/refresh",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)})(n||(e.InlineValueRefreshRequest=n={}))}}),XI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var t=Ae(),r;(function(s){s.method="textDocument/inlayHint",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(r||(e.InlayHintRequest=r={}));var n;(function(s){s.method="inlayHint/resolve",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolRequestType(s.method)})(n||(e.InlayHintResolveRequest=n={}));var a;(function(s){s.method="workspace/inlayHint/refresh",s.messageDirection=t.MessageDirection.serverToClient,s.type=new t.ProtocolRequestType0(s.method)})(a||(e.InlayHintRefreshRequest=a={}))}}),JI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var t=ti(),r=_d(),n=Ae(),a;(function(c){function f(d){const m=d;return m&&r.boolean(m.retriggerRequest)}i(f,"is"),c.is=f})(a||(e.DiagnosticServerCancellationData=a={}));var s;(function(c){c.Full="full",c.Unchanged="unchanged"})(s||(e.DocumentDiagnosticReportKind=s={}));var o;(function(c){c.method="textDocument/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new t.ProgressType})(o||(e.DocumentDiagnosticRequest=o={}));var l;(function(c){c.method="workspace/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new t.ProgressType})(l||(e.WorkspaceDiagnosticRequest=l={}));var u;(function(c){c.method="workspace/diagnostic/refresh",c.messageDirection=n.MessageDirection.serverToClient,c.type=new n.ProtocolRequestType0(c.method)})(u||(e.DiagnosticRefreshRequest=u={}))}}),ZI=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;var t=(xs(),bd(Dl)),r=_d(),n=Ae(),a;(function(v){v.Markup=1,v.Code=2;function b(S){return S===1||S===2}i(b,"is"),v.is=b})(a||(e.NotebookCellKind=a={}));var s;(function(v){function b(I,R){const P={executionOrder:I};return(R===!0||R===!1)&&(P.success=R),P}i(b,"create"),v.create=b;function S(I){const R=I;return r.objectLiteral(R)&&t.uinteger.is(R.executionOrder)&&(R.success===void 0||r.boolean(R.success))}i(S,"is"),v.is=S;function w(I,R){return I===R?!0:I==null||R===null||R===void 0?!1:I.executionOrder===R.executionOrder&&I.success===R.success}i(w,"equals"),v.equals=w})(s||(e.ExecutionSummary=s={}));var o;(function(v){function b(R,P){return{kind:R,document:P}}i(b,"create"),v.create=b;function S(R){const P=R;return r.objectLiteral(P)&&a.is(P.kind)&&t.DocumentUri.is(P.document)&&(P.metadata===void 0||r.objectLiteral(P.metadata))}i(S,"is"),v.is=S;function w(R,P){const z=new Set;return R.document!==P.document&&z.add("document"),R.kind!==P.kind&&z.add("kind"),R.executionSummary!==P.executionSummary&&z.add("executionSummary"),(R.metadata!==void 0||P.metadata!==void 0)&&!I(R.metadata,P.metadata)&&z.add("metadata"),(R.executionSummary!==void 0||P.executionSummary!==void 0)&&!s.equals(R.executionSummary,P.executionSummary)&&z.add("executionSummary"),z}i(w,"diff"),v.diff=w;function I(R,P){if(R===P)return!0;if(R==null||P===null||P===void 0||typeof R!=typeof P||typeof R!="object")return!1;const z=Array.isArray(R),X=Array.isArray(P);if(z!==X)return!1;if(z&&X){if(R.length!==P.length)return!1;for(let Z=0;Z0}i(ae,"hasId"),p.hasId=ae})(O||(e.StaticRegistrationOptions=O={}));var x;(function(p){function ae(Te){const q=Te;return q&&(q.documentSelector===null||C.is(q.documentSelector))}i(ae,"is"),p.is=ae})(x||(e.TextDocumentRegistrationOptions=x={}));var D;(function(p){function ae(q){const h=q;return n.objectLiteral(h)&&(h.workDoneProgress===void 0||n.boolean(h.workDoneProgress))}i(ae,"is"),p.is=ae;function Te(q){const h=q;return h&&n.boolean(h.workDoneProgress)}i(Te,"hasWorkDoneProgress"),p.hasWorkDoneProgress=Te})(D||(e.WorkDoneProgressOptions=D={}));var G;(function(p){p.method="initialize",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(G||(e.InitializeRequest=G={}));var W;(function(p){p.unknownProtocolVersion=1})(W||(e.InitializeErrorCodes=W={}));var Y;(function(p){p.method="initialized",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(Y||(e.InitializedNotification=Y={}));var V;(function(p){p.method="shutdown",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType0(p.method)})(V||(e.ShutdownRequest=V={}));var Pe;(function(p){p.method="exit",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType0(p.method)})(Pe||(e.ExitNotification=Pe={}));var oe;(function(p){p.method="workspace/didChangeConfiguration",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(oe||(e.DidChangeConfigurationNotification=oe={}));var Le;(function(p){p.Error=1,p.Warning=2,p.Info=3,p.Log=4,p.Debug=5})(Le||(e.MessageType=Le={}));var De;(function(p){p.method="window/showMessage",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(De||(e.ShowMessageNotification=De={}));var ke;(function(p){p.method="window/showMessageRequest",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType(p.method)})(ke||(e.ShowMessageRequest=ke={}));var Ze;(function(p){p.method="window/logMessage",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(Ze||(e.LogMessageNotification=Ze={}));var Je;(function(p){p.method="telemetry/event",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(Je||(e.TelemetryEventNotification=Je={}));var ne;(function(p){p.None=0,p.Full=1,p.Incremental=2})(ne||(e.TextDocumentSyncKind=ne={}));var Kt;(function(p){p.method="textDocument/didOpen",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(Kt||(e.DidOpenTextDocumentNotification=Kt={}));var Ee;(function(p){function ae(q){let h=q;return h!=null&&typeof h.text=="string"&&h.range!==void 0&&(h.rangeLength===void 0||typeof h.rangeLength=="number")}i(ae,"isIncremental"),p.isIncremental=ae;function Te(q){let h=q;return h!=null&&typeof h.text=="string"&&h.range===void 0&&h.rangeLength===void 0}i(Te,"isFull"),p.isFull=Te})(Ee||(e.TextDocumentContentChangeEvent=Ee={}));var kt;(function(p){p.method="textDocument/didChange",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(kt||(e.DidChangeTextDocumentNotification=kt={}));var ra;(function(p){p.method="textDocument/didClose",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(ra||(e.DidCloseTextDocumentNotification=ra={}));var fi;(function(p){p.method="textDocument/didSave",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(fi||(e.DidSaveTextDocumentNotification=fi={}));var di;(function(p){p.Manual=1,p.AfterDelay=2,p.FocusOut=3})(di||(e.TextDocumentSaveReason=di={}));var pi;(function(p){p.method="textDocument/willSave",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(pi||(e.WillSaveTextDocumentNotification=pi={}));var mi;(function(p){p.method="textDocument/willSaveWaitUntil",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(mi||(e.WillSaveTextDocumentWaitUntilRequest=mi={}));var Ot;(function(p){p.method="workspace/didChangeWatchedFiles",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolNotificationType(p.method)})(Ot||(e.DidChangeWatchedFilesNotification=Ot={}));var na;(function(p){p.Created=1,p.Changed=2,p.Deleted=3})(na||(e.FileChangeType=na={}));var hi;(function(p){function ae(Te){const q=Te;return n.objectLiteral(q)&&(r.URI.is(q.baseUri)||r.WorkspaceFolder.is(q.baseUri))&&n.string(q.pattern)}i(ae,"is"),p.is=ae})(hi||(e.RelativePattern=hi={}));var yi;(function(p){p.Create=1,p.Change=2,p.Delete=4})(yi||(e.WatchKind=yi={}));var gi;(function(p){p.method="textDocument/publishDiagnostics",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolNotificationType(p.method)})(gi||(e.PublishDiagnosticsNotification=gi={}));var vi;(function(p){p.Invoked=1,p.TriggerCharacter=2,p.TriggerForIncompleteCompletions=3})(vi||(e.CompletionTriggerKind=vi={}));var aa;(function(p){p.method="textDocument/completion",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(aa||(e.CompletionRequest=aa={}));var ia;(function(p){p.method="completionItem/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(ia||(e.CompletionResolveRequest=ia={}));var Wt;(function(p){p.method="textDocument/hover",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Wt||(e.HoverRequest=Wt={}));var sa;(function(p){p.Invoked=1,p.TriggerCharacter=2,p.ContentChange=3})(sa||(e.SignatureHelpTriggerKind=sa={}));var Ti;(function(p){p.method="textDocument/signatureHelp",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ti||(e.SignatureHelpRequest=Ti={}));var $i;(function(p){p.method="textDocument/definition",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})($i||(e.DefinitionRequest=$i={}));var oa;(function(p){p.method="textDocument/references",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(oa||(e.ReferencesRequest=oa={}));var la;(function(p){p.method="textDocument/documentHighlight",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(la||(e.DocumentHighlightRequest=la={}));var Ri;(function(p){p.method="textDocument/documentSymbol",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ri||(e.DocumentSymbolRequest=Ri={}));var no;(function(p){p.method="textDocument/codeAction",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(no||(e.CodeActionRequest=no={}));var Ai;(function(p){p.method="codeAction/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ai||(e.CodeActionResolveRequest=Ai={}));var Ei;(function(p){p.method="workspace/symbol",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ei||(e.WorkspaceSymbolRequest=Ei={}));var Ci;(function(p){p.method="workspaceSymbol/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ci||(e.WorkspaceSymbolResolveRequest=Ci={}));var bi;(function(p){p.method="textDocument/codeLens",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(bi||(e.CodeLensRequest=bi={}));var bt;(function(p){p.method="codeLens/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(bt||(e.CodeLensResolveRequest=bt={}));var _i;(function(p){p.method="workspace/codeLens/refresh",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType0(p.method)})(_i||(e.CodeLensRefreshRequest=_i={}));var Si;(function(p){p.method="textDocument/documentLink",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Si||(e.DocumentLinkRequest=Si={}));var Lr;(function(p){p.method="documentLink/resolve",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Lr||(e.DocumentLinkResolveRequest=Lr={}));var wi;(function(p){p.method="textDocument/formatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(wi||(e.DocumentFormattingRequest=wi={}));var Jr;(function(p){p.method="textDocument/rangeFormatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Jr||(e.DocumentRangeFormattingRequest=Jr={}));var Ii;(function(p){p.method="textDocument/rangesFormatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ii||(e.DocumentRangesFormattingRequest=Ii={}));var Vt;(function(p){p.method="textDocument/onTypeFormatting",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Vt||(e.DocumentOnTypeFormattingRequest=Vt={}));var cr;(function(p){p.Identifier=1})(cr||(e.PrepareSupportDefaultBehavior=cr={}));var Ni;(function(p){p.method="textDocument/rename",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Ni||(e.RenameRequest=Ni={}));var Pi;(function(p){p.method="textDocument/prepareRename",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(Pi||(e.PrepareRenameRequest=Pi={}));var fr;(function(p){p.method="workspace/executeCommand",p.messageDirection=t.MessageDirection.clientToServer,p.type=new t.ProtocolRequestType(p.method)})(fr||(e.ExecuteCommandRequest=fr={}));var ua;(function(p){p.method="workspace/applyEdit",p.messageDirection=t.MessageDirection.serverToClient,p.type=new t.ProtocolRequestType("workspace/applyEdit")})(ua||(e.ApplyWorkspaceEditRequest=ua={}))}}),tN=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var t=ti();function r(n,a,s,o){return t.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),(0,t.createMessageConnection)(n,a,s,o)}i(r,"createProtocolConnection"),e.createProtocolConnection=r}}),rN=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(e){var t=e&&e.__createBinding||(Object.create?(function(s,o,l,u){u===void 0&&(u=l);var c=Object.getOwnPropertyDescriptor(o,l);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:i(function(){return o[l]},"get")}),Object.defineProperty(s,u,c)}):(function(s,o,l,u){u===void 0&&(u=l),s[u]=o[l]})),r=e&&e.__exportStar||function(s,o){for(var l in s)l!=="default"&&!Object.prototype.hasOwnProperty.call(o,l)&&t(o,s,l)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,r(ti(),e),r((xs(),bd(Dl)),e),r(Ae(),e),r(eN(),e);var n=tN();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:i(function(){return n.createProtocolConnection},"get")});var a;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(a||(e.LSPErrorCodes=a={}))}}),nN=H({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(e){var t=e&&e.__createBinding||(Object.create?(function(s,o,l,u){u===void 0&&(u=l);var c=Object.getOwnPropertyDescriptor(o,l);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:i(function(){return o[l]},"get")}),Object.defineProperty(s,u,c)}):(function(s,o,l,u){u===void 0&&(u=l),s[u]=o[l]})),r=e&&e.__exportStar||function(s,o){for(var l in s)l!=="default"&&!Object.prototype.hasOwnProperty.call(o,l)&&t(o,s,l)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var n=uh();r(uh(),e),r(rN(),e);function a(s,o,l,u){return(0,n.createMessageConnection)(s,o,l,u)}i(a,"createProtocolConnection"),e.createProtocolConnection=a}}),Hg={};Vr(Hg,{AbstractAstReflection:()=>Id,AbstractCstNode:()=>Pm,AbstractLangiumParser:()=>Om,AbstractParserErrorMessageProvider:()=>MS,AbstractThreadedAsyncParser:()=>SF,AstUtils:()=>Nd,BiMap:()=>Nl,Cancellation:()=>pe,CompositeCstNodeImpl:()=>ku,ContextCache:()=>Fu,CstNodeBuilder:()=>OS,CstUtils:()=>Sd,DEFAULT_TOKENIZE_OPTIONS:()=>Jm,DONE_RESULT:()=>tt,DatatypeSymbol:()=>_l,DefaultAstNodeDescriptionProvider:()=>pw,DefaultAstNodeLocator:()=>hw,DefaultAsyncParser:()=>Ow,DefaultCommentProvider:()=>kw,DefaultConfigurationProvider:()=>yw,DefaultDocumentBuilder:()=>gw,DefaultDocumentValidator:()=>dw,DefaultHydrator:()=>Dw,DefaultIndexManager:()=>vw,DefaultJsonSerializer:()=>lw,DefaultLangiumDocumentFactory:()=>QS,DefaultLangiumDocuments:()=>ew,DefaultLangiumProfiler:()=>kF,DefaultLexer:()=>Zm,DefaultLexerErrorMessageProvider:()=>$w,DefaultLinker:()=>tw,DefaultNameProvider:()=>rw,DefaultReferenceDescriptionProvider:()=>mw,DefaultReferences:()=>nw,DefaultScopeComputation:()=>aw,DefaultScopeProvider:()=>ow,DefaultServiceRegistry:()=>uw,DefaultTokenBuilder:()=>Du,DefaultValueConverter:()=>zm,DefaultWorkspaceLock:()=>Lw,DefaultWorkspaceManager:()=>Tw,Deferred:()=>wr,Disposable:()=>Nn,DisposableCache:()=>Gu,DocumentCache:()=>sw,DocumentState:()=>J,DocumentValidator:()=>_t,EMPTY_SCOPE:()=>EF,EMPTY_STREAM:()=>Ua,EmptyFileSystem:()=>Xe,EmptyFileSystemProvider:()=>Gw,ErrorWithLocation:()=>Wl,GrammarAST:()=>Jg,GrammarUtils:()=>sp,IndentationAwareLexer:()=>IF,IndentationAwareTokenBuilder:()=>Mw,JSDocDocumentationProvider:()=>Pw,LangiumCompletionParser:()=>GS,LangiumParser:()=>xS,LangiumParserErrorMessageProvider:()=>Lm,LeafCstNodeImpl:()=>bl,LexingMode:()=>wn,MapScope:()=>AF,Module:()=>nd,MultiMap:()=>Ir,MultiMapScope:()=>iw,OperationCancelled:()=>tr,ParserWorker:()=>wF,ProfilingTask:()=>zw,Reduction:()=>Ts,RefResolving:()=>un,RegExpUtils:()=>lp,RootCstNodeImpl:()=>km,SimpleCache:()=>Vm,StreamImpl:()=>er,StreamScope:()=>Qf,TextDocument:()=>wl,TreeStreamImpl:()=>Ka,URI:()=>Tt,UriTrie:()=>Km,UriUtils:()=>nt,VALIDATE_EACH_NODE:()=>fw,ValidationCategory:()=>Pl,ValidationRegistry:()=>cw,ValueConverter:()=>Zt,WorkspaceCache:()=>qm,assertCondition:()=>op,assertUnreachable:()=>qr,createCompletionParser:()=>Mm,createDefaultCoreModule:()=>je,createDefaultSharedCoreModule:()=>Be,createGrammarConfig:()=>_p,createLangiumParser:()=>Gm,createParser:()=>Ou,delayNextTick:()=>xu,diagnosticData:()=>Sn,eagerLoad:()=>ih,getDiagnosticRange:()=>Ym,indentationBuilderDefaultOptions:()=>id,inject:()=>ee,interruptAndCheck:()=>ze,isAstNode:()=>Oe,isAstNodeDescription:()=>wd,isAstNodeWithComment:()=>Hm,isCompositeCstNode:()=>$r,isIMultiModeLexerDefinition:()=>Bu,isJSDoc:()=>eh,isLeafCstNode:()=>xn,isLinkingError:()=>pn,isMultiReference:()=>rr,isNamed:()=>Wm,isOperationCancelled:()=>ta,isReference:()=>rt,isRootCstNode:()=>Ml,isTokenTypeArray:()=>ju,isTokenTypeDictionary:()=>kl,loadGrammarFromJson:()=>Ue,parseJSDoc:()=>Qm,prepareLangiumParser:()=>Fm,setInterruptionPeriod:()=>jm,startCancelableOperation:()=>Mu,stream:()=>ue,toDiagnosticData:()=>Xm,toDiagnosticSeverity:()=>gs});var Sd={};Vr(Sd,{DefaultNameRegexp:()=>tp,RangeComparison:()=>Qt,compareRange:()=>Qd,findCommentNode:()=>rp,findDeclarationNodeAtOffset:()=>yv,findLeafNodeAtOffset:()=>Kl,findLeafNodeBeforeOffset:()=>np,flattenCst:()=>hv,getDatatypeNode:()=>mv,getInteriorNodes:()=>Tv,getNextNode:()=>gv,getPreviousNode:()=>ip,getStartlineNode:()=>vv,inRange:()=>ep,isChildNode:()=>Zd,isCommentNode:()=>ul,streamCst:()=>Ha,toDocumentSegment:()=>Ya,tokenToRange:()=>$s});function Oe(e){return typeof e=="object"&&e!==null&&typeof e.$type=="string"}i(Oe,"isAstNode");function rt(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"ref"in e}i(rt,"isReference");function rr(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"items"in e}i(rr,"isMultiReference");function wd(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&typeof e.type=="string"&&typeof e.path=="string"}i(wd,"isAstNodeDescription");function pn(e){return typeof e=="object"&&e!==null&&typeof e.info=="object"&&typeof e.message=="string"}i(pn,"isLinkingError");var Id=class{static{i(this,"AbstractAstReflection")}constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){const t=this.types[e.container.$type];if(!t)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const r=t.properties[e.property]?.referenceType;if(!r)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return r}getTypeMetaData(e){const t=this.types[e];return t||{name:e,properties:{},superTypes:[]}}isInstance(e,t){return Oe(e)&&this.isSubtype(e.$type,t)}isSubtype(e,t){if(e===t)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const n=r[t];if(n!==void 0)return n;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,t)):!1;return r[t]=s,s}}getAllSubTypes(e){const t=this.allSubtypes[e];if(t)return t;{const r=this.getAllTypes(),n=[];for(const a of r)this.isSubtype(a,e)&&n.push(a);return this.allSubtypes[e]=n,n}}};function $r(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}i($r,"isCompositeCstNode");function xn(e){return typeof e=="object"&&e!==null&&typeof e.tokenType=="object"}i(xn,"isLeafCstNode");function Ml(e){return $r(e)&&typeof e.fullText=="string"}i(Ml,"isRootCstNode");var er=class hr{static{i(this,"StreamImpl")}constructor(t,r){this.startFn=t,this.nextFn=r}iterator(){const t={state:this.startFn(),next:i(()=>this.nextFn(t.state),"next"),[Symbol.iterator]:()=>t};return t}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const t=this.iterator();let r=0,n=t.next();for(;!n.done;)r++,n=t.next();return r}toArray(){const t=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&t.push(n.value);while(!n.done);return t}toSet(){return new Set(this)}toMap(t,r){const n=this.map(a=>[t?t(a):a,r?r(a):a]);return new Map(n)}toString(){return this.join()}concat(t){return new hr(()=>({first:this.startFn(),firstDone:!1,iterator:t[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return tt})}join(t=","){const r=this.iterator();let n="",a,s=!1;do a=r.next(),a.done||(s&&(n+=t),n+=Yg(a.value)),s=!0;while(!a.done);return n}indexOf(t,r=0){const n=this.iterator();let a=0,s=n.next();for(;!s.done;){if(a>=r&&s.value===t)return a;s=n.next(),a++}return-1}every(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(!t(n.value))return!1;n=r.next()}return!0}some(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(t(n.value))return!0;n=r.next()}return!1}forEach(t){const r=this.iterator();let n=0,a=r.next();for(;!a.done;)t(a.value,n),a=r.next(),n++}map(t){return new hr(this.startFn,r=>{const{done:n,value:a}=this.nextFn(r);return n?tt:{done:!1,value:t(a)}})}filter(t){return new hr(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&t(n.value))return n;while(!n.done);return tt})}nonNullable(){return this.filter(t=>t!=null)}reduce(t,r){const n=this.iterator();let a=r,s=n.next();for(;!s.done;)a===void 0?a=s.value:a=t(a,s.value),s=n.next();return a}reduceRight(t,r){return this.recursiveReduce(this.iterator(),t,r)}recursiveReduce(t,r,n){const a=t.next();if(a.done)return n;const s=this.recursiveReduce(t,r,n);return s===void 0?a.value:r(s,a.value)}find(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(t(n.value))return n.value;n=r.next()}}findIndex(t){const r=this.iterator();let n=0,a=r.next();for(;!a.done;){if(t(a.value))return n;a=r.next(),n++}return-1}includes(t){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===t)return!0;n=r.next()}return!1}flatMap(t){return new hr(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const s=r.iterator.next();if(s.done)r.iterator=void 0;else return s}const{done:n,value:a}=this.nextFn(r.this);if(!n){const s=t(a);if(vs(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(r.iterator);return tt})}flat(t){if(t===void 0&&(t=1),t<=0)return this;const r=t>1?this.flat(t-1):this;return new hr(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const o=n.iterator.next();if(o.done)n.iterator=void 0;else return o}const{done:a,value:s}=r.nextFn(n.this);if(!a)if(vs(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(n.iterator);return tt})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(t=1){return new hr(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>t?tt:this.nextFn(r.state)))}distinct(t){return new hr(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const a=t?t(n.value):n.value;if(!r.set.has(a))return r.set.add(a),n}while(!n.done);return tt})}exclude(t,r){const n=new Set;for(const a of t){const s=r?r(a):a;n.add(s)}return this.filter(a=>{const s=r?r(a):a;return!n.has(s)})}};function Yg(e){return typeof e=="string"?e:typeof e>"u"?"undefined":typeof e.toString=="function"?e.toString():Object.prototype.toString.call(e)}i(Yg,"toString");function vs(e){return!!e&&typeof e[Symbol.iterator]=="function"}i(vs,"isIterable");var Ua=new er(()=>{},()=>tt),tt=Object.freeze({done:!0,value:void 0});function ue(...e){if(e.length===1){const t=e[0];if(t instanceof er)return t;if(vs(t))return new er(()=>t[Symbol.iterator](),r=>r.next());if(typeof t.length=="number")return new er(()=>({index:0}),r=>r.index1?new er(()=>({collIndex:0,arrIndex:0}),t=>{do{if(t.iterator){const r=t.iterator.next();if(!r.done)return r;t.iterator=void 0}if(t.array){if(t.arrIndex({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[t(e)[Symbol.iterator]()],pruned:!1}),n=>{for(n.pruned&&(n.iterators.pop(),n.pruned=!1);n.iterators.length>0;){const s=n.iterators[n.iterators.length-1].next();if(s.done)n.iterators.pop();else return n.iterators.push(t(s.value)[Symbol.iterator]()),s}return tt})}iterator(){const e={state:this.startFn(),next:i(()=>this.nextFn(e.state),"next"),prune:i(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},Ts;(function(e){function t(s){return s.reduce((o,l)=>o+l,0)}i(t,"sum"),e.sum=t;function r(s){return s.reduce((o,l)=>o*l,0)}i(r,"product"),e.product=r;function n(s){return s.reduce((o,l)=>Math.min(o,l))}i(n,"min"),e.min=n;function a(s){return s.reduce((o,l)=>Math.max(o,l))}i(a,"max"),e.max=a})(Ts||(Ts={}));var Nd={};Vr(Nd,{assignMandatoryProperties:()=>Pd,copyAstNode:()=>Yo,findRootNode:()=>Fa,getContainerOfType:()=>Mn,getDocument:()=>Mt,getReferenceNodes:()=>qo,hasContainerOfType:()=>Xg,linkContentToContainer:()=>Wa,streamAllContents:()=>Nr,streamAst:()=>Gt,streamContents:()=>Gs,streamReferences:()=>Va});function Wa(e,t={}){for(const[r,n]of Object.entries(e))r.startsWith("$")||(Array.isArray(n)?n.forEach((a,s)=>{Oe(a)&&(a.$container=e,a.$containerProperty=r,a.$containerIndex=s,t.deep&&Wa(a,t))}):Oe(n)&&(n.$container=e,n.$containerProperty=r,t.deep&&Wa(n,t)))}i(Wa,"linkContentToContainer");function Mn(e,t){let r=e;for(;r;){if(t(r))return r;r=r.$container}}i(Mn,"getContainerOfType");function Xg(e,t){let r=e;for(;r;){if(t(r))return!0;r=r.$container}return!1}i(Xg,"hasContainerOfType");function Mt(e){const r=Fa(e).$document;if(!r)throw new Error("AST node has no document.");return r}i(Mt,"getDocument");function Fa(e){for(;e.$container;)e=e.$container;return e}i(Fa,"findRootNode");function qo(e){return rt(e)?e.ref?[e.ref]:[]:rr(e)?e.items.map(t=>t.ref):[]}i(qo,"getReferenceNodes");function Gs(e,t){if(!e)throw new Error("Node must be an AstNode.");const r=t?.range;return new er(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndexGs(r,t))}i(Nr,"streamAllContents");function Gt(e,t){if(e){if(t?.range&&!Ho(e,t.range))return new Ka(e,()=>[])}else throw new Error("Root node must be an AstNode.");return new Ka(e,r=>Gs(r,t),{includeRoot:!0})}i(Gt,"streamAst");function Ho(e,t){if(!t)return!0;const r=e.$cstNode?.range;return r?ep(r,t):!1}i(Ho,"isAstNodeInRange");function Va(e){return new er(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndexdt,AbstractParserRule:()=>ns,AbstractRule:()=>Pa,AbstractType:()=>vt,Action:()=>xr,Alternatives:()=>as,ArrayLiteral:()=>Xo,ArrayType:()=>Jo,Assignment:()=>Mr,BooleanLiteral:()=>Zo,CharacterRange:()=>Gr,Condition:()=>Fr,Conjunction:()=>is,CrossReference:()=>zr,Disjunction:()=>ss,EndOfFile:()=>Qo,Grammar:()=>gr,GrammarImport:()=>el,Group:()=>mn,InferredType:()=>tl,InfixRule:()=>Jt,InfixRuleOperatorList:()=>os,InfixRuleOperators:()=>rl,Interface:()=>ka,Keyword:()=>Oa,LangiumGrammarAstReflection:()=>Jd,LangiumGrammarTerminals:()=>aN,NamedArgument:()=>La,NegatedToken:()=>hn,Negation:()=>nl,NumberLiteral:()=>al,Parameter:()=>Da,ParameterReference:()=>il,ParserRule:()=>Lt,ReferenceType:()=>ls,RegexToken:()=>yn,ReturnType:()=>sl,RuleCall:()=>gn,SimpleType:()=>xa,StringLiteral:()=>ol,TerminalAlternatives:()=>vn,TerminalElement:()=>pt,TerminalGroup:()=>Tn,TerminalRule:()=>vr,TerminalRuleCall:()=>$n,Type:()=>us,TypeAttribute:()=>Rn,TypeDefinition:()=>An,UnionType:()=>ll,UnorderedGroup:()=>cs,UntilToken:()=>En,ValueLiteral:()=>Cn,Wildcard:()=>Ma,isAbstractElement:()=>Gl,isAbstractParserRule:()=>Gn,isAbstractRule:()=>Zg,isAbstractType:()=>Qg,isAction:()=>jr,isAlternatives:()=>Fl,isArrayLiteral:()=>ev,isArrayType:()=>Od,isAssignment:()=>Rr,isBooleanLiteral:()=>Ld,isCharacterRange:()=>Dd,isCondition:()=>tv,isConjunction:()=>xd,isCrossReference:()=>Fn,isDisjunction:()=>Md,isEndOfFile:()=>Gd,isGrammar:()=>rv,isGrammarImport:()=>nv,isGroup:()=>zn,isInferredType:()=>Fs,isInfixRule:()=>qa,isInfixRuleOperatorList:()=>av,isInfixRuleOperators:()=>iv,isInterface:()=>Fd,isKeyword:()=>Ar,isNamedArgument:()=>sv,isNegatedToken:()=>zd,isNegation:()=>jd,isNumberLiteral:()=>ov,isParameter:()=>lv,isParameterReference:()=>Bd,isParserRule:()=>it,isReferenceType:()=>Ud,isRegexToken:()=>Kd,isReturnType:()=>Wd,isRuleCall:()=>Er,isSimpleType:()=>zl,isStringLiteral:()=>uv,isTerminalAlternatives:()=>Vd,isTerminalElement:()=>cv,isTerminalGroup:()=>qd,isTerminalRule:()=>Nt,isTerminalRuleCall:()=>jl,isType:()=>Bl,isTypeAttribute:()=>fv,isTypeDefinition:()=>dv,isUnionType:()=>Hd,isUnorderedGroup:()=>Ul,isUntilToken:()=>Yd,isValueLiteral:()=>pv,isWildcard:()=>Xd,reflection:()=>j});var aN={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},dt={$type:"AbstractElement",cardinality:"cardinality"};function Gl(e){return j.isInstance(e,dt.$type)}i(Gl,"isAbstractElement");var ns={$type:"AbstractParserRule"};function Gn(e){return j.isInstance(e,ns.$type)}i(Gn,"isAbstractParserRule");var Pa={$type:"AbstractRule"};function Zg(e){return j.isInstance(e,Pa.$type)}i(Zg,"isAbstractRule");var vt={$type:"AbstractType"};function Qg(e){return j.isInstance(e,vt.$type)}i(Qg,"isAbstractType");var xr={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function jr(e){return j.isInstance(e,xr.$type)}i(jr,"isAction");var as={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Fl(e){return j.isInstance(e,as.$type)}i(Fl,"isAlternatives");var Xo={$type:"ArrayLiteral",elements:"elements"};function ev(e){return j.isInstance(e,Xo.$type)}i(ev,"isArrayLiteral");var Jo={$type:"ArrayType",elementType:"elementType"};function Od(e){return j.isInstance(e,Jo.$type)}i(Od,"isArrayType");var Mr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function Rr(e){return j.isInstance(e,Mr.$type)}i(Rr,"isAssignment");var Zo={$type:"BooleanLiteral",true:"true"};function Ld(e){return j.isInstance(e,Zo.$type)}i(Ld,"isBooleanLiteral");var Gr={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function Dd(e){return j.isInstance(e,Gr.$type)}i(Dd,"isCharacterRange");var Fr={$type:"Condition"};function tv(e){return j.isInstance(e,Fr.$type)}i(tv,"isCondition");var is={$type:"Conjunction",left:"left",right:"right"};function xd(e){return j.isInstance(e,is.$type)}i(xd,"isConjunction");var zr={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Fn(e){return j.isInstance(e,zr.$type)}i(Fn,"isCrossReference");var ss={$type:"Disjunction",left:"left",right:"right"};function Md(e){return j.isInstance(e,ss.$type)}i(Md,"isDisjunction");var Qo={$type:"EndOfFile",cardinality:"cardinality"};function Gd(e){return j.isInstance(e,Qo.$type)}i(Gd,"isEndOfFile");var gr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function rv(e){return j.isInstance(e,gr.$type)}i(rv,"isGrammar");var el={$type:"GrammarImport",path:"path"};function nv(e){return j.isInstance(e,el.$type)}i(nv,"isGrammarImport");var mn={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function zn(e){return j.isInstance(e,mn.$type)}i(zn,"isGroup");var tl={$type:"InferredType",name:"name"};function Fs(e){return j.isInstance(e,tl.$type)}i(Fs,"isInferredType");var Jt={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function qa(e){return j.isInstance(e,Jt.$type)}i(qa,"isInfixRule");var os={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function av(e){return j.isInstance(e,os.$type)}i(av,"isInfixRuleOperatorList");var rl={$type:"InfixRuleOperators",precedences:"precedences"};function iv(e){return j.isInstance(e,rl.$type)}i(iv,"isInfixRuleOperators");var ka={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Fd(e){return j.isInstance(e,ka.$type)}i(Fd,"isInterface");var Oa={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Ar(e){return j.isInstance(e,Oa.$type)}i(Ar,"isKeyword");var La={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function sv(e){return j.isInstance(e,La.$type)}i(sv,"isNamedArgument");var hn={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function zd(e){return j.isInstance(e,hn.$type)}i(zd,"isNegatedToken");var nl={$type:"Negation",value:"value"};function jd(e){return j.isInstance(e,nl.$type)}i(jd,"isNegation");var al={$type:"NumberLiteral",value:"value"};function ov(e){return j.isInstance(e,al.$type)}i(ov,"isNumberLiteral");var Da={$type:"Parameter",name:"name"};function lv(e){return j.isInstance(e,Da.$type)}i(lv,"isParameter");var il={$type:"ParameterReference",parameter:"parameter"};function Bd(e){return j.isInstance(e,il.$type)}i(Bd,"isParameterReference");var Lt={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function it(e){return j.isInstance(e,Lt.$type)}i(it,"isParserRule");var ls={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function Ud(e){return j.isInstance(e,ls.$type)}i(Ud,"isReferenceType");var yn={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Kd(e){return j.isInstance(e,yn.$type)}i(Kd,"isRegexToken");var sl={$type:"ReturnType",name:"name"};function Wd(e){return j.isInstance(e,sl.$type)}i(Wd,"isReturnType");var gn={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Er(e){return j.isInstance(e,gn.$type)}i(Er,"isRuleCall");var xa={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function zl(e){return j.isInstance(e,xa.$type)}i(zl,"isSimpleType");var ol={$type:"StringLiteral",value:"value"};function uv(e){return j.isInstance(e,ol.$type)}i(uv,"isStringLiteral");var vn={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Vd(e){return j.isInstance(e,vn.$type)}i(Vd,"isTerminalAlternatives");var pt={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function cv(e){return j.isInstance(e,pt.$type)}i(cv,"isTerminalElement");var Tn={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function qd(e){return j.isInstance(e,Tn.$type)}i(qd,"isTerminalGroup");var vr={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Nt(e){return j.isInstance(e,vr.$type)}i(Nt,"isTerminalRule");var $n={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function jl(e){return j.isInstance(e,$n.$type)}i(jl,"isTerminalRuleCall");var us={$type:"Type",name:"name",type:"type"};function Bl(e){return j.isInstance(e,us.$type)}i(Bl,"isType");var Rn={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function fv(e){return j.isInstance(e,Rn.$type)}i(fv,"isTypeAttribute");var An={$type:"TypeDefinition"};function dv(e){return j.isInstance(e,An.$type)}i(dv,"isTypeDefinition");var ll={$type:"UnionType",types:"types"};function Hd(e){return j.isInstance(e,ll.$type)}i(Hd,"isUnionType");var cs={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Ul(e){return j.isInstance(e,cs.$type)}i(Ul,"isUnorderedGroup");var En={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Yd(e){return j.isInstance(e,En.$type)}i(Yd,"isUntilToken");var Cn={$type:"ValueLiteral"};function pv(e){return j.isInstance(e,Cn.$type)}i(pv,"isValueLiteral");var Ma={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Xd(e){return j.isInstance(e,Ma.$type)}i(Xd,"isWildcard");var Jd=class extends Id{static{i(this,"LangiumGrammarAstReflection")}constructor(){super(...arguments),this.types={AbstractElement:{name:dt.$type,properties:{cardinality:{name:dt.cardinality}},superTypes:[]},AbstractParserRule:{name:ns.$type,properties:{},superTypes:[Pa.$type,vt.$type]},AbstractRule:{name:Pa.$type,properties:{},superTypes:[]},AbstractType:{name:vt.$type,properties:{},superTypes:[]},Action:{name:xr.$type,properties:{cardinality:{name:xr.cardinality},feature:{name:xr.feature},inferredType:{name:xr.inferredType},operator:{name:xr.operator},type:{name:xr.type,referenceType:vt.$type}},superTypes:[dt.$type]},Alternatives:{name:as.$type,properties:{cardinality:{name:as.cardinality},elements:{name:as.elements,defaultValue:[]}},superTypes:[dt.$type]},ArrayLiteral:{name:Xo.$type,properties:{elements:{name:Xo.elements,defaultValue:[]}},superTypes:[Cn.$type]},ArrayType:{name:Jo.$type,properties:{elementType:{name:Jo.elementType}},superTypes:[An.$type]},Assignment:{name:Mr.$type,properties:{cardinality:{name:Mr.cardinality},feature:{name:Mr.feature},operator:{name:Mr.operator},predicate:{name:Mr.predicate},terminal:{name:Mr.terminal}},superTypes:[dt.$type]},BooleanLiteral:{name:Zo.$type,properties:{true:{name:Zo.true,defaultValue:!1}},superTypes:[Fr.$type,Cn.$type]},CharacterRange:{name:Gr.$type,properties:{cardinality:{name:Gr.cardinality},left:{name:Gr.left},lookahead:{name:Gr.lookahead},parenthesized:{name:Gr.parenthesized,defaultValue:!1},right:{name:Gr.right}},superTypes:[pt.$type]},Condition:{name:Fr.$type,properties:{},superTypes:[]},Conjunction:{name:is.$type,properties:{left:{name:is.left},right:{name:is.right}},superTypes:[Fr.$type]},CrossReference:{name:zr.$type,properties:{cardinality:{name:zr.cardinality},deprecatedSyntax:{name:zr.deprecatedSyntax,defaultValue:!1},isMulti:{name:zr.isMulti,defaultValue:!1},terminal:{name:zr.terminal},type:{name:zr.type,referenceType:vt.$type}},superTypes:[dt.$type]},Disjunction:{name:ss.$type,properties:{left:{name:ss.left},right:{name:ss.right}},superTypes:[Fr.$type]},EndOfFile:{name:Qo.$type,properties:{cardinality:{name:Qo.cardinality}},superTypes:[dt.$type]},Grammar:{name:gr.$type,properties:{imports:{name:gr.imports,defaultValue:[]},interfaces:{name:gr.interfaces,defaultValue:[]},isDeclared:{name:gr.isDeclared,defaultValue:!1},name:{name:gr.name},rules:{name:gr.rules,defaultValue:[]},types:{name:gr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:el.$type,properties:{path:{name:el.path}},superTypes:[]},Group:{name:mn.$type,properties:{cardinality:{name:mn.cardinality},elements:{name:mn.elements,defaultValue:[]},guardCondition:{name:mn.guardCondition},predicate:{name:mn.predicate}},superTypes:[dt.$type]},InferredType:{name:tl.$type,properties:{name:{name:tl.name}},superTypes:[vt.$type]},InfixRule:{name:Jt.$type,properties:{call:{name:Jt.call},dataType:{name:Jt.dataType},inferredType:{name:Jt.inferredType},name:{name:Jt.name},operators:{name:Jt.operators},parameters:{name:Jt.parameters,defaultValue:[]},returnType:{name:Jt.returnType,referenceType:vt.$type}},superTypes:[ns.$type]},InfixRuleOperatorList:{name:os.$type,properties:{associativity:{name:os.associativity},operators:{name:os.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:rl.$type,properties:{precedences:{name:rl.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:ka.$type,properties:{attributes:{name:ka.attributes,defaultValue:[]},name:{name:ka.name},superTypes:{name:ka.superTypes,defaultValue:[],referenceType:vt.$type}},superTypes:[vt.$type]},Keyword:{name:Oa.$type,properties:{cardinality:{name:Oa.cardinality},predicate:{name:Oa.predicate},value:{name:Oa.value}},superTypes:[dt.$type]},NamedArgument:{name:La.$type,properties:{calledByName:{name:La.calledByName,defaultValue:!1},parameter:{name:La.parameter,referenceType:Da.$type},value:{name:La.value}},superTypes:[]},NegatedToken:{name:hn.$type,properties:{cardinality:{name:hn.cardinality},lookahead:{name:hn.lookahead},parenthesized:{name:hn.parenthesized,defaultValue:!1},terminal:{name:hn.terminal}},superTypes:[pt.$type]},Negation:{name:nl.$type,properties:{value:{name:nl.value}},superTypes:[Fr.$type]},NumberLiteral:{name:al.$type,properties:{value:{name:al.value}},superTypes:[Cn.$type]},Parameter:{name:Da.$type,properties:{name:{name:Da.name}},superTypes:[]},ParameterReference:{name:il.$type,properties:{parameter:{name:il.parameter,referenceType:Da.$type}},superTypes:[Fr.$type]},ParserRule:{name:Lt.$type,properties:{dataType:{name:Lt.dataType},definition:{name:Lt.definition},entry:{name:Lt.entry,defaultValue:!1},fragment:{name:Lt.fragment,defaultValue:!1},inferredType:{name:Lt.inferredType},name:{name:Lt.name},parameters:{name:Lt.parameters,defaultValue:[]},returnType:{name:Lt.returnType,referenceType:vt.$type}},superTypes:[ns.$type]},ReferenceType:{name:ls.$type,properties:{isMulti:{name:ls.isMulti,defaultValue:!1},referenceType:{name:ls.referenceType}},superTypes:[An.$type]},RegexToken:{name:yn.$type,properties:{cardinality:{name:yn.cardinality},lookahead:{name:yn.lookahead},parenthesized:{name:yn.parenthesized,defaultValue:!1},regex:{name:yn.regex}},superTypes:[pt.$type]},ReturnType:{name:sl.$type,properties:{name:{name:sl.name}},superTypes:[]},RuleCall:{name:gn.$type,properties:{arguments:{name:gn.arguments,defaultValue:[]},cardinality:{name:gn.cardinality},predicate:{name:gn.predicate},rule:{name:gn.rule,referenceType:Pa.$type}},superTypes:[dt.$type]},SimpleType:{name:xa.$type,properties:{primitiveType:{name:xa.primitiveType},stringType:{name:xa.stringType},typeRef:{name:xa.typeRef,referenceType:vt.$type}},superTypes:[An.$type]},StringLiteral:{name:ol.$type,properties:{value:{name:ol.value}},superTypes:[Cn.$type]},TerminalAlternatives:{name:vn.$type,properties:{cardinality:{name:vn.cardinality},elements:{name:vn.elements,defaultValue:[]},lookahead:{name:vn.lookahead},parenthesized:{name:vn.parenthesized,defaultValue:!1}},superTypes:[pt.$type]},TerminalElement:{name:pt.$type,properties:{cardinality:{name:pt.cardinality},lookahead:{name:pt.lookahead},parenthesized:{name:pt.parenthesized,defaultValue:!1}},superTypes:[dt.$type]},TerminalGroup:{name:Tn.$type,properties:{cardinality:{name:Tn.cardinality},elements:{name:Tn.elements,defaultValue:[]},lookahead:{name:Tn.lookahead},parenthesized:{name:Tn.parenthesized,defaultValue:!1}},superTypes:[pt.$type]},TerminalRule:{name:vr.$type,properties:{definition:{name:vr.definition},fragment:{name:vr.fragment,defaultValue:!1},hidden:{name:vr.hidden,defaultValue:!1},name:{name:vr.name},type:{name:vr.type}},superTypes:[Pa.$type]},TerminalRuleCall:{name:$n.$type,properties:{cardinality:{name:$n.cardinality},lookahead:{name:$n.lookahead},parenthesized:{name:$n.parenthesized,defaultValue:!1},rule:{name:$n.rule,referenceType:vr.$type}},superTypes:[pt.$type]},Type:{name:us.$type,properties:{name:{name:us.name},type:{name:us.type}},superTypes:[vt.$type]},TypeAttribute:{name:Rn.$type,properties:{defaultValue:{name:Rn.defaultValue},isOptional:{name:Rn.isOptional,defaultValue:!1},name:{name:Rn.name},type:{name:Rn.type}},superTypes:[]},TypeDefinition:{name:An.$type,properties:{},superTypes:[]},UnionType:{name:ll.$type,properties:{types:{name:ll.types,defaultValue:[]}},superTypes:[An.$type]},UnorderedGroup:{name:cs.$type,properties:{cardinality:{name:cs.cardinality},elements:{name:cs.elements,defaultValue:[]}},superTypes:[dt.$type]},UntilToken:{name:En.$type,properties:{cardinality:{name:En.cardinality},lookahead:{name:En.lookahead},parenthesized:{name:En.parenthesized,defaultValue:!1},terminal:{name:En.terminal}},superTypes:[pt.$type]},ValueLiteral:{name:Cn.$type,properties:{},superTypes:[]},Wildcard:{name:Ma.$type,properties:{cardinality:{name:Ma.cardinality},lookahead:{name:Ma.lookahead},parenthesized:{name:Ma.parenthesized,defaultValue:!1}},superTypes:[pt.$type]}}}},j=new Jd;function mv(e){let t=e,r=!1;for(;t;){const n=Mn(t.grammarSource,it);if(n&&n.dataType)t=t.container,r=!0;else return r?t:void 0}}i(mv,"getDatatypeNode");function Ha(e){return new Ka(e,t=>$r(t)?t.content:[],{includeRoot:!0})}i(Ha,"streamCst");function hv(e){return Ha(e).filter(xn)}i(hv,"flattenCst");function Zd(e,t){for(;e.container;)if(e=e.container,e===t)return!0;return!1}i(Zd,"isChildNode");function $s(e){return{start:{character:e.startColumn-1,line:e.startLine-1},end:{character:e.endColumn,line:e.endLine-1}}}i($s,"tokenToRange");function Ya(e){if(!e)return;const{offset:t,end:r,range:n}=e;return{range:n,offset:t,end:r,length:r-t}}i(Ya,"toDocumentSegment");var Qt;(function(e){e[e.Before=0]="Before",e[e.After=1]="After",e[e.OverlapFront=2]="OverlapFront",e[e.OverlapBack=3]="OverlapBack",e[e.Inside=4]="Inside",e[e.Outside=5]="Outside"})(Qt||(Qt={}));function Qd(e,t){if(e.end.linet.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return Qt.After;const r=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character,n=e.end.lineQt.After}i(ep,"inRange");var tp=/^[\w\p{L}]$/u;function yv(e,t,r=tp){if(e){if(t>0){const n=t-e.offset,a=e.text.charAt(n);r.test(a)||t--}return Kl(e,t)}}i(yv,"findDeclarationNodeAtOffset");function rp(e,t){if(e){const r=ip(e,!0);if(r&&ul(r,t))return r;if(Ml(e)){const n=e.content.findIndex(a=>!a.hidden);for(let a=n-1;a>=0;a--){const s=e.content[a];if(ul(s,t))return s}}}}i(rp,"findCommentNode");function ul(e,t){return xn(e)&&t.includes(e.tokenType.name)}i(ul,"isCommentNode");function Kl(e,t){if(xn(e))return e;if($r(e)){const r=ap(e,t,!1);if(r)return Kl(r,t)}}i(Kl,"findLeafNodeAtOffset");function np(e,t){if(xn(e))return e;if($r(e)){const r=ap(e,t,!0);if(r)return np(r,t)}}i(np,"findLeafNodeBeforeOffset");function ap(e,t,r){let n=0,a=e.content.length-1,s;for(;n<=a;){const o=Math.floor((n+a)/2),l=e.content[o];if(l.offset<=t&&l.end>t)return l;l.end<=t?(s=r?l:void 0,n=o+1):a=o-1}return s}i(ap,"binarySearch");function ip(e,t=!0){for(;e.container;){const r=e.container;let n=r.content.indexOf(e);for(;n>0;){n--;const a=r.content[n];if(t||!a.hidden)return a}e=r}}i(ip,"getPreviousNode");function gv(e,t=!0){for(;e.container;){const r=e.container;let n=r.content.indexOf(e);const a=r.content.length-1;for(;nTp,findNameAssignment:()=>Zl,findNodeForKeyword:()=>vp,findNodeForProperty:()=>Yl,findNodesForKeyword:()=>wv,findNodesForKeywordInternal:()=>Jl,findNodesForProperty:()=>gp,getActionAtElement:()=>Rp,getActionType:()=>Ep,getAllReachableRules:()=>Hl,getAllRulesUsedForCrossReferences:()=>Sv,getCrossReferenceTerminal:()=>hp,getEntryRule:()=>dp,getExplicitRuleType:()=>js,getHiddenRules:()=>pp,getRuleType:()=>Cp,getRuleTypeName:()=>Ov,getTypeName:()=>Pn,isArrayCardinality:()=>Nv,isArrayOperator:()=>Pv,isCommentTerminal:()=>yp,isDataType:()=>kv,isDataTypeRule:()=>zs,isOptionalCardinality:()=>Iv,terminalRegex:()=>Bs});var Wl=class extends Error{static{i(this,"ErrorWithLocation")}constructor(e,t){super(e?`${t} at ${e.range.start.line}:${e.range.start.character}`:t)}};function qr(e,t="Error: Got unexpected value."){throw new Error(t)}i(qr,"assertUnreachable");function op(e,t="Error: Condition is violated."){if(!e)throw new Error(t)}i(op,"assertCondition");var lp={};Vr(lp,{NEWLINE_REGEXP:()=>Ev,escapeRegExp:()=>ri,getTerminalParts:()=>bv,isMultilineComment:()=>up,isWhitespace:()=>ql,partialMatches:()=>cp,partialRegExp:()=>fp,whitespaceCharacters:()=>_v});function U(e){return e.charCodeAt(0)}i(U,"cc");function Po(e,t){Array.isArray(e)?e.forEach(function(r){t.push(r)}):t.push(e)}i(Po,"insertToSet");function $a(e,t){if(e[t]===!0)throw"duplicate flag "+t;e[t],e[t]=!0}i($a,"addFlag");function sn(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}i(sn,"ASSERT_EXISTS");function Rv(){throw Error("Internal Error - Should never get here!")}i(Rv,"ASSERT_NEVER_REACH_HERE");function Cf(e){return e.type==="Character"}i(Cf,"isCharacter");var cl=[];for(let e=U("0");e<=U("9");e++)cl.push(e);var fl=[U("_")].concat(cl);for(let e=U("a");e<=U("z");e++)fl.push(e);for(let e=U("A");e<=U("Z");e++)fl.push(e);var ch=[U(" "),U("\f"),U(` +`),U("\r"),U(" "),U("\v"),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U(" "),U("\u2028"),U("\u2029"),U(" "),U(" "),U(" "),U("\uFEFF")],iN=/[0-9a-fA-F]/,ao=/[0-9]/,sN=/[1-9]/,Av=class{static{i(this,"RegExpParser")}constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const r={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":$a(r,"global");break;case"i":$a(r,"ignoreCase");break;case"m":$a(r,"multiLine");break;case"u":$a(r,"unicode");break;case"y":$a(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}break}}sn(t);const r=this.disjunction();return this.consumeChar(")"),{type:t,value:r,loc:this.loc(e)}}return Rv()}quantifier(e=!1){let t;const r=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),t={atLeast:n,atMost:a}):t={atLeast:n,atMost:1/0},this.consumeChar("}");break}if(e===!0&&t===void 0)return;sn(t);break}if(!(e===!0&&t===void 0)&&sn(t))return this.peekChar(0)==="?"?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(r),t}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),sn(e))return e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[U(` +`),U("\r"),U("\u2028"),U("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=cl;break;case"D":e=cl,t=!0;break;case"s":e=ch;break;case"S":e=ch,t=!0;break;case"w":e=fl;break;case"W":e=fl,t=!0;break}if(sn(e))return{type:"Set",value:e,complement:t}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=U("\f");break;case"n":e=U(` +`);break;case"r":e=U("\r");break;case"t":e=U(" ");break;case"v":e=U("\v");break}if(sn(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:U("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:U(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case` +`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:U(e)}}}characterClass(){const e=[];let t=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),t=!0);this.isClassAtom();){const r=this.classAtom();if(r.type,Cf(r)&&this.isRangeDash()){this.consumeChar("-");const n=this.classAtom();if(n.type,Cf(n)){if(n.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},Vl=class{static{i(this,"BaseRegExpVisitor")}visitChildren(e){for(const t in e){const r=e[t];e.hasOwnProperty(t)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.forEach(n=>{this.visit(n)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},Ev=/\r?\n/gm,Cv=new Av,oN=class extends Vl{static{i(this,"TerminalRegExpVisitor")}constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const t=String.fromCharCode(e.value);if(!this.multiline&&t===` +`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=ri(t);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const t=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(t);this.multiline=!!` +`.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const t=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},bn=new oN;function bv(e){try{typeof e!="string"&&(e=e.source),e=`/${e}/`;const t=Cv.pattern(e),r=[];for(const n of t.value.value)bn.reset(e),bn.visit(n),r.push({start:bn.startRegexp,end:bn.endRegex});return r}catch{return[]}}i(bv,"getTerminalParts");function up(e){try{return typeof e=="string"&&(e=new RegExp(e)),e=e.toString(),bn.reset(e),bn.visit(Cv.pattern(e)),bn.multiline}catch{return!1}}i(up,"isMultilineComment");var _v=`\f +\r \v              \u2028\u2029   \uFEFF`.split("");function ql(e){const t=typeof e=="string"?new RegExp(e):e;return _v.some(r=>t.test(r))}i(ql,"isWhitespace");function ri(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(ri,"escapeRegExp");function cp(e,t){const r=fp(e),n=t.match(r);return!!n&&n[0].length>0}i(cp,"partialMatches");function fp(e){typeof e=="string"&&(e=new RegExp(e));const t=e,r=e.source;let n=0;function a(){let s="",o;function l(c){s+=r.substr(n,c),n+=c}i(l,"appendRaw");function u(c){s+="(?:"+r.substr(n,c)+"|$)",n+=c}for(i(u,"appendOptional");n",n)-n+1);break;default:u(2);break}break;case"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=n,o=o.exec(r)||[],u(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":l(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=n,o=o.exec(r),o?l(o[0].length):u(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":s+="(?:",n+=3,s+=a()+"|$)";break;case"=":s+="(?=",n+=3,s+=a()+")";break;case"!":o=n,n+=3,a(),s+=r.substr(o,n-o);break;case"<":switch(r[n+3]){case"=":case"!":o=n,n+=4,a(),s+=r.substr(o,n-o);break;default:l(r.indexOf(">",n)-n+1),s+=a()+"|$)";break}break}else l(1),s+=a()+"|$)";break;case")":return++n,s;default:u(1);break}return s}return i(a,"process"),new RegExp(a(),e.flags)}i(fp,"partialRegExp");function dp(e){return e.rules.find(t=>it(t)&&t.entry)}i(dp,"getEntryRule");function pp(e){return e.rules.filter(t=>Nt(t)&&t.hidden)}i(pp,"getHiddenRules");function Hl(e,t){const r=new Set,n=dp(e);if(!n)return new Set(e.rules);const a=[n].concat(pp(e));for(const o of a)mp(o,r,t);const s=new Set;for(const o of e.rules)(r.has(o.name)||Nt(o)&&o.hidden)&&s.add(o);return s}i(Hl,"getAllReachableRules");function mp(e,t,r){t.add(e.name),Nr(e).forEach(n=>{if(Er(n)||r&&jl(n)){const a=n.rule.ref;a&&!t.has(a.name)&&mp(a,t,r)}})}i(mp,"ruleDfs");function Sv(e){const t=new Set;return Nr(e).forEach(r=>{Fn(r)&&(it(r.type.ref)&&t.add(r.type.ref),Fs(r.type.ref)&&it(r.type.ref.$container)&&t.add(r.type.ref.$container))}),t}i(Sv,"getAllRulesUsedForCrossReferences");function hp(e){if(e.terminal)return e.terminal;if(e.type.ref)return Zl(e.type.ref)?.terminal}i(hp,"getCrossReferenceTerminal");function yp(e){return e.hidden&&!ql(Bs(e))}i(yp,"isCommentTerminal");function gp(e,t){return!e||!t?[]:Xl(e,t,e.astNode,!0)}i(gp,"findNodesForProperty");function Yl(e,t,r){if(!e||!t)return;const n=Xl(e,t,e.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}i(Yl,"findNodeForProperty");function Xl(e,t,r,n){if(!n){const a=Mn(e.grammarSource,Rr);if(a&&a.feature===t)return[e]}return $r(e)&&e.astNode===r?e.content.flatMap(a=>Xl(a,t,r,!1)):[]}i(Xl,"findNodesForPropertyInternal");function wv(e,t){return e?Jl(e,t,e?.astNode):[]}i(wv,"findNodesForKeyword");function vp(e,t,r){if(!e)return;const n=Jl(e,t,e?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}i(vp,"findNodeForKeyword");function Jl(e,t,r){if(e.astNode!==r)return[];if(Ar(e.grammarSource)&&e.grammarSource.value===t)return[e];const n=Ha(e).iterator();let a;const s=[];do if(a=n.next(),!a.done){const o=a.value;o.astNode===r?Ar(o.grammarSource)&&o.grammarSource.value===t&&s.push(o):n.prune()}while(!a.done);return s}i(Jl,"findNodesForKeywordInternal");function Tp(e){const t=e.astNode;for(;t===e.container?.astNode;){const r=Mn(e.grammarSource,Rr);if(r)return r;e=e.container}}i(Tp,"findAssignment");function Zl(e){let t=e;return Fs(t)&&(jr(t.$container)?t=t.$container.$container:Gn(t.$container)?t=t.$container:qr(t.$container)),$p(e,t,new Map)}i(Zl,"findNameAssignment");function $p(e,t,r){function n(a,s){let o;return Mn(a,Rr)||(o=$p(s,s,r)),r.set(e,o),o}if(i(n,"go"),r.has(e))return r.get(e);r.set(e,void 0);for(const a of Nr(t)){if(Rr(a)&&a.feature.toLowerCase()==="name")return r.set(e,a),a;if(Er(a)&&it(a.rule.ref))return n(a,a.rule.ref);if(zl(a)&&a.typeRef?.ref)return n(a,a.typeRef.ref)}}i($p,"findNameAssignmentInternal");function Rp(e){const t=e.$container;if(zn(t)){const r=t.elements,n=r.indexOf(e);for(let a=n-1;a>=0;a--){const s=r[a];if(jr(s))return s;{const o=Nr(r[a]).find(jr);if(o)return o}}}if(Gl(t))return Rp(t)}i(Rp,"getActionAtElement");function Iv(e,t){return e==="?"||e==="*"||zn(t)&&!!t.guardCondition}i(Iv,"isOptionalCardinality");function Nv(e){return e==="*"||e==="+"}i(Nv,"isArrayCardinality");function Pv(e){return e==="+="}i(Pv,"isArrayOperator");function zs(e){return Ap(e,new Set)}i(zs,"isDataTypeRule");function Ap(e,t){if(t.has(e))return!0;t.add(e);for(const r of Nr(e))if(Er(r)){if(!r.rule.ref||it(r.rule.ref)&&!Ap(r.rule.ref,t)||qa(r.rule.ref))return!1}else{if(Rr(r))return!1;if(jr(r))return!1}return!!e.definition}i(Ap,"isDataTypeRuleInternal");function kv(e){return dl(e.type,new Set)}i(kv,"isDataType");function dl(e,t){if(t.has(e))return!0;if(t.add(e),Od(e))return!1;if(Ud(e))return!1;if(Hd(e))return e.types.every(r=>dl(r,t));if(zl(e)){if(e.primitiveType!==void 0)return!0;if(e.stringType!==void 0)return!0;if(e.typeRef!==void 0){const r=e.typeRef.ref;return Bl(r)?dl(r.type,t):!1}else return!1}else return!1}i(dl,"isDataTypeInternal");function js(e){if(!Nt(e)){if(e.inferredType)return e.inferredType.name;if(e.dataType)return e.dataType;if(e.returnType){const t=e.returnType.ref;if(t)return t.name}}}i(js,"getExplicitRuleType");function Pn(e){if(Gn(e))return it(e)&&zs(e)?e.name:js(e)??e.name;if(Fd(e)||Bl(e)||Wd(e))return e.name;if(jr(e)){const t=Ep(e);if(t)return t}else if(Fs(e))return e.name;throw new Error("Cannot get name of Unknown Type")}i(Pn,"getTypeName");function Ep(e){if(e.inferredType)return e.inferredType.name;if(e.type?.ref)return Pn(e.type.ref)}i(Ep,"getActionType");function Ov(e){return Nt(e)?e.type?.name??"string":it(e)&&zs(e)?e.name:js(e)??e.name}i(Ov,"getRuleTypeName");function Cp(e){return Nt(e)?e.type?.name??"string":js(e)??e.name}i(Cp,"getRuleType");function Bs(e){const t={s:!1,i:!1,u:!1},r=jn(e.definition,t),n=Object.entries(t).filter(([,a])=>a).map(([a])=>a).join("");return new RegExp(r,n)}i(Bs,"terminalRegex");var bp=/[\s\S]/.source;function jn(e,t){if(Vd(e))return Lv(e);if(qd(e))return Dv(e);if(Dd(e))return Gv(e);if(jl(e)){const r=e.rule.ref;if(!r)throw new Error("Missing rule reference.");return nr(jn(r.definition),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}else{if(zd(e))return Mv(e);if(Yd(e))return xv(e);if(Kd(e)){const r=e.regex.lastIndexOf("/"),n=e.regex.substring(1,r),a=e.regex.substring(r+1);return t&&(t.i=a.includes("i"),t.s=a.includes("s"),t.u=a.includes("u")),nr(n,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}else{if(Xd(e))return nr(bp,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized});throw new Error(`Invalid terminal element: ${e?.$type}, ${e?.$cstNode?.text}`)}}}i(jn,"abstractElementToRegex");function Lv(e){return nr(e.elements.map(t=>jn(t)).join("|"),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}i(Lv,"terminalAlternativesToRegex");function Dv(e){return nr(e.elements.map(t=>jn(t)).join(""),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}i(Dv,"terminalGroupToRegex");function xv(e){return nr(`${bp}*?${jn(e.terminal)}`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}i(xv,"untilTokenToRegex");function Mv(e){return nr(`(?!${jn(e.terminal)})${bp}*?`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}i(Mv,"negateTokenToRegex");function Gv(e){return e.right?nr(`[${ko(e.left)}-${ko(e.right)}]`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1}):nr(ko(e.left),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}i(Gv,"characterRangeToRegex");function ko(e){return ri(e.value)}i(ko,"keywordToRegex");function nr(e,t){return(t.parenthesized||t.lookahead||t.wrap!==!1)&&(e=`(${t.lookahead??(t.parenthesized?"":"?:")}${e})`),t.cardinality?`${e}${t.cardinality}`:e}i(nr,"withCardinality");function _p(e){const t=[],r=e.Grammar;for(const n of r.rules)Nt(n)&&yp(n)&&up(Bs(n))&&t.push(n.name);return{multilineCommentRules:t,nameRegexp:tp}}i(_p,"createGrammarConfig");var lN=typeof global=="object"&&global&&global.Object===Object&&global,Fv=lN,uN=typeof self=="object"&&self&&self.Object===Object&&self,cN=Fv||uN||Function("return this")(),ir=cN,fN=ir.Symbol,wt=fN,zv=Object.prototype,dN=zv.hasOwnProperty,pN=zv.toString,Oi=wt?wt.toStringTag:void 0;function jv(e){var t=dN.call(e,Oi),r=e[Oi];try{e[Oi]=void 0;var n=!0}catch{}var a=pN.call(e);return n&&(t?e[Oi]=r:delete e[Oi]),a}i(jv,"getRawTag");var mN=jv,hN=Object.prototype,yN=hN.toString;function Bv(e){return yN.call(e)}i(Bv,"objectToString");var gN=Bv,vN="[object Null]",TN="[object Undefined]",fh=wt?wt.toStringTag:void 0;function Uv(e){return e==null?e===void 0?TN:vN:fh&&fh in Object(e)?mN(e):gN(e)}i(Uv,"baseGetTag");var Hr=Uv;function Kv(e){return e!=null&&typeof e=="object"}i(Kv,"isObjectLike");var jt=Kv,$N="[object Symbol]";function Wv(e){return typeof e=="symbol"||jt(e)&&Hr(e)==$N}i(Wv,"isSymbol");var Ql=Wv;function Vv(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r0){if(++t>=rP)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}i(uT,"shortOut");var iP=uT;function cT(e){return function(){return e}}i(cT,"constant");var sP=cT,oP=(function(){try{var e=Un(Object,"defineProperty");return e({},"",{}),e}catch{}})(),pl=oP,lP=pl?function(e,t){return pl(e,"toString",{configurable:!0,enumerable:!1,value:sP(t),writable:!0})}:Ws,uP=lP,cP=iP(uP),fP=cP;function fT(e,t){for(var r=-1,n=e==null?0:e.length;++r-1}i(vT,"arrayIncludes");var TT=vT,mP=9007199254740991,hP=/^(?:0|[1-9]\d*)$/;function $T(e,t){var r=typeof e;return t=t??mP,!!t&&(r=="number"||r!="symbol"&&hP.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=TP}i(ST,"isLength");var Pp=ST;function wT(e){return e!=null&&Pp(e.length)&&!Pr(e)}i(wT,"isArrayLike");var sr=wT;function IT(e,t,r){if(!It(r))return!1;var n=typeof t;return(n=="number"?sr(r)&&eu(t,r.length):n=="string"&&t in r)?Vs(r[t],e):!1}i(IT,"isIterateeCall");var ru=IT;function NT(e){return Np(function(t,r){var n=-1,a=r.length,s=a>1?r[a-1]:void 0,o=a>2?r[2]:void 0;for(s=e.length>3&&typeof s=="function"?(a--,s):void 0,o&&ru(r[0],r[1],o)&&(s=a<3?void 0:s,a=1),t=Object(t);++n-1}i(s$,"listCacheHas");var Mk=s$;function o$(e,t){var r=this.__data__,n=iu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}i(o$,"listCacheSet");var Gk=o$;function Wn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0&&r(l)?t>1?xp(l,t-1,r,n,a):Dp(a,l):n||(a[a.length]=l)}return a}i(xp,"baseFlatten");var Mp=xp;function E$(e){var t=e==null?0:e.length;return t?Mp(e,1):[]}i(E$,"flatten");var Ft=E$,nO=UT(Object.getPrototypeOf,Object),C$=nO;function b$(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(a);++nl))return!1;var c=s.get(e),f=s.get(t);if(c&&f)return c==t&&f==e;var d=-1,m=!0,g=r&q0?new jp:void 0;for(s.set(e,t),s.set(t,e);++d2?t[2]:void 0;for(a&&ru(t[0],t[1],a)&&(n=1);++r=zL&&(s=Bp,o=!1,t=new jp(t));e:for(;++a-1?a[s?t[o]:o]:void 0}}i(sA,"createFind");var VL=sA,qL=Math.max;function oA(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:Ks(r);return a<0&&(a=qL(n+a,0)),mT(e,or(t),a)}i(oA,"findIndex");var HL=oA,YL=VL(HL),Ja=YL;function lA(e){return e&&e.length?e[0]:void 0}i(lA,"head");var Bt=lA;function uA(e,t){var r=-1,n=sr(e)?Array(e.length):[];return Hn(e,function(a,s,o){n[++r]=t(a,s,o)}),n}i(uA,"baseMap");var XL=uA;function cA(e,t){var r=re(e)?Us:XL;return r(e,or(t))}i(cA,"map");var F=cA;function fA(e,t){return Mp(F(e,t),1)}i(fA,"flatMap");var St=fA,JL=Object.prototype,ZL=JL.hasOwnProperty,QL=ML(function(e,t,r){ZL.call(e,r)?e[r].push(t):Ip(e,r,[t])}),eD=QL,tD=Object.prototype,rD=tD.hasOwnProperty;function dA(e,t){return e!=null&&rD.call(e,t)}i(dA,"baseHas");var nD=dA;function pA(e,t){return e!=null&&PR(e,t,nD)}i(pA,"has");var B=pA,aD="[object String]";function mA(e){return typeof e=="string"||!re(e)&&jt(e)&&Hr(e)==aD}i(mA,"isString");var mt=mA;function hA(e,t){return Us(t,function(r){return e[r]})}i(hA,"baseValues");var iD=hA;function yA(e){return e==null?[]:iD(e,$t(e))}i(yA,"values");var Me=yA,sD=Math.max;function gA(e,t,r,n){e=sr(e)?e:Me(e),r=r&&!n?Ks(r):0;var a=e.length;return r<0&&(r=sD(a+r,0)),mt(e)?r<=a&&e.indexOf(t,r)>-1:!!a&&wp(e,t,r)>-1}i(gA,"includes");var ut=gA,oD=Math.max;function vA(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:Ks(r);return a<0&&(a=oD(n+a,0)),wp(e,t,a)}i(vA,"indexOf");var Uh=vA,lD="[object Map]",uD="[object Set]",cD=Object.prototype,fD=cD.hasOwnProperty;function TA(e){if(e==null)return!0;if(sr(e)&&(re(e)||typeof e=="string"||typeof e.splice=="function"||Rs(e)||kp(e)||nu(e)))return!e.length;var t=Xa(e);if(t==lD||t==uD)return!e.size;if(Hs(e))return!WT(e).length;for(var r in e)if(fD.call(e,r))return!1;return!0}i(TA,"isEmpty");var me=TA,dD="[object RegExp]";function $A(e){return jt(e)&&Hr(e)==dD}i($A,"baseIsRegExp");var pD=$A,Kh=Br&&Br.isRegExp,mD=Kh?Ys(Kh):pD,Cr=mD;function RA(e){return e===void 0}i(RA,"isUndefined");var br=RA,hD="Expected a function";function AA(e){if(typeof e!="function")throw new TypeError(hD);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}i(AA,"negate");var yD=AA;function EA(e,t,r,n){if(!It(e))return e;t=cu(t,e);for(var a=-1,s=t.length,o=s-1,l=e;l!=null&&++a=CD){var c=t?null:ED(e);if(c)return Up(c);o=!1,a=Bp,u=new jp}else u=t?[]:l;e:for(;++n{t.accept(e)})}},st=class extends lr{static{i(this,"NonTerminal")}constructor(e){super([]),this.idx=1,Rt(this,Ut(e,t=>t!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},ni=class extends lr{static{i(this,"Rule")}constructor(e){super(e.definition),this.orgText="",Rt(this,Ut(e,t=>t!==void 0))}},ht=class extends lr{static{i(this,"Alternative")}constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Rt(this,Ut(e,t=>t!==void 0))}},He=class extends lr{static{i(this,"Option")}constructor(e){super(e.definition),this.idx=1,Rt(this,Ut(e,t=>t!==void 0))}},Et=class extends lr{static{i(this,"RepetitionMandatory")}constructor(e){super(e.definition),this.idx=1,Rt(this,Ut(e,t=>t!==void 0))}},Ct=class extends lr{static{i(this,"RepetitionMandatoryWithSeparator")}constructor(e){super(e.definition),this.idx=1,Rt(this,Ut(e,t=>t!==void 0))}},be=class extends lr{static{i(this,"Repetition")}constructor(e){super(e.definition),this.idx=1,Rt(this,Ut(e,t=>t!==void 0))}},yt=class extends lr{static{i(this,"RepetitionWithSeparator")}constructor(e){super(e.definition),this.idx=1,Rt(this,Ut(e,t=>t!==void 0))}},gt=class extends lr{static{i(this,"Alternation")}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Rt(this,Ut(e,t=>t!==void 0))}},ve=class{static{i(this,"Terminal")}constructor(e){this.idx=1,Rt(this,Ut(e,t=>t!==void 0))}accept(e){e.visit(this)}};function xA(e){return F(e,ms)}i(xA,"serializeGrammar");function ms(e){function t(r){return F(r,ms)}if(i(t,"convertDefinition"),e instanceof st){const r={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return mt(e.label)&&(r.label=e.label),r}else{if(e instanceof ht)return{type:"Alternative",definition:t(e.definition)};if(e instanceof He)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof Et)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof Ct)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:ms(new ve({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof yt)return{type:"RepetitionWithSeparator",idx:e.idx,separator:ms(new ve({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof be)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof gt)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof ve){const r={type:"Terminal",name:e.terminalType.name,label:LA(e.terminalType),idx:e.idx};mt(e.label)&&(r.terminalLabel=e.label);const n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(r.pattern=Cr(n)?n.source:n),r}else{if(e instanceof ni)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}}i(ms,"serializeProduction");var ai=class{static{i(this,"GAstVisitor")}visit(e){const t=e;switch(t.constructor){case st:return this.visitNonTerminal(t);case ht:return this.visitAlternative(t);case He:return this.visitOption(t);case Et:return this.visitRepetitionMandatory(t);case Ct:return this.visitRepetitionMandatoryWithSeparator(t);case yt:return this.visitRepetitionWithSeparator(t);case be:return this.visitRepetition(t);case gt:return this.visitAlternation(t);case ve:return this.visitTerminal(t);case ni:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function MA(e){return e instanceof ht||e instanceof He||e instanceof be||e instanceof Et||e instanceof Ct||e instanceof yt||e instanceof ve||e instanceof ni}i(MA,"isSequenceProd");function _s(e,t=[]){return e instanceof He||e instanceof be||e instanceof yt?!0:e instanceof gt?PA(e.definition,n=>_s(n,t)):e instanceof st&&ut(t,e)?!1:e instanceof lr?(e instanceof st&&t.push(e),zt(e.definition,n=>_s(n,t))):!1}i(_s,"isOptionalProd");function GA(e){return e instanceof gt}i(GA,"isBranchingProd");function Dt(e){if(e instanceof st)return"SUBRULE";if(e instanceof He)return"OPTION";if(e instanceof gt)return"OR";if(e instanceof Et)return"AT_LEAST_ONE";if(e instanceof Ct)return"AT_LEAST_ONE_SEP";if(e instanceof yt)return"MANY_SEP";if(e instanceof be)return"MANY";if(e instanceof ve)return"CONSUME";throw Error("non exhaustive match")}i(Dt,"getProductionDslName");var pu=class{static{i(this,"RestWalker")}walk(e,t=[]){K(e.definition,(r,n)=>{const a=qe(e.definition,n+1);if(r instanceof st)this.walkProdRef(r,a,t);else if(r instanceof ve)this.walkTerminal(r,a,t);else if(r instanceof ht)this.walkFlat(r,a,t);else if(r instanceof He)this.walkOption(r,a,t);else if(r instanceof Et)this.walkAtLeastOne(r,a,t);else if(r instanceof Ct)this.walkAtLeastOneSep(r,a,t);else if(r instanceof yt)this.walkManySep(r,a,t);else if(r instanceof be)this.walkMany(r,a,t);else if(r instanceof gt)this.walkOr(r,a,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,r){}walkProdRef(e,t,r){}walkFlat(e,t,r){const n=t.concat(r);this.walk(e,n)}walkOption(e,t,r){const n=t.concat(r);this.walk(e,n)}walkAtLeastOne(e,t,r){const n=[new He({definition:e.definition})].concat(t,r);this.walk(e,n)}walkAtLeastOneSep(e,t,r){const n=If(e,t,r);this.walk(e,n)}walkMany(e,t,r){const n=[new He({definition:e.definition})].concat(t,r);this.walk(e,n)}walkManySep(e,t,r){const n=If(e,t,r);this.walk(e,n)}walkOr(e,t,r){const n=t.concat(r);K(e.definition,a=>{const s=new ht({definition:[a]});this.walk(s,n)})}};function If(e,t,r){return[new He({definition:[new ve({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}i(If,"restForRepetitionWithSeparator");function ii(e){if(e instanceof st)return ii(e.referencedRule);if(e instanceof ve)return jA(e);if(MA(e))return FA(e);if(GA(e))return zA(e);throw Error("non exhaustive match")}i(ii,"first");function FA(e){let t=[];const r=e.definition;let n=0,a=r.length>n,s,o=!0;for(;a&&o;)s=r[n],o=_s(s),t=t.concat(ii(s)),n=n+1,a=r.length>n;return Vp(t)}i(FA,"firstForSequence");function zA(e){const t=F(e.definition,r=>ii(r));return Vp(Ft(t))}i(zA,"firstForBranching");function jA(e){return[e.terminalType]}i(jA,"firstForTerminal");var BA="_~IN~_",_D=class extends pu{static{i(this,"ResyncFollowsWalker")}constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,r){}walkProdRef(e,t,r){const n=KA(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(r),s=new ht({definition:a}),o=ii(s);this.follows[n]=o}};function UA(e){const t={};return K(e,r=>{const n=new _D(r).startWalking();Rt(t,n)}),t}i(UA,"computeAllProdsFollows");function KA(e,t){return e.name+t+BA}i(KA,"buildBetweenProdsFollowPrefix");var Oo={},SD=new Av;function Zs(e){const t=e.toString();if(Oo.hasOwnProperty(t))return Oo[t];{const r=SD.pattern(t);return Oo[t]=r,r}}i(Zs,"getRegExpAst");function WA(){Oo={}}i(WA,"clearRegExpParserCache");var VA="Complement Sets are not supported for first char optimization",yl=`Unable to use "first char" lexer optimizations: +`;function qA(e,t=!1){try{const r=Zs(e);return gl(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===VA)t&&qp(`${yl} Unable to optimize: < ${e.toString()} > + Complement Sets cannot be automatically optimized. + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";t&&(n=` + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),hl(`${yl} + Failed parsing: < ${e.toString()} > + Using the @chevrotain/regexp-to-ast library + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}i(qA,"getOptimizedStartCodesIndices");function gl(e,t,r){switch(e.type){case"Disjunction":for(let a=0;a{if(typeof u=="number")Ji(u,t,r);else{const c=u;if(r===!0)for(let f=c.from;f<=c.to;f++)Ji(f,t,r);else{for(let f=c.from;f<=c.to&&f=Qi){const f=c.from>=Qi?c.from:Qi,d=c.to,m=_r(f),g=_r(d);for(let v=m;v<=g;v++)t[v]=v}}}});break;case"Group":gl(o.value,t,r);break;default:throw Error("Non Exhaustive Match")}const l=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&vl(o)===!1||o.type!=="Group"&&l===!1)break}break;default:throw Error("non exhaustive match!")}return Me(t)}i(gl,"firstCharOptimizedIndices");function Ji(e,t,r){const n=_r(e);t[n]=n,r===!0&&HA(e,t)}i(Ji,"addOptimizedIdxToResult");function HA(e,t){const r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r){const a=_r(n.charCodeAt(0));t[a]=a}else{const a=r.toLowerCase();if(a!==r){const s=_r(a.charCodeAt(0));t[s]=s}}}i(HA,"handleIgnoreCase");function Nf(e,t){return Ja(e.value,r=>{if(typeof r=="number")return ut(t,r);{const n=r;return Ja(t,a=>n.from<=a&&a<=n.to)!==void 0}})}i(Nf,"findCode");function vl(e){const t=e.quantifier;return t&&t.atLeast===0?!0:e.value?re(e.value)?zt(e.value,vl):vl(e.value):!1}i(vl,"isWholeOptional");var wD=class extends Vl{static{i(this,"CharCodeFinder")}constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){ut(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Nf(e,this.targetCharCodes)===void 0&&(this.found=!0):Nf(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function mu(e,t){if(t instanceof RegExp){const r=Zs(t),n=new wD(e);return n.visit(r),n.found}else return Ja(t,r=>ut(e,r.charCodeAt(0)))!==void 0}i(mu,"canMatchCharCode");var On="PATTERN",Zi="defaultMode",so="modes";function YA(e,t){t=Wp(t,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:i((I,R)=>R(),"tracer")});const r=t.tracer;r("initCharCodeToOptimizedIndexMap",()=>{yE()});let n;r("Reject Lexer.NA",()=>{n=du(e,I=>I[On]===at.NA)});let a=!1,s;r("Transform Patterns",()=>{a=!1,s=F(n,I=>{const R=I[On];if(Cr(R)){const P=R.source;return P.length===1&&P!=="^"&&P!=="$"&&P!=="."&&!R.ignoreCase?P:P.length===2&&P[0]==="\\"&&!ut(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],P[1])?P[1]:Pf(R)}else{if(Pr(R))return a=!0,{exec:R};if(typeof R=="object")return a=!0,R;if(typeof R=="string"){if(R.length===1)return R;{const P=R.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),z=new RegExp(P);return Pf(z)}}else throw Error("non exhaustive match")}})});let o,l,u,c,f;r("misc mapping",()=>{o=F(n,I=>I.tokenTypeIdx),l=F(n,I=>{const R=I.GROUP;if(R!==at.SKIPPED){if(mt(R))return R;if(br(R))return!1;throw Error("non exhaustive match")}}),u=F(n,I=>{const R=I.LONGER_ALT;if(R)return re(R)?F(R,z=>Uh(n,z)):[Uh(n,R)]}),c=F(n,I=>I.PUSH_MODE),f=F(n,I=>B(I,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const I=Zp(t.lineTerminatorCharacters);d=F(n,R=>!1),t.positionTracking!=="onlyOffset"&&(d=F(n,R=>B(R,"LINE_BREAKS")?!!R.LINE_BREAKS:Jp(R,I)===!1&&mu(I,R.PATTERN)))});let m,g,v,b;r("Misc Mapping #2",()=>{m=F(n,Xp),g=F(s,mE),v=At(n,(I,R)=>{const P=R.GROUP;return mt(P)&&P!==at.SKIPPED&&(I[P]=[]),I},{}),b=F(s,(I,R)=>({pattern:s[R],longerAlt:u[R],canLineTerminator:d[R],isCustom:m[R],short:g[R],group:l[R],push:c[R],pop:f[R],tokenTypeIdx:o[R],tokenType:n[R]}))});let S=!0,w=[];return t.safeMode||r("First Char Optimization",()=>{w=At(n,(I,R,P)=>{if(typeof R.PATTERN=="string"){const z=R.PATTERN.charCodeAt(0),X=_r(z);Lo(I,X,b[P])}else if(re(R.START_CHARS_HINT)){let z;K(R.START_CHARS_HINT,X=>{const Z=typeof X=="string"?X.charCodeAt(0):X,ce=_r(Z);z!==ce&&(z=ce,Lo(I,ce,b[P]))})}else if(Cr(R.PATTERN))if(R.PATTERN.unicode)S=!1,t.ensureOptimizations&&hl(`${yl} Unable to analyze < ${R.PATTERN.toString()} > pattern. + The regexp unicode flag is not currently supported by the regexp-to-ast library. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const z=qA(R.PATTERN,t.ensureOptimizations);me(z)&&(S=!1),K(z,X=>{Lo(I,X,b[P])})}else t.ensureOptimizations&&hl(`${yl} TokenType: <${R.name}> is using a custom token pattern without providing parameter. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),S=!1;return I},[])}),{emptyGroups:v,patternIdxToConfig:b,charCodeToPatternIdxToConfig:w,hasCustom:a,canBeOptimized:S}}i(YA,"analyzeTokenTypes");function XA(e,t){let r=[];const n=ZA(e);r=r.concat(n.errors);const a=QA(n.valid),s=a.valid;return r=r.concat(a.errors),r=r.concat(JA(s)),r=r.concat(iE(s)),r=r.concat(sE(s,t)),r=r.concat(oE(s)),r}i(XA,"validatePatterns");function JA(e){let t=[];const r=Pt(e,n=>Cr(n[On]));return t=t.concat(eE(r)),t=t.concat(rE(r)),t=t.concat(nE(r)),t=t.concat(aE(r)),t=t.concat(tE(r)),t}i(JA,"validateRegExpPattern");function ZA(e){const t=Pt(e,a=>!B(a,On)),r=F(t,a=>({message:"Token Type: ->"+a.name+"<- missing static 'PATTERN' property",type:_e.MISSING_PATTERN,tokenTypes:[a]})),n=fu(e,t);return{errors:r,valid:n}}i(ZA,"findMissingPatterns");function QA(e){const t=Pt(e,a=>{const s=a[On];return!Cr(s)&&!Pr(s)&&!B(s,"exec")&&!mt(s)}),r=F(t,a=>({message:"Token Type: ->"+a.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:_e.INVALID_PATTERN,tokenTypes:[a]})),n=fu(e,t);return{errors:r,valid:n}}i(QA,"findInvalidPatterns");var ID=/[^\\][$]/;function eE(e){class t extends Vl{static{i(this,"EndAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const r=Pt(e,a=>{const s=a.PATTERN;try{const o=Zs(s),l=new t;return l.visit(o),l.found}catch{return ID.test(s.source)}});return F(r,a=>({message:`Unexpected RegExp Anchor Error: + Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain end of input anchor '$' + See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:_e.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}i(eE,"findEndOfInputAnchor");function tE(e){const t=Pt(e,n=>n.PATTERN.test(""));return F(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:_e.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}i(tE,"findEmptyMatchRegExps");var ND=/[^\\[][\^]|^\^/;function rE(e){class t extends Vl{static{i(this,"StartAnchorFinder")}constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const r=Pt(e,a=>{const s=a.PATTERN;try{const o=Zs(s),l=new t;return l.visit(o),l.found}catch{return ND.test(s.source)}});return F(r,a=>({message:`Unexpected RegExp Anchor Error: + Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain start of input anchor '^' + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:_e.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}i(rE,"findStartOfInputAnchor");function nE(e){const t=Pt(e,n=>{const a=n[On];return a instanceof RegExp&&(a.multiline||a.global)});return F(t,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:_e.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}i(nE,"findUnsupportedFlags");function aE(e){const t=[];let r=F(e,s=>At(e,(o,l)=>(s.PATTERN.source===l.PATTERN.source&&!ut(t,l)&&l.PATTERN!==at.NA&&(t.push(l),o.push(l)),o),[]));r=Js(r);const n=Pt(r,s=>s.length>1);return F(n,s=>{const o=F(s,u=>u.name);return{message:`The same RegExp pattern ->${Bt(s).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:_e.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}i(aE,"findDuplicatePatterns");function iE(e){const t=Pt(e,n=>{if(!B(n,"GROUP"))return!1;const a=n.GROUP;return a!==at.SKIPPED&&a!==at.NA&&!mt(a)});return F(t,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:_e.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}i(iE,"findInvalidGroupType");function sE(e,t){const r=Pt(e,a=>a.PUSH_MODE!==void 0&&!ut(t,a.PUSH_MODE));return F(r,a=>({message:`Token Type: ->${a.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${a.PUSH_MODE}<-which does not exist`,type:_e.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[a]}))}i(sE,"findModesThatDoNotExist");function oE(e){const t=[],r=At(e,(n,a,s)=>{const o=a.PATTERN;return o===at.NA||(mt(o)?n.push({str:o,idx:s,tokenType:a}):Cr(o)&&uE(o)&&n.push({str:o.source,idx:s,tokenType:a})),n},[]);return K(e,(n,a)=>{K(r,({str:s,idx:o,tokenType:l})=>{if(a${l.name}<- can never be matched. +Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition. +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:u,type:_e.UNREACHABLE_PATTERN,tokenTypes:[n,l]})}})}),t}i(oE,"findUnreachablePatterns");function lE(e,t){if(Cr(t)){if(cE(t))return!1;const r=t.exec(e);return r!==null&&r.index===0}else{if(Pr(t))return t(e,0,[],{});if(B(t,"exec"))return t.exec(e,0,[],{});if(typeof t=="string")return t===e;throw Error("non exhaustive match")}}i(lE,"tryToMatchStrToPattern");function uE(e){return Ja([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>e.source.indexOf(r)!==-1)===void 0}i(uE,"noMetaChar");function cE(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition +`,type:_e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),B(e,so)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+so+`> property in its definition +`,type:_e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),B(e,so)&&B(e,Zi)&&!B(e.modes,e.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Zi}: <${e.defaultMode}>which does not exist +`,type:_e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),B(e,so)&&K(e.modes,(a,s)=>{K(a,(o,l)=>{if(br(o))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${l}> +`,type:_e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(B(o,"LONGER_ALT")){const u=re(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];K(u,c=>{!br(c)&&!ut(a,c)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${c.name}> on token <${o.name}> outside of mode <${s}> +`,type:_e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}i(fE,"performRuntimeChecks");function dE(e,t,r){const n=[];let a=!1;const s=Js(Ft(Me(e.modes))),o=du(s,u=>u[On]===at.NA),l=Zp(r);return t&&K(o,u=>{const c=Jp(u,l);if(c!==!1){const d={message:hE(u,c),type:c.issue,tokenType:u};n.push(d)}else B(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(a=!0):mu(l,u.PATTERN)&&(a=!0)}),t&&!a&&n.push({message:`Warning: No LINE_BREAKS Found. + This Lexer has been defined to track line and column information, + But none of the Token Types can be identified as matching a line terminator. + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS + for details.`,type:_e.NO_LINE_BREAKS_FLAGS}),n}i(dE,"performWarningRuntimeChecks");function pE(e){const t={},r=$t(e);return K(r,n=>{const a=e[n];if(re(a))t[n]=[];else throw Error("non exhaustive match")}),t}i(pE,"cloneEmptyGroups");function Xp(e){const t=e.PATTERN;if(Cr(t))return!1;if(Pr(t))return!0;if(B(t,"exec"))return!0;if(mt(t))return!1;throw Error("non exhaustive match")}i(Xp,"isCustomPattern");function mE(e){return mt(e)&&e.length===1?e.charCodeAt(0):!1}i(mE,"isShortPattern");var PD={test:i(function(e){const t=e.length;for(let r=this.lastIndex;r Token Type + Root cause: ${t.errMsg}. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===_e.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. + The problem is in the <${e.name}> Token Type + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}i(hE,"buildLineBreakIssueMessage");function Zp(e){return F(e,r=>mt(r)?r.charCodeAt(0):r)}i(Zp,"getCharCodes");function Lo(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}i(Lo,"addToMapOfArrays");var Qi=256,Do=[];function _r(e){return e255?255+~~(e/255):e}}i(yE,"initCharCodeToOptimizedIndexMap");function si(e,t){const r=e.tokenTypeIdx;return r===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[r]===!0}i(si,"tokenStructuredMatcher");function Ss(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}i(Ss,"tokenStructuredMatcherNoCategories");var Wh=1,gE={};function oi(e){const t=vE(e);TE(t),RE(t),$E(t),K(t,r=>{r.isParent=r.categoryMatches.length>0})}i(oi,"augmentTokenTypes");function vE(e){let t=Ye(e),r=e,n=!0;for(;n;){r=Js(Ft(F(r,s=>s.CATEGORIES)));const a=fu(r,t);t=t.concat(a),me(a)?n=!1:r=a}return t}i(vE,"expandCategories");function TE(e){K(e,t=>{em(t)||(gE[Wh]=t,t.tokenTypeIdx=Wh++),kf(t)&&!re(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),kf(t)||(t.CATEGORIES=[]),AE(t)||(t.categoryMatches=[]),EE(t)||(t.categoryMatchesMap={})})}i(TE,"assignTokenDefaultProps");function $E(e){K(e,t=>{t.categoryMatches=[],K(t.categoryMatchesMap,(r,n)=>{t.categoryMatches.push(gE[n].tokenTypeIdx)})})}i($E,"assignCategoriesTokensProp");function RE(e){K(e,t=>{Qp([],t)})}i(RE,"assignCategoriesMapProp");function Qp(e,t){K(e,r=>{t.categoryMatchesMap[r.tokenTypeIdx]=!0}),K(t.CATEGORIES,r=>{const n=e.concat(t);ut(n,r)||Qp(n,r)})}i(Qp,"singleAssignCategoriesToksMap");function em(e){return B(e,"tokenTypeIdx")}i(em,"hasShortKeyProperty");function kf(e){return B(e,"CATEGORIES")}i(kf,"hasCategoriesProperty");function AE(e){return B(e,"categoryMatches")}i(AE,"hasExtendingTokensTypesProperty");function EE(e){return B(e,"categoryMatchesMap")}i(EE,"hasExtendingTokensTypesMapProperty");function CE(e){return B(e,"tokenTypeIdx")}i(CE,"isTokenType");var Of={buildUnableToPopLexerModeMessage(e){return`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,t,r,n,a,s){return`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${r} characters.`}},_e;(function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(_e||(_e={}));var es={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` +`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Of,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(es);var at=class{static{i(this,"Lexer")}constructor(e,t=es){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(n,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${n}>`);const{time:o,value:l}=Hp(a),u=o>10?console.warn:console.log;return this.traceInitIndent time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof t=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. +a boolean 2nd argument is no longer supported`);this.config=Rt({},es,t);const r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let n,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===es.lineTerminatorsPattern)this.config.lineTerminatorsPattern=PD;else if(this.config.lineTerminatorCharacters===es.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),re(e)?n={modes:{defaultMode:Ye(e)},defaultMode:Zi}:(a=!1,n=Ye(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(fE(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(dE(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},K(n.modes,(o,l)=>{n.modes[l]=du(o,u=>br(u))});const s=$t(n.modes);if(K(n.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(XA(o,s))}),me(this.lexerDefinitionErrors)){oi(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=YA(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=Rt({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=n.defaultMode,!me(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=F(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- +`);throw new Error(`Errors detected in definition of Lexer: +`+l)}K(this.lexerDefinitionWarning,o=>{qp(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=Fe),this.trackStartLines===!1&&(this.computeNewColumn=Ws),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Fe),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=At(this.canModeBeOptimized,(l,u,c)=>(u===!1&&l.push(c),l),[]);if(t.ensureOptimizations&&!me(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized. + Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. + Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{WA()}),this.TRACE_INIT("toFastProperties",()=>{Yp(this)})})}tokenize(e,t=this.defaultMode){if(!me(this.lexerDefinitionErrors)){const n=F(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- +`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: +`+n)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let r,n,a,s,o,l,u,c,f,d,m,g,v,b,S;const w=e,I=w.length;let R=0,P=0;const z=this.hasCustom?0:Math.floor(e.length/10),X=new Array(z),Z=[];let ce=this.trackStartLines?1:void 0,se=this.trackStartLines?1:void 0;const Se=pE(this.emptyGroups),k=this.trackStartLines,C=this.config.lineTerminatorsPattern;let y=0,E=[],T=[];const $=[],_=[];Object.freeze(_);let O=!1;const x=i(Y=>{if($.length===1&&Y.tokenType.PUSH_MODE===void 0){const V=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Y);Z.push({offset:Y.startOffset,line:Y.startLine,column:Y.startColumn,length:Y.image.length,message:V})}else{$.pop();const V=kn($);E=this.patternIdxToConfig[V],T=this.charCodeToPatternIdxToConfig[V],y=E.length;const Pe=this.canModeBeOptimized[V]&&this.config.safeMode===!1;T&&Pe?O=!0:O=!1}},"pop_mode");function D(Y){$.push(Y),T=this.charCodeToPatternIdxToConfig[Y],E=this.patternIdxToConfig[Y],y=E.length,y=E.length;const V=this.canModeBeOptimized[Y]&&this.config.safeMode===!1;T&&V?O=!0:O=!1}i(D,"push_mode"),D.call(this,t);let G;const W=this.config.recoveryEnabled;for(;Rl.length){l=s,f=s.length,u=c,G=ke;break}}}break}}if(f!==-1){if(d=G.group,d!==void 0&&(l=l!==null?l:e.substring(R,R+f),m=G.tokenTypeIdx,g=this.createTokenInstance(l,R,m,G.tokenType,ce,se,f),this.handlePayload(g,u),d===!1?P=this.addToken(X,P,g):Se[d].push(g)),k===!0&&G.canLineTerminator===!0){let oe=0,Le,De;C.lastIndex=0;do l=l!==null?l:e.substring(R,R+f),Le=C.test(l),Le===!0&&(De=C.lastIndex-1,oe++);while(Le===!0);oe!==0?(ce=ce+oe,se=f-De,this.updateTokenEndLineColumnLocation(g,d,De,oe,ce,se,f)):se=this.computeNewColumn(se,f)}else se=this.computeNewColumn(se,f);R=R+f,this.handleModes(G,x,D,g)}else{const oe=R,Le=ce,De=se;let ke=W===!1;for(;ke===!1&&R ${In(e)} <--`:`token of type --> ${e.name} <--`} but found --> '${t.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:e,ruleName:t}){return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:r,customUserDescription:n,ruleName:a}){const s="Expecting: ",l=` +but found: '`+Bt(t).image+"'";if(n)return s+n+l;{const u=At(e,(m,g)=>m.concat(g),[]),c=F(u,m=>`[${F(m,g=>In(g)).join(", ")}]`),d=`one of these possible Token sequences: +${F(c,(m,g)=>` ${g+1}. ${m}`).join(` +`)}`;return s+d+l}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:r,ruleName:n}){const a="Expecting: ",o=` +but found: '`+Bt(t).image+"'";if(r)return a+r+o;{const u=`expecting at least one iteration which starts with one of these possible Token sequences:: + <${F(e,c=>`[${F(c,f=>In(f)).join(",")}]`).join(" ,")}>`;return a+u+o}}};Object.freeze(Ga);var OD={buildRuleNotFoundError(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+`<- +inside top level rule: ->`+e.name+"<-"}},_n={buildDuplicateFoundError(e,t){function r(f){return f instanceof ve?f.terminalType.name:f instanceof st?f.nonTerminalName:""}i(r,"getExtraProductionArgument");const n=e.name,a=Bt(t),s=a.idx,o=Dt(a),l=r(a),u=s>0;let c=`->${o}${u?s:""}<- ${l?`with argument: ->${l}<-`:""} + appears more than once (${t.length} times) in the top level rule: ->${n}<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,` +`),c},buildNamespaceConflictError(e){return`Namespace conflict found in grammar. +The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>. +To resolve this make sure each Terminal and Non-Terminal names are unique +This is easy to accomplish by using the convention that Terminal names start with an uppercase letter +and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(e){const t=F(e.prefixPath,a=>In(a)).join(", "),r=e.alternation.idx===0?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix +in inside <${e.topLevelRule.name}> Rule, +<${t}> may appears as a prefix path in all these alternatives. +See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX +For Further details.`},buildAlternationAmbiguityError(e){const t=e.alternation.idx===0?"":e.alternation.idx,r=e.prefixPath.length===0;let n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule, +`;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable. +Only the last alternative may be empty. +`;else{const a=F(e.prefixPath,s=>In(s)).join(", ");n+=`<${a}> may appears as a prefix path in all these alternatives. +`}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`,n},buildEmptyRepetitionError(e){let t=Dt(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens. +This could lead to an infinite loop.`},buildTokenNameError(e){return"deprecated"},buildEmptyAlternationError(e){return`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule. +Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(e){return`An Alternation cannot have more than 256 alternatives: + inside <${e.topLevelRule.name}> Rule. + has ${e.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(e){const t=e.topLevelRule.name,r=F(e.leftRecursionPath,s=>s.name),n=`${t} --> ${r.concat([t]).join(" --> ")}`;return`Left Recursion found in grammar. +rule: <${t}> can be invoked from itself (directly or indirectly) +without consuming any Tokens. The grammar path that causes this is: + ${n} + To fix this refactor your grammar to remove the left recursion. +see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return"deprecated"},buildDuplicateRuleNameError(e){let t;return e.topLevelRule instanceof ni?t=e.topLevelRule.name:t=e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function _E(e,t){const r=new LD(e,t);return r.resolveRefs(),r.errors}i(_E,"resolveGrammar");var LD=class extends ai{static{i(this,"GastRefResolverVisitor")}constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){K(Me(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:ot.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},DD=class extends pu{static{i(this,"AbstractNextPossibleTokensWalker")}constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Ye(this.path.ruleStack).reverse(),this.occurrenceStack=Ye(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const n=t.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,n)}}updateExpectedNext(){me(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},xD=class extends DD{static{i(this,"NextAfterTokenWalker")}constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const n=t.concat(r),a=new ht({definition:n});this.possibleTokTypes=ii(a),this.found=!0}}},hu=class extends pu{static{i(this,"AbstractNextTerminalAfterProductionWalker")}constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},MD=class extends hu{static{i(this,"NextTerminalAfterManyWalker")}walkMany(e,t,r){if(e.idx===this.occurrence){const n=Bt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof ve&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkMany(e,t,r)}},ey=class extends hu{static{i(this,"NextTerminalAfterManySepWalker")}walkManySep(e,t,r){if(e.idx===this.occurrence){const n=Bt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof ve&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkManySep(e,t,r)}},GD=class extends hu{static{i(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(e,t,r){if(e.idx===this.occurrence){const n=Bt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof ve&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkAtLeastOne(e,t,r)}},ty=class extends hu{static{i(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(e,t,r){if(e.idx===this.occurrence){const n=Bt(t.concat(r));this.result.isEndOfRule=n===void 0,n instanceof ve&&(this.result.token=n.terminalType,this.result.occurrence=n.idx)}else super.walkAtLeastOneSep(e,t,r)}};function Tl(e,t,r=[]){r=Ye(r);let n=[],a=0;function s(l){return l.concat(qe(e,a+1))}i(s,"remainingPathWith");function o(l){const u=Tl(s(l),t,r);return n.concat(u)}for(i(o,"getAlternativesForProd");r.length{me(u.definition)===!1&&(n=o(u.definition))}),n;if(l instanceof ve)r.push(l.terminalType);else throw Error("non exhaustive match")}a++}return n.push({partialPath:r,suffixDef:qe(e,a)}),n}i(Tl,"possiblePathsFrom");function nm(e,t,r,n){const a="EXIT_NONE_TERMINAL",s=[a],o="EXIT_ALTERNATIVE";let l=!1;const u=t.length,c=u-n-1,f=[],d=[];for(d.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!me(d);){const m=d.pop();if(m===o){l&&kn(d).idx<=c&&d.pop();continue}const g=m.def,v=m.idx,b=m.ruleStack,S=m.occurrenceStack;if(me(g))continue;const w=g[0];if(w===a){const I={idx:v,def:qe(g),ruleStack:bs(b),occurrenceStack:bs(S)};d.push(I)}else if(w instanceof ve)if(v=0;I--){const R=w.definition[I],P={idx:v,def:R.definition.concat(qe(g)),ruleStack:b,occurrenceStack:S};d.push(P),d.push(o)}else if(w instanceof ht)d.push({idx:v,def:w.definition.concat(qe(g)),ruleStack:b,occurrenceStack:S});else if(w instanceof ni)d.push(SE(w,v,b,S));else throw Error("non exhaustive match")}return f}i(nm,"nextPossibleTokensAfter");function SE(e,t,r,n){const a=Ye(r);a.push(e.name);const s=Ye(n);return s.push(1),{idx:t,def:e.definition,ruleStack:a,occurrenceStack:s}}i(SE,"expandTopLevelRule");var Re;(function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"})(Re||(Re={}));function yu(e){if(e instanceof He||e==="Option")return Re.OPTION;if(e instanceof be||e==="Repetition")return Re.REPETITION;if(e instanceof Et||e==="RepetitionMandatory")return Re.REPETITION_MANDATORY;if(e instanceof Ct||e==="RepetitionMandatoryWithSeparator")return Re.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof yt||e==="RepetitionWithSeparator")return Re.REPETITION_WITH_SEPARATOR;if(e instanceof gt||e==="Alternation")return Re.ALTERNATION;throw Error("non exhaustive match")}i(yu,"getProdType");function Lf(e){const{occurrence:t,rule:r,prodType:n,maxLookahead:a}=e,s=yu(n);return s===Re.ALTERNATION?eo(t,r,a):to(t,r,s,a)}i(Lf,"getLookaheadPaths");function wE(e,t,r,n,a,s){const o=eo(e,t,r),l=im(o)?Ss:si;return s(o,n,l,a)}i(wE,"buildLookaheadFuncForOr");function IE(e,t,r,n,a,s){const o=to(e,t,a,r),l=im(o)?Ss:si;return s(o[0],l,n)}i(IE,"buildLookaheadFuncForOptionalProd");function NE(e,t,r,n){const a=e.length,s=zt(e,o=>zt(o,l=>l.length===1));if(t)return function(o){const l=F(o,u=>u.GATE);for(let u=0;uFt(u)),l=At(o,(u,c,f)=>(K(c,d=>{B(u,d.tokenTypeIdx)||(u[d.tokenTypeIdx]=f),K(d.categoryMatches,m=>{B(u,m)||(u[m]=f)})}),u),{});return function(){const u=this.LA(1);return l[u.tokenTypeIdx]}}else return function(){for(let o=0;os.length===1),a=e.length;if(n&&!r){const s=Ft(e);if(s.length===1&&me(s[0].categoryMatches)){const l=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===l}}else{const o=At(s,(l,u,c)=>(l[u.tokenTypeIdx]=!0,K(u.categoryMatches,f=>{l[f]=!0}),l),[]);return function(){const l=this.LA(1);return o[l.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;sTl([o],1)),n=Df(r.length),a=F(r,o=>{const l={};return K(o,u=>{const c=xo(u.partialPath);K(c,f=>{l[f]=!0})}),l});let s=r;for(let o=1;o<=t;o++){const l=s;s=Df(l.length);for(let u=0;u{const w=xo(S.partialPath);K(w,I=>{a[u][I]=!0})})}}}}return n}i(am,"lookAheadSequenceFromAlternatives");function eo(e,t,r,n){const a=new kE(e,Re.ALTERNATION,n);return t.accept(a),am(a.result,r)}i(eo,"getLookaheadPathsForOr");function to(e,t,r,n){const a=new kE(e,r);t.accept(a);const s=a.result,l=new FD(t,e,r).startWalking(),u=new ht({definition:s}),c=new ht({definition:l});return am([u,c],n)}i(to,"getLookaheadPathsForOptionalProd");function $l(e,t){e:for(let r=0;r{const a=t[n];return r===a||a.categoryMatchesMap[r.tokenTypeIdx]})}i(LE,"isStrictPrefixOfPath");function im(e){return zt(e,t=>zt(t,r=>zt(r,n=>me(n.categoryMatches))))}i(im,"areTokenCategoriesNotUsed");function DE(e){const t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return F(t,r=>Object.assign({type:ot.CUSTOM_LOOKAHEAD_VALIDATION},r))}i(DE,"validateLookahead");function xE(e,t,r,n){const a=St(e,u=>ME(u,r)),s=qE(e,t,r),o=St(e,u=>UE(u,r)),l=St(e,u=>FE(u,e,n,r));return a.concat(s,o,l)}i(xE,"validateGrammar");function ME(e,t){const r=new zD;e.accept(r);const n=r.allProductions,a=eD(n,GE),s=Ut(a,l=>l.length>1);return F(Me(s),l=>{const u=Bt(l),c=t.buildDuplicateFoundError(e,l),f=Dt(u),d={message:c,type:ot.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:f,occurrence:u.idx},m=sm(u);return m&&(d.parameter=m),d})}i(ME,"validateDuplicateProductions");function GE(e){return`${Dt(e)}_#_${e.idx}_#_${sm(e)}`}i(GE,"identifyProductionForDuplicates");function sm(e){return e instanceof ve?e.terminalType.name:e instanceof st?e.nonTerminalName:""}i(sm,"getExtraProductionArgument");var zD=class extends ai{static{i(this,"OccurrenceValidationCollector")}constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function FE(e,t,r,n){const a=[];if(At(t,(o,l)=>l.name===e.name?o+1:o,0)>1){const o=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:r});a.push({message:o,type:ot.DUPLICATE_RULE_NAME,ruleName:e.name})}return a}i(FE,"validateRuleDoesNotAlreadyExist");function zE(e,t,r){const n=[];let a;return ut(t,e)||(a=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:a,type:ot.INVALID_RULE_OVERRIDE,ruleName:e})),n}i(zE,"validateRuleIsOverridden");function om(e,t,r,n=[]){const a=[],s=hs(t.definition);if(me(s))return[];{const o=e.name;ut(s,e)&&a.push({message:r.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:ot.LEFT_RECURSION,ruleName:o});const u=fu(s,n.concat([e])),c=St(u,f=>{const d=Ye(n);return d.push(f),om(e,f,r,d)});return a.concat(c)}}i(om,"validateNoLeftRecursion");function hs(e){let t=[];if(me(e))return t;const r=Bt(e);if(r instanceof st)t.push(r.referencedRule);else if(r instanceof ht||r instanceof He||r instanceof Et||r instanceof Ct||r instanceof yt||r instanceof be)t=t.concat(hs(r.definition));else if(r instanceof gt)t=Ft(F(r.definition,s=>hs(s.definition)));else if(!(r instanceof ve))throw Error("non exhaustive match");const n=_s(r),a=e.length>1;if(n&&a){const s=qe(e);return t.concat(hs(s))}else return t}i(hs,"getFirstNoneTerminal");var lm=class extends ai{static{i(this,"OrCollector")}constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function jE(e,t){const r=new lm;e.accept(r);const n=r.alternations;return St(n,s=>{const o=bs(s.definition);return St(o,(l,u)=>{const c=nm([l],[],si,1);return me(c)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:s,emptyChoiceIdx:u}),type:ot.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:s.idx,alternative:u+1}]:[]})})}i(jE,"validateEmptyOrAlternative");function BE(e,t,r){const n=new lm;e.accept(n);let a=n.alternations;return a=du(a,o=>o.ignoreAmbiguities===!0),St(a,o=>{const l=o.idx,u=o.maxLookahead||t,c=eo(l,e,u,o),f=WE(c,o,e,r),d=VE(c,o,e,r);return f.concat(d)})}i(BE,"validateAmbiguousAlternationAlternatives");var jD=class extends ai{static{i(this,"RepetitionCollector")}constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function UE(e,t){const r=new lm;e.accept(r);const n=r.alternations;return St(n,s=>s.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:s}),type:ot.TOO_MANY_ALTS,ruleName:e.name,occurrence:s.idx}]:[])}i(UE,"validateTooManyAlts");function KE(e,t,r){const n=[];return K(e,a=>{const s=new jD;a.accept(s);const o=s.allProductions;K(o,l=>{const u=yu(l),c=l.maxLookahead||t,f=l.idx,m=to(f,a,u,c)[0];if(me(Ft(m))){const g=r.buildEmptyRepetitionError({topLevelRule:a,repetition:l});n.push({message:g,type:ot.NO_NON_EMPTY_LOOKAHEAD,ruleName:a.name})}})}),n}i(KE,"validateSomeNonEmptyLookaheadPath");function WE(e,t,r,n){const a=[],s=At(e,(l,u,c)=>(t.definition[c].ignoreAmbiguities===!0||K(u,f=>{const d=[c];K(e,(m,g)=>{c!==g&&$l(m,f)&&t.definition[g].ignoreAmbiguities!==!0&&d.push(g)}),d.length>1&&!$l(a,f)&&(a.push(f),l.push({alts:d,path:f}))}),l),[]);return F(s,l=>{const u=F(l.alts,f=>f+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:u,prefixPath:l.path}),type:ot.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:t.idx,alternatives:l.alts}})}i(WE,"checkAlternativesAmbiguities");function VE(e,t,r,n){const a=At(e,(o,l,u)=>{const c=F(l,f=>({idx:u,path:f}));return o.concat(c)},[]);return Js(St(a,o=>{if(t.definition[o.idx].ignoreAmbiguities===!0)return[];const u=o.idx,c=o.path,f=Pt(a,m=>t.definition[m.idx].ignoreAmbiguities!==!0&&m.idx{const g=[m.idx+1,u+1],v=t.idx===0?"":t.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:g,prefixPath:m.path}),type:ot.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:v,alternatives:g}})}))}i(VE,"checkPrefixAlternativesAmbiguities");function qE(e,t,r){const n=[],a=F(t,s=>s.name);return K(e,s=>{const o=s.name;if(ut(a,o)){const l=r.buildNamespaceConflictError(s);n.push({message:l,type:ot.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),n}i(qE,"checkTerminalAndNoneTerminalsNameSpace");function HE(e){const t=Wp(e,{errMsgProvider:OD}),r={};return K(e.rules,n=>{r[n.name]=n}),_E(r,t.errMsgProvider)}i(HE,"resolveGrammar");function YE(e){return e=Wp(e,{errMsgProvider:_n}),xE(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}i(YE,"validateGrammar");var XE="MismatchedTokenException",JE="NoViableAltException",ZE="EarlyExitException",QE="NotAllInputParsedException",eC=[XE,JE,ZE,QE];Object.freeze(eC);function ws(e){return ut(eC,e.name)}i(ws,"isRecognitionException");var gu=class extends Error{static{i(this,"RecognitionException")}constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},tC=class extends gu{static{i(this,"MismatchedTokenException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=XE}},BD=class extends gu{static{i(this,"NoViableAltException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=JE}},UD=class extends gu{static{i(this,"NotAllInputParsedException")}constructor(e,t){super(e,t),this.name=QE}},KD=class extends gu{static{i(this,"EarlyExitException")}constructor(e,t,r){super(e,t),this.previousToken=r,this.name=ZE}},Hu={},rC="InRuleRecoveryException",WD=class extends Error{static{i(this,"InRuleRecoveryException")}constructor(e){super(e),this.name=rC}},VD=class{static{i(this,"Recoverable")}initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=B(e,"recoveryEnabled")?e.recoveryEnabled:Sr.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=nC)}getTokenToInsert(e){const t=Qs(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,r,n){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let c=this.LA(1);const f=i(()=>{const d=this.LA(0),m=this.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:u,previous:d,ruleName:this.getCurrRuleFullName()}),g=new tC(m,u,this.LA(0));g.resyncedTokens=bs(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(c,n)){f();return}else if(r.call(this)){f(),e.apply(this,t);return}else this.tokenMatcher(c,a)?l=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,t,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getFollowsForInRuleRecovery(e,t){const r=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new WD("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||me(t))return!1;const r=this.LA(1);return Ja(t,a=>this.tokenMatcher(r,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(t);return ut(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA(1),r=2;for(;;){const n=Ja(e,a=>rm(t,a));if(n!==void 0)return n;t=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Hu;const e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return F(e,(r,n)=>n===0?Hu:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:t[n],inRule:this.shortRuleNameToFullName(e[n-1])})}flattenFollowSet(){const e=F(this.buildFullFollowKeyStack(),t=>this.getFollowSetFromFollowKey(t));return Ft(e)}getFollowSetFromFollowKey(e){if(e===Hu)return[Ur];const t=e.ruleName+e.idxInCallingRule+BA+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Ur)||t.push(e),t}reSyncTo(e){const t=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,t);return bs(t)}attemptInRepetitionRecovery(e,t,r,n,a,s,o){}getCurrentGrammarPath(e,t){const r=this.getHumanReadableRuleStack(),n=Ye(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:n,lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return F(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function nC(e,t,r,n,a,s,o){const l=this.getKeyForAutomaticLookahead(n,a);let u=this.firstAfterRepMap[l];if(u===void 0){const m=this.getCurrRuleFullName(),g=this.getGAstProductions()[m];u=new s(g,a).startWalking(),this.firstAfterRepMap[l]=u}let c=u.token,f=u.occurrence;const d=u.isEndOfRule;this.RULE_STACK.length===1&&d&&c===void 0&&(c=Ur,f=1),!(c===void 0||f===void 0)&&this.shouldInRepetitionRecoveryBeTried(c,f,o)&&this.tryInRepetitionRecovery(e,t,r,c)}i(nC,"attemptInRepetitionRecovery");var qD=4,Yr=8,aC=1<om(t,t,_n))}validateEmptyOrAlternatives(e){return St(e,t=>jE(t,_n))}validateAmbiguousAlternationAlternatives(e,t){return St(e,r=>BE(r,t,_n))}validateSomeNonEmptyLookaheadPath(e,t){return KE(e,t,_n)}buildLookaheadForAlternation(e){return wE(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,NE)}buildLookaheadForOptional(e){return IE(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,yu(e.prodType),PE)}},HD=class{static{i(this,"LooksAhead")}initLooksAhead(e){this.dynamicTokensEnabled=B(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Sr.dynamicTokensEnabled,this.maxLookahead=B(e,"maxLookahead")?e.maxLookahead:Sr.maxLookahead,this.lookaheadStrategy=B(e,"lookaheadStrategy")?e.lookaheadStrategy:new um({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){K(e,t=>{this.TRACE_INIT(`${t.name} Rule Lookahead`,()=>{const{alternation:r,repetition:n,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=sC(t);K(r,u=>{const c=u.idx===0?"":u.idx;this.TRACE_INIT(`${Dt(u)}${c}`,()=>{const f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:t,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),d=Go(this.fullRuleNameToShort[t.name],aC,u.idx);this.setLaFuncCache(d,f)})}),K(n,u=>{this.computeLookaheadFunc(t,u.idx,xf,"Repetition",u.maxLookahead,Dt(u))}),K(a,u=>{this.computeLookaheadFunc(t,u.idx,iC,"Option",u.maxLookahead,Dt(u))}),K(s,u=>{this.computeLookaheadFunc(t,u.idx,Mf,"RepetitionMandatory",u.maxLookahead,Dt(u))}),K(o,u=>{this.computeLookaheadFunc(t,u.idx,Mo,"RepetitionMandatoryWithSeparator",u.maxLookahead,Dt(u))}),K(l,u=>{this.computeLookaheadFunc(t,u.idx,Gf,"RepetitionWithSeparator",u.maxLookahead,Dt(u))})})})}computeLookaheadFunc(e,t,r,n,a,s){this.TRACE_INIT(`${s}${t===0?"":t}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:n}),l=Go(this.fullRuleNameToShort[e.name],r,t);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,t){const r=this.getLastExplicitRuleShortName();return Go(r,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},YD=class extends ai{static{i(this,"DslMethodsCollectorVisitor")}constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},oo=new YD;function sC(e){oo.reset(),e.accept(oo);const t=oo.dslMethods;return oo.reset(),t}i(sC,"collectMethods");function Ff(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffseto.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: + ${s.join(` + +`).replace(/\n/g,` + `)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=t,r}i(cC,"createBaseSemanticVisitorConstructor");function fC(e,t,r){const n=i(function(){},"derivedConstructor");cm(n,e+"BaseSemanticsWithDefaults");const a=Object.create(r.prototype);return K(t,s=>{a[s]=uC}),n.prototype=a,n.prototype.constructor=n,n}i(fC,"createBaseVisitorConstructorWithDefaults");var jf;(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})(jf||(jf={}));function dC(e,t){return pC(e,t)}i(dC,"validateVisitor");function pC(e,t){const r=Pt(t,a=>Pr(e[a])===!1),n=F(r,a=>({msg:`Missing visitor method: <${a}> on ${e.constructor.name} CST Visitor.`,type:jf.MISSING_METHOD,methodName:a}));return Js(n)}i(pC,"validateMissingCstMethods");var JD=class{static{i(this,"TreeBuilder")}initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=B(e,"nodeLocationTracking")?e.nodeLocationTracking:Sr.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Fe,this.cstFinallyStateUpdate=Fe,this.cstPostTerminal=Fe,this.cstPostNonTerminal=Fe,this.cstPostRule=Fe;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=zf,this.setNodeLocationFromNode=zf,this.cstPostRule=Fe,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Fe,this.setNodeLocationFromNode=Fe,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Ff,this.setNodeLocationFromNode=Ff,this.cstPostRule=Fe,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Fe,this.setNodeLocationFromNode=Fe,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Fe,this.setNodeLocationFromNode=Fe,this.cstPostRule=Fe,this.setInitialNodeLocation=Fe;else throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),r=e.location;r.startOffset<=t.startOffset?(r.endOffset=t.endOffset,r.endLine=t.endLine,r.endColumn=t.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),r=e.location;r.startOffset<=t.startOffset?r.endOffset=t.endOffset:r.startOffset=NaN}cstPostTerminal(e,t){const r=this.CST_STACK[this.CST_STACK.length-1];oC(r,t,e),this.setNodeLocationFromToken(r.location,t)}cstPostNonTerminal(e,t){const r=this.CST_STACK[this.CST_STACK.length-1];lC(r,t,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(br(this.baseCstVisitorConstructor)){const e=cC(this.className,$t(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(br(this.baseCstVisitorWithDefaultsConstructor)){const e=fC(this.className,$t(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},ZD=class{static{i(this,"LexerAdapter")}initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Rl}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Rl:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},QD=class{static{i(this,"RecognizerApi")}ACTION(e){return e.call(this)}consume(e,t,r){return this.consumeInternal(t,e,r)}subrule(e,t,r){return this.subruleInternal(t,e,r)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,r=Al){if(ut(this.definedRulesNames,e)){const s={message:_n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:ot.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const n=this.defineRule(e,t,r);return this[e]=n,n}OVERRIDE_RULE(e,t,r=Al){const n=zE(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(n);const a=this.defineRule(e,t,r);return this[e]=a,a}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return e.apply(this,t),!0}catch(n){if(ws(n))return!1;throw n}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return xA(Me(this.gastProductionsCache))}},ex=class{static{i(this,"RecognizerEngine")}initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Ss,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},B(t,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. + See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 + For Further details.`);if(re(e)){if(me(e))throw Error(`A Token Vocabulary cannot be empty. + Note that the first argument for the parser constructor + is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. + See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 + For Further details.`)}if(re(e))this.tokensMap=At(e,(a,s)=>(a[s.name]=s,a),{});else if(B(e,"modes")&&zt(Ft(Me(e.modes)),CE)){const a=Ft(Me(e.modes)),s=Vp(a);this.tokensMap=At(s,(o,l)=>(o[l.name]=l,o),{})}else if(It(e))this.tokensMap=Ye(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Ur;const r=B(e,"modes")?Ft(Me(e.modes)):Me(e),n=zt(r,a=>me(a.categoryMatches));this.tokenMatcher=n?Ss:si,oi(Me(this.tokensMap))}defineRule(e,t,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' +Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const n=B(r,"resyncEnabled")?r.resyncEnabled:Al.resyncEnabled,a=B(r,"recoveryValueFunc")?r.recoveryValueFunc:Al.recoveryValueFunc,s=this.ruleShortNameIdx<s.call(this)&&o.call(this),"lookAheadFunc")}}else a=e;if(n.call(this)===!0)return a.call(this)}atLeastOneInternal(e,t){const r=this.getKeyForAutomaticLookahead(Mf,e);return this.atLeastOneInternalLogic(e,t,r)}atLeastOneInternalLogic(e,t,r){let n=this.getLaFuncFromCache(r),a;if(typeof t!="function"){a=t.DEF;const s=t.GATE;if(s!==void 0){const o=n;n=i(()=>s.call(this)&&o.call(this),"lookAheadFunc")}}else a=t;if(n.call(this)===!0){let s=this.doSingleRepetition(a);for(;n.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,Re.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],n,Mf,e,GD)}atLeastOneSepFirstInternal(e,t){const r=this.getKeyForAutomaticLookahead(Mo,e);this.atLeastOneSepFirstInternalLogic(e,t,r)}atLeastOneSepFirstInternalLogic(e,t,r){const n=t.DEF,a=t.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){n.call(this);const o=i(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,n,ty],o,Mo,e,ty)}else throw this.raiseEarlyExitException(e,Re.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)}manyInternal(e,t){const r=this.getKeyForAutomaticLookahead(xf,e);return this.manyInternalLogic(e,t,r)}manyInternalLogic(e,t,r){let n=this.getLaFuncFromCache(r),a;if(typeof t!="function"){a=t.DEF;const o=t.GATE;if(o!==void 0){const l=n;n=i(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else a=t;let s=!0;for(;n.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],n,xf,e,MD,s)}manySepFirstInternal(e,t){const r=this.getKeyForAutomaticLookahead(Gf,e);this.manySepFirstInternalLogic(e,t,r)}manySepFirstInternalLogic(e,t,r){const n=t.DEF,a=t.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){n.call(this);const o=i(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,n,ey],o,Gf,e,ey)}}repetitionSepSecondInternal(e,t,r,n,a){for(;r();)this.CONSUME(t),n.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,r,n,a],r,Mo,e,a)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const r=this.getKeyForAutomaticLookahead(aC,t),n=re(e)?e:e.DEF,s=this.getLaFuncFromCache(r).call(this,n);if(s!==void 0)return n[s].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new UD(t,e))}}subruleInternal(e,t,r){let n;try{const a=r!==void 0?r.ARGS:void 0;return this.subruleIdx=t,n=e.apply(this,a),this.cstPostNonTerminal(n,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),n}catch(a){throw this.subruleInternalError(a,r,e.ruleName)}}subruleInternalError(e,t,r){throw ws(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,t,r){let n;try{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),n=a):this.consumeInternalError(e,a,r)}catch(a){n=this.consumeInternalRecovery(e,t,a)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,n),n}consumeInternalError(e,t,r){let n;const a=this.LA(0);throw r!==void 0&&r.ERR_MSG?n=r.ERR_MSG:n=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new tC(n,t,a))}consumeInternalRecovery(e,t,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(a){throw a.name===rC?r:a}}else throw r}saveRecogState(){const e=this.errors,t=Ye(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Ur)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},tx=class{static{i(this,"ErrorHandler")}initErrorHandler(e){this._errors=[],this.errorMessageProvider=B(e,"errorMessageProvider")?e.errorMessageProvider:Sr.errorMessageProvider}SAVE_ERROR(e){if(ws(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Ye(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Ye(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,r){const n=this.getCurrRuleFullName(),a=this.getGAstProductions()[n],o=to(e,a,t,this.maxLookahead)[0],l=[];for(let c=1;c<=this.maxLookahead;c++)l.push(this.LA(c));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:r,ruleName:n});throw this.SAVE_ERROR(new KD(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const r=this.getCurrRuleFullName(),n=this.getGAstProductions()[r],a=eo(e,n,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new BD(l,this.LA(1),o))}},rx=class{static{i(this,"ContentAssist")}initContentAssist(){}computeContentAssist(e,t){const r=this.gastProductionsCache[e];if(br(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return nm([r],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const t=Bt(e.ruleStack),n=this.getGAstProductions()[t];return new xD(n,e).startWalking()}},vu={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(vu);var ry=!0,ny=Math.pow(2,Yr)-1,mC=ja({name:"RECORDING_PHASE_TOKEN",pattern:at.NA});oi([mC]);var hC=Qs(mC,`This IToken indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(hC);var nx={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},ax=class{static{i(this,"GastRecorder")}initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(r,n){return this.consumeInternalRecord(r,e,n)},this[`SUBRULE${t}`]=function(r,n){return this.subruleInternalRecord(r,e,n)},this[`OPTION${t}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${t}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${t}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${t}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${t}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${t}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,t,r){return this.consumeInternalRecord(t,e,r)},this.subrule=function(e,t,r){return this.subruleInternalRecord(t,e,r)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const r=t>0?t:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return Rl}topLevelRuleRecord(e,t){try{const r=new ni({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),t.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+` + This error was thrown during the "grammar recording phase" For more info see: + https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,t){return Ra.call(this,He,e,t)}atLeastOneInternalRecord(e,t){Ra.call(this,Et,t,e)}atLeastOneSepFirstInternalRecord(e,t){Ra.call(this,Ct,t,e,ry)}manyInternalRecord(e,t){Ra.call(this,be,t,e)}manySepFirstInternalRecord(e,t){Ra.call(this,yt,t,e,ry)}orInternalRecord(e,t){return yC.call(this,e,t)}subruleInternalRecord(e,t,r){if(Is(t),!e||B(e,"ruleName")===!1){const o=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const n=kn(this.recordingProdStack),a=e.ruleName,s=new st({idx:t,nonTerminalName:a,label:r?.LABEL,referencedRule:void 0});return n.definition.push(s),this.outputCst?nx:vu}consumeInternalRecord(e,t,r){if(Is(t),!em(e)){const s=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const n=kn(this.recordingProdStack),a=new ve({idx:t,terminalType:e,label:r?.LABEL});return n.definition.push(a),hC}};function Ra(e,t,r,n=!1){Is(r);const a=kn(this.recordingProdStack),s=Pr(t)?t:t.DEF,o=new e({definition:[],idx:r});return n&&(o.separator=t.SEP),B(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),a.definition.push(o),this.recordingProdStack.pop(),vu}i(Ra,"recordProd");function yC(e,t){Is(t);const r=kn(this.recordingProdStack),n=re(e)===!1,a=n===!1?e:e.DEF,s=new gt({definition:[],idx:t,ignoreAmbiguities:n&&e.IGNORE_AMBIGUITIES===!0});B(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD);const o=PA(a,l=>Pr(l.GATE));return s.hasPredicates=o,r.definition.push(s),K(a,l=>{const u=new ht({definition:[]});s.definition.push(u),B(l,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:B(l,"GATE")&&(u.ignoreAmbiguities=!0),this.recordingProdStack.push(u),l.ALT.call(this),this.recordingProdStack.pop()}),vu}i(yC,"recordOrProd");function Bf(e){return e===0?"":`${e}`}i(Bf,"getIdxSuffix");function Is(e){if(e<0||e>ny){const t=new Error(`Invalid DSL Method idx value: <${e}> + Idx value must be a none negative value smaller than ${ny+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}i(Is,"assertMethodIdxIsValid");var ix=class{static{i(this,"PerformanceTracer")}initPerformanceTracer(e){if(B(e,"traceInitPerf")){const t=e.traceInitPerf,r=typeof t=="number";this.traceInitMaxIdent=r?t:1/0,this.traceInitPerf=r?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Sr.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:n,value:a}=Hp(t),s=n>10?console.warn:console.log;return this.traceInitIndent time: ${n}ms`),this.traceInitIndent--,a}else return t()}};function gC(e,t){t.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(a=>{if(a==="constructor")return;const s=Object.getOwnPropertyDescriptor(n,a);s&&(s.get||s.set)?Object.defineProperty(e.prototype,a,s):e.prototype[a]=r.prototype[a]})})}i(gC,"applyMixins");var Rl=Qs(Ur,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Rl);var Sr=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Ga,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Al=Object.freeze({recoveryValueFunc:i(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),ot;(function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(ot||(ot={}));function Uf(e=void 0){return function(){return e}}i(Uf,"EMPTY_ALT");var fm=class vC{static{i(this,"Parser")}static performSelfAnalysis(t){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let t;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{Yp(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),K(this.definedRulesNames,a=>{const o=this[a].originalGrammarAction;let l;this.TRACE_INIT(`${a} Rule`,()=>{l=this.topLevelRuleRecord(a,o)}),this.gastProductionsCache[a]=l})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=HE({rules:Me(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(me(n)&&this.skipValidations===!1){const a=YE({rules:Me(this.gastProductionsCache),tokenTypes:Me(this.tokensMap),errMsgProvider:_n,grammarName:r}),s=DE({lookaheadStrategy:this.lookaheadStrategy,rules:Me(this.gastProductionsCache),tokenTypes:Me(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(a,s)}}),me(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const a=UA(Me(this.gastProductionsCache));this.resyncFollows=a}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var a,s;(s=(a=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(a,{rules:Me(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Me(this.gastProductionsCache))})),!vC.DEFER_DEFINITION_ERRORS_HANDLING&&!me(this.definitionErrors))throw t=F(this.definitionErrors,a=>a.message),new Error(`Parser Definition Errors detected: + ${t.join(` +------------------------------- +`)}`)})}constructor(t,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(t,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),B(r,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. + Please use the flag on the relevant DSL method instead. + See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES + For further details.`);this.skipValidations=B(r,"skipValidations")?r.skipValidations:Sr.skipValidations}};fm.DEFER_DEFINITION_ERRORS_HANDLING=!1;gC(fm,[VD,HD,JD,ZD,ex,QD,tx,rx,ax,ix]);var sx=class extends fm{static{i(this,"EmbeddedActionsParser")}constructor(e,t=Sr){const r=Ye(t);r.outputCst=!1,super(e,r)}};function TC(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r-1}i(SC,"listCacheHas");var dx=SC;function wC(e,t){var r=this.__data__,n=Tu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}i(wC,"listCacheSet");var px=wC;function Yn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++tl))return!1;var c=s.get(e),f=s.get(t);if(c&&f)return c==t&&f==e;var d=-1,m=!0,g=r&TM?new ob:void 0;for(s.set(e,t),s.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=e1}i(Nb,"isLength");var mm=Nb,t1="[object Arguments]",r1="[object Array]",n1="[object Boolean]",a1="[object Date]",i1="[object Error]",s1="[object Function]",o1="[object Map]",l1="[object Number]",u1="[object Object]",c1="[object RegExp]",f1="[object Set]",d1="[object String]",p1="[object WeakMap]",m1="[object ArrayBuffer]",h1="[object DataView]",y1="[object Float32Array]",g1="[object Float64Array]",v1="[object Int8Array]",T1="[object Int16Array]",$1="[object Int32Array]",R1="[object Uint8Array]",A1="[object Uint8ClampedArray]",E1="[object Uint16Array]",C1="[object Uint32Array]",ge={};ge[y1]=ge[g1]=ge[v1]=ge[T1]=ge[$1]=ge[R1]=ge[A1]=ge[E1]=ge[C1]=!0;ge[t1]=ge[r1]=ge[m1]=ge[n1]=ge[h1]=ge[a1]=ge[i1]=ge[s1]=ge[o1]=ge[l1]=ge[u1]=ge[c1]=ge[f1]=ge[d1]=ge[p1]=!1;function Pb(e){return Za(e)&&mm(e.length)&&!!ge[li(e)]}i(Pb,"baseIsTypedArray");var b1=Pb;function kb(e){return function(t){return e(t)}}i(kb,"baseUnary");var _1=kb,Ob=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ys=Ob&&typeof module=="object"&&module&&!module.nodeType&&module,S1=ys&&ys.exports===Ob,Ju=S1&&OC.process,w1=(function(){try{var e=ys&&ys.require&&ys.require("util").types;return e||Ju&&Ju.binding&&Ju.binding("util")}catch{}})(),py=w1,my=py&&py.isTypedArray,I1=my?_1(my):b1,hm=I1,N1=Object.prototype,P1=N1.hasOwnProperty;function Lb(e,t){var r=lt(e),n=!r&&Eu(e),a=!r&&!n&&El(e),s=!r&&!n&&!a&&hm(e),o=r||n||a||s,l=o?UM(e.length,String):[],u=l.length;for(var c in e)(t||P1.call(e,c))&&!(o&&(c=="length"||a&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ib(c,u)))&&l.push(c);return l}i(Lb,"arrayLikeKeys");var k1=Lb,O1=Object.prototype;function Db(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||O1;return e===r}i(Db,"isPrototype");var xb=Db;function Mb(e,t){return function(r){return e(t(r))}}i(Mb,"overArg");var L1=Mb,D1=L1(Object.keys,Object),x1=D1,M1=Object.prototype,G1=M1.hasOwnProperty;function Gb(e){if(!xb(e))return x1(e);var t=[];for(var r in Object(e))G1.call(e,r)&&r!="constructor"&&t.push(r);return t}i(Gb,"baseKeys");var Fb=Gb;function zb(e){return e!=null&&mm(e.length)&&!zC(e)}i(zb,"isArrayLike");var Cu=zb;function jb(e){return Cu(e)?k1(e):Fb(e)}i(jb,"keys");var ym=jb;function Bb(e){return MM(e,ym,BM)}i(Bb,"getAllKeys");var hy=Bb,F1=1,z1=Object.prototype,j1=z1.hasOwnProperty;function Ub(e,t,r,n,a,s){var o=r&F1,l=hy(e),u=l.length,c=hy(t),f=c.length;if(u!=f&&!o)return!1;for(var d=u;d--;){var m=l[d];if(!(o?m in t:j1.call(t,m)))return!1}var g=s.get(e),v=s.get(t);if(g&&v)return g==t&&v==e;var b=!0;s.set(e,t),s.set(t,e);for(var S=o;++dCm(e,t,o));return ea(e,t,n,r,...a)}i(D_,"alternation");function x_(e,t,r){const n=Ge(e,t,r,{type:Kr});Or(e,n);const a=ea(e,t,n,r,Xr(e,t,r));return M_(e,t,r,a)}i(x_,"option");function Xr(e,t,r){const n=GG(Tr(r.definition,a=>Cm(e,t,a)),a=>a!==void 0);return n.length===1?n[0]:n.length===0?void 0:F_(e,n)}i(Xr,"block");function bm(e,t,r,n,a){const s=n.left,o=n.right,l=Ge(e,t,r,{type:UG});Or(e,l);const u=Ge(e,t,r,{type:S_});return s.loopback=l,u.loopback=l,e.decisionMap[Ln(t,a?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=l,Ie(o,l),a===void 0?(Ie(l,s),Ie(l,u)):(Ie(l,u),Ie(l,a.left),Ie(a.right,s)),{left:s,right:u}}i(bm,"plus");function _m(e,t,r,n,a){const s=n.left,o=n.right,l=Ge(e,t,r,{type:BG});Or(e,l);const u=Ge(e,t,r,{type:S_}),c=Ge(e,t,r,{type:jG});return l.loopback=c,u.loopback=c,Ie(l,s),Ie(l,u),Ie(o,c),a!==void 0?(Ie(c,u),Ie(c,a.left),Ie(a.right,s)):Ie(c,l),e.decisionMap[Ln(t,a?"RepetitionWithSeparator":"Repetition",r.idx)]=l,{left:l,right:u}}i(_m,"star");function M_(e,t,r,n){const a=n.left,s=n.right;return Ie(a,s),e.decisionMap[Ln(t,"Option",r.idx)]=a,n}i(M_,"optional");function Or(e,t){return e.decisionStates.push(t),t.decision=e.decisionStates.length-1,t.decision}i(Or,"defineDecisionState");function ea(e,t,r,n,...a){const s=Ge(e,t,n,{type:zG,start:r});r.end=s;for(const l of a)l!==void 0?(Ie(r,l.left),Ie(l.right,s)):Ie(r,s);const o={left:r,right:s};return e.decisionMap[Ln(t,G_(n),n.idx)]=r,o}i(ea,"makeAlts");function G_(e){if(e instanceof gt)return"Alternation";if(e instanceof He)return"Option";if(e instanceof be)return"Repetition";if(e instanceof yt)return"RepetitionWithSeparator";if(e instanceof Et)return"RepetitionMandatory";if(e instanceof Ct)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}i(G_,"getProdType");function F_(e,t){const r=t.length;for(let s=0;se.alt)}get key(){let e="";for(const t in this.map)e+=t+":";return e}};function Sm(e,t=!0){return`${t?`a${e.alt}`:""}s${e.state.stateNumber}:${e.stack.map(r=>r.stateNumber.toString()).join("_")}`}i(Sm,"getATNConfigKey");function U_(e,t,r){for(var n=-1,a=e.length;++n0&&r(l)?t>1?wm(l,t-1,r,n,a):gb(a,l):n||(a[a.length]=l)}return a}i(wm,"baseFlatten");var q_=wm;function H_(e,t){return q_(Tr(e,t),1)}i(H_,"flatMap");var HG=H_;function Y_(e,t,r,n){for(var a=e.length,s=r+(n?1:-1);n?s--:++s-1}i(Q_,"arrayIncludes");var QG=Q_;function eS(e,t,r){for(var n=-1,a=e==null?0:e.length;++n=iF){var c=t?null:aF(e);if(c)return pm(c);o=!1,a=cb,u=new ob}else u=t?[]:l;e:for(;++n{const a=n.toString();let s=r[a];return s!==void 0||(s={atnStartState:e,decision:t,states:{}},r[a]=s),s}}i(dS,"createDFACache");var pS=class{static{i(this,"PredicateSet")}constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e="";const t=this.predicates.length;for(let r=0;rconsole.log(r))}initialize(e){this.atn=I_(e.rules),this.dfas=mS(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:t,rule:r,hasPredicates:n,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=Ln(r,"Alternation",t),c=this.atn.decisionMap[l].decision,f=Tr(Lf({maxLookahead:1,occurrence:t,prodType:"Alternation",rule:r}),d=>Tr(d,m=>m[0]));if(Yf(f,!1)&&!a){const d=Sy(f,(m,g,v)=>(Zu(g,b=>{b&&(m[b.tokenTypeIdx]=v,Zu(b.categoryMatches,S=>{m[S]=v}))}),m),{});return n?function(m){var g;const v=this.LA(1),b=d[v.tokenTypeIdx];if(m!==void 0&&b!==void 0){const S=(g=m[b])===null||g===void 0?void 0:g.GATE;if(S!==void 0&&S.call(this)===!1)return}return b}:function(){const m=this.LA(1);return d[m.tokenTypeIdx]}}else return n?function(d){const m=new pS,g=d===void 0?0:d.length;for(let b=0;bTr(d,m=>m[0]));if(Yf(f)&&f[0][0]&&!a){const d=f[0],m=lF(d);if(m.length===1&&hF(m[0].categoryMatches)){const v=m[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===v}}else{const g=Sy(m,(v,b)=>(b!==void 0&&(v[b.tokenTypeIdx]=!0,Zu(b.categoryMatches,S=>{v[S]=!0})),v),{});return function(){const v=this.LA(1);return g[v.tokenTypeIdx]===!0}}}return function(){const d=zo.call(this,s,c,wy,o);return typeof d=="object"?!1:d===0}}};function Yf(e,t=!0){const r=new Set;for(const n of e){const a=new Set;for(const s of n){if(s===void 0){if(t)break;return!1}const o=[s.tokenTypeIdx].concat(s.categoryMatches);for(const l of o)if(r.has(l)){if(!a.has(l))return!1}else r.add(l),a.add(l)}}return!0}i(Yf,"isLL1Sequence");function mS(e){const t=e.decisionStates.length,r=Array(t);for(let n=0;nIn(a)).join(", "),r=e.production.idx===0?"":e.production.idx;let n=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(", ")}> in <${TS(e.production)}${r}> inside <${e.topLevelRule.name}> Rule, +<${t}> may appears as a prefix path in all these alternatives. +`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`,n}i(vS,"buildAmbiguityError");function TS(e){if(e instanceof st)return"SUBRULE";if(e instanceof He)return"OPTION";if(e instanceof gt)return"OR";if(e instanceof Et)return"AT_LEAST_ONE";if(e instanceof Ct)return"AT_LEAST_ONE_SEP";if(e instanceof yt)return"MANY_SEP";if(e instanceof be)return"MANY";if(e instanceof ve)return"CONSUME";throw Error("non exhaustive match")}i(TS,"getProductionDslName");function $S(e,t,r){const n=HG(t.configs.elements,s=>s.state.transitions),a=oF(n.filter(s=>s instanceof Am).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:a,tokenPath:e}}i($S,"buildAdaptivePredictError");function RS(e,t){return e.edges[t.tokenTypeIdx]}i(RS,"getExistingTargetState");function AS(e,t,r){const n=new Hf,a=[];for(const o of e.elements){if(r.is(o.alt)===!1)continue;if(o.state.type===ro){a.push(o);continue}const l=o.state.transitions.length;for(let u=0;u0&&!SS(s))for(const o of a)s.add(o);return s}i(AS,"computeReachSet");function ES(e,t){if(e instanceof Am&&rm(t,e.tokenType))return e.target}i(ES,"getReachableTarget");function CS(e,t){let r;for(const n of e.elements)if(t.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}i(CS,"getUniqueAlt");function Im(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}i(Im,"newDFAState");function Xf(e,t,r,n){return n=Nm(e,n),t.edges[r.tokenTypeIdx]=n,n}i(Xf,"addDFAEdge");function Nm(e,t){if(t===Cl)return t;const r=t.configs.key,n=e.states[r];return n!==void 0?n:(t.configs.finalize(),e.states[r]=t,t)}i(Nm,"addDFAState");function bS(e){const t=new Hf,r=e.transitions.length;for(let n=0;n0){const a=[...e.stack],o={state:a.pop(),alt:e.alt,stack:a};Os(o,t)}else t.add(e);return}r.epsilonOnlyTransitions||t.add(e);const n=r.transitions.length;for(let a=0;a1)return!0;return!1}i(PS,"hasConflictingAltSet");function kS(e){for(const t of Array.from(e.values()))if(Object.keys(t).length===1)return!0;return!1}i(kS,"hasStateAssociatedWithOneAlt");xs();var OS=class{static{i(this,"CstNodeBuilder")}constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new km(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const t=new ku;return t.grammarSource=e,t.root=this.rootNode,this.current.content.push(t),this.nodeStack.push(t),t}buildLeafNode(e,t){const r=new bl(e.startOffset,e.image.length,$s(e),e.tokenType,!t);return r.grammarSource=t,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const t=e.container;if(t){const r=t.content.indexOf(e);r>=0&&t.content.splice(r,1)}}addHiddenNodes(e){const t=[];for(const a of e){const s=new bl(a.startOffset,a.image.length,$s(a),a.tokenType,!0);s.root=this.rootNode,t.push(s)}let r=this.current,n=!1;if(r.content.length>0){r.content.push(...t);return}for(;r.container;){const a=r.container.content.indexOf(r);if(a>0){r.container.content.splice(a,0,...t),n=!0;break}r=r.container}n||this.rootNode.content.unshift(...t)}construct(e){const t=this.current;typeof e.$type=="string"&&!e.$infix&&(this.current.astNode=e),e.$cstNode=t;const r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}},Pm=class{static{i(this,"AbstractCstNode")}get hidden(){return!1}get astNode(){const e=typeof this._astNode?.$type=="string"?this._astNode:this.container?.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},bl=class extends Pm{static{i(this,"LeafCstNodeImpl")}get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,t,r,n,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=n,this._length=t,this._range=r}},ku=class extends Pm{static{i(this,"CompositeCstNodeImpl")}constructor(){super(...arguments),this.content=new TF(this)}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){const e=this.firstNonHiddenNode,t=this.lastNonHiddenNode;if(e&&t){if(this._rangeCache===void 0){const{range:r}=e,{range:n}=t;this._rangeCache={start:r.start,end:n.end.line=0;e--){const t=this.content[e];if(!t.hidden)return t}return this.content[this.content.length-1]}},TF=class LS extends Array{static{i(this,"CstNodeContainer")}constructor(t){super(),this.parent=t,Object.setPrototypeOf(this,LS.prototype)}push(...t){return this.addParents(t),super.push(...t)}unshift(...t){return this.addParents(t),super.unshift(...t)}splice(t,r,...n){return this.addParents(n),super.splice(t,r,...n)}addParents(t){for(const r of t)r.container=this.parent}},km=class extends ku{static{i(this,"RootCstNodeImpl")}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},_l=Symbol("Datatype");function jo(e){return e.$type===_l}i(jo,"isDataTypeNode");var Iy="​",DS=i(e=>e.endsWith(Iy)?e:e+Iy,"withRuleSuffix"),Om=class{static{i(this,"AbstractLangiumParser")}constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const t=this.lexer.definition,r=e.LanguageMetaData.mode==="production";e.shared.profilers.LangiumProfiler?.isActive("parsing")?this.wrapper=new RF(t,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new FS(t,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,t){this.wrapper.wrapOr(e,t)}optional(e,t){this.wrapper.wrapOption(e,t)}many(e,t){this.wrapper.wrapMany(e,t)}atLeastOne(e,t){this.wrapper.wrapAtLeastOne(e,t)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},xS=class extends Om{static{i(this,"LangiumParser")}get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new OS,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,t){const r=this.computeRuleType(e);let n;qa(e)&&(n=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(DS(e.name),this.startImplementation(r,n,t).bind(this));return this.allRules.set(e.name,a),it(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const t=e.name,r=new Map;for(let n=0;n0&&(t=this.construct()),t===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return t}startImplementation(e,t,r){return n=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===_l?s.value="":t!==void 0&&(s.$infixName=t)}return r(n),a?this.construct():void 0}}extractHiddenTokens(e){const t=this.lexerResult.hidden;if(!t.length)return[];const r=e.startOffset;for(let n=0;nr)return t.splice(0,n);return t.splice(0,t.length)}consume(e,t,r){const n=this.wrapper.wrapConsume(e,t);if(!this.isRecording()&&this.isValidToken(n)){const a=this.extractHiddenTokens(n);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(n,r),{assignment:o,crossRef:l}=this.getAssignment(r),u=this.current;if(o){const c=Ar(r)?n.image:this.converter.convert(n.image,s);this.assign(o.operator,o.feature,c,s,l)}else if(jo(u)){let c=n.image;Ar(r)||(c=this.converter.convert(c,s).toString()),u.value+=c}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,t,r,n,a){let s;!this.isRecording()&&!r&&(s=this.nodeBuilder.buildCompositeNode(n));let o;try{o=this.wrapper.wrapSubrule(e,t,a)}finally{this.isRecording()||(o===void 0&&!r&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,n,s))}}performSubruleAssignment(e,t,r){const{assignment:n,crossRef:a}=this.getAssignment(t);if(n)this.assign(n.operator,n.feature,e,r,a);else if(!n){const s=this.current;if(jo(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,t){if(!this.isRecording()){let r=this.current;if(t.feature&&t.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(t).content.push(r.$cstNode);const a={$type:e};this.stack.push(a),this.assign(t.operator,t.feature,r,r.$cstNode)}else r.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):jo(e)?this.converter.convert(e.value,e.$cstNode):(Pd(this.astReflection,e),e)}constructInfix(e,t){const r=e.parts;if(!Array.isArray(r)||r.length===0)return;const n=e.operators;if(!Array.isArray(n)||r.length<2)return r[0];let a=0,s=-1;for(let v=0;vs?(s=S.precedence,a=v):S.precedence===s&&(S.rightAssoc||(a=v))}const o=n.slice(0,a),l=n.slice(a+1),u=r.slice(0,a+1),c=r.slice(a+1),f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:c,operators:l},m=this.constructInfix(f,t),g=this.constructInfix(d,t);return{$type:e.$type,$cstNode:e.$cstNode,left:m,operator:n[a],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const t=Mn(e,Rr);this.assignmentMap.set(e,{assignment:t,crossRef:t&&Fn(t.terminal)?t.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,t,r,n,a){const s=this.current;let o;switch(a==="single"&&typeof r=="string"?o=this.linker.buildReference(s,t,n,r):a==="multi"&&typeof r=="string"?o=this.linker.buildMultiReference(s,t,n,r):o=r,e){case"=":{s[t]=o;break}case"?=":{s[t]=!0;break}case"+=":Array.isArray(s[t])||(s[t]=[]),s[t].push(o)}}assignWithoutOverride(e,t){for(const[n,a]of Object.entries(t)){const s=e[n];s===void 0?e[n]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[n]=a)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},MS=class{static{i(this,"AbstractParserErrorMessageProvider")}buildMismatchTokenMessage(e){return Ga.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Ga.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Ga.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Ga.buildEarlyExitMessage(e)}},Lm=class extends MS{static{i(this,"LangiumParserErrorMessageProvider")}buildMismatchTokenMessage({expected:e,actual:t}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${t.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},GS=class extends Om{static{i(this,"LangiumCompletionParser")}constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const t=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=t.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,t){const r=this.wrapper.DEFINE_RULE(DS(e.name),this.startImplementation(t).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return t=>{const r=this.keepStackSize();try{e(t)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,t,r){this.wrapper.wrapConsume(e,t),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,t,r,n,a){this.before(n),this.wrapper.wrapSubrule(e,t,a),this.after(n)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const t=this.elementStack.lastIndexOf(e);t>=0&&this.elementStack.splice(t)}}get currIdx(){return this.wrapper.currIdx}},$F={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Lm},FS=class extends sx{static{i(this,"ChevrotainWrapper")}constructor(e,t){const r=t&&"maxLookahead"in t;super(e,{...$F,lookaheadStrategy:r?new um({maxLookahead:t.maxLookahead}):new vF({logging:t.skipValidations?()=>{}:void 0}),...t})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,t,r){return this.RULE(e,t,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,t){return this.consume(e,t,void 0)}wrapSubrule(e,t,r){return this.subrule(e,t,{ARGS:[r]})}wrapOr(e,t){this.or(e,t)}wrapOption(e,t){this.option(e,t)}wrapMany(e,t){this.many(e,t)}wrapAtLeastOne(e,t){this.atLeastOne(e,t)}rule(e){return e.call(this,{})}},RF=class extends FS{static{i(this,"ProfilerWrapper")}constructor(e,t,r){super(e,t),this.task=r}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,t,r){this.task.startSubTask(this.ruleName(t));try{return super.subrule(e,t,r)}finally{this.task.stopSubTask(this.ruleName(t))}}};function Ou(e,t,r){return zS({parser:t,tokens:r,ruleNames:new Map},e),t}i(Ou,"createParser");function zS(e,t){const r=Hl(t,!1),n=ue(t.rules).filter(it).filter(s=>r.has(s));for(const s of n){const o={...e,consume:1,optional:1,subrule:1,many:1,or:1};e.parser.rule(s,Wr(o,s.definition))}const a=ue(t.rules).filter(qa).filter(s=>r.has(s));for(const s of a)e.parser.rule(s,jS(e,s))}i(zS,"buildRules");function jS(e,t){const r=t.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+t.call.rule.$refText);if(Nt(r))throw new Error("Cannot use terminal rule in infix expression");const n=t.operators.precedences.flatMap(g=>g.operators),a={$type:"Group",elements:[]},s={$container:a,$type:"Assignment",feature:"parts",operator:"+=",terminal:t.call},o={$container:a,$type:"Group",elements:[],cardinality:"*"};a.elements.push(s,o);const u={$container:o,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},c={...s,$container:o};o.elements.push(u,c);const d=n.map(g=>e.tokens[g.value]).map((g,v)=>({ALT:i(()=>e.parser.consume(v,g,u),"ALT")}));let m;return g=>{m??(m=Lu(e,r)),e.parser.subrule(0,m,!1,s,g),e.parser.many(0,{DEF:i(()=>{e.parser.alternatives(0,d),e.parser.subrule(1,m,!1,c,g)},"DEF")})}}i(jS,"buildInfixRule");function Wr(e,t,r=!1){let n;if(Ar(t))n=HS(e,t);else if(jr(t))n=BS(e,t);else if(Rr(t))n=Wr(e,t.terminal);else if(Fn(t))n=Dm(e,t);else if(Er(t))n=US(e,t);else if(Fl(t))n=WS(e,t);else if(Ul(t))n=VS(e,t);else if(zn(t))n=qS(e,t);else if(Gd(t)){const a=e.consume++;n=i(()=>e.parser.consume(a,Ur,t),"method")}else throw new Wl(t.$cstNode,`Unexpected element type: ${t.$type}`);return xm(e,r?void 0:Ls(t),n,t.cardinality)}i(Wr,"buildElement");function BS(e,t){const r=Pn(t);return()=>e.parser.action(r,t)}i(BS,"buildAction");function US(e,t){const r=t.rule.ref;if(Gn(r)){const n=e.subrule++,a=it(r)&&r.fragment,s=t.arguments.length>0?KS(r,t.arguments):()=>({});let o;return l=>{o??(o=Lu(e,r)),e.parser.subrule(n,o,a,t,s(l))}}else if(Nt(r)){const n=e.consume++,a=Sl(e,r.name);return()=>e.parser.consume(n,a,t)}else if(r)qr();else throw new Wl(t.$cstNode,`Undefined rule: ${t.rule.$refText}`)}i(US,"buildRuleCall");function KS(e,t){if(t.some(n=>n.calledByName)){const n=t.map(a=>({parameterName:a.parameter?.ref?.name,predicate:xt(a.value)}));return a=>{const s={};for(const{parameterName:o,predicate:l}of n)o&&(s[o]=l(a));return s}}else{const n=t.map(a=>xt(a.value));return a=>{const s={};for(let o=0;ot(n)||r(n)}else if(xd(e)){const t=xt(e.left),r=xt(e.right);return n=>t(n)&&r(n)}else if(jd(e)){const t=xt(e.value);return r=>!t(r)}else if(Bd(e)){const t=e.parameter.ref.name;return r=>r!==void 0&&r[t]===!0}else if(Ld(e)){const t=!!e.true;return()=>t}qr()}i(xt,"buildPredicate");function WS(e,t){if(t.elements.length===1)return Wr(e,t.elements[0]);{const r=[];for(const a of t.elements){const s={ALT:Wr(e,a,!0)},o=Ls(a);o&&(s.GATE=xt(o)),r.push(s)}const n=e.or++;return a=>e.parser.alternatives(n,r.map(s=>{const o={ALT:i(()=>s.ALT(a),"ALT")},l=s.GATE;return l&&(o.GATE=()=>l(a)),o}))}}i(WS,"buildAlternatives");function VS(e,t){if(t.elements.length===1)return Wr(e,t.elements[0]);const r=[];for(const l of t.elements){const u={ALT:Wr(e,l,!0)},c=Ls(l);c&&(u.GATE=xt(c)),r.push(u)}const n=e.or++,a=i((l,u)=>{const c=u.getRuleStack().join("-");return`uGroup_${l}_${c}`},"idFunc"),s=i(l=>e.parser.alternatives(n,r.map((u,c)=>{const f={ALT:i(()=>!0,"ALT")},d=e.parser;f.ALT=()=>{if(u.ALT(l),!d.isRecording()){const g=a(n,d);d.unorderedGroups.get(g)||d.unorderedGroups.set(g,[]);const v=d.unorderedGroups.get(g);typeof v?.[c]>"u"&&(v[c]=!0)}};const m=u.GATE;return m?f.GATE=()=>m(l):f.GATE=()=>!d.unorderedGroups.get(a(n,d))?.[c],f})),"alternatives"),o=xm(e,Ls(t),s,"*");return l=>{o(l),e.parser.isRecording()||e.parser.unorderedGroups.delete(a(n,e.parser))}}i(VS,"buildUnorderedGroup");function qS(e,t){const r=t.elements.map(n=>Wr(e,n));return n=>r.forEach(a=>a(n))}i(qS,"buildGroup");function Ls(e){if(zn(e))return e.guardCondition}i(Ls,"getGuardCondition");function Dm(e,t,r=t.terminal){if(r)if(Er(r)&&it(r.rule.ref)){const n=r.rule.ref,a=e.subrule++;let s;return o=>{s??(s=Lu(e,n)),e.parser.subrule(a,s,!1,t,o)}}else if(Er(r)&&Nt(r.rule.ref)){const n=e.consume++,a=Sl(e,r.rule.ref.name);return()=>e.parser.consume(n,a,t)}else if(Ar(r)){const n=e.consume++,a=Sl(e,r.value);return()=>e.parser.consume(n,a,t)}else throw new Error("Could not build cross reference parser");else{if(!t.type.ref)throw new Error("Could not resolve reference to type: "+t.type.$refText);const a=Zl(t.type.ref)?.terminal;if(!a)throw new Error("Could not find name assignment for type: "+Pn(t.type.ref));return Dm(e,t,a)}}i(Dm,"buildCrossReference");function HS(e,t){const r=e.consume++,n=e.tokens[t.value];if(!n)throw new Error("Could not find token for keyword: "+t.value);return()=>e.parser.consume(r,n,t)}i(HS,"buildKeyword");function xm(e,t,r,n){const a=t&&xt(t);if(!n)if(a){const s=e.or++;return o=>e.parser.alternatives(s,[{ALT:i(()=>r(o),"ALT"),GATE:i(()=>a(o),"GATE")},{ALT:Uf(),GATE:i(()=>!a(o),"GATE")}])}else return r;if(n==="*"){const s=e.many++;return o=>e.parser.many(s,{DEF:i(()=>r(o),"DEF"),GATE:a?()=>a(o):void 0})}else if(n==="+"){const s=e.many++;if(a){const o=e.or++;return l=>e.parser.alternatives(o,[{ALT:i(()=>e.parser.atLeastOne(s,{DEF:i(()=>r(l),"DEF")}),"ALT"),GATE:i(()=>a(l),"GATE")},{ALT:Uf(),GATE:i(()=>!a(l),"GATE")}])}else return o=>e.parser.atLeastOne(s,{DEF:i(()=>r(o),"DEF")})}else if(n==="?"){const s=e.optional++;return o=>e.parser.optional(s,{DEF:i(()=>r(o),"DEF"),GATE:a?()=>a(o):void 0})}else qr()}i(xm,"wrap");function Lu(e,t){const r=YS(e,t),n=e.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}i(Lu,"getRule");function YS(e,t){if(Gn(t))return t.name;if(e.ruleNames.has(t))return e.ruleNames.get(t);{let r=t,n=r.$container,a=t.$type;for(;!it(n);)(zn(n)||Fl(n)||Ul(n))&&(a=n.elements.indexOf(r).toString()+":"+a),r=n,n=n.$container;return a=n.name+":"+a,e.ruleNames.set(t,a),a}}i(YS,"getRuleName");function Sl(e,t){const r=e.tokens[t];if(!r)throw new Error(`Token "${t}" not found."`);return r}i(Sl,"getToken");function Mm(e){const t=e.Grammar,r=e.parser.Lexer,n=new GS(e);return Ou(t,n,r.definition),n.finalize(),n}i(Mm,"createCompletionParser");function Gm(e){const t=Fm(e);return t.finalize(),t}i(Gm,"createLangiumParser");function Fm(e){const t=e.Grammar,r=e.parser.Lexer,n=new xS(e);return Ou(t,n,r.definition)}i(Fm,"prepareLangiumParser");var Du=class{static{i(this,"DefaultTokenBuilder")}constructor(){this.diagnostics=[]}buildTokens(e,t){const r=ue(Hl(e,!1)),n=this.buildTerminalTokens(r),a=this.buildKeywordTokens(r,n,t);return a.push(...n),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Nt).filter(t=>!t.fragment).map(t=>this.buildTerminalToken(t)).toArray()}buildTerminalToken(e){const t=Bs(e),r=this.requiresCustomPattern(t)?this.regexPatternFunction(t):t,n={name:e.name,PATTERN:r};return typeof r=="function"&&(n.LINE_BREAKS=!0),e.hidden&&(n.GROUP=ql(t)?at.SKIPPED:"hidden"),n}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const t=new RegExp(e,e.flags+"y");return(r,n)=>(t.lastIndex=n,t.exec(r))}buildKeywordTokens(e,t,r){return e.filter(Gn).flatMap(n=>Nr(n).filter(Ar)).distinct(n=>n.value).toArray().sort((n,a)=>a.value.length-n.value.length).map(n=>this.buildKeywordToken(n,t,!!r?.caseInsensitive))}buildKeywordToken(e,t,r){const n=this.buildKeywordPattern(e,r),a={name:e.value,PATTERN:n,LONGER_ALT:this.findLongerAlt(e,t)};return typeof n=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,t){return t?new RegExp(ri(e.value),"i"):e.value}findLongerAlt(e,t){return t.reduce((r,n)=>{const a=n?.PATTERN;return a?.source&&cp("^"+a.source+"$",e.value)&&r.push(n),r},[])}},zm=class{static{i(this,"DefaultValueConverter")}convert(e,t){let r=t.grammarSource;if(Fn(r)&&(r=hp(r)),Er(r)){const n=r.rule.ref;if(!n)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(n,e,t)}return e}runConverter(e,t,r){switch(e.name.toUpperCase()){case"INT":return Zt.convertInt(t);case"STRING":return Zt.convertString(t);case"ID":return Zt.convertID(t)}switch(Cp(e)?.toLowerCase()){case"number":return Zt.convertNumber(t);case"boolean":return Zt.convertBoolean(t);case"bigint":return Zt.convertBigint(t);case"date":return Zt.convertDate(t);default:return t}}},Zt;(function(e){function t(c){let f="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(e,0):setImmediate(e)})}i(xu,"delayNextTick");var Bo=0,XS=10;function Mu(){return Bo=performance.now(),new pe.CancellationTokenSource}i(Mu,"startCancelableOperation");function jm(e){XS=e}i(jm,"setInterruptionPeriod");var tr=Symbol("OperationCancelled");function ta(e){return e===tr}i(ta,"isOperationCancelled");async function ze(e){if(e===pe.CancellationToken.None)return;const t=performance.now();if(t-Bo>=XS&&(Bo=t,await xu(),Bo=performance.now()),e.isCancellationRequested)throw tr}i(ze,"interruptAndCheck");var wr=class{static{i(this,"Deferred")}constructor(){this.promise=new Promise((e,t)=>{this.resolve=r=>(e(r),this),this.reject=r=>(t(r),this)})}},Ny=class Jf{static{i(this,"FullTextDocument")}constructor(t,r,n,a){this._uri=t,this._languageId=r,this._version=n,this._content=a,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){const r=this.offsetAt(t.start),n=this.offsetAt(t.end);return this._content.substring(r,n)}return this._content}update(t,r){for(const n of t)if(Jf.isIncremental(n)){const a=Um(n.range),s=this.offsetAt(a.start),o=this.offsetAt(a.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(o,this._content.length);const l=Math.max(a.start.line,0),u=Math.max(a.end.line,0);let c=this._lineOffsets;const f=Zf(n.text,!1,s);if(u-l===f.length)for(let m=0,g=f.length;mt?a=o:n=o+1}const s=n-1;return t=this.ensureBeforeEOL(t,r[s]),{line:s,character:t-r[s]}}offsetAt(t){const r=this.getLineOffsets();if(t.line>=r.length)return this._content.length;if(t.line<0)return 0;const n=r[t.line];if(t.character<=0)return n;const a=t.line+1r&&Bm(this._content.charCodeAt(t-1));)t--;return t}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){const r=t;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(t){const r=t;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},wl;(function(e){function t(a,s,o,l){return new Ny(a,s,o,l)}i(t,"create"),e.create=t;function r(a,s,o){if(a instanceof Ny)return a.update(s,o),a;throw new Error("TextDocument.update: document must be created by TextDocument.create")}i(r,"update"),e.update=r;function n(a,s){const o=a.getText(),l=Il(s.map(JS),(f,d)=>{const m=f.range.start.line-d.range.start.line;return m===0?f.range.start.character-d.range.start.character:m});let u=0;const c=[];for(const f of l){const d=a.offsetAt(f.range.start);if(du&&c.push(o.substring(u,d)),f.newText.length&&c.push(f.newText),u=a.offsetAt(f.range.end)}return c.push(o.substr(u)),c.join("")}i(n,"applyEdits"),e.applyEdits=n})(wl||(wl={}));function Il(e,t){if(e.length<=1)return e;const r=e.length/2|0,n=e.slice(0,r),a=e.slice(r);Il(n,t),Il(a,t);let s=0,o=0,l=0;for(;sr.line||t.line===r.line&&t.character>r.character?{start:r,end:t}:e}i(Um,"getWellformedRange");function JS(e){const t=Um(e.range);return t!==e.range?{newText:e.newText,range:t}:e}i(JS,"getWellformedEdit");var ZS;(()=>{var e={975:k=>{function C(T){if(typeof T!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(T))}i(C,"e");function y(T,$){for(var _,O="",x=0,D=-1,G=0,W=0;W<=T.length;++W){if(W2){var Y=O.lastIndexOf("/");if(Y!==O.length-1){Y===-1?(O="",x=0):x=(O=O.slice(0,Y)).length-1-O.lastIndexOf("/"),D=W,G=0;continue}}else if(O.length===2||O.length===1){O="",x=0,D=W,G=0;continue}}$&&(O.length>0?O+="/..":O="..",x=2)}else O.length>0?O+="/"+T.slice(D+1,W):O=T.slice(D+1,W),x=W-D-1;D=W,G=0}else _===46&&G!==-1?++G:G=-1}return O}i(y,"r");var E={resolve:i(function(){for(var T,$="",_=!1,O=arguments.length-1;O>=-1&&!_;O--){var x;O>=0?x=arguments[O]:(T===void 0&&(T=process.cwd()),x=T),C(x),x.length!==0&&($=x+"/"+$,_=x.charCodeAt(0)===47)}return $=y($,!_),_?$.length>0?"/"+$:"/":$.length>0?$:"."},"resolve"),normalize:i(function(T){if(C(T),T.length===0)return".";var $=T.charCodeAt(0)===47,_=T.charCodeAt(T.length-1)===47;return(T=y(T,!$)).length!==0||$||(T="."),T.length>0&&_&&(T+="/"),$?"/"+T:T},"normalize"),isAbsolute:i(function(T){return C(T),T.length>0&&T.charCodeAt(0)===47},"isAbsolute"),join:i(function(){if(arguments.length===0)return".";for(var T,$=0;$0&&(T===void 0?T=_:T+="/"+_)}return T===void 0?".":E.normalize(T)},"join"),relative:i(function(T,$){if(C(T),C($),T===$||(T=E.resolve(T))===($=E.resolve($)))return"";for(var _=1;_W){if($.charCodeAt(D+V)===47)return $.slice(D+V+1);if(V===0)return $.slice(D+V)}else x>W&&(T.charCodeAt(_+V)===47?Y=V:V===0&&(Y=0));break}var Pe=T.charCodeAt(_+V);if(Pe!==$.charCodeAt(D+V))break;Pe===47&&(Y=V)}var oe="";for(V=_+Y+1;V<=O;++V)V!==O&&T.charCodeAt(V)!==47||(oe.length===0?oe+="..":oe+="/..");return oe.length>0?oe+$.slice(D+Y):(D+=Y,$.charCodeAt(D)===47&&++D,$.slice(D))},"relative"),_makeLong:i(function(T){return T},"_makeLong"),dirname:i(function(T){if(C(T),T.length===0)return".";for(var $=T.charCodeAt(0),_=$===47,O=-1,x=!0,D=T.length-1;D>=1;--D)if(($=T.charCodeAt(D))===47){if(!x){O=D;break}}else x=!1;return O===-1?_?"/":".":_&&O===1?"//":T.slice(0,O)},"dirname"),basename:i(function(T,$){if($!==void 0&&typeof $!="string")throw new TypeError('"ext" argument must be a string');C(T);var _,O=0,x=-1,D=!0;if($!==void 0&&$.length>0&&$.length<=T.length){if($.length===T.length&&$===T)return"";var G=$.length-1,W=-1;for(_=T.length-1;_>=0;--_){var Y=T.charCodeAt(_);if(Y===47){if(!D){O=_+1;break}}else W===-1&&(D=!1,W=_+1),G>=0&&(Y===$.charCodeAt(G)?--G==-1&&(x=_):(G=-1,x=W))}return O===x?x=W:x===-1&&(x=T.length),T.slice(O,x)}for(_=T.length-1;_>=0;--_)if(T.charCodeAt(_)===47){if(!D){O=_+1;break}}else x===-1&&(D=!1,x=_+1);return x===-1?"":T.slice(O,x)},"basename"),extname:i(function(T){C(T);for(var $=-1,_=0,O=-1,x=!0,D=0,G=T.length-1;G>=0;--G){var W=T.charCodeAt(G);if(W!==47)O===-1&&(x=!1,O=G+1),W===46?$===-1?$=G:D!==1&&(D=1):$!==-1&&(D=-1);else if(!x){_=G+1;break}}return $===-1||O===-1||D===0||D===1&&$===O-1&&$===_+1?"":T.slice($,O)},"extname"),format:i(function(T){if(T===null||typeof T!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof T);return(function($,_){var O=_.dir||_.root,x=_.base||(_.name||"")+(_.ext||"");return O?O===_.root?O+x:O+"/"+x:x})(0,T)},"format"),parse:i(function(T){C(T);var $={root:"",dir:"",base:"",ext:"",name:""};if(T.length===0)return $;var _,O=T.charCodeAt(0),x=O===47;x?($.root="/",_=1):_=0;for(var D=-1,G=0,W=-1,Y=!0,V=T.length-1,Pe=0;V>=_;--V)if((O=T.charCodeAt(V))!==47)W===-1&&(Y=!1,W=V+1),O===46?D===-1?D=V:Pe!==1&&(Pe=1):D!==-1&&(Pe=-1);else if(!Y){G=V+1;break}return D===-1||W===-1||Pe===0||Pe===1&&D===W-1&&D===G+1?W!==-1&&($.base=$.name=G===0&&x?T.slice(1,W):T.slice(G,W)):(G===0&&x?($.name=T.slice(1,D),$.base=T.slice(1,W)):($.name=T.slice(G,D),$.base=T.slice(G,W)),$.ext=T.slice(D,W)),G>0?$.dir=T.slice(0,G-1):x&&($.dir="/"),$},"parse"),sep:"/",delimiter:":",win32:null,posix:null};E.posix=E,k.exports=E}},t={};function r(k){var C=t[k];if(C!==void 0)return C.exports;var y=t[k]={exports:{}};return e[k](y,y.exports,r),y.exports}i(r,"r"),r.d=(k,C)=>{for(var y in C)r.o(C,y)&&!r.o(k,y)&&Object.defineProperty(k,y,{enumerable:!0,get:C[y]})},r.o=(k,C)=>Object.prototype.hasOwnProperty.call(k,C),r.r=k=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})};var n={};let a;r.r(n),r.d(n,{URI:i(()=>m,"URI"),Utils:i(()=>Se,"Utils")}),typeof process=="object"?a=process.platform==="win32":typeof navigator=="object"&&(a=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,o=/^\//,l=/^\/\//;function u(k,C){if(!k.scheme&&C)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${k.authority}", path: "${k.path}", query: "${k.query}", fragment: "${k.fragment}"}`);if(k.scheme&&!s.test(k.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(k.path){if(k.authority){if(!o.test(k.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(k.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}i(u,"a");const c="",f="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class m{static{i(this,"l")}static isUri(C){return C instanceof m||!!C&&typeof C.authority=="string"&&typeof C.fragment=="string"&&typeof C.path=="string"&&typeof C.query=="string"&&typeof C.scheme=="string"&&typeof C.fsPath=="string"&&typeof C.with=="function"&&typeof C.toString=="function"}scheme;authority;path;query;fragment;constructor(C,y,E,T,$,_=!1){typeof C=="object"?(this.scheme=C.scheme||c,this.authority=C.authority||c,this.path=C.path||c,this.query=C.query||c,this.fragment=C.fragment||c):(this.scheme=(function(O,x){return O||x?O:"file"})(C,_),this.authority=y||c,this.path=(function(O,x){switch(O){case"https":case"http":case"file":x?x[0]!==f&&(x=f+x):x=f}return x})(this.scheme,E||c),this.query=T||c,this.fragment=$||c,u(this,_))}get fsPath(){return I(this,!1)}with(C){if(!C)return this;let{scheme:y,authority:E,path:T,query:$,fragment:_}=C;return y===void 0?y=this.scheme:y===null&&(y=c),E===void 0?E=this.authority:E===null&&(E=c),T===void 0?T=this.path:T===null&&(T=c),$===void 0?$=this.query:$===null&&($=c),_===void 0?_=this.fragment:_===null&&(_=c),y===this.scheme&&E===this.authority&&T===this.path&&$===this.query&&_===this.fragment?this:new v(y,E,T,$,_)}static parse(C,y=!1){const E=d.exec(C);return E?new v(E[2]||c,X(E[4]||c),X(E[5]||c),X(E[7]||c),X(E[9]||c),y):new v(c,c,c,c,c)}static file(C){let y=c;if(a&&(C=C.replace(/\\/g,f)),C[0]===f&&C[1]===f){const E=C.indexOf(f,2);E===-1?(y=C.substring(2),C=f):(y=C.substring(2,E),C=C.substring(E)||f)}return new v("file",y,C,c,c)}static from(C){const y=new v(C.scheme,C.authority,C.path,C.query,C.fragment);return u(y,!0),y}toString(C=!1){return R(this,C)}toJSON(){return this}static revive(C){if(C){if(C instanceof m)return C;{const y=new v(C);return y._formatted=C.external,y._fsPath=C._sep===g?C.fsPath:null,y}}return C}}const g=a?1:void 0;class v extends m{static{i(this,"d")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=I(this,!1)),this._fsPath}toString(C=!1){return C?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)}toJSON(){const C={$mid:1};return this._fsPath&&(C.fsPath=this._fsPath,C._sep=g),this._formatted&&(C.external=this._formatted),this.path&&(C.path=this.path),this.scheme&&(C.scheme=this.scheme),this.authority&&(C.authority=this.authority),this.query&&(C.query=this.query),this.fragment&&(C.fragment=this.fragment),C}}const b={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function S(k,C,y){let E,T=-1;for(let $=0;$=97&&_<=122||_>=65&&_<=90||_>=48&&_<=57||_===45||_===46||_===95||_===126||C&&_===47||y&&_===91||y&&_===93||y&&_===58)T!==-1&&(E+=encodeURIComponent(k.substring(T,$)),T=-1),E!==void 0&&(E+=k.charAt($));else{E===void 0&&(E=k.substr(0,$));const O=b[_];O!==void 0?(T!==-1&&(E+=encodeURIComponent(k.substring(T,$)),T=-1),E+=O):T===-1&&(T=$)}}return T!==-1&&(E+=encodeURIComponent(k.substring(T))),E!==void 0?E:k}i(S,"m");function w(k){let C;for(let y=0;y1&&k.scheme==="file"?`//${k.authority}${k.path}`:k.path.charCodeAt(0)===47&&(k.path.charCodeAt(1)>=65&&k.path.charCodeAt(1)<=90||k.path.charCodeAt(1)>=97&&k.path.charCodeAt(1)<=122)&&k.path.charCodeAt(2)===58?C?k.path.substr(1):k.path[1].toLowerCase()+k.path.substr(2):k.path,a&&(y=y.replace(/\//g,"\\")),y}i(I,"v");function R(k,C){const y=C?w:S;let E="",{scheme:T,authority:$,path:_,query:O,fragment:x}=k;if(T&&(E+=T,E+=":"),($||T==="file")&&(E+=f,E+=f),$){let D=$.indexOf("@");if(D!==-1){const G=$.substr(0,D);$=$.substr(D+1),D=G.lastIndexOf(":"),D===-1?E+=y(G,!1,!1):(E+=y(G.substr(0,D),!1,!1),E+=":",E+=y(G.substr(D+1),!1,!0)),E+="@"}$=$.toLowerCase(),D=$.lastIndexOf(":"),D===-1?E+=y($,!1,!0):(E+=y($.substr(0,D),!1,!0),E+=$.substr(D))}if(_){if(_.length>=3&&_.charCodeAt(0)===47&&_.charCodeAt(2)===58){const D=_.charCodeAt(1);D>=65&&D<=90&&(_=`/${String.fromCharCode(D+32)}:${_.substr(3)}`)}else if(_.length>=2&&_.charCodeAt(1)===58){const D=_.charCodeAt(0);D>=65&&D<=90&&(_=`${String.fromCharCode(D+32)}:${_.substr(2)}`)}E+=y(_,!0,!1)}return O&&(E+="?",E+=y(O,!1,!1)),x&&(E+="#",E+=C?x:S(x,!1,!1)),E}i(R,"b");function P(k){try{return decodeURIComponent(k)}catch{return k.length>3?k.substr(0,3)+P(k.substr(3)):k}}i(P,"C");const z=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function X(k){return k.match(z)?k.replace(z,(C=>P(C))):k}i(X,"w");var Z=r(975);const ce=Z.posix||Z,se="/";var Se;(function(k){k.joinPath=function(C,...y){return C.with({path:ce.join(C.path,...y)})},k.resolvePath=function(C,...y){let E=C.path,T=!1;E[0]!==se&&(E=se+E,T=!0);let $=ce.resolve(E,...y);return T&&$[0]===se&&!C.authority&&($=$.substring(1)),C.with({path:$})},k.dirname=function(C){if(C.path.length===0||C.path===se)return C;let y=ce.dirname(C.path);return y.length===1&&y.charCodeAt(0)===46&&(y=""),C.with({path:y})},k.basename=function(C){return ce.basename(C.path)},k.extname=function(C){return ce.extname(C.path)}})(Se||(Se={})),ZS=n})();var{URI:Tt,Utils:Di}=ZS,nt;(function(e){e.basename=Di.basename,e.dirname=Di.dirname,e.extname=Di.extname,e.joinPath=Di.joinPath,e.resolvePath=Di.resolvePath;const t=typeof process=="object"&&process?.platform==="win32";function r(o,l){return o?.toString()===l?.toString()}i(r,"equals"),e.equals=r;function n(o,l){const u=typeof o=="string"?Tt.parse(o).path:o.path,c=typeof l=="string"?Tt.parse(l).path:l.path,f=u.split("/").filter(b=>b.length>0),d=c.split("/").filter(b=>b.length>0);if(t){const b=/^[A-Z]:$/;if(f[0]&&b.test(f[0])&&(f[0]=f[0].toLowerCase()),d[0]&&b.test(d[0])&&(d[0]=d[0].toLowerCase()),f[0]!==d[0])return c.substring(1)}let m=0;for(;m({name:n.name,uri:nt.joinPath(Tt.parse(t),n.name).toString(),element:n.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const t=this.getNode(nt.normalize(e),!1);return t?this.collectValues(t):[]}getNode(e,t){const r=e.split("/");e.charAt(e.length-1)==="/"&&r.pop();let n=this.root;for(const a of r){let s=n.children.get(a);if(!s)if(t)s={name:a,children:new Map,parent:n},n.children.set(a,s);else return;n=s}return n}collectValues(e){const t=[];e.element&&t.push(e.element);for(const r of e.children.values())t.push(...this.collectValues(r));return t}},J;(function(e){e[e.Changed=0]="Changed",e[e.Parsed=1]="Parsed",e[e.IndexedContent=2]="IndexedContent",e[e.ComputedScopes=3]="ComputedScopes",e[e.Linked=4]="Linked",e[e.IndexedReferences=5]="IndexedReferences",e[e.Validated=6]="Validated"})(J||(J={}));var QS=class{static{i(this,"DefaultLangiumDocumentFactory")}constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,t=pe.CancellationToken.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,t)}fromTextDocument(e,t,r){return t=t??Tt.parse(e.uri),pe.CancellationToken.is(r)?this.createAsync(t,e,r):this.create(t,e,r)}fromString(e,t,r){return pe.CancellationToken.is(r)?this.createAsync(t,e,r):this.create(t,e,r)}fromModel(e,t){return this.create(t,{$model:e})}create(e,t,r){if(typeof t=="string"){const n=this.parse(e,t,r);return this.createLangiumDocument(n,e,void 0,t)}else if("$model"in t){const n={value:t.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(n,e)}else{const n=this.parse(e,t.getText(),r);return this.createLangiumDocument(n,e,t)}}async createAsync(e,t,r){if(typeof t=="string"){const n=await this.parseAsync(e,t,r);return this.createLangiumDocument(n,e,void 0,t)}else{const n=await this.parseAsync(e,t.getText(),r);return this.createLangiumDocument(n,e,t)}}createLangiumDocument(e,t,r,n){let a;if(r)a={parseResult:e,uri:t,state:J.Parsed,references:[],textDocument:r};else{const s=this.createTextDocumentGetter(t,n);a={parseResult:e,uri:t,state:J.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,t){const r=e.parseResult.value.$cstNode?.root.fullText,n=this.textDocuments?.get(e.uri.toString()),a=n?n.getText():await this.fileSystemProvider.readFile(e.uri);if(n)Object.defineProperty(e,"textDocument",{value:n});else{const s=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:s})}return r!==a&&(e.parseResult=await this.parseAsync(e.uri,a,t),e.parseResult.value.$document=e),e.state=J.Parsed,e}parse(e,t,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(t,r)}parseAsync(e,t,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(t,r)}createTextDocumentGetter(e,t){const r=this.serviceRegistry;let n;return()=>n??(n=wl.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,t??""))}},ew=class{static{i(this,"DefaultLangiumDocuments")}constructor(e){this.documentTrie=new Km,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return ue(this.documentTrie.all())}addDocument(e){const t=e.uri.toString();if(this.documentTrie.has(t))throw new Error(`A document with the URI '${t}' is already present.`);this.documentTrie.insert(t,e)}getDocument(e){const t=e.toString();return this.documentTrie.find(t)}getDocuments(e){const t=e.toString();return this.documentTrie.findAll(t)}async getOrCreateDocument(e,t){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,t),this.addDocument(r),r)}createDocument(e,t,r){if(r)return this.langiumDocumentFactory.fromString(t,e,r).then(n=>(this.addDocument(n),n));{const n=this.langiumDocumentFactory.fromString(t,e);return this.addDocument(n),n}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const t=e.toString(),r=this.documentTrie.find(t);return r&&this.documentBuilder().resetToState(r,J.Changed),r}deleteDocument(e){const t=e.toString(),r=this.documentTrie.find(t);return r&&(r.state=J.Changed,this.documentTrie.delete(t)),r}deleteDocuments(e){const t=e.toString(),r=this.documentTrie.findAll(t);for(const n of r)n.state=J.Changed;return this.documentTrie.delete(t),r}},un=Symbol("RefResolving"),tw=class{static{i(this,"DefaultLinker")}constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,t=pe.CancellationToken.None){if(this.profiler?.isActive("linking")){const r=this.profiler.createTask("linking",this.languageId);r.start();try{for(const n of Gt(e.parseResult.value))await ze(t),Va(n).forEach(a=>{const s=`${n.$type}:${a.property}`;r.startSubTask(s);try{this.doLink(a,e)}finally{r.stopSubTask(s)}})}finally{r.stop()}}else for(const r of Gt(e.parseResult.value))await ze(t),Va(r).forEach(n=>this.doLink(n,e))}doLink(e,t){const r=e.reference;if("_ref"in r&&r._ref===void 0){r._ref=un;try{const n=this.getCandidate(e);if(pn(n))r._ref=n;else{r._nodeDescription=n;const a=this.loadAstNode(n);r._ref=a??this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${r.$refText}':`,n);const a=n.message??String(n);r._ref={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${a}`}}t.references.push(r)}else if("_items"in r&&r._items===void 0){r._items=un;try{const n=this.getCandidates(e),a=[];if(pn(n))r._linkingError=n;else for(const s of n){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}r._items=a}catch(n){r._linkingError={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${n}`},r._items=[]}t.references.push(r)}}unlink(e){for(const t of e.references)"_ref"in t?(t._ref=void 0,delete t._nodeDescription):"_items"in t&&(t._items=void 0,delete t._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const r=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(n=>`${n.documentUri}#${n.path}`).toArray();return r.length>0?r:this.createLinkingError(e)}buildReference(e,t,r,n){const a=this,s={$refNode:r,$refText:n,_ref:void 0,get ref(){if(Oe(this._ref))return this._ref;if(wd(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:t},this._nodeDescription)}else if(this._ref===void 0){this._ref=un;const o=Fa(e).$document,l=a.getLinkedNode({reference:s,container:e,property:t});if(l.error&&o&&o.state0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:t})}};return s}throwCyclicReferenceError(e,t,r){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${t} (symbol '${r}')`)}getLinkedNode(e){try{const t=this.getCandidate(e);if(pn(t))return{error:t};const r=this.loadAstNode(t);return r?{node:r,descr:t}:{descr:t,error:this.createLinkingError(e,t)}}catch(t){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,t);const r=t.message??String(t);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${r}`}}}}loadAstNode(e){if(e.node)return e.node;const t=this.langiumDocuments().getDocument(e.documentUri);if(t)return this.astNodeLocator.getAstNode(t.parseResult.value,e.path)}createLinkingError(e,t){const r=Fa(e.container).$document;r&&r.stateFn(t)&&t.isMulti)}findDeclarations(e){if(e){const t=Tp(e),r=e.astNode;if(t&&r){const n=r[t.feature];if(rt(n)||rr(n))return qo(n);if(Array.isArray(n)){for(const a of n)if((rt(a)||rr(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return qo(a)}}if(r){const n=this.nameProvider.getNameNode(r);if(n&&(n===e||Zd(e,n)))return this.getSelfNodes(r)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const t=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),r=this.getNodeFromReferenceDescription(t.head());if(r){for(const n of Va(r))if(rr(n.reference)&&n.reference.items.some(a=>a.ref===e))return n.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const t=this.documents.getDocument(e.sourceUri);if(t)return this.nodeLocator.getAstNode(t.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const t=this.findDeclarations(e),r=[];for(const n of t){const a=this.nameProvider.getNameNode(n)??n.$cstNode;a&&r.push(a)}return r}findReferences(e,t){const r=[];t.includeDeclaration&&r.push(...this.getSelfReferences(e));let n=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return t.documentUri&&(n=n.filter(a=>nt.equals(a.sourceUri,t.documentUri))),r.push(...n),ue(r)}getSelfReferences(e){const t=this.getSelfNodes(e),r=[];for(const n of t){const a=this.nameProvider.getNameNode(n);if(a){const s=Mt(n),o=this.nodeLocator.getAstNodePath(n);r.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:Ya(a),local:!0})}}return r}},Ir=class{static{i(this,"MultiMap")}constructor(e){if(this.map=new Map,e)for(const[t,r]of e)this.add(t,r)}get size(){return Ts.sum(ue(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,t){if(t===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const n=r.indexOf(t);if(n>=0)return r.length===1?this.map.delete(e):r.splice(n,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const t=this.map.get(e);return t?ue(t):Ua}has(e,t){if(t===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(t)>=0:!1}}add(e,t){return this.map.has(e)?this.map.get(e).push(t):this.map.set(e,[t]),this}addAll(e,t){return this.map.has(e)?this.map.get(e).push(...t):this.map.set(e,Array.from(t)),this}forEach(e){this.map.forEach((t,r)=>t.forEach(n=>e(n,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return ue(this.map.entries()).flatMap(([e,t])=>t.map(r=>[e,r]))}keys(){return ue(this.map.keys())}values(){return ue(this.map.values()).flat()}entriesGroupedByKey(){return ue(this.map.entries())}},Nl=class{static{i(this,"BiMap")}get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[t,r]of e)this.set(t,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,t){return this.map.set(e,t),this.inverse.set(t,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const t=this.map.get(e);return t!==void 0?(this.map.delete(e),this.inverse.delete(t),!0):!1}},aw=class{static{i(this,"DefaultScopeComputation")}constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,t=pe.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,t)}async collectExportedSymbolsForNode(e,t,r=Gs,n=pe.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,t);for(const s of r(e))await ze(n),this.addExportedSymbol(s,a,t);return a}addExportedSymbol(e,t,r){const n=this.nameProvider.getName(e);n&&t.push(this.descriptions.createDescription(e,n,r))}async collectLocalSymbols(e,t=pe.CancellationToken.None){const r=e.parseResult.value,n=new Ir;for(const a of Nr(r))await ze(t),this.addLocalSymbol(a,e,n);return n}addLocalSymbol(e,t,r){const n=e.$container;if(n){const a=this.nameProvider.getName(e);a&&r.add(n,this.descriptions.createDescription(e,a,t))}}},Qf=class{static{i(this,"StreamScope")}constructor(e,t,r){this.elements=e,this.outerScope=t,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===t):this.elements.find(n=>n.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.filter(n=>n.name.toLowerCase()===t):this.elements.filter(n=>n.name===e);return(this.concatOuterScope||r.isEmpty())&&this.outerScope?r.concat(this.outerScope.getElements(e)):r}},AF=class{static{i(this,"MapScope")}constructor(e,t,r){this.elements=new Map,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0;for(const n of e){const a=this.caseInsensitive?n.name.toLowerCase():n.name;this.elements.set(a,n)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t),n=r?[r]:[];return(this.concatOuterScope||n.length>0)&&this.outerScope?ue(n).concat(this.outerScope.getElements(e)):ue(n)}getAllElements(){let e=ue(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},iw=class{static{i(this,"MultiMapScope")}constructor(e,t,r){this.elements=new Ir,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0;for(const n of e){const a=this.caseInsensitive?n.name.toLowerCase():n.name;this.elements.add(a,n)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t)[0];if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t);return(this.concatOuterScope||r.length===0)&&this.outerScope?ue(r).concat(this.outerScope.getElements(e)):ue(r)}getAllElements(){let e=ue(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},EF={getElement(){},getElements(){return Ua},getAllElements(){return Ua}},Gu=class{static{i(this,"DisposableCache")}constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},Vm=class extends Gu{static{i(this,"SimpleCache")}constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,t){this.throwIfDisposed(),this.cache.set(e,t)}get(e,t){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(t){const r=t();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},Fu=class extends Gu{static{i(this,"ContextCache")}constructor(e){super(),this.cache=new Map,this.converter=e??(t=>t)}has(e,t){return this.throwIfDisposed(),this.cacheForContext(e).has(t)}set(e,t,r){this.throwIfDisposed(),this.cacheForContext(e).set(t,r)}get(e,t,r){this.throwIfDisposed();const n=this.cacheForContext(e);if(n.has(t))return n.get(t);if(r){const a=r();return n.set(t,a),a}else return}delete(e,t){return this.throwIfDisposed(),this.cacheForContext(e).delete(t)}clear(e){if(this.throwIfDisposed(),e){const t=this.converter(e);this.cache.delete(t)}else this.cache.clear()}cacheForContext(e){const t=this.converter(e);let r=this.cache.get(t);return r||(r=new Map,this.cache.set(t,r)),r}},sw=class extends Fu{static{i(this,"DocumentCache")}constructor(e,t){super(r=>r.toString()),t?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(t,r=>{this.clear(r.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{for(const a of n)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{const a=r.concat(n);for(const s of a)this.clear(s)}))}},qm=class extends Vm{static{i(this,"WorkspaceCache")}constructor(e,t){super(),t?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(t,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,n)=>{n.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},ow=class{static{i(this,"DefaultScopeProvider")}constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new qm(e.shared)}getScope(e){const t=[],r=this.reflection.getReferenceType(e),n=Mt(e.container).localSymbols;if(n){let s=e.container;do n.has(s)&&t.push(n.getStream(s).filter(o=>this.reflection.isSubtype(o.type,r))),s=s.$container;while(s)}let a=this.getGlobalScope(r,e);for(let s=t.length-1;s>=0;s--)a=this.createScope(t[s],a);return a}createScope(e,t,r){return new Qf(ue(e),t,r)}createScopeForNodes(e,t,r){const n=ue(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new Qf(n,t,r)}getGlobalScope(e,t){return this.globalScopeCache.get(e,()=>new iw(this.indexManager.allElements(e)))}};function Hm(e){return typeof e.$comment=="string"}i(Hm,"isAstNodeWithComment");function ed(e){return typeof e=="object"&&!!e&&("$ref"in e||"$error"in e)}i(ed,"isIntermediateReference");var lw=class{static{i(this,"DefaultJsonSerializer")}constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,t){const r=t??{},n=t?.replacer,a=i((o,l)=>this.replacer(o,l,r),"defaultReplacer"),s=n?(o,l)=>n(o,l,a):a;try{return this.currentDocument=Mt(e),JSON.stringify(e,s,t?.space)}finally{this.currentDocument=void 0}}deserialize(e,t){const r=t??{},n=JSON.parse(e);return this.linkNode(n,n,r),n}replacer(e,t,{refText:r,sourceText:n,textRegions:a,comments:s,uriConverter:o}){if(!this.ignoreProperties.has(e))if(rt(t)){const l=t.ref,u=r?t.$refText:void 0;if(l){const c=Mt(l);let f="";this.currentDocument&&this.currentDocument!==c&&(o?f=o(c.uri,l):f=c.uri.toString());const d=this.astNodeLocator.getAstNodePath(l);return{$ref:`${f}#${d}`,$refText:u}}else return{$error:t.error?.message??"Could not resolve reference",$refText:u}}else if(rr(t)){const l=r?t.$refText:void 0,u=[];for(const c of t.items){const f=c.ref,d=Mt(c.ref);let m="";this.currentDocument&&this.currentDocument!==d&&(o?m=o(d.uri,f):m=d.uri.toString());const g=this.astNodeLocator.getAstNodePath(f);u.push(`${m}#${g}`)}return{$refs:u,$refText:l}}else if(Oe(t)){let l;if(a&&(l=this.addAstNodeRegionWithAssignmentsTo({...t}),(!e||t.$document)&&l?.$textRegion&&(l.$textRegion.documentURI=this.currentDocument?.uri.toString())),n&&!e&&(l??(l={...t}),l.$sourceText=t.$cstNode?.text),s){l??(l={...t});const u=this.commentProvider.getComment(t);u&&(l.$comment=u.replace(/\r/g,""))}return l??t}else return t}addAstNodeRegionWithAssignmentsTo(e){const t=i(r=>({offset:r.offset,end:r.end,length:r.length,range:r.range}),"createDocumentSegment");if(e.$cstNode){const r=e.$textRegion=t(e.$cstNode),n=r.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=gp(e.$cstNode,a).map(t);s.length!==0&&(n[a]=s)}),e}}linkNode(e,t,r,n,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let c=0;c{await this.handleException(()=>e.call(t,r,n,a),"An error occurred during validation",n,r)}}async handleException(e,t,r,n){try{await e()}catch(a){if(ta(a))throw a;console.error(`${t}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);r("error",`${t}: ${s}`,{node:n})}}addEntry(e,t){if(e==="AstNode"){this.entries.add("AstNode",t);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,t)}getChecks(e,t){let r=ue(this.entries.get(e)).concat(this.entries.get("AstNode"));return t&&(r=r.filter(n=>t.includes(n.category))),r.map(n=>n.check)}registerBeforeDocument(e,t=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",t))}registerAfterDocument(e,t=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",t))}wrapPreparationException(e,t,r){return async(n,a,s,o)=>{await this.handleException(()=>e.call(r,n,a,s,o),t,a,n)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},fw=Object.freeze({validateNode:!0,validateChildren:!0}),dw=class{static{i(this,"DefaultDocumentValidator")}constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,t={},r=pe.CancellationToken.None){const n=e.parseResult,a=[];if(await ze(r),(!t.categories||t.categories.includes("built-in"))&&(this.processLexingErrors(n,a,t),t.stopAfterLexingErrors&&a.some(s=>s.data?.code===_t.LexingError)||(this.processParsingErrors(n,a,t),t.stopAfterParsingErrors&&a.some(s=>s.data?.code===_t.ParsingError))||(this.processLinkingErrors(e,a,t),t.stopAfterLinkingErrors&&a.some(s=>s.data?.code===_t.LinkingError))))return a;try{a.push(...await this.validateAst(n.value,t,r))}catch(s){if(ta(s))throw s;console.error("An error occurred during validation:",s)}return await ze(r),a}processLexingErrors(e,t,r){const n=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(const a of n){const s=a.severity??"error",o={severity:gs(s),range:{start:{line:a.line-1,character:a.column-1},end:{line:a.line-1,character:a.column+a.length-1}},message:a.message,data:Xm(s),source:this.getSource()};t.push(o)}}processParsingErrors(e,t,r){for(const n of e.parserErrors){let a;if(isNaN(n.token.startOffset)){if("previousToken"in n){const s=n.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=$s(n.token);if(a){const s={severity:gs("error"),range:a,message:n.message,data:Sn(_t.ParsingError),source:this.getSource()};t.push(s)}}}processLinkingErrors(e,t,r){for(const n of e.references){const a=n.error;if(a){const s={node:a.info.container,range:n.$refNode?.range,property:a.info.property,index:a.info.index,data:{code:_t.LinkingError,containerType:a.info.container.$type,property:a.info.property,refText:a.info.reference.$refText}};t.push(this.toDiagnostic("error",a.message,s))}}}async validateAst(e,t,r=pe.CancellationToken.None){const n=[],a=i((s,o,l)=>{n.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,t,a,r),await this.validateAstNodes(e,t,a,r),await this.validateAstAfter(e,t,a,r),n}async validateAstBefore(e,t,r,n=pe.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await ze(n),await s(e,r,t.categories??[],n)}async validateAstNodes(e,t,r,n=pe.CancellationToken.None){if(this.profiler?.isActive("validating")){const a=this.profiler.createTask("validating",this.languageId);a.start();try{const s=Gt(e).iterator();for(const o of s){a.startSubTask(o.$type);const l=this.validateSingleNodeOptions(o,t);if(l.validateNode)try{const u=this.validationRegistry.getChecks(o.$type,t.categories);for(const c of u)await c(o,r,n)}finally{a.stopSubTask(o.$type)}l.validateChildren||s.prune()}}finally{a.stop()}}else{const a=Gt(e).iterator();for(const s of a){await ze(n);const o=this.validateSingleNodeOptions(s,t);if(o.validateNode){const l=this.validationRegistry.getChecks(s.$type,t.categories);for(const u of l)await u(s,r,n)}o.validateChildren||a.prune()}}}validateSingleNodeOptions(e,t){return fw}async validateAstAfter(e,t,r,n=pe.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await ze(n),await s(e,r,t.categories??[],n)}toDiagnostic(e,t,r){return{message:t,range:Ym(r),severity:gs(e),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function Ym(e){if(e.range)return e.range;let t;return typeof e.property=="string"?t=Yl(e.node.$cstNode,e.property,e.index):typeof e.keyword=="string"&&(t=vp(e.node.$cstNode,e.keyword,e.index)),t??(t=e.node.$cstNode),t?t.range:{start:{line:0,character:0},end:{line:0,character:0}}}i(Ym,"getDiagnosticRange");function gs(e){switch(e){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+e)}}i(gs,"toDiagnosticSeverity");function Xm(e){switch(e){case"error":return Sn(_t.LexingError);case"warning":return Sn(_t.LexingWarning);case"info":return Sn(_t.LexingInfo);case"hint":return Sn(_t.LexingHint);default:throw new Error("Invalid diagnostic severity: "+e)}}i(Xm,"toDiagnosticData");var _t;(function(e){e.LexingError="lexing-error",e.LexingWarning="lexing-warning",e.LexingInfo="lexing-info",e.LexingHint="lexing-hint",e.ParsingError="parsing-error",e.LinkingError="linking-error"})(_t||(_t={}));var pw=class{static{i(this,"DefaultAstNodeDescriptionProvider")}constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,t,r){const n=r??Mt(e);t??(t=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!t)throw new Error(`Node at path ${a} has no name.`);let s;const o=i(()=>s??(s=Ya(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:t,get nameSegment(){return o()},selectionSegment:Ya(e.$cstNode),type:e.$type,documentUri:n.uri,path:a}}},mw=class{static{i(this,"DefaultReferenceDescriptionProvider")}constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,t=pe.CancellationToken.None){const r=[],n=e.parseResult.value;for(const a of Gt(n))await ze(t),Va(a).forEach(s=>{s.reference.error||r.push(...this.createInfoDescriptions(s))});return r}createInfoDescriptions(e){const t=e.reference;if(t.error||!t.$refNode)return[];let r=[];rt(t)&&t.$nodeDescription?r=[t.$nodeDescription]:rr(t)&&(r=t.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const n=Mt(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=Ya(t.$refNode);for(const l of r)s.push({sourceUri:n,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:nt.equals(l.documentUri,n)});return s}},hw=class{static{i(this,"DefaultAstNodeLocator")}constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const t=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return t+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:t}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return t!==void 0?e+this.indexSeparator+t:e}getAstNode(e,t){return t.split(this.segmentSeparator).reduce((n,a)=>{if(!n||a.length===0)return n;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1));return n[o]?.[l]}return n[a]},e)}},zu={};Ll(zu,Cd(ei()));var yw=class{static{i(this,"DefaultConfigurationProvider")}constructor(e){this._ready=new wr,this.onConfigurationSectionUpdateEmitter=new zu.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){this.workspaceConfig=e.capabilities.workspace?.configuration??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const t=this.serviceRegistry.all;e.register({section:t.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const t=this.serviceRegistry.all.map(n=>({section:this.toSectionName(n.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(t);t.forEach((n,a)=>{this.updateSectionConfiguration(n.section,r[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([t,r])=>{this.updateSectionConfiguration(t,r),this.onConfigurationSectionUpdateEmitter.fire({section:t,configuration:r})})}updateSectionConfiguration(e,t){this.settings[e]=t}async getConfiguration(e,t){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][t]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},uo=Cd(nN()),Nn;(function(e){function t(r){return{dispose:i(async()=>await r(),"dispose")}}i(t,"create"),e.create=t})(Nn||(Nn={}));var gw=class{static{i(this,"DefaultDocumentBuilder")}constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Ir,this.documentPhaseListeners=new Ir,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=J.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,t={},r=pe.CancellationToken.None){for(const n of e){const a=n.uri.toString();if(n.state===J.Validated){if(typeof t.validation=="boolean"&&t.validation)this.resetToState(n,J.IndexedReferences);else if(typeof t.validation=="object"){const s=this.findMissingValidationCategories(n,t);s.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:{categories:s}},result:this.buildState.get(a)?.result}),n.state=J.IndexedReferences)}}else this.buildState.delete(a)}this.currentState=J.Changed,await this.emitUpdate(e.map(n=>n.uri),[]),await this.buildDocuments(e,t,r)}async update(e,t,r=pe.CancellationToken.None){this.currentState=J.Changed;const n=[];for(const l of t){const u=this.langiumDocuments.deleteDocuments(l);for(const c of u)n.push(c.uri),this.cleanUpDeleted(c)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=J.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,J.Changed)}const s=ue(a).concat(n).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,J.ComputedScopes)),await this.emitUpdate(a,n),await ze(r);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>l.state=1}findMissingValidationCategories(e,t){const r=this.buildState.get(e.uri.toString()),n=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=r?.result?.validationChecks?new Set(r?.result?.validationChecks):r?.completed?n:new Set,s=t===void 0||t.validation===!0?n:typeof t.validation=="object"?t.validation.categories??n:[];return ue(s).filter(o=>!a.has(o)).toArray()}async findChangedUris(e){if(this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e))return[e];try{const r=await this.fileSystemProvider.stat(e);if(r.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(r))return[e]}catch{}return[]}async emitUpdate(e,t){await Promise.all(this.updateListeners.map(r=>r(e,t)))}sortDocuments(e){let t=0,r=e.length-1;for(;t=0&&!this.hasTextDocument(e[r]);)r--;tr.error!==void 0)?!0:this.indexManager.isAffected(e,t)}onUpdate(e){return this.updateListeners.push(e),Nn.create(()=>{const t=this.updateListeners.indexOf(e);t>=0&&this.updateListeners.splice(t,1)})}resetToState(e,t){switch(t){case J.Changed:case J.Parsed:this.indexManager.removeContent(e.uri);case J.IndexedContent:e.localSymbols=void 0;case J.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case J.Linked:this.indexManager.removeReferences(e.uri);case J.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case J.Validated:}e.state>t&&(e.state=t)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=J.Changed}async buildDocuments(e,t,r){this.prepareBuild(e,t),await this.runCancelable(e,J.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,J.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,J.ComputedScopes,r,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,r)});const n=e.filter(s=>this.shouldLink(s));await this.runCancelable(n,J.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(n,J.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,J.Validated,r,async s=>{await this.validate(s,r),this.markAsCompleted(s)})}markAsCompleted(e){const t=this.buildState.get(e.uri.toString());t&&(t.completed=!0)}prepareBuild(e,t){for(const r of e){const n=r.uri.toString(),a=this.buildState.get(n);(!a||a.completed)&&this.buildState.set(n,{completed:!1,options:t,result:a?.result})}}async runCancelable(e,t,r,n){for(const s of e)s.states.state===t);await this.notifyBuildPhase(a,t,r),this.currentState=t}onBuildPhase(e,t){return this.buildPhaseListeners.add(e,t),Nn.create(()=>{this.buildPhaseListeners.delete(e,t)})}onDocumentPhase(e,t){return this.documentPhaseListeners.add(e,t),Nn.create(()=>{this.documentPhaseListeners.delete(e,t)})}waitUntil(e,t,r){let n;return t&&"path"in t?n=t:r=t,r??(r=pe.CancellationToken.None),n?this.awaitDocumentState(e,n,r):this.awaitBuilderState(e,r)}awaitDocumentState(e,t,r){const n=this.langiumDocuments.getDocument(t);if(n){if(n.state>=e)return Promise.resolve(t);if(r.isCancellationRequested)return Promise.reject(tr);if(this.currentState>=e&&e>n.state)return Promise.reject(new uo.ResponseError(uo.LSPErrorCodes.RequestFailed,`Document state of ${t.toString()} is ${J[n.state]}, requiring ${J[e]}, but workspace state is already ${J[this.currentState]}. Returning undefined.`))}else return Promise.reject(new uo.ResponseError(uo.LSPErrorCodes.ServerCancelled,`No document found for URI: ${t.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{nt.equals(u.uri,t)&&(o.dispose(),l.dispose(),a(u.uri))}),l=r.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(tr)})})}awaitBuilderState(e,t){return this.currentState>=e?Promise.resolve():t.isCancellationRequested?Promise.reject(tr):new Promise((r,n)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),r()}),s=t.onCancellationRequested(()=>{a.dispose(),s.dispose(),n(tr)})})}async notifyDocumentPhase(e,t,r){const a=this.documentPhaseListeners.get(t).slice();for(const s of a)try{await ze(r),await s(e,r)}catch(o){if(!ta(o))throw o}}async notifyBuildPhase(e,t,r){if(e.length===0)return;const a=this.buildPhaseListeners.get(t).slice();for(const s of a)await ze(r),await s(e,r)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,t){const r=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,n=this.getBuildOptions(e),a=typeof n.validation=="object"?{...n.validation}:{};a.categories=this.findMissingValidationCategories(e,n);const s=await r.validateDocument(e,a,t);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=ue(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}},vw=class{static{i(this,"DefaultIndexManager")}constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Fu,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,t){const r=Mt(e).uri,n=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{nt.equals(s.targetUri,r)&&s.targetPath===t&&n.push(s)})}),ue(n)}allElements(e,t){let r=ue(this.symbolIndex.keys());return t&&(r=r.filter(n=>!t||t.has(n))),r.map(n=>this.getFileDescriptions(n,e)).flat()}getFileDescriptions(e,t){return t?this.symbolByTypeIndex.get(e,t,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,t))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const t=e.toString();this.symbolIndex.delete(t),this.symbolByTypeIndex.clear(t)}removeReferences(e){const t=e.toString();this.referenceIndex.delete(t)}async updateContent(e,t=pe.CancellationToken.None){const n=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,t),a=e.uri.toString();this.symbolIndex.set(a,n),this.symbolByTypeIndex.clear(a)}async updateReferences(e,t=pe.CancellationToken.None){const n=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,t);this.referenceIndex.set(e.uri.toString(),n)}isAffected(e,t){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(n=>!n.local&&t.has(n.targetUri.toString())):!1}},Tw=class{static{i(this,"DefaultWorkspaceManager")}constructor(e){this.initialBuildOptions={},this._ready=new wr,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(t=>this.initializeWorkspace(this.folders??[],t))}async initializeWorkspace(e,t=pe.CancellationToken.None){const r=await this.performStartup(e);await ze(t),await this.documentBuilder.build(r,this.initialBuildOptions,t)}async performStartup(e){const t=[],r=i(s=>{t.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,r);const n=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,n)));const a=ue(n).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,r),this._ready.resolve(),t}async loadWorkspaceDocuments(e,t){await Promise.all(e.map(async r=>{const n=await this.langiumDocuments.getOrCreateDocument(r);t(n)}))}loadAdditionalDocuments(e,t){return Promise.resolve()}getRootFolder(e){return Tt.parse(e.uri)}async traverseFolder(e,t){try{const r=await this.fileSystemProvider.readDirectory(e);await Promise.all(r.map(async n=>{this.shouldIncludeEntry(n)&&(n.isDirectory?await this.traverseFolder(n.uri,t):n.isFile&&t.push(n.uri))}))}catch(r){console.error("Failure to read directory content of "+e.toString(!0),r)}}async searchFolder(e){const t=[];return await this.traverseFolder(e,t),t}shouldIncludeEntry(e){const t=nt.basename(e.uri);return t.startsWith(".")?!1:e.isDirectory?t!=="node_modules"&&t!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},$w=class{static{i(this,"DefaultLexerErrorMessageProvider")}buildUnexpectedCharactersMessage(e,t,r,n,a){return Of.buildUnexpectedCharactersMessage(e,t,r,n,a)}buildUnableToPopLexerModeMessage(e){return Of.buildUnableToPopLexerModeMessage(e)}},Jm={mode:"full"},Zm=class{static{i(this,"DefaultLexer")}constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const t=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(t);const r=kl(t)?Object.values(t):t,n=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new at(r,{positionTracking:"full",skipValidations:n,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,t=Jm){const r=this.chevrotainLexer.tokenize(e);return{tokens:r.tokens,errors:r.errors,hidden:r.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(e)}}toTokenTypeDictionary(e){if(kl(e))return e;const t=Bu(e)?Object.values(e.modes).flat():e,r={};return t.forEach(n=>r[n.name]=n),r}};function ju(e){return Array.isArray(e)&&(e.length===0||"name"in e[0])}i(ju,"isTokenTypeArray");function Bu(e){return e&&"modes"in e&&"defaultMode"in e}i(Bu,"isIMultiModeLexerDefinition");function kl(e){return!ju(e)&&!Bu(e)}i(kl,"isTokenTypeDictionary");xs();function Qm(e,t,r){let n,a;typeof e=="string"?(a=t,n=r):(a=e.range.start,n=t),a||(a=ie.create(0,0));const s=th(e),o=Uu(n),l=Rw({lines:s,position:a,options:o});return Cw({index:0,tokens:l,position:a})}i(Qm,"parseJSDoc");function eh(e,t){const r=Uu(t),n=th(e);if(n.length===0)return!1;const a=n[0],s=n[n.length-1],o=r.start,l=r.end;return!!o?.exec(a)&&!!l?.exec(s)}i(eh,"isJSDoc");function th(e){let t="";return typeof e=="string"?t=e:t=e.text,t.split(Ev)}i(th,"getLines");var Py=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,CF=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Rw(e){const t=[];let r=e.position.line,n=e.position.character;for(let a=0;a=l.length){if(t.length>0){const f=ie.create(r,n);t.push({type:"break",content:"",range:Q.create(f,f)})}}else{Py.lastIndex=u;const f=Py.exec(l);if(f){const d=f[0],m=f[1],g=ie.create(r,n+u),v=ie.create(r,n+u+d.length);t.push({type:"tag",content:m,range:Q.create(g,v)}),u+=d.length,u=Ol(l,u)}if(u0&&t[t.length-1].type==="break"?t.slice(0,-1):t}i(Rw,"tokenize");function Aw(e,t,r,n){const a=[];if(e.length===0){const s=ie.create(r,n),o=ie.create(r,n+t.length);a.push({type:"text",content:t,range:Q.create(s,o)})}else{let s=0;for(const l of e){const u=l.index,c=t.substring(s,u);c.length>0&&a.push({type:"text",content:t.substring(s,u),range:Q.create(ie.create(r,s+n),ie.create(r,u+n))});let f=c.length+1;const d=l[1];if(a.push({type:"inline-tag",content:d,range:Q.create(ie.create(r,s+f+n),ie.create(r,s+f+d.length+n))}),f+=d.length,l.length===4){f+=l[2].length;const m=l[3];a.push({type:"text",content:m,range:Q.create(ie.create(r,s+f+n),ie.create(r,s+f+m.length+n))})}else a.push({type:"text",content:"",range:Q.create(ie.create(r,s+f+n),ie.create(r,s+f+n))});s=u+l[0].length}const o=t.substring(s);o.length>0&&a.push({type:"text",content:o,range:Q.create(ie.create(r,s+n),ie.create(r,s+n+o.length))})}return a}i(Aw,"buildInlineTokens");var bF=/\S/,_F=/\s*$/;function Ol(e,t){const r=e.substring(t).match(bF);return r?t+r.index:e.length}i(Ol,"skipWhitespace");function Ew(e){const t=e.match(_F);if(t&&typeof t.index=="number")return t.index}i(Ew,"lastCharacter");function Cw(e){const t=ie.create(e.position.line,e.position.character);if(e.tokens.length===0)return new ky([],Q.create(t,t));const r=[];for(;e.indext.name===e)}getTags(e){return this.getAllTags().filter(t=>t.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const t of this.elements)if(e.length===0)e=t.toString();else{const r=t.toString();e+=rd(e)+r}return e.trim()}toMarkdown(e){let t="";for(const r of this.elements)if(t.length===0)t=r.toMarkdown(e);else{const n=r.toMarkdown(e);t+=rd(t)+n}return t.trim()}},Qu=class{static{i(this,"JSDocTagImpl")}constructor(e,t,r,n){this.name=e,this.content=t,this.inline=r,this.range=n}toString(){let e=`@${this.name}`;const t=this.content.toString();return this.content.inlines.length===1?e=`${e} ${t}`:this.content.inlines.length>1&&(e=`${e} +${t}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){const t=this.content.toMarkdown(e);if(this.inline){const a=ww(this.name,t,e??{});if(typeof a=="string")return a}let r="";e?.tag==="italic"||e?.tag===void 0?r="*":e?.tag==="bold"?r="**":e?.tag==="bold-italic"&&(r="***");let n=`${r}@${this.name}${r}`;return this.content.inlines.length===1?n=`${n} — ${t}`:this.content.inlines.length>1&&(n=`${n} +${t}`),this.inline?`{${n}}`:n}};function ww(e,t,r){if(e==="linkplain"||e==="linkcode"||e==="link"){const n=t.indexOf(" ");let a=t;if(n>0){const o=Ol(t,n);a=t.substring(o),t=t.substring(0,n)}return(e==="linkcode"||e==="link"&&r.link==="code")&&(a=`\`${a}\``),r.renderLink?.(t,a)??Iw(t,a)}}i(ww,"renderInlineTag");function Iw(e,t){try{return Tt.parse(e,!0),`[${t}](${e})`}catch{return e}}i(Iw,"renderLinkDefault");var td=class{static{i(this,"JSDocTextImpl")}constructor(e,t){this.inlines=e,this.range=t}toString(){let e="";for(let t=0;tr.range.start.line&&(e+=` +`)}return e}toMarkdown(e){let t="";for(let r=0;rn.range.start.line&&(t+=` +`)}return t}},Nw=class{static{i(this,"JSDocLineImpl")}constructor(e,t){this.text=e,this.range=t}toString(){return this.text}toMarkdown(){return this.text}};function rd(e){return e.endsWith(` +`)?` +`:` + +`}i(rd,"fillNewlines");var Pw=class{static{i(this,"JSDocDocumentationProvider")}constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const t=this.commentProvider.getComment(e);if(t&&eh(t))return Qm(t).toMarkdown({renderLink:i((n,a)=>this.documentationLinkRenderer(e,n,a),"renderLink"),renderTag:i(n=>this.documentationTagRenderer(e,n),"renderTag")})}documentationLinkRenderer(e,t,r){const n=this.findNameInLocalSymbols(e,t)??this.findNameInGlobalScope(e,t);if(n&&n.nameSegment){const a=n.nameSegment.range.start.line+1,s=n.nameSegment.range.start.character+1,o=n.documentUri.with({fragment:`L${a},${s}`});return`[${r}](${o.toString()})`}else return}documentationTagRenderer(e,t){}findNameInLocalSymbols(e,t){const n=Mt(e).localSymbols;if(!n)return;let a=e;do{const o=n.getStream(a).find(l=>l.name===t);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,t){return this.indexManager.allElements().find(n=>n.name===t)}},kw=class{static{i(this,"DefaultCommentProvider")}constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return Hm(e)?e.$comment:rp(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}},Ow=class{static{i(this,"DefaultAsyncParser")}constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,t){return Promise.resolve(this.syncParser.parse(e))}},SF=class{static{i(this,"AbstractThreadedAsyncParser")}constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length{if(this.queue.length>0){const t=this.queue.shift();t&&(e.lock(),t.resolve(e))}}),this.workerPool.push(e)}}async parse(e,t){const r=await this.acquireParserWorker(t),n=new wr;let a;const s=t.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(r)},this.terminationDelay)});return r.parse(e).then(o=>{const l=this.hydrator.hydrate(o);n.resolve(l)}).catch(o=>{n.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),n.promise}terminateWorker(e){e.terminate();const t=this.workerPool.indexOf(e);t>=0&&this.workerPool.splice(t,1)}async acquireParserWorker(e){this.initializeWorkers();for(const r of this.workerPool)if(r.ready)return r.lock(),r;const t=new wr;return e.onCancellationRequested(()=>{const r=this.queue.indexOf(t);r>=0&&this.queue.splice(r,1),t.reject(tr)}),this.queue.push(t),t.promise}},wF=class{static{i(this,"ParserWorker")}get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,t,r,n){this.onReadyEmitter=new zu.Emitter,this.deferred=new wr,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=n,t(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),r(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(tr),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new wr,this.sendMessage(e),this.deferred.promise}},Lw=class{static{i(this,"DefaultWorkspaceLock")}constructor(){this.previousTokenSource=new pe.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const t=Mu();return this.previousTokenSource=t,this.enqueue(this.writeQueue,e,t.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,t,r=pe.CancellationToken.None){const n=new wr,a={action:t,deferred:n,cancellationToken:r};return e.push(a),this.performNextOperation(),n.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:t,deferred:r,cancellationToken:n})=>{try{const a=await Promise.resolve().then(()=>t(n));r.resolve(a)}catch(a){ta(a)?r.resolve(void 0):r.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},Dw=class{static{i(this,"DefaultHydrator")}constructor(e){this.grammarElementIdMap=new Nl,this.tokenTypeIdMap=new Nl,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(t=>({...t,message:t.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const t=new Map,r=new Map;for(const n of Gt(e))t.set(n,{});if(e.$cstNode)for(const n of Ha(e.$cstNode))r.set(n,{});return{astNodes:t,cstNodes:r}}dehydrateAstNode(e,t){const r=t.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,t));for(const[n,a]of Object.entries(e))if(!n.startsWith("$"))if(Array.isArray(a)){const s=[];r[n]=s;for(const o of a)Oe(o)?s.push(this.dehydrateAstNode(o,t)):rt(o)?s.push(this.dehydrateReference(o,t)):s.push(o)}else Oe(a)?r[n]=this.dehydrateAstNode(a,t):rt(a)?r[n]=this.dehydrateReference(a,t):a!==void 0&&(r[n]=a);return r}dehydrateReference(e,t){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=t.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,t){const r=t.cstNodes.get(e);return Ml(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=t.astNodes.get(e.astNode),$r(e)?r.content=e.content.map(n=>this.dehydrateCstNode(n,t)):xn(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const t=e.value,r=this.createHydrationContext(t);return"$cstNode"in t&&this.hydrateCstNode(t.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(t,r)}}createHydrationContext(e){const t=new Map,r=new Map;for(const a of Gt(e))t.set(a,{});let n;if(e.$cstNode)for(const a of Ha(e.$cstNode)){let s;"fullText"in a?(s=new km(a.fullText),n=s):"content"in a?s=new ku:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(r.set(a,s),s.root=n)}return{astNodes:t,cstNodes:r}}hydrateAstNode(e,t){const r=t.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=t.cstNodes.get(e.$cstNode));for(const[n,a]of Object.entries(e))if(!n.startsWith("$"))if(Array.isArray(a)){const s=[];r[n]=s;for(const o of a)Oe(o)?s.push(this.setParent(this.hydrateAstNode(o,t),r)):rt(o)?s.push(this.hydrateReference(o,r,n,t)):s.push(o)}else Oe(a)?r[n]=this.setParent(this.hydrateAstNode(a,t),r):rt(a)?r[n]=this.hydrateReference(a,r,n,t):a!==void 0&&(r[n]=a);return r}setParent(e,t){return e.$container=t,e}hydrateReference(e,t,r,n){return this.linker.buildReference(t,r,n.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,t,r=0){const n=t.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(n.grammarSource=this.getGrammarElement(e.grammarSource)),n.astNode=t.astNodes.get(e.astNode),$r(n))for(const a of e.content){const s=this.hydrateCstNode(a,t,r++);n.content.push(s)}return n}hydrateCstLeafNode(e){const t=this.getTokenType(e.tokenType),r=e.offset,n=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new bl(r,n,{start:{line:a,character:s},end:{line:o,character:l}},t,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const t of Gt(this.grammar))Gl(t)&&this.grammarElementIdMap.set(t,e++)}};function je(e){return{documentation:{CommentProvider:i(t=>new kw(t),"CommentProvider"),DocumentationProvider:i(t=>new Pw(t),"DocumentationProvider")},parser:{AsyncParser:i(t=>new Ow(t),"AsyncParser"),GrammarConfig:i(t=>_p(t),"GrammarConfig"),LangiumParser:i(t=>Gm(t),"LangiumParser"),CompletionParser:i(t=>Mm(t),"CompletionParser"),ValueConverter:i(()=>new zm,"ValueConverter"),TokenBuilder:i(()=>new Du,"TokenBuilder"),Lexer:i(t=>new Zm(t),"Lexer"),ParserErrorMessageProvider:i(()=>new Lm,"ParserErrorMessageProvider"),LexerErrorMessageProvider:i(()=>new $w,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:i(()=>new hw,"AstNodeLocator"),AstNodeDescriptionProvider:i(t=>new pw(t),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:i(t=>new mw(t),"ReferenceDescriptionProvider")},references:{Linker:i(t=>new tw(t),"Linker"),NameProvider:i(()=>new rw,"NameProvider"),ScopeProvider:i(t=>new ow(t),"ScopeProvider"),ScopeComputation:i(t=>new aw(t),"ScopeComputation"),References:i(t=>new nw(t),"References")},serializer:{Hydrator:i(t=>new Dw(t),"Hydrator"),JsonSerializer:i(t=>new lw(t),"JsonSerializer")},validation:{DocumentValidator:i(t=>new dw(t),"DocumentValidator"),ValidationRegistry:i(t=>new cw(t),"ValidationRegistry")},shared:i(()=>e.shared,"shared")}}i(je,"createDefaultCoreModule");function Be(e){return{ServiceRegistry:i(t=>new uw(t),"ServiceRegistry"),workspace:{LangiumDocuments:i(t=>new ew(t),"LangiumDocuments"),LangiumDocumentFactory:i(t=>new QS(t),"LangiumDocumentFactory"),DocumentBuilder:i(t=>new gw(t),"DocumentBuilder"),IndexManager:i(t=>new vw(t),"IndexManager"),WorkspaceManager:i(t=>new Tw(t),"WorkspaceManager"),FileSystemProvider:i(t=>e.fileSystemProvider(t),"FileSystemProvider"),WorkspaceLock:i(()=>new Lw,"WorkspaceLock"),ConfigurationProvider:i(t=>new yw(t),"ConfigurationProvider")},profilers:{}}}i(Be,"createDefaultSharedCoreModule");var nd;(function(e){e.merge=(t,r)=>Qa(Qa({},t),r)})(nd||(nd={}));function ee(e,t,r,n,a,s,o,l,u){const c=[e,t,r,n,a,s,o,l,u].reduce(Qa,{});return sh(c)}i(ee,"inject");var xw=Symbol("isProxy");function ih(e){if(e&&e[xw])for(const t of Object.values(e))ih(t);return e}i(ih,"eagerLoad");function sh(e,t){const r=new Proxy({},{deleteProperty:i(()=>!1,"deleteProperty"),set:i(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:i((n,a)=>a===xw?!0:ad(n,a,e,t||r),"get"),getOwnPropertyDescriptor:i((n,a)=>(ad(n,a,e,t||r),Object.getOwnPropertyDescriptor(n,a)),"getOwnPropertyDescriptor"),has:i((n,a)=>a in e,"has"),ownKeys:i(()=>[...Object.getOwnPropertyNames(e)],"ownKeys")});return r}i(sh,"_inject");var Oy=Symbol();function ad(e,t,r,n){if(t in e){if(e[t]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+e[t]);if(e[t]===Oy)throw new Error('Cycle detected. Please make "'+String(t)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return e[t]}else if(t in r){const a=r[t];e[t]=Oy;try{e[t]=typeof a=="function"?a(n):sh(a,n)}catch(s){throw e[t]=s instanceof Error?s:void 0,s}return e[t]}else return}i(ad,"_resolve");function Qa(e,t){if(t){for(const[r,n]of Object.entries(t))if(n!=null)if(typeof n=="object"){const a=e[r];typeof a=="object"&&a!==null?e[r]=Qa(a,n):e[r]=Qa({},n)}else e[r]=n}return e}i(Qa,"_merge");var id={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},wn;(function(e){e.REGULAR="indentation-sensitive",e.IGNORE_INDENTATION="ignore-indentation"})(wn||(wn={}));var Mw=class extends Du{static{i(this,"IndentationAwareTokenBuilder")}constructor(e=id){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...id,...e},this.indentTokenType=ja({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=ja({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,t){const r=super.buildTokens(e,t);if(!ju(r))throw new Error("Invalid tokens built by default builder");const{indentTokenName:n,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,u,c;const f=[];for(const d of r){for(const[m,g]of o)d.name===m?d.PUSH_MODE=wn.IGNORE_INDENTATION:d.name===g&&(d.POP_MODE=!0);d.name===a?l=d:d.name===n?u=d:d.name===s?c=d:f.push(d)}if(!l||!u||!c)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[wn.REGULAR]:[l,u,...f,c],[wn.IGNORE_INDENTATION]:[...f,c]},defaultMode:wn.REGULAR}:[l,u,c,...f]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,t){return t===0||`\r +`.includes(e[t-1])}matchWhitespace(e,t,r,n){this.whitespaceRegExp.lastIndex=t;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:a?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,t,r,n){const a=this.getLineNumber(t,n);return Qs(e,r,n,n+r.length,a,a,1,r.length)}getLineNumber(e,t){return e.substring(0,t).split(/\r\n|\r|\n/).length}indentMatcher(e,t,r,n){if(!this.isStartOfLine(e,t))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,t,r,n);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,t,r,n){if(!this.isStartOfLine(e,t))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,t,r,n);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${t}. Current indentation stack: ${this.indentationStack}`,offset:t,length:o?.[0]?.length??0,line:this.getLineNumber(e,t),column:1}),null;const u=this.indentationStack.length-l-1,c=e.substring(0,t).match(/[\r\n]+$/)?.[0].length??1;for(let f=0;f1;)t.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],t}},IF=class extends Zm{static{i(this,"IndentationAwareLexer")}constructor(e){if(super(e),e.parser.TokenBuilder instanceof Mw)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,t=Jm){const r=super.tokenize(e),n=r.report;t?.mode==="full"&&r.tokens.push(...n.remainingDedents),n.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,u=[],c=r.tokens.length-1;for(let f=0;f=0&&u.push(r.tokens[c]),r.tokens=u,r}},oh={};Vr(oh,{AstUtils:()=>Nd,BiMap:()=>Nl,Cancellation:()=>pe,ContextCache:()=>Fu,CstUtils:()=>Sd,DONE_RESULT:()=>tt,Deferred:()=>wr,Disposable:()=>Nn,DisposableCache:()=>Gu,DocumentCache:()=>sw,EMPTY_STREAM:()=>Ua,ErrorWithLocation:()=>Wl,GrammarUtils:()=>sp,MultiMap:()=>Ir,OperationCancelled:()=>tr,Reduction:()=>Ts,RegExpUtils:()=>lp,SimpleCache:()=>Vm,StreamImpl:()=>er,TreeStreamImpl:()=>Ka,URI:()=>Tt,UriTrie:()=>Km,UriUtils:()=>nt,WorkspaceCache:()=>qm,assertCondition:()=>op,assertUnreachable:()=>qr,delayNextTick:()=>xu,interruptAndCheck:()=>ze,isOperationCancelled:()=>ta,loadGrammarFromJson:()=>Ue,setInterruptionPeriod:()=>jm,startCancelableOperation:()=>Mu,stream:()=>ue});Ll(oh,zu);var Gw=class{static{i(this,"EmptyFileSystemProvider")}stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},Xe={fileSystemProvider:i(()=>new Gw,"fileSystemProvider")},NF={Grammar:i(()=>{},"Grammar"),LanguageMetaData:i(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},PF={AstReflection:i(()=>new Jd,"AstReflection")};function Fw(){const e=ee(Be(Xe),PF),t=ee(je({shared:e}),NF);return e.ServiceRegistry.register(t),t}i(Fw,"createMinimalGrammarServices");function Ue(e){const t=Fw(),r=t.serializer.JsonSerializer.deserialize(e);return t.shared.workspace.LangiumDocumentFactory.fromModel(r,Tt.parse(`memory:/${r.name??"grammar"}.langium`)),r}i(Ue,"loadGrammarFromJson");Ll(Hg,oh);var kF=class{static{i(this,"DefaultLangiumProfiler")}constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new Ir}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(t=>this.activeCategories.add(t)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(t=>this.activeCategories.delete(t)):this.activeCategories.clear()}createTask(e,t){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${t}'.`),new zw(r=>this.records.add(e,this.dumpRecord(e,r)),t)}dumpRecord(e,t){console.info(`Task ${e}.${t.identifier} executed in ${t.duration.toFixed(2)}ms and ended at ${t.date.toISOString()}`);const r=[];for(const s of t.entries.keys()){const o=t.entries.get(s),l=o.reduce((u,c)=>u+c);r.push({name:`${t.identifier}.${s}`,count:o.length,duration:l})}const n=t.duration-r.map(s=>s.duration).reduce((s,o)=>s+o,0);r.push({name:t.identifier,count:1,duration:n}),r.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return i(a,"Round"),console.table(r.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/t.duration),"Time (ms)":a(s.duration)}))),t}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(t=>e.some(r=>r===t[0])).flatMap(t=>t[1])}},zw=class{static{i(this,"ProfilingTask")}constructor(e,t){this.stack=[],this.entries=new Ir,this.addRecord=e,this.identifier=t}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(t=>t.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const t=this.stack.pop();if(!t)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(t.id!==e)throw new Error(`Sub-Task "${t.id}" is not already stopped.`);const r=performance.now()-t.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=r);const n=r-t.content;this.entries.add(e,n)}},sd;(e=>{e.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(sd||(sd={}));var od;(e=>{e.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(od||(od={}));var ld;(e=>{e.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(ld||(ld={}));var ud;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(ud||(ud={}));var cd;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(cd||(cd={}));var fd;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(fd||(fd={}));var dd;(e=>{e.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(dd||(dd={}));var pd;(e=>{e.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(pd||(pd={}));var md;(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(md||(md={}));var hd;(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(hd||(hd={}));var yd;(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(yd||(yd={}));var gd;(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(gd||(gd={}));var vd;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(vd||(vd={}));var Td;(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(Td||(Td={}));var $d;(e=>{e.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})($d||($d={}));({...sd.Terminals,...od.Terminals,...ld.Terminals,...ud.Terminals,...cd.Terminals,...fd.Terminals,...dd.Terminals,...pd.Terminals,...md.Terminals,...hd.Terminals,...yd.Terminals,...gd.Terminals,...Td.Terminals,...vd.Terminals,...$d.Terminals});var Ly={$type:"AbnfAlternation",alternatives:"alternatives"},Dy={$type:"AbnfConcatenation",elements:"elements"},ec={$type:"AbnfElement",primary:"primary",repeat:"repeat"},xy={$type:"AbnfGroup",element:"element"},My={$type:"AbnfNumVal",value:"value"},Gy={$type:"AbnfOptionalGroup",element:"element"},ca={$type:"AbnfPrimary"},tc={$type:"AbnfRule",definition:"definition",name:"name"},Fy={$type:"AbnfRuleName",name:"name"},zy={$type:"AbnfStringLiteral",value:"value"},co={$type:"Accelerator",name:"name",x:"x",y:"y"},rc={$type:"Alignment",direction:"direction",members:"members"},fo={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},xi={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},nc={$type:"Annotations",x:"x",y:"y"},Xt={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function OF(e){return Ne.isInstance(e,Xt.$type)}i(OF,"isArchitecture");var po={$type:"Axis",label:"label",name:"name"},Ko={$type:"Branch",name:"name",order:"order"};function LF(e){return Ne.isInstance(e,Ko.$type)}i(LF,"isBranch");var jy={$type:"Checkout",branch:"branch"},mo={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},ac={$type:"ClassDefStatement",className:"className",styleText:"styleText"},Aa={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function DF(e){return Ne.isInstance(e,Aa.$type)}i(DF,"isCommit");var ho={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},Zr={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},yo={$type:"Curve",entries:"entries",label:"label",name:"name"},cn={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function xF(e){return Ne.isInstance(e,cn.$type)}i(xF,"isCynefin");var go={$type:"Deaccelerator",name:"name",x:"x",y:"y"},By={$type:"Decorator",strategy:"strategy"},fa={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},Wo={$type:"DomainBlock",domain:"domain",items:"items"};function MF(e){return Ne.isInstance(e,Wo.$type)}i(MF,"isDomainBlock");var Rd={$type:"DomainItem",label:"label"};function GF(e){return Ne.isInstance(e,Rd.$type)}i(GF,"isDomainItem");var Uy={$type:"EbnfChoice",alternatives:"alternatives"},Ky={$type:"EbnfExceptionPostfix",except:"except"},Wy={$type:"EbnfGroup",element:"element"},Vy={$type:"EbnfNonTerminal",name:"name"},qy={$type:"EbnfOneOrMorePostfix",operator:"operator"},Hy={$type:"EbnfOptional",element:"element"},Yy={$type:"EbnfOptionalPostfix",operator:"operator"},Mi={$type:"EbnfPostfix"},Qr={$type:"EbnfPrimary"},Xy={$type:"EbnfRepetition",element:"element"},ic={$type:"EbnfRule",definition:"definition",name:"name"},Jy={$type:"EbnfSequence",elements:"elements"},Zy={$type:"EbnfSpecial",text:"text"},sc={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},Qy={$type:"EbnfTerminal",value:"value"},eg={$type:"EbnfZeroOrMorePostfix",operator:"operator"},Ht={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},da={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},en={$type:"EmFrame"},Gi={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},tg={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},oc={$type:"EmModelEntity",name:"name"};function FF(e){return e==="rmo"||e==="readmodel"||e==="ui"||e==="cmd"||e==="command"||e==="evt"||e==="event"||e==="pcr"||e==="processor"}i(FF,"isEmModelEntityType");var vo={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},yr={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function zF(e){return Ne.isInstance(e,yr.$type)}i(zF,"isEmResetFrame");var Dr={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},lc={$type:"Entry",axis:"axis",value:"value"},dr={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},rg={$type:"Evolution",stages:"stages"},To={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},uc={$type:"Evolve",component:"component",target:"target"},fn={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function jF(e){return Ne.isInstance(e,fn.$type)}i(jF,"isGitGraph");var Fi={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},ts={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function BF(e){return Ne.isInstance(e,ts.$type)}i(BF,"isInfo");var zi={$type:"Item",classSelector:"classSelector",name:"name"},cc={$type:"Junction",id:"id",in:"in"},ji={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},$o={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},tn={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},Ea={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function UF(e){return Ne.isInstance(e,Ea.$type)}i(UF,"isMerge");var Ro={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},fc={$type:"Option",name:"name",value:"value"},Ca={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function KF(e){return Ne.isInstance(e,Ca.$type)}i(KF,"isPacket");var ba={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function WF(e){return Ne.isInstance(e,ba.$type)}i(WF,"isPacketBlock");var ng={$type:"PegAny",dot:"dot"},ag={$type:"PegGroup",element:"element"},ig={$type:"PegIdentifier",name:"name"},sg={$type:"PegLiteral",value:"value"},og={$type:"PegOrderedChoice",alternatives:"alternatives"},dc={$type:"PegPrefix",operator:"operator",suffix:"suffix"},Bi={$type:"PegPrimary"},pc={$type:"PegRule",definition:"definition",name:"name"},lg={$type:"PegSequence",elements:"elements"},mc={$type:"PegSuffix",operator:"operator",primary:"primary"},dn={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function VF(e){return Ne.isInstance(e,dn.$type)}i(VF,"isPie");var Vo={$type:"PieSection",label:"label",value:"value"};function qF(e){return Ne.isInstance(e,Vo.$type)}i(qF,"isPieSection");var hc={$type:"Pipeline",components:"components",parent:"parent"},Ao={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},rn={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},_a={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function HF(e){return Ne.isInstance(e,_a.$type)}i(HF,"isRailroad");var Sa={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function YF(e){return Ne.isInstance(e,Sa.$type)}i(YF,"isRailroadAbnf");var ug={$type:"RailroadChoiceExpr",alternatives:"alternatives"},wa={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function XF(e){return Ne.isInstance(e,wa.$type)}i(XF,"isRailroadEbnf");var pr={$type:"RailroadExpression"},cg={$type:"RailroadNonTerminalExpr",name:"name"},fg={$type:"RailroadOneOrMoreExpr",element:"element"},dg={$type:"RailroadOptionalExpr",element:"element"},Ia={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function JF(e){return Ne.isInstance(e,Ia.$type)}i(JF,"isRailroadPeg");var yc={$type:"RailroadRule",definition:"definition",name:"name"},pg={$type:"RailroadSequenceExpr",elements:"elements"},mg={$type:"RailroadSpecialExpr",text:"text"},hg={$type:"RailroadTerminalExpr",value:"value"},yg={$type:"RailroadZeroOrMoreExpr",element:"element"},gc={$type:"Section",classSelector:"classSelector",name:"name"},pa={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},vc={$type:"Size",height:"height",width:"width"},ma={$type:"Statement"},rs={$type:"Transition",from:"from",label:"label",to:"to"};function ZF(e){return Ne.isInstance(e,rs.$type)}i(ZF,"isTransition");var Na={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function QF(e){return Ne.isInstance(e,Na.$type)}i(QF,"isTreemap");var Tc={$type:"TreemapRow",indent:"indent",item:"item"},ha={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},Ui={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},We={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function ez(e){return Ne.isInstance(e,We.$type)}i(ez,"isWardley");var jw=class extends Id{constructor(){super(...arguments),this.types={AbnfAlternation:{name:Ly.$type,properties:{alternatives:{name:Ly.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:Dy.$type,properties:{elements:{name:Dy.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:ec.$type,properties:{primary:{name:ec.primary},repeat:{name:ec.repeat}},superTypes:[]},AbnfGroup:{name:xy.$type,properties:{element:{name:xy.element}},superTypes:[ca.$type]},AbnfNumVal:{name:My.$type,properties:{value:{name:My.value}},superTypes:[ca.$type]},AbnfOptionalGroup:{name:Gy.$type,properties:{element:{name:Gy.element}},superTypes:[ca.$type]},AbnfPrimary:{name:ca.$type,properties:{},superTypes:[]},AbnfRule:{name:tc.$type,properties:{definition:{name:tc.definition},name:{name:tc.name}},superTypes:[]},AbnfRuleName:{name:Fy.$type,properties:{name:{name:Fy.name}},superTypes:[ca.$type]},AbnfStringLiteral:{name:zy.$type,properties:{value:{name:zy.value}},superTypes:[ca.$type]},Accelerator:{name:co.$type,properties:{name:{name:co.name},x:{name:co.x},y:{name:co.y}},superTypes:[]},Alignment:{name:rc.$type,properties:{direction:{name:rc.direction},members:{name:rc.members,defaultValue:[]}},superTypes:[]},Anchor:{name:fo.$type,properties:{evolution:{name:fo.evolution},name:{name:fo.name},visibility:{name:fo.visibility}},superTypes:[]},Annotation:{name:xi.$type,properties:{number:{name:xi.number},text:{name:xi.text},x:{name:xi.x},y:{name:xi.y}},superTypes:[]},Annotations:{name:nc.$type,properties:{x:{name:nc.x},y:{name:nc.y}},superTypes:[]},Architecture:{name:Xt.$type,properties:{accDescr:{name:Xt.accDescr},accTitle:{name:Xt.accTitle},alignments:{name:Xt.alignments,defaultValue:[]},edges:{name:Xt.edges,defaultValue:[]},groups:{name:Xt.groups,defaultValue:[]},junctions:{name:Xt.junctions,defaultValue:[]},services:{name:Xt.services,defaultValue:[]},title:{name:Xt.title}},superTypes:[]},Axis:{name:po.$type,properties:{label:{name:po.label},name:{name:po.name}},superTypes:[]},Branch:{name:Ko.$type,properties:{name:{name:Ko.name},order:{name:Ko.order}},superTypes:[ma.$type]},Checkout:{name:jy.$type,properties:{branch:{name:jy.branch}},superTypes:[ma.$type]},CherryPicking:{name:mo.$type,properties:{id:{name:mo.id},parent:{name:mo.parent},tags:{name:mo.tags,defaultValue:[]}},superTypes:[ma.$type]},ClassDefStatement:{name:ac.$type,properties:{className:{name:ac.className},styleText:{name:ac.styleText}},superTypes:[]},Commit:{name:Aa.$type,properties:{id:{name:Aa.id},message:{name:Aa.message},tags:{name:Aa.tags,defaultValue:[]},type:{name:Aa.type}},superTypes:[ma.$type]},Common:{name:ho.$type,properties:{accDescr:{name:ho.accDescr},accTitle:{name:ho.accTitle},title:{name:ho.title}},superTypes:[]},Component:{name:Zr.$type,properties:{decorator:{name:Zr.decorator},evolution:{name:Zr.evolution},inertia:{name:Zr.inertia,defaultValue:!1},label:{name:Zr.label},name:{name:Zr.name},visibility:{name:Zr.visibility}},superTypes:[]},Curve:{name:yo.$type,properties:{entries:{name:yo.entries,defaultValue:[]},label:{name:yo.label},name:{name:yo.name}},superTypes:[]},Cynefin:{name:cn.$type,properties:{accDescr:{name:cn.accDescr},accTitle:{name:cn.accTitle},domains:{name:cn.domains,defaultValue:[]},title:{name:cn.title},transitions:{name:cn.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:go.$type,properties:{name:{name:go.name},x:{name:go.x},y:{name:go.y}},superTypes:[]},Decorator:{name:By.$type,properties:{strategy:{name:By.strategy}},superTypes:[]},Direction:{name:fa.$type,properties:{accDescr:{name:fa.accDescr},accTitle:{name:fa.accTitle},dir:{name:fa.dir},statements:{name:fa.statements,defaultValue:[]},title:{name:fa.title}},superTypes:[fn.$type]},DomainBlock:{name:Wo.$type,properties:{domain:{name:Wo.domain},items:{name:Wo.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:Rd.$type,properties:{label:{name:Rd.label}},superTypes:[]},EbnfChoice:{name:Uy.$type,properties:{alternatives:{name:Uy.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:Ky.$type,properties:{except:{name:Ky.except}},superTypes:[Mi.$type]},EbnfGroup:{name:Wy.$type,properties:{element:{name:Wy.element}},superTypes:[Qr.$type]},EbnfNonTerminal:{name:Vy.$type,properties:{name:{name:Vy.name}},superTypes:[Qr.$type]},EbnfOneOrMorePostfix:{name:qy.$type,properties:{operator:{name:qy.operator}},superTypes:[Mi.$type]},EbnfOptional:{name:Hy.$type,properties:{element:{name:Hy.element}},superTypes:[Qr.$type]},EbnfOptionalPostfix:{name:Yy.$type,properties:{operator:{name:Yy.operator}},superTypes:[Mi.$type]},EbnfPostfix:{name:Mi.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Qr.$type,properties:{},superTypes:[]},EbnfRepetition:{name:Xy.$type,properties:{element:{name:Xy.element}},superTypes:[Qr.$type]},EbnfRule:{name:ic.$type,properties:{definition:{name:ic.definition},name:{name:ic.name}},superTypes:[]},EbnfSequence:{name:Jy.$type,properties:{elements:{name:Jy.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:Zy.$type,properties:{text:{name:Zy.text}},superTypes:[Qr.$type]},EbnfTerm:{name:sc.$type,properties:{base:{name:sc.base},postfixes:{name:sc.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:Qy.$type,properties:{value:{name:Qy.value}},superTypes:[Qr.$type]},EbnfZeroOrMorePostfix:{name:eg.$type,properties:{operator:{name:eg.operator}},superTypes:[Mi.$type]},Edge:{name:Ht.$type,properties:{lhsDir:{name:Ht.lhsDir},lhsGroup:{name:Ht.lhsGroup,defaultValue:!1},lhsId:{name:Ht.lhsId},lhsInto:{name:Ht.lhsInto,defaultValue:!1},rhsDir:{name:Ht.rhsDir},rhsGroup:{name:Ht.rhsGroup,defaultValue:!1},rhsId:{name:Ht.rhsId},rhsInto:{name:Ht.rhsInto,defaultValue:!1},title:{name:Ht.title}},superTypes:[]},EmDataEntity:{name:da.$type,properties:{dataBlockValue:{name:da.dataBlockValue},dataType:{name:da.dataType},name:{name:da.name}},superTypes:[]},EmFrame:{name:en.$type,properties:{},superTypes:[]},EmGwt:{name:Gi.$type,properties:{givenStatements:{name:Gi.givenStatements,defaultValue:[]},sourceFrame:{name:Gi.sourceFrame,referenceType:en.$type},thenStatements:{name:Gi.thenStatements,defaultValue:[]},whenStatements:{name:Gi.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:tg.$type,properties:{entityIdentifier:{name:tg.entityIdentifier,referenceType:oc.$type}},superTypes:[]},EmModelEntity:{name:oc.$type,properties:{name:{name:oc.name}},superTypes:[]},EmNoteEntity:{name:vo.$type,properties:{dataBlockValue:{name:vo.dataBlockValue},dataType:{name:vo.dataType},sourceFrame:{name:vo.sourceFrame,referenceType:en.$type}},superTypes:[]},EmResetFrame:{name:yr.$type,properties:{dataInlineValue:{name:yr.dataInlineValue},dataReference:{name:yr.dataReference,referenceType:da.$type},dataType:{name:yr.dataType},entityIdentifier:{name:yr.entityIdentifier},modelEntityType:{name:yr.modelEntityType},name:{name:yr.name},sourceFrames:{name:yr.sourceFrames,defaultValue:[],referenceType:en.$type}},superTypes:[en.$type]},EmTimeFrame:{name:Dr.$type,properties:{dataInlineValue:{name:Dr.dataInlineValue},dataReference:{name:Dr.dataReference,referenceType:da.$type},dataType:{name:Dr.dataType},entityIdentifier:{name:Dr.entityIdentifier},modelEntityType:{name:Dr.modelEntityType},name:{name:Dr.name},sourceFrames:{name:Dr.sourceFrames,defaultValue:[],referenceType:en.$type}},superTypes:[en.$type]},Entry:{name:lc.$type,properties:{axis:{name:lc.axis,referenceType:po.$type},value:{name:lc.value}},superTypes:[]},EventModel:{name:dr.$type,properties:{accDescr:{name:dr.accDescr},accTitle:{name:dr.accTitle},dataEntities:{name:dr.dataEntities,defaultValue:[]},frames:{name:dr.frames,defaultValue:[]},gwtEntities:{name:dr.gwtEntities,defaultValue:[]},modelEntities:{name:dr.modelEntities,defaultValue:[]},noteEntities:{name:dr.noteEntities,defaultValue:[]},title:{name:dr.title}},superTypes:[]},Evolution:{name:rg.$type,properties:{stages:{name:rg.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:To.$type,properties:{boundary:{name:To.boundary},name:{name:To.name},secondName:{name:To.secondName}},superTypes:[]},Evolve:{name:uc.$type,properties:{component:{name:uc.component},target:{name:uc.target}},superTypes:[]},GitGraph:{name:fn.$type,properties:{accDescr:{name:fn.accDescr},accTitle:{name:fn.accTitle},statements:{name:fn.statements,defaultValue:[]},title:{name:fn.title}},superTypes:[]},Group:{name:Fi.$type,properties:{icon:{name:Fi.icon},id:{name:Fi.id},in:{name:Fi.in},title:{name:Fi.title}},superTypes:[]},Info:{name:ts.$type,properties:{accDescr:{name:ts.accDescr},accTitle:{name:ts.accTitle},title:{name:ts.title}},superTypes:[]},Item:{name:zi.$type,properties:{classSelector:{name:zi.classSelector},name:{name:zi.name}},superTypes:[]},Junction:{name:cc.$type,properties:{id:{name:cc.id},in:{name:cc.in}},superTypes:[]},Label:{name:ji.$type,properties:{negX:{name:ji.negX,defaultValue:!1},negY:{name:ji.negY,defaultValue:!1},offsetX:{name:ji.offsetX},offsetY:{name:ji.offsetY}},superTypes:[]},Leaf:{name:$o.$type,properties:{classSelector:{name:$o.classSelector},name:{name:$o.name},value:{name:$o.value}},superTypes:[zi.$type]},Link:{name:tn.$type,properties:{arrow:{name:tn.arrow},from:{name:tn.from},fromPort:{name:tn.fromPort},linkLabel:{name:tn.linkLabel},to:{name:tn.to},toPort:{name:tn.toPort}},superTypes:[]},Merge:{name:Ea.$type,properties:{branch:{name:Ea.branch},id:{name:Ea.id},tags:{name:Ea.tags,defaultValue:[]},type:{name:Ea.type}},superTypes:[ma.$type]},Note:{name:Ro.$type,properties:{evolution:{name:Ro.evolution},text:{name:Ro.text},visibility:{name:Ro.visibility}},superTypes:[]},Option:{name:fc.$type,properties:{name:{name:fc.name},value:{name:fc.value,defaultValue:!1}},superTypes:[]},Packet:{name:Ca.$type,properties:{accDescr:{name:Ca.accDescr},accTitle:{name:Ca.accTitle},blocks:{name:Ca.blocks,defaultValue:[]},title:{name:Ca.title}},superTypes:[]},PacketBlock:{name:ba.$type,properties:{bits:{name:ba.bits},end:{name:ba.end},label:{name:ba.label},start:{name:ba.start}},superTypes:[]},PegAny:{name:ng.$type,properties:{dot:{name:ng.dot}},superTypes:[Bi.$type]},PegGroup:{name:ag.$type,properties:{element:{name:ag.element}},superTypes:[Bi.$type]},PegIdentifier:{name:ig.$type,properties:{name:{name:ig.name}},superTypes:[Bi.$type]},PegLiteral:{name:sg.$type,properties:{value:{name:sg.value}},superTypes:[Bi.$type]},PegOrderedChoice:{name:og.$type,properties:{alternatives:{name:og.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:dc.$type,properties:{operator:{name:dc.operator},suffix:{name:dc.suffix}},superTypes:[]},PegPrimary:{name:Bi.$type,properties:{},superTypes:[]},PegRule:{name:pc.$type,properties:{definition:{name:pc.definition},name:{name:pc.name}},superTypes:[]},PegSequence:{name:lg.$type,properties:{elements:{name:lg.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:mc.$type,properties:{operator:{name:mc.operator},primary:{name:mc.primary}},superTypes:[]},Pie:{name:dn.$type,properties:{accDescr:{name:dn.accDescr},accTitle:{name:dn.accTitle},sections:{name:dn.sections,defaultValue:[]},showData:{name:dn.showData,defaultValue:!1},title:{name:dn.title}},superTypes:[]},PieSection:{name:Vo.$type,properties:{label:{name:Vo.label},value:{name:Vo.value}},superTypes:[]},Pipeline:{name:hc.$type,properties:{components:{name:hc.components,defaultValue:[]},parent:{name:hc.parent}},superTypes:[]},PipelineComponent:{name:Ao.$type,properties:{evolution:{name:Ao.evolution},label:{name:Ao.label},name:{name:Ao.name}},superTypes:[]},Radar:{name:rn.$type,properties:{accDescr:{name:rn.accDescr},accTitle:{name:rn.accTitle},axes:{name:rn.axes,defaultValue:[]},curves:{name:rn.curves,defaultValue:[]},options:{name:rn.options,defaultValue:[]},title:{name:rn.title}},superTypes:[]},Railroad:{name:_a.$type,properties:{accDescr:{name:_a.accDescr},accTitle:{name:_a.accTitle},rules:{name:_a.rules,defaultValue:[]},title:{name:_a.title}},superTypes:[]},RailroadAbnf:{name:Sa.$type,properties:{accDescr:{name:Sa.accDescr},accTitle:{name:Sa.accTitle},rules:{name:Sa.rules,defaultValue:[]},title:{name:Sa.title}},superTypes:[]},RailroadChoiceExpr:{name:ug.$type,properties:{alternatives:{name:ug.alternatives,defaultValue:[]}},superTypes:[pr.$type]},RailroadEbnf:{name:wa.$type,properties:{accDescr:{name:wa.accDescr},accTitle:{name:wa.accTitle},rules:{name:wa.rules,defaultValue:[]},title:{name:wa.title}},superTypes:[]},RailroadExpression:{name:pr.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:cg.$type,properties:{name:{name:cg.name}},superTypes:[pr.$type]},RailroadOneOrMoreExpr:{name:fg.$type,properties:{element:{name:fg.element}},superTypes:[pr.$type]},RailroadOptionalExpr:{name:dg.$type,properties:{element:{name:dg.element}},superTypes:[pr.$type]},RailroadPeg:{name:Ia.$type,properties:{accDescr:{name:Ia.accDescr},accTitle:{name:Ia.accTitle},rules:{name:Ia.rules,defaultValue:[]},title:{name:Ia.title}},superTypes:[]},RailroadRule:{name:yc.$type,properties:{definition:{name:yc.definition},name:{name:yc.name}},superTypes:[]},RailroadSequenceExpr:{name:pg.$type,properties:{elements:{name:pg.elements,defaultValue:[]}},superTypes:[pr.$type]},RailroadSpecialExpr:{name:mg.$type,properties:{text:{name:mg.text}},superTypes:[pr.$type]},RailroadTerminalExpr:{name:hg.$type,properties:{value:{name:hg.value}},superTypes:[pr.$type]},RailroadZeroOrMoreExpr:{name:yg.$type,properties:{element:{name:yg.element}},superTypes:[pr.$type]},Section:{name:gc.$type,properties:{classSelector:{name:gc.classSelector},name:{name:gc.name}},superTypes:[zi.$type]},Service:{name:pa.$type,properties:{icon:{name:pa.icon},iconText:{name:pa.iconText},id:{name:pa.id},in:{name:pa.in},title:{name:pa.title}},superTypes:[]},Size:{name:vc.$type,properties:{height:{name:vc.height},width:{name:vc.width}},superTypes:[]},Statement:{name:ma.$type,properties:{},superTypes:[]},Transition:{name:rs.$type,properties:{from:{name:rs.from},label:{name:rs.label},to:{name:rs.to}},superTypes:[]},TreeNode:{name:ha.$type,properties:{classAnnotation:{name:ha.classAnnotation},descAnnotation:{name:ha.descAnnotation},iconAnnotation:{name:ha.iconAnnotation},indent:{name:ha.indent},name:{name:ha.name}},superTypes:[]},TreeView:{name:Ui.$type,properties:{accDescr:{name:Ui.accDescr},accTitle:{name:Ui.accTitle},nodes:{name:Ui.nodes,defaultValue:[]},title:{name:Ui.title}},superTypes:[]},Treemap:{name:Na.$type,properties:{accDescr:{name:Na.accDescr},accTitle:{name:Na.accTitle},title:{name:Na.title},TreemapRows:{name:Na.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:Tc.$type,properties:{indent:{name:Tc.indent},item:{name:Tc.item}},superTypes:[]},Wardley:{name:We.$type,properties:{accDescr:{name:We.accDescr},accelerators:{name:We.accelerators,defaultValue:[]},accTitle:{name:We.accTitle},anchors:{name:We.anchors,defaultValue:[]},annotation:{name:We.annotation,defaultValue:[]},annotations:{name:We.annotations,defaultValue:[]},components:{name:We.components,defaultValue:[]},deaccelerators:{name:We.deaccelerators,defaultValue:[]},evolution:{name:We.evolution},evolves:{name:We.evolves,defaultValue:[]},links:{name:We.links,defaultValue:[]},notes:{name:We.notes,defaultValue:[]},pipelines:{name:We.pipelines,defaultValue:[]},size:{name:We.size},title:{name:We.title}},superTypes:[]}}}static{i(this,"MermaidAstReflection")}},Ne=new jw,gg,tz=i(()=>gg??(gg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),vg,rz=i(()=>vg??(vg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),Tg,nz=i(()=>Tg??(Tg=Ue('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),$g,az=i(()=>$g??($g=Ue(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),Rg,iz=i(()=>Rg??(Rg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),Ag,sz=i(()=>Ag??(Ag=Ue(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),Eg,oz=i(()=>Eg??(Eg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),Cg,lz=i(()=>Cg??(Cg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),bg,uz=i(()=>bg??(bg=Ue('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),_g,cz=i(()=>_g??(_g=Ue(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),Sg,fz=i(()=>Sg??(Sg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),wg,dz=i(()=>wg??(wg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),Ig,pz=i(()=>Ig??(Ig=Ue(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),Ng,mz=i(()=>Ng??(Ng=Ue(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),Pg,hz=i(()=>Pg??(Pg=Ue(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),yz={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},gz={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},vz={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Tz={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},$z={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Rz={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Az={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Ez={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Cz={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},bz={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},_z={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Sz={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},wz={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Iz={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Nz={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ct={AstReflection:i(()=>new jw,"AstReflection")},Pz={Grammar:i(()=>tz(),"Grammar"),LanguageMetaData:i(()=>yz,"LanguageMetaData"),parser:{}},kz={Grammar:i(()=>rz(),"Grammar"),LanguageMetaData:i(()=>gz,"LanguageMetaData"),parser:{}},Oz={Grammar:i(()=>nz(),"Grammar"),LanguageMetaData:i(()=>vz,"LanguageMetaData"),parser:{}},Lz={Grammar:i(()=>az(),"Grammar"),LanguageMetaData:i(()=>Tz,"LanguageMetaData"),parser:{}},Dz={Grammar:i(()=>iz(),"Grammar"),LanguageMetaData:i(()=>$z,"LanguageMetaData"),parser:{}},xz={Grammar:i(()=>sz(),"Grammar"),LanguageMetaData:i(()=>Rz,"LanguageMetaData"),parser:{}},Mz={Grammar:i(()=>oz(),"Grammar"),LanguageMetaData:i(()=>Az,"LanguageMetaData"),parser:{}},Gz={Grammar:i(()=>lz(),"Grammar"),LanguageMetaData:i(()=>Ez,"LanguageMetaData"),parser:{}},Fz={Grammar:i(()=>uz(),"Grammar"),LanguageMetaData:i(()=>Cz,"LanguageMetaData"),parser:{}},zz={Grammar:i(()=>cz(),"Grammar"),LanguageMetaData:i(()=>bz,"LanguageMetaData"),parser:{}},jz={Grammar:i(()=>fz(),"Grammar"),LanguageMetaData:i(()=>_z,"LanguageMetaData"),parser:{}},Bz={Grammar:i(()=>dz(),"Grammar"),LanguageMetaData:i(()=>Sz,"LanguageMetaData"),parser:{}},Uz={Grammar:i(()=>pz(),"Grammar"),LanguageMetaData:i(()=>wz,"LanguageMetaData"),parser:{}},Kz={Grammar:i(()=>mz(),"Grammar"),LanguageMetaData:i(()=>Iz,"LanguageMetaData"),parser:{}},Wz={Grammar:i(()=>hz(),"Grammar"),LanguageMetaData:i(()=>Nz,"LanguageMetaData"),parser:{}},Vz=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,qz=/accTitle[\t ]*:([^\n\r]*)/,Hz=/title([\t ][^\n\r]*|)/,Yz={ACC_DESCR:Vz,ACC_TITLE:qz,TITLE:Hz},ur=class extends zm{static{i(this,"AbstractMermaidValueConverter")}runConverter(e,t,r){let n=this.runCommonConverter(e,t,r);return n===void 0&&(n=this.runCustomConverter(e,t,r)),n===void 0?super.runConverter(e,t,r):n}runCommonConverter(e,t,r){const n=Yz[e.name];if(n===void 0)return;const a=n.exec(t);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,` +`)}}},ci=class extends ur{static{i(this,"CommonValueConverter")}runCustomConverter(e,t,r){}},ft=class extends Du{static{i(this,"AbstractMermaidTokenBuilder")}constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,t,r){const n=super.buildKeywordTokens(e,t,r);return n.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),n}};(class extends ft{static{i(this,"CommonTokenBuilder")}});/*! Bundled license information: + +lodash-es/lodash.js: + (** + * @license + * Lodash (Custom Build) + * Build: `lodash modularize exports="es" -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) +*/var Xz=class extends ft{static{i(this,"RadarTokenBuilder")}constructor(){super(["radar-beta"])}},Bw={parser:{TokenBuilder:i(()=>new Xz,"TokenBuilder"),ValueConverter:i(()=>new ci,"ValueConverter")}};function Uw(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Gz,Bw);return t.ServiceRegistry.register(r),{shared:t,Radar:r}}i(Uw,"createRadarServices");var Jz=class extends ft{static{i(this,"RailroadTokenBuilder")}constructor(){super(["railroad-beta"])}},kg=i(e=>{const t=e.slice(1,-1);let r="";for(let n=0;nnew Jz,"TokenBuilder"),ValueConverter:i(()=>new Zz,"ValueConverter")}};function Ww(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),jz,Kw);return t.ServiceRegistry.register(r),{shared:t,Railroad:r}}i(Ww,"createRailroadServices");var Qz=class extends ft{static{i(this,"RailroadEbnfTokenBuilder")}constructor(){super(["railroad-ebnf-beta"])}},Og=i(e=>{const t=e.slice(1,-1);let r="";for(let n=0;nnew Qz,"TokenBuilder"),ValueConverter:i(()=>new ej,"ValueConverter")}};function qw(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),zz,Vw);return t.ServiceRegistry.register(r),{shared:t,RailroadEbnf:r}}i(qw,"createRailroadEbnfServices");var tj=class extends ft{static{i(this,"RailroadAbnfTokenBuilder")}constructor(){super(["railroad-abnf-beta"])}},rj=class extends ur{static{i(this,"RailroadAbnfValueConverter")}runConverter(e,t,r){const n=super.runConverter(e,t,r);if(e.name==="TITLE"&&typeof n=="string"){const a=n.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return a.slice(1,-1)}return n}runCustomConverter(e,t,r){if(e.name==="ABNF_STRING")return t.slice(1,-1)}},Hw={parser:{TokenBuilder:i(()=>new tj,"TokenBuilder"),ValueConverter:i(()=>new rj,"ValueConverter")}};function Yw(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Fz,Hw);return t.ServiceRegistry.register(r),{shared:t,RailroadAbnf:r}}i(Yw,"createRailroadAbnfServices");var nj=class extends ft{static{i(this,"RailroadPegTokenBuilder")}constructor(){super(["railroad-peg-beta"])}},Lg=i(e=>{const t=e.slice(1,-1);let r="";for(let n=0;nnew nj,"TokenBuilder"),ValueConverter:i(()=>new aj,"ValueConverter")}};function Jw(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Bz,Xw);return t.ServiceRegistry.register(r),{shared:t,RailroadPeg:r}}i(Jw,"createRailroadPegServices");var ij=class extends ft{static{i(this,"TreemapTokenBuilder")}constructor(){super(["treemap"])}},sj=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,oj=class extends ur{static{i(this,"TreemapValueConverter")}runCustomConverter(e,t,r){if(e.name==="NUMBER2")return parseFloat(t.replace(/,/g,""));if(e.name==="SEPARATOR")return t.substring(1,t.length-1);if(e.name==="STRING2")return t.substring(1,t.length-1);if(e.name==="INDENTATION")return t.length;if(e.name==="ClassDef"){if(typeof t!="string")return t;const n=sj.exec(t);if(n)return{$type:"ClassDefStatement",className:n[1],styleText:n[2]||void 0}}}};function Zw(e){const t=e.validation.TreemapValidator,r=e.validation.ValidationRegistry;if(r){const n={Treemap:t.checkSingleRoot.bind(t)};r.register(n,t)}}i(Zw,"registerValidationChecks");var lj=class{static{i(this,"TreemapValidator")}checkSingleRoot(e,t){let r;for(const n of e.TreemapRows)n.item&&(r===void 0&&n.indent===void 0?r=0:n.indent===void 0?t("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}):r!==void 0&&r>=parseInt(n.indent,10)&&t("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}))}},Qw={parser:{TokenBuilder:i(()=>new ij,"TokenBuilder"),ValueConverter:i(()=>new oj,"ValueConverter")},validation:{TreemapValidator:i(()=>new lj,"TreemapValidator")}};function eI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Uz,Qw);return t.ServiceRegistry.register(r),Zw(r),{shared:t,Treemap:r}}i(eI,"createTreemapServices");var uj=class extends ur{static{i(this,"WardleyValueConverter")}runCustomConverter(e,t,r){switch(e.name.toUpperCase()){case"LINK_LABEL":return t.substring(1).trim();default:return}}},tI={parser:{ValueConverter:i(()=>new uj,"ValueConverter")}};function rI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Wz,tI);return t.ServiceRegistry.register(r),{shared:t,Wardley:r}}i(rI,"createWardleyServices");var cj=class extends ft{static{i(this,"CynefinTokenBuilder")}constructor(){super(["cynefin-beta"])}},nI={parser:{TokenBuilder:i(()=>new cj,"TokenBuilder"),ValueConverter:i(()=>new ci,"ValueConverter")}};function aI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),kz,nI);return t.ServiceRegistry.register(r),{shared:t,Cynefin:r}}i(aI,"createCynefinServices");var fj=class extends ft{static{i(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},iI={parser:{TokenBuilder:i(()=>new fj,"TokenBuilder"),ValueConverter:i(()=>new ci,"ValueConverter")}};function sI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Lz,iI);return t.ServiceRegistry.register(r),{shared:t,GitGraph:r}}i(sI,"createGitGraphServices");var dj=class extends ft{static{i(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}},oI={parser:{TokenBuilder:i(()=>new dj,"TokenBuilder"),ValueConverter:i(()=>new ci,"ValueConverter")}};function lI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Dz,oI);return t.ServiceRegistry.register(r),{shared:t,Info:r}}i(lI,"createInfoServices");var pj=class extends ft{static{i(this,"PacketTokenBuilder")}constructor(){super(["packet"])}},uI={parser:{TokenBuilder:i(()=>new pj,"TokenBuilder"),ValueConverter:i(()=>new ci,"ValueConverter")}};function cI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),xz,uI);return t.ServiceRegistry.register(r),{shared:t,Packet:r}}i(cI,"createPacketServices");var mj=class extends ft{static{i(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}},hj=class extends ur{static{i(this,"PieValueConverter")}runCustomConverter(e,t,r){if(e.name==="PIE_SECTION_LABEL")return t.replace(/"/g,"").trim()}},fI={parser:{TokenBuilder:i(()=>new mj,"TokenBuilder"),ValueConverter:i(()=>new hj,"ValueConverter")}};function dI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Mz,fI);return t.ServiceRegistry.register(r),{shared:t,Pie:r}}i(dI,"createPieServices");var yj=class extends ur{static{i(this,"TreeViewValueConverter")}runCustomConverter(e,t,r){if(e.name==="INDENTATION")return t?.length||0;if(e.name==="QUOTED_NAME")return t.substring(1,t.length-1);if(e.name==="BARE_NAME")return t.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return t.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const n=t.trim();return n.substring(5,n.length-1)}if(e.name==="DESC_ANNOTATION")return t.trim().substring(2).trim()}},gj=class extends ft{static{i(this,"TreeViewTokenBuilder")}constructor(){super(["treeView-beta"])}},pI={parser:{TokenBuilder:i(()=>new gj,"TokenBuilder"),ValueConverter:i(()=>new yj,"ValueConverter")}};function mI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Kz,pI);return t.ServiceRegistry.register(r),{shared:t,TreeView:r}}i(mI,"createTreeViewServices");var vj=class extends ft{static{i(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}},Tj=class extends ur{static{i(this,"ArchitectureValueConverter")}runCustomConverter(e,t,r){if(e.name==="ARCH_ICON")return t.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return t.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let n=t.replace(/^\[|]$/g,"").trim();return(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))&&(n=n.slice(1,-1),n=n.replace(/\\"/g,'"').replace(/\\'/g,"'")),n.trim()}}},hI={parser:{TokenBuilder:i(()=>new vj,"TokenBuilder"),ValueConverter:i(()=>new Tj,"ValueConverter")}};function yI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Pz,hI);return t.ServiceRegistry.register(r),{shared:t,Architecture:r}}i(yI,"createArchitectureServices");var $j=class extends ft{static{i(this,"EventModelingTokenBuilder")}constructor(){super(["eventmodeling"])}},Dg=new Set(["cmd","command"]),xg=new Set(["evt","event"]),$c=new Set(["rmo","readmodel"]),Mg=new Set(["pcr","processor"]),Gg=new Set(["ui"]);function gI(e){const t=e.validation.EventModelingValidator,r=e.validation.ValidationRegistry;if(r){const n={EmTimeFrame:t.checkSourceFrameTypes.bind(t),EmResetFrame:t.checkSourceFrameTypes.bind(t)};r.register(n,t)}}i(gI,"registerValidationChecks");var Rj=class{static{i(this,"EventModelingValidator")}checkSourceFrameTypes(e,t){e.sourceFrames.length!==0&&(Dg.has(e.modelEntityType)?this.validateSources(e,new Set([...Gg,...Mg]),"command","ui or processor",t):xg.has(e.modelEntityType)?this.validateSources(e,Dg,"event","command",t):$c.has(e.modelEntityType)?this.validateSources(e,xg,"read model","event",t):Mg.has(e.modelEntityType)?this.validateSources(e,$c,"processor","read model",t):Gg.has(e.modelEntityType)&&this.validateSources(e,$c,"ui","read model",t))}validateSources(e,t,r,n,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!t.has(o.modelEntityType)&&a("error",`A ${r} can only receive input from a ${n}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},vI={parser:{TokenBuilder:i(()=>new $j,"TokenBuilder"),ValueConverter:i(()=>new ci,"ValueConverter")},validation:{EventModelingValidator:i(()=>new Rj,"EventModelingValidator")}};function TI(e=Xe){const t=ee(Be(e),ct),r=ee(je({shared:t}),Oz,vI);return t.ServiceRegistry.register(r),gI(r),{shared:t,EventModel:r}}i(TI,"createEventModelingServices");var Ve={},Aj={info:i(async()=>{const{createInfoServices:e}=await et(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>bj);return{createInfoServices:r}},void 0),t=e().Info.parser.LangiumParser;Ve.info=t},"info"),packet:i(async()=>{const{createPacketServices:e}=await et(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>_j);return{createPacketServices:r}},void 0),t=e().Packet.parser.LangiumParser;Ve.packet=t},"packet"),pie:i(async()=>{const{createPieServices:e}=await et(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>Sj);return{createPieServices:r}},void 0),t=e().Pie.parser.LangiumParser;Ve.pie=t},"pie"),treeView:i(async()=>{const{createTreeViewServices:e}=await et(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>wj);return{createTreeViewServices:r}},void 0),t=e().TreeView.parser.LangiumParser;Ve.treeView=t},"treeView"),architecture:i(async()=>{const{createArchitectureServices:e}=await et(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>Ij);return{createArchitectureServices:r}},void 0),t=e().Architecture.parser.LangiumParser;Ve.architecture=t},"architecture"),gitGraph:i(async()=>{const{createGitGraphServices:e}=await et(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>Nj);return{createGitGraphServices:r}},void 0),t=e().GitGraph.parser.LangiumParser;Ve.gitGraph=t},"gitGraph"),eventmodeling:i(async()=>{const{createEventModelingServices:e}=await et(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>Pj);return{createEventModelingServices:r}},void 0),t=e().EventModel.parser.LangiumParser;Ve.eventmodeling=t},"eventmodeling"),radar:i(async()=>{const{createRadarServices:e}=await et(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>kj);return{createRadarServices:r}},void 0),t=e().Radar.parser.LangiumParser;Ve.radar=t},"radar"),railroad:i(async()=>{const{createRailroadServices:e}=await et(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>Oj);return{createRailroadServices:r}},void 0),t=e().Railroad.parser.LangiumParser;Ve.railroad=t},"railroad"),railroadEbnf:i(async()=>{const{createRailroadEbnfServices:e}=await et(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>Lj);return{createRailroadEbnfServices:r}},void 0),t=e().RailroadEbnf.parser.LangiumParser;Ve.railroadEbnf=t},"railroadEbnf"),railroadAbnf:i(async()=>{const{createRailroadAbnfServices:e}=await et(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>Dj);return{createRailroadAbnfServices:r}},void 0),t=e().RailroadAbnf.parser.LangiumParser;Ve.railroadAbnf=t},"railroadAbnf"),railroadPeg:i(async()=>{const{createRailroadPegServices:e}=await et(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>xj);return{createRailroadPegServices:r}},void 0),t=e().RailroadPeg.parser.LangiumParser;Ve.railroadPeg=t},"railroadPeg"),treemap:i(async()=>{const{createTreemapServices:e}=await et(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>Mj);return{createTreemapServices:r}},void 0),t=e().Treemap.parser.LangiumParser;Ve.treemap=t},"treemap"),wardley:i(async()=>{const{createWardleyServices:e}=await et(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>Gj);return{createWardleyServices:r}},void 0),t=e().Wardley.parser.LangiumParser;Ve.wardley=t},"wardley"),cynefin:i(async()=>{const{createCynefinServices:e}=await et(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>Fj);return{createCynefinServices:r}},void 0),t=e().Cynefin.parser.LangiumParser;Ve.cynefin=t},"cynefin")};async function Ej(e,t){const r=Aj[e];if(!r)throw new Error(`Unknown diagram type: ${e}`);Ve[e]||await r();const a=Ve[e].parse(t);if(a.lexerErrors.length>0||a.parserErrors.length>0)throw new Cj(a);return a.value}i(Ej,"parse");var Cj=class extends Error{constructor(e){const t=e.lexerErrors.map(n=>{const a=n.line!==void 0&&!isNaN(n.line)?n.line:"?",s=n.column!==void 0&&!isNaN(n.column)?n.column:"?";return`Lexer error on line ${a}, column ${s}: ${n.message}`}).join(` +`),r=e.parserErrors.map(n=>{const a=n.token.startLine!==void 0&&!isNaN(n.token.startLine)?n.token.startLine:"?",s=n.token.startColumn!==void 0&&!isNaN(n.token.startColumn)?n.token.startColumn:"?";return`Parse error on line ${a}, column ${s}: ${n.message}`}).join(` +`);super(`Parsing failed: ${t} ${r}`),this.result=e}static{i(this,"MermaidParseError")}};const bj=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:oI,createInfoServices:lI},Symbol.toStringTag,{value:"Module"})),_j=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:uI,createPacketServices:cI},Symbol.toStringTag,{value:"Module"})),Sj=Object.freeze(Object.defineProperty({__proto__:null,PieModule:fI,createPieServices:dI},Symbol.toStringTag,{value:"Module"})),wj=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:pI,createTreeViewServices:mI},Symbol.toStringTag,{value:"Module"})),Ij=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:hI,createArchitectureServices:yI},Symbol.toStringTag,{value:"Module"})),Nj=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:iI,createGitGraphServices:sI},Symbol.toStringTag,{value:"Module"})),Pj=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:vI,createEventModelingServices:TI},Symbol.toStringTag,{value:"Module"})),kj=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:Bw,createRadarServices:Uw},Symbol.toStringTag,{value:"Module"})),Oj=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:Kw,createRailroadServices:Ww},Symbol.toStringTag,{value:"Module"})),Lj=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:Vw,createRailroadEbnfServices:qw},Symbol.toStringTag,{value:"Module"})),Dj=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:Hw,createRailroadAbnfServices:Yw},Symbol.toStringTag,{value:"Module"})),xj=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:Xw,createRailroadPegServices:Jw},Symbol.toStringTag,{value:"Module"})),Mj=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:Qw,createTreemapServices:eI},Symbol.toStringTag,{value:"Module"})),Gj=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:tI,createWardleyServices:rI},Symbol.toStringTag,{value:"Module"})),Fj=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:nI,createCynefinServices:aI},Symbol.toStringTag,{value:"Module"}));export{Cj as M,qw as a,Yw as b,Ww as c,Jw as d,zF as i,Ej as p}; diff --git a/apps/kimi-code/dist-web/assets/cynefinDiagram-TSTJHNR4-DLqJ7d9z.js b/apps/kimi-code/dist-web/assets/cynefinDiagram-TSTJHNR4-DLqJ7d9z.js new file mode 100644 index 00000000000..96dd6c472ed --- /dev/null +++ b/apps/kimi-code/dist-web/assets/cynefinDiagram-TSTJHNR4-DLqJ7d9z.js @@ -0,0 +1,62 @@ +import{p as xt}from"./chunk-JWPE2WC7-BJMJfnyy.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-WW7RuneT.js";import{p as Bt}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.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; + } + .cynefinDomainLabel { + font-size: ${t.domainFontSize}px; + font-weight: bold; + fill: ${t.labelColor}; + } + .cynefinSubtitle { + font-size: ${t.itemFontSize-1}px; + fill: ${t.textColor}; + font-style: italic; + } + .cynefinItem { + fill-opacity: 0.95; + stroke: ${t.boundaryColor}; + stroke-width: 1; + } + .cynefinItemText { + font-size: ${t.itemFontSize}px; + fill: ${t.textColor}; + } + .cynefinItemOverflow { + fill-opacity: 0.6; + stroke: ${t.boundaryColor}; + stroke-width: 1; + stroke-dasharray: 3 2; + } + .cynefinBoundary { + stroke: ${t.boundaryColor}; + stroke-width: ${t.boundaryWidth}; + stroke-dasharray: 6 3; + } + .cynefinCliff { + stroke: ${t.cliffColor}; + stroke-width: ${t.cliffWidth}; + } + .cynefinConfusion { + stroke: ${t.boundaryColor}; + stroke-width: 1.5; + stroke-dasharray: 4 2; + } + .cynefinArrowLine { + stroke: ${t.arrowColor}; + stroke-width: ${t.arrowWidth}; + fill: none; + } + .cynefinArrowHead { + fill: ${t.arrowColor}; + stroke: none; + } + .cynefinArrowLabel { + font-size: ${t.itemFontSize-1}px; + fill: ${t.textColor}; + } + .cynefinTitle { + font-size: ${t.domainFontSize+2}px; + font-weight: bold; + fill: ${t.labelColor}; + } + `},"styles"),Gt=Ht,Ut={parser:Wt,db:Y,renderer:Ft,styles:Gt};export{Ut as diagram}; diff --git a/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-G1--45o_.js b/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-G1--45o_.js new file mode 100644 index 00000000000..65e6290cd48 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-G1--45o_.js @@ -0,0 +1,4 @@ +import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-LhAgalr3.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-WW7RuneT.js";import{G as Q}from"./graph-DOmOIIwC.js";import{l as U}from"./layout-D-LzfAck.js";import"./map-DxJ2ADlA.js";import"./index-CiHMlsuo.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-DlPR1W9u.js b/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-DlPR1W9u.js new file mode 100644 index 00000000000..f51ffcc9327 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-DlPR1W9u.js @@ -0,0 +1,3 @@ +import{p as re}from"./chunk-JWPE2WC7-BJMJfnyy.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-WW7RuneT.js";import{p as be,i as ve}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.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-Bj3iAwJq.js b/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-Bj3iAwJq.js new file mode 100644 index 00000000000..cb6e45620ce --- /dev/null +++ b/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-Bj3iAwJq.js @@ -0,0 +1,24 @@ +import{p as me}from"./chunk-JWPE2WC7-BJMJfnyy.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-WW7RuneT.js";import{s as Fe}from"./chunk-VR4S4FIN-C_RujyXt.js";import{p as Ne}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./index-CiHMlsuo.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}; + fill: ${r.sectionFillColor}; + } + .treemapNode.leaf { + stroke: ${r.leafStrokeColor}; + stroke-width: ${r.leafStrokeWidth}; + fill: ${r.leafFillColor}; + } + .treemapLabel { + fill: ${h}; + font-size: ${r.labelFontSize}; + } + .treemapValue { + fill: ${d}; + font-size: ${r.valueFontSize}; + } + .treemapTitle { + fill: ${o}; + font-size: ${r.titleFontSize}; + } + `},"getStyles"),pt=dt,Ct={parser:ce,get db(){return new ie},renderer:ct,styles:pt};export{Ct as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-D0p601mB.js b/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-D0p601mB.js new file mode 100644 index 00000000000..76b28fd0a61 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-D0p601mB.js @@ -0,0 +1,24 @@ +import{p as B}from"./chunk-JWPE2WC7-BJMJfnyy.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-WW7RuneT.js";import{p as _}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.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}; + } + .packetByte.start { + fill: ${e.startByteColor}; + } + .packetByte.end { + fill: ${e.endByteColor}; + } + .packetLabel { + fill: ${e.labelColor}; + font-size: ${e.labelFontSize}; + } + .packetTitle { + fill: ${e.titleColor}; + font-size: ${e.titleFontSize}; + } + .packetBlock { + stroke: ${e.blockStrokeColor}; + stroke-width: ${e.blockStrokeWidth}; + fill: ${e.blockFillColor}; + } + `},"styles"),J={parser:v,get db(){return new w},renderer:j,styles:H};export{J as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BLpvk7p_.js b/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BLpvk7p_.js new file mode 100644 index 00000000000..e390e481578 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BLpvk7p_.js @@ -0,0 +1,30 @@ +import{I as X}from"./chunk-2Q5K7J3B-NzojNxDT.js";import{p as O}from"./chunk-JWPE2WC7-BJMJfnyy.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-WW7RuneT.js";import{p as ne}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.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` + .treeView-node-label { + font-size: ${e}; + fill: ${t}; + white-space: pre; + } + .treeView-node-dir { + font-weight: bold; + } + .treeView-node-line { + stroke: ${r}; + } + .treeView-node-icon { + color: ${i}; + } + .treeView-node-description { + font-size: ${e}; + fill: ${a}; + font-style: italic; + white-space: pre; + } + .treeView-highlight-bg { + fill: ${c}; + stroke: ${l}; + stroke-width: 1; + } + `},"styles"),Be=ye,Ne={db:I,renderer:Ie,parser:fe,styles:Be};export{Ne as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-DKRP3hVn.js b/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-DKRP3hVn.js new file mode 100644 index 00000000000..38d04dbe8e2 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-DKRP3hVn.js @@ -0,0 +1,41 @@ +import{p as k}from"./chunk-JWPE2WC7-BJMJfnyy.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-WW7RuneT.js";import{p as H}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.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;r{const t=W(),e=C(),r=y(t,e.themeVariables),s=y(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),lt=c(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=it(a);return` + .radarTitle { + font-size: ${t.fontSize}; + color: ${t.titleColor}; + dominant-baseline: hanging; + text-anchor: middle; + } + .radarAxisLine { + stroke: ${e.axisColor}; + stroke-width: ${e.axisStrokeWidth}; + } + .radarAxisLabel { + font-size: ${e.axisLabelFontSize}px; + color: ${e.axisColor}; + } + .radarGraticule { + fill: ${e.graticuleColor}; + fill-opacity: ${e.graticuleOpacity}; + stroke: ${e.graticuleColor}; + stroke-width: ${e.graticuleStrokeWidth}; + } + .radarLegendText { + text-anchor: start; + font-size: ${e.legendFontSize}px; + dominant-baseline: hanging; + } + ${ot(t,e)} + `},"styles"),xt={parser:tt,db:$,renderer:nt,styles:lt};export{xt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/ebnfDiagram-CCIWWBDH-CdaRbvzq.js b/apps/kimi-code/dist-web/assets/ebnfDiagram-CCIWWBDH-CdaRbvzq.js new file mode 100644 index 00000000000..0ad4ae1999c --- /dev/null +++ b/apps/kimi-code/dist-web/assets/ebnfDiagram-CCIWWBDH-CdaRbvzq.js @@ -0,0 +1 @@ +import{g as l,r as m,d as n}from"./chunk-MOJQB5TN-DmVMZHwQ.js";import{p}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{_ as t,l as o}from"./mermaid.core-WW7RuneT.js";import{M as u,a as f}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.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-DPLVpHbv.js b/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-DPLVpHbv.js new file mode 100644 index 00000000000..f55d23e8377 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-DPLVpHbv.js @@ -0,0 +1,85 @@ +import{g as Mt}from"./chunk-XXDRQBXY-D_bv9kM4.js";import{s as Bt}from"./chunk-VR4S4FIN-C_RujyXt.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-WW7RuneT.js";import{c as Jt}from"./channel-8Bt6a0tz.js";import"./index-CiHMlsuo.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()+` +`+c+"^"},"showPosition"),test_match:l(function(n,c){var o,r,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),r=n[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],o=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var t in p)this[t]=p[t];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,c,o,r;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),t=0;tc[0].length)){if(c=o,r=t,this.options.backtrack_lexer){if(n=this.test_match(o,p[t]),n!==!1)return n;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(n=this.test_match(c,p[r]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var c=this.next();return c||this.lex()},"lex"),begin:l(function(c){this.conditionStack.push(c)},"begin"),popState:l(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:l(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:l(function(c){this.begin(c)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(c,o,r,p){switch(r){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 73;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 62;case 25:return 58;case 26:return 58;case 27:this.begin("block_bq");break;case 28:return 58;case 29:this.popState();break;case 30:return 63;case 31:break;case 32:return this.popState(),19;case 33:return o.yytext[0];case 34:return 20;case 35:return 21;case 36:return this.begin("style"),44;case 37:return this.popState(),10;case 38:break;case 39:return 13;case 40:return 42;case 41:return 49;case 42:return this.begin("style"),37;case 43:return 43;case 44:return 66;case 45:return 68;case 46:return 68;case 47:return 68;case 48:return 66;case 49:return 66;case 50:return 67;case 51:return 67;case 52:return 67;case 53:return 67;case 54:return 67;case 55:return 68;case 56:return 67;case 57:return 68;case 58:return 69;case 59:return 69;case 60:return 51;case 61:return 69;case 62:return 69;case 63:return 69;case 64:return 52;case 65:return 48;case 66:return 69;case 67:return 66;case 68:return 67;case 69:return 68;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 72;case 74:return 71;case 75:return 71;case 76:return 71;case 77:return 41;case 78:return 47;case 79:return 40;case 80:return o.yytext[0];case 81:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[37,38,39,40,41,77,78],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[28,29],inclusive:!1},block:{rules:[23,24,25,26,27,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,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,75,76,79,80,81],inclusive:!0}}};return I})();ut.lexer=vt;function $(){this.yy={}}return l($,"Parser"),$.prototype=ut,ut.Parser=$,new $})();_t.parser=_t;var $t=_t,te=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Ft,this.getAccTitle=Yt,this.setAccDescription=Pt,this.getAccDescription=zt,this.setDiagramTitle=Gt,this.getDiagramTitle=Kt,this.getConfig=l(()=>it().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{l(this,"ErDB")}addEntity(e,i=""){return this.entities.has(e)?!this.entities.get(e)?.alias&&i&&(this.entities.get(e).alias=i,V.info(`Add alias '${i}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:i,shape:"erBox",look:it().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),V.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,i){const h=this.addEntity(e);let a;for(a=i.length-1;a>=0;a--)i[a].keys||(i[a].keys=[]),i[a].comment||(i[a].comment=""),h.attributes.push(i[a]),V.debug("Added attribute ",i[a].name)}addRelationship(e,i,h,a){const u=this.entities.get(e),d=this.entities.get(h);if(!u||!d)return;const y={entityA:u.id,roleA:i,entityB:d.id,relSpec:a};this.relationships.push(y),V.debug("Added new relationship :",y)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let i=[];for(const h of e){const a=this.classes.get(h);a?.styles&&(i=[...i,...a.styles??[]].map(u=>u.trim())),a?.textStyles&&(i=[...i,...a.textStyles??[]].map(u=>u.trim()))}return i}addCssStyles(e,i){for(const h of e){const a=this.entities.get(h);if(!i||!a)return;for(const u of i)a.cssStyles.push(u)}}addClass(e,i){e.forEach(h=>{let a=this.classes.get(h);a===void 0&&(a={id:h,styles:[],textStyles:[]},this.classes.set(h,a)),i&&i.forEach(function(u){if(/color/.exec(u)){const d=u.replace("fill","bgFill");a.textStyles.push(d)}a.styles.push(u)})})}setClass(e,i){for(const h of e){const a=this.entities.get(h);if(a)for(const u of i)a.cssClasses+=" "+u}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Ut()}getData(){const e=[],i=[],h=it();let a=0;for(const d of this.entities.keys()){const y=this.entities.get(d);y&&(y.cssCompiledStyles=this.getCompiledStyles(y.cssClasses.split(" ")),y.colorIndex=a++,e.push(y))}let u=0;for(const d of this.relationships){const y={id:Zt(d.entityA,d.entityB,{prefix:"id",counter:u++}),type:"normal",curve:"basis",start:d.entityA,end:d.entityB,label:d.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:d.relSpec.cardB.toLowerCase(),arrowTypeEnd:d.relSpec.cardA.toLowerCase(),pattern:d.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:h.look,labelType:"markdown"};i.push(y)}return{nodes:e,edges:i,other:{},config:h,direction:"TB"}}},xt={};Wt(xt,{draw:()=>ee});var ee=l(async function(e,i,h,a){V.info("REF0:"),V.info("Drawing er diagram (unified)",i);const{securityLevel:u,er:d,layout:y}=it(),f=a.db.getData(),m=Mt(i,u);f.type=a.type,f.layoutAlgorithm=qt(y),f.config.flowchart.nodeSpacing=d?.nodeSpacing||140,f.config.flowchart.rankSpacing=d?.rankSpacing||80,f.direction=a.db.getDirection();const{config:j}=f,{look:W}=j;W==="neo"?f.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:f.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],f.diagramId=i,await Qt(f,m),f.layoutAlgorithm==="elk"&&m.select(".edges").lower();const S=m.selectAll('[id*="-background"]');Array.from(S).length>0&&S.each(function(){const M=Xt(this),R=M.attr("id").replace("-background",""),T=m.select(`#${CSS.escape(R)}`);if(!T.empty()){const C=T.attr("transform");M.attr("transform",C)}});const q=8;Ht.insertTitle(m,"erDiagramTitleText",d?.titleTopMargin??25,a.db.getDiagramTitle()),Bt(m,q,"erDiagram",d?.useMaxWidth??!0)},"draw"),Ct=l((e,i)=>{const h=Jt,a=h(e,"r"),u=h(e,"g"),d=h(e,"b");return jt(a,u,d,i)},"fade"),rt=new Set(["redux-color","redux-dark-color"]),se=l(e=>{const{theme:i,look:h,bkgColorArray:a,borderColorArray:u}=e;if(!rt.has(i))return"";const d=a?.length>0;let y="";for(let f=0;f{const{look:i,theme:h,erEdgeLabelBackground:a,strokeWidth:u}=e;return` + ${se(e)} + .entityBox { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + } + + .relationshipLabelBox { + fill: ${e.tertiaryColor}; + opacity: 0.7; + background-color: ${e.tertiaryColor}; + rect { + opacity: 0.5; + } + } + + .labelBkg { + background-color: ${rt.has(h)&&a?a:Ct(e.tertiaryColor,.5)}; + } + + .edgeLabel { + background-color: ${rt.has(h)&&a?a:e.edgeLabelBackground}; + } + .edgeLabel .label rect { + fill: ${rt.has(h)&&a?a:e.edgeLabelBackground}; + } + .edgeLabel .label text { + fill: ${e.textColor}; + } + + .edgeLabel .label { + fill: ${e.nodeBorder}; + font-size: 14px; + } + + .label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + + .edge-pattern-dashed { + stroke-dasharray: 8,8; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon + { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: ${i==="neo"?u:"1px"}; + } + + .relationshipLine { + stroke: ${e.lineColor}; + stroke-width: ${i==="neo"?u:"1px"}; + fill: none; + } + + .marker { + fill: none !important; + stroke: ${e.lineColor} !important; + stroke-width: 1; + } + [data-look=neo].labelBkg { + background-color: ${Ct(e.tertiaryColor,.5)}; + } +`},"getStyles"),re=ie,ue={parser:$t,get db(){return new te},renderer:xt,styles:re};export{ue as diagram}; diff --git a/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-eOlMNTnl.js b/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-eOlMNTnl.js new file mode 100644 index 00000000000..2f19e73a9b7 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-eOlMNTnl.js @@ -0,0 +1,156 @@ +import{g as He}from"./chunk-5VM5RSS4-BJR-VYAu.js";import{g as Xe}from"./chunk-XXDRQBXY-D_bv9kM4.js";import{s as Qe}from"./chunk-VR4S4FIN-C_RujyXt.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-WW7RuneT.js";import{f as ft}from"./chunk-32BRIVSS-CRTrWqUr.js";import{c as gt}from"./channel-8Bt6a0tz.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+` +}`,n=ut(k,{schema:ot})}const g=this.edges.find(k=>k.id===e);if(g){const k=n;k?.animate!==void 0&&(g.animate=k.animate),k?.animation!==void 0&&(g.animation=k.animation),k?.curve!==void 0&&(g.interpolate=k.curve);return}let B,f=this.vertices.get(e);if(f===void 0&&(i===void 0&&r===void 0&&a!==void 0&&a!==null&&J.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:bt+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,i!==void 0?(this.config=g1(),B=this.sanitizeText(i.text.trim()),f.labelType=i.type,B.startsWith('"')&&B.endsWith('"')&&(B=B.substring(1,B.length-1)),f.text=B):f.text===void 0&&(f.text=e),r!==void 0&&(f.type=r),a?.forEach(k=>{f.styles.push(k)}),o?.forEach(k=>{f.classes.push(k)}),d!==void 0&&(f.dir=d),f.props===void 0?f.props=l:l!==void 0&&Object.assign(f.props,l),n!==void 0){if(n.shape){if(n.shape!==n.shape.toLowerCase()||n.shape.includes("_"))throw new Error(`No such shape: ${n.shape}. Shape names should be lowercase.`);if(!lt(n.shape))throw new Error(`No such shape: ${n.shape}.`);f.type=n?.shape}n?.label&&(f.text=n?.label,f.labelType=this.sanitizeNodeLabelType(n?.labelType)),n?.icon&&(f.icon=n?.icon,!n.label?.trim()&&f.text===e&&(f.text="")),n?.form&&(f.form=n?.form),n?.pos&&(f.pos=n?.pos),n?.img&&(f.img=n?.img,!n.label?.trim()&&f.text===e&&(f.text="")),n?.constraint&&(f.constraint=n.constraint),n.w&&(f.assetWidth=Number(n.w)),n.h&&(f.assetHeight=Number(n.h))}}addSingleLink(e,i,r,a){const l={start:e,end:i,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};J.info("abc78 Got edge...",l);const A=r.text;if(A!==void 0&&(l.text=this.sanitizeText(A.text.trim()),l.text.startsWith('"')&&l.text.endsWith('"')&&(l.text=l.text.substring(1,l.text.length-1)),l.labelType=this.sanitizeNodeLabelType(A.type)),r!==void 0&&(l.type=r.type,l.stroke=r.stroke,l.length=r.length>10?10:r.length),a&&!this.edges.some(n=>n.id===a))l.id=a,l.isUserDefinedId=!0;else{const n=this.edges.filter(g=>g.start===l.start&&g.end===l.end);n.length===0?l.id=te(l.start,l.end,{counter:0,prefix:"L"}):l.id=te(l.start,l.end,{counter:n.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))J.info("Pushing edge..."),this.edges.push(l);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. + +Initialize mermaid with maxEdges set to a higher number to allow more edges. +You cannot set this config via configuration inside the diagram as it is a secure config. +You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,i,r){const a=this.isLinkData(r)?r.id.replace("@",""):void 0;J.info("addLink",e,i,a);for(const o of e)for(const d of i){const l=o===e[e.length-1],A=d===i[0];l&&A?this.addSingleLink(o,d,r,a):this.addSingleLink(o,d,r,void 0)}}updateLinkInterpolate(e,i){e.forEach(r=>{r==="default"?this.edges.defaultInterpolate=i:this.edges[r].interpolate=i})}updateLink(e,i){e.forEach(r=>{if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?this.edges.defaultStyle=i:(this.edges[r].style=i,(this.edges[r]?.style?.length??0)>0&&!this.edges[r]?.style?.some(a=>a?.startsWith("fill"))&&this.edges[r]?.style?.push("fill:none"))})}addClass(e,i){const r=i.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(a=>{let o=this.classes.get(a);o===void 0&&(o={id:a,styles:[],textStyles:[]},this.classes.set(a,o)),r?.forEach(d=>{if(/color/.exec(d)){const l=d.replace("fill","bgFill");o.textStyles.push(l)}o.styles.push(d)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,i){for(const r of e.split(",")){const a=this.vertices.get(r);a&&a.classes.push(i);const o=this.edges.find(l=>l.id===r);o&&o.classes.push(i);const d=this.subGraphLookup.get(r);d&&d.classes.push(i)}}setTooltip(e,i){if(i!==void 0){i=this.sanitizeText(i);for(const r of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(r):r,i)}}setClickFun(e,i,r){if(g1().securityLevel!=="loose"||i===void 0)return;let a=[];if(typeof r=="string"){a=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let d=0;d{const d=this.lookUpDomId(e),l=document.querySelector(`[id="${d}"]`);l!==null&&l.addEventListener("click",()=>{ie.runFunc(i,...a)},!1)}))}setLink(e,i,r){e.split(",").forEach(a=>{const o=this.vertices.get(a);o!==void 0&&(o.link=ie.formatUrl(i,this.config),o.linkTarget=r)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,i,r){e.split(",").forEach(a=>{this.setClickFun(a,i,r)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(i=>{i(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const i=ft();se(e).select("svg").selectAll("g.node").on("mouseover",o=>{const d=se(o.currentTarget),l=d.attr("title");if(l===null)return;const A=o.currentTarget?.getBoundingClientRect();i.transition().duration(200).style("opacity",".9"),i.text(d.attr("title")).style("left",window.scrollX+A.left+(A.right-A.left)/2+"px").style("top",window.scrollY+A.bottom+"px"),i.html(ct.sanitize(l)),d.classed("hover",!0)}).on("mouseout",o=>{i.transition().duration(500).style("opacity",0),se(o.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=g1(),ht()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,i,r){let a=e.text.trim(),o=r.text;e===r&&/\s/.exec(r.text)&&(a=void 0);const l=b(Y=>{const F={boolean:{},number:{},string:{}},_=[];let b1;return{nodeList:Y.filter(function(j){const h1=typeof j;return j.stmt&&j.stmt==="dir"?(b1=j.value,!1):j.trim()===""?!1:h1 in F?F[h1].hasOwnProperty(j)?!1:F[h1][j]=!0:_.includes(j)?!1:_.push(j)}),dir:b1}},"uniq")(i.flat()),A=l.nodeList,n=l.dir,g=n!==void 0,B=g1().flowchart??{},f=n??(B.inheritDir?this.getDirection()??g1().direction??void 0:void 0);if(this.version==="gen-1")for(let Y=0;Y2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=i,this.subGraphs[i].id===e)return{result:!0,count:0};let a=0,o=1;for(;a=0){const l=this.indexNodes2(e,d);if(l.result)return{result:!0,count:o+l.count};o=o+l.count}a=a+1}return{result:!1,count:o}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let i=e.trim(),r="arrow_open";switch(i[0]){case"<":r="arrow_point",i=i.slice(1);break;case"x":r="arrow_cross",i=i.slice(1);break;case"o":r="arrow_circle",i=i.slice(1);break}let a="normal";return i.includes("=")&&(a="thick"),i.includes(".")&&(a="dotted"),{type:r,stroke:a}}countChar(e,i){const r=i.length;let a=0;for(let o=0;o":a="arrow_point",i.startsWith("<")&&(a="double_"+a,r=r.slice(1));break;case"o":a="arrow_circle",i.startsWith("o")&&(a="double_"+a,r=r.slice(1));break}let o="normal",d=r.length-1;r.startsWith("=")&&(o="thick"),r.startsWith("~")&&(o="invisible");const l=this.countChar(".",r);return l&&(o="dotted",d=l),{type:a,stroke:o,length:d}}destructLink(e,i){const r=this.destructEndLink(e);let a;if(i){if(a=this.destructStartLink(i),a.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if(a.type==="arrow_open")a.type=r.type;else{if(a.type!==r.type)return{type:"INVALID",stroke:"INVALID"};a.type="double_"+a.type}return a.type==="double_arrow"&&(a.type="double_arrow_point"),a.length=r.length,a}return r}exists(e,i){for(const r of e)if(r.nodes.includes(i))return!0;return!1}makeUniq(e,i){const r=[];return e.nodes.forEach((a,o)=>{this.exists(i,a)||r.push(e.nodes[o])}),{nodes:r}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,i){return e.find(r=>r.id===i)}destructEdgeType(e){let i="none",r="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":r=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":i=e.replace("double_",""),r=i;break}return{arrowTypeStart:i,arrowTypeEnd:r}}addNodeFromVertex(e,i,r,a,o,d){const l=r.get(e.id),A=a.get(e.id)??!1,n=this.findNode(i,e.id);if(n)n.cssStyles=e.styles,n.cssCompiledStyles=this.getCompiledStyles(e.classes),n.cssClasses=e.classes.join(" ");else{const g={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:l,padding:o.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:d,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};A?i.push({...g,isGroup:!0,shape:"rect"}):i.push({...g,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let i=[];for(const r of e){const a=this.classes.get(r);a?.styles&&(i=[...i,...a.styles??[]].map(o=>o.trim())),a?.textStyles&&(i=[...i,...a.textStyles??[]].map(o=>o.trim()))}return i}getData(){const e=g1(),i=[],r=[],a=this.getSubGraphs(),o=new Map,d=new Map;for(let n=a.length-1;n>=0;n--){const g=a[n];g.nodes.length>0&&d.set(g.id,!0);for(const B of g.nodes)o.set(B,g.id)}for(let n=a.length-1;n>=0;n--){const g=a[n];i.push({id:g.id,label:g.title,labelStyle:"",labelType:g.labelType,parentId:o.get(g.id),padding:8,cssCompiledStyles:this.getCompiledStyles(g.classes),cssClasses:g.classes.join(" "),shape:"rect",dir:g.dir==="TD"?"TB":g.dir,explicitDir:g.hasExplicitDir,isGroup:!0,look:e.look})}this.getVertices().forEach(n=>{this.addNodeFromVertex(n,i,o,d,e,e.look||"classic")});const A=this.getEdges();return A.forEach((n,g)=>{const{arrowTypeStart:B,arrowTypeEnd:f}=this.destructEdgeType(n.type),k=[...A.defaultStyle??[]];n.style&&k.push(...n.style);const Y={id:te(n.start,n.end,{counter:g,prefix:"L"},n.id),isUserDefinedId:n.isUserDefinedId,start:n.start,end:n.end,type:n.type??"normal",label:n.text,labelType:n.labelType,labelpos:"c",thickness:n.stroke,minlen:n.length,classes:n?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:n?.stroke==="invisible"||n?.type==="arrow_open"?"none":B,arrowTypeEnd:n?.stroke==="invisible"||n?.type==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(n.classes),labelStyle:k,style:k,pattern:n.stroke,look:e.look,animate:n.animate,animation:n.animation,curve:n.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};r.push(Y)}),{nodes:i,edges:r,other:{},config:e}}defaultConfig(){return dt.flowchart}},kt=b(function(e,i){return i.db.getClasses()},"getClasses"),mt=b(async function(e,i,r,a,o){J.info("REF0:"),J.info("Drawing state diagram (v2)",i);const{securityLevel:d,flowchart:l,layout:A}=g1();a.db.setDiagramId(i),J.debug("Before getData: ");const n=a.db.getData();J.debug("Data: ",n);const g=Xe(i,d),B=a.db.getDirection();n.type=a.type,n.layoutAlgorithm=Ze(A),n.layoutAlgorithm==="dagre"&&A==="elk"&&J.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),n.direction=B,n.nodeSpacing=l?.nodeSpacing||50,n.rankSpacing=l?.rankSpacing||50,n.markers=["point","circle","cross"],n.diagramId=i,J.debug("REF1:",n),await $e(n,g,o);const f=n.config.flowchart?.diagramPadding??8;ie.insertTitle(g,"flowchartTitleText",l?.titleTopMargin||0,a.db.getDiagramTitle()),Qe(g,f,"flowchart",l?.useMaxWidth||!1)},"draw"),Dt={getClasses:kt,draw:mt},re=(function(){var e=b(function(f1,c,h,p){for(h=h||{},p=f1.length;p--;h[f1[p]]=c);return h},"o"),i=[1,4],r=[1,3],a=[1,5],o=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],d=[2,2],l=[1,13],A=[1,14],n=[1,15],g=[1,16],B=[1,23],f=[1,25],k=[1,26],Y=[1,27],F=[1,50],_=[1,49],b1=[1,29],N1=[1,30],j=[1,31],h1=[1,32],P1=[1,33],L=[1,45],V=[1,47],I=[1,43],w=[1,48],R=[1,44],N=[1,51],G=[1,46],P=[1,52],O=[1,53],O1=[1,34],M1=[1,35],U1=[1,36],z1=[1,37],W1=[1,38],d1=[1,58],T=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],$=[1,62],e1=[1,61],t1=[1,63],D1=[8,9,11,75,77,78],ae=[1,79],E1=[1,92],C1=[1,97],T1=[1,96],S1=[1,93],y1=[1,89],x1=[1,95],F1=[1,91],_1=[1,98],B1=[1,94],v1=[1,99],L1=[1,90],A1=[8,9,10,11,40,75,77,78],U=[8,9,10,11,40,46,75,77,78],q=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],ne=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],V1=[44,60,89,102,105,106,109,111,114,115,116],ue=[1,122],oe=[1,123],j1=[1,125],K1=[1,124],le=[44,60,62,74,89,102,105,106,109,111,114,115,116],ce=[1,134],he=[1,148],de=[1,149],pe=[1,150],fe=[1,151],ge=[1,136],be=[1,138],Ae=[1,142],ke=[1,143],me=[1,144],De=[1,145],Ee=[1,146],Ce=[1,147],Te=[1,152],Se=[1,153],ye=[1,132],xe=[1,133],Fe=[1,140],_e=[1,135],Be=[1,139],ve=[1,137],X1=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Le=[1,155],Ve=[1,157],x=[8,9,11],H=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],m=[1,177],z=[1,173],W=[1,174],D=[1,178],E=[1,175],C=[1,176],I1=[77,116,119],S=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Ie=[10,106],p1=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],s1=[1,248],i1=[1,246],r1=[1,250],a1=[1,244],n1=[1,245],u1=[1,247],o1=[1,249],l1=[1,251],w1=[1,269],we=[8,9,11,106],Z=[8,9,10,11,60,84,105,106,109,110,111,112],Q1={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:b(function(c,h,p,u,y,t,G1){var s=t.length-1;switch(y){case 2:this.$=[];break;case 3:(!Array.isArray(t[s])||t[s].length>0)&&t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 183:this.$=t[s];break;case 11:u.setDirection("TB"),this.$="TB";break;case 12:u.setDirection(t[s-1]),this.$=t[s-1];break;case 27:this.$=t[s-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=u.addSubGraph(t[s-6],t[s-1],t[s-4]);break;case 34:this.$=u.addSubGraph(t[s-3],t[s-1],t[s-3]);break;case 35:this.$=u.addSubGraph(void 0,t[s-1],void 0);break;case 37:this.$=t[s].trim(),u.setAccTitle(this.$);break;case 38:case 39:this.$=t[s].trim(),u.setAccDescription(this.$);break;case 43:this.$=t[s-1]+t[s];break;case 44:this.$=t[s];break;case 45:u.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),u.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 46:u.addLink(t[s-2].stmt,t[s],t[s-1]),this.$={stmt:t[s],nodes:t[s].concat(t[s-2].nodes)};break;case 47:u.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 48:this.$={stmt:t[s-1],nodes:t[s-1]};break;case 49:u.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),this.$={stmt:t[s-1],nodes:t[s-1],shapeData:t[s]};break;case 50:this.$={stmt:t[s],nodes:t[s]};break;case 51:this.$=[t[s]];break;case 52:u.addVertex(t[s-5][t[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s-4]),this.$=t[s-5].concat(t[s]);break;case 53:this.$=t[s-4].concat(t[s]);break;case 54:this.$=t[s];break;case 55:this.$=t[s-2],u.setClass(t[s-2],t[s]);break;case 56:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"square");break;case 57:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"doublecircle");break;case 58:this.$=t[s-5],u.addVertex(t[s-5],t[s-2],"circle");break;case 59:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"ellipse");break;case 60:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"stadium");break;case 61:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"subroutine");break;case 62:this.$=t[s-7],u.addVertex(t[s-7],t[s-1],"rect",void 0,void 0,void 0,Object.fromEntries([[t[s-5],t[s-3]]]));break;case 63:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"cylinder");break;case 64:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"round");break;case 65:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"diamond");break;case 66:this.$=t[s-5],u.addVertex(t[s-5],t[s-2],"hexagon");break;case 67:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"odd");break;case 68:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"trapezoid");break;case 69:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"inv_trapezoid");break;case 70:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"lean_right");break;case 71:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"lean_left");break;case 72:this.$=t[s],u.addVertex(t[s]);break;case 73:t[s-1].text=t[s],this.$=t[s-1];break;case 74:case 75:t[s-2].text=t[s-1],this.$=t[s-2];break;case 76:this.$=t[s];break;case 77:var v=u.destructLink(t[s],t[s-2]);this.$={type:v.type,stroke:v.stroke,length:v.length,text:t[s-1]};break;case 78:var v=u.destructLink(t[s],t[s-2]);this.$={type:v.type,stroke:v.stroke,length:v.length,text:t[s-1],id:t[s-3]};break;case 79:this.$={text:t[s],type:"text"};break;case 80:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 81:this.$={text:t[s],type:"string"};break;case 82:this.$={text:t[s],type:"markdown"};break;case 83:var v=u.destructLink(t[s]);this.$={type:v.type,stroke:v.stroke,length:v.length};break;case 84:var v=u.destructLink(t[s]);this.$={type:v.type,stroke:v.stroke,length:v.length,id:t[s-1]};break;case 85:this.$=t[s-1];break;case 86:this.$={text:t[s],type:"text"};break;case 87:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 88:this.$={text:t[s],type:"string"};break;case 89:case 104:this.$={text:t[s],type:"markdown"};break;case 101:this.$={text:t[s],type:"text"};break;case 102:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 103:this.$={text:t[s],type:"text"};break;case 105:this.$=t[s-4],u.addClass(t[s-2],t[s]);break;case 106:this.$=t[s-4],u.setClass(t[s-2],t[s]);break;case 107:case 115:this.$=t[s-1],u.setClickEvent(t[s-1],t[s]);break;case 108:case 116:this.$=t[s-3],u.setClickEvent(t[s-3],t[s-2]),u.setTooltip(t[s-3],t[s]);break;case 109:this.$=t[s-2],u.setClickEvent(t[s-2],t[s-1],t[s]);break;case 110:this.$=t[s-4],u.setClickEvent(t[s-4],t[s-3],t[s-2]),u.setTooltip(t[s-4],t[s]);break;case 111:this.$=t[s-2],u.setLink(t[s-2],t[s]);break;case 112:this.$=t[s-4],u.setLink(t[s-4],t[s-2]),u.setTooltip(t[s-4],t[s]);break;case 113:this.$=t[s-4],u.setLink(t[s-4],t[s-2],t[s]);break;case 114:this.$=t[s-6],u.setLink(t[s-6],t[s-4],t[s]),u.setTooltip(t[s-6],t[s-2]);break;case 117:this.$=t[s-1],u.setLink(t[s-1],t[s]);break;case 118:this.$=t[s-3],u.setLink(t[s-3],t[s-2]),u.setTooltip(t[s-3],t[s]);break;case 119:this.$=t[s-3],u.setLink(t[s-3],t[s-2],t[s]);break;case 120:this.$=t[s-5],u.setLink(t[s-5],t[s-4],t[s]),u.setTooltip(t[s-5],t[s-2]);break;case 121:this.$=t[s-4],u.addVertex(t[s-2],void 0,void 0,t[s]);break;case 122:this.$=t[s-4],u.updateLink([t[s-2]],t[s]);break;case 123:this.$=t[s-4],u.updateLink(t[s-2],t[s]);break;case 124:this.$=t[s-8],u.updateLinkInterpolate([t[s-6]],t[s-2]),u.updateLink([t[s-6]],t[s]);break;case 125:this.$=t[s-8],u.updateLinkInterpolate(t[s-6],t[s-2]),u.updateLink(t[s-6],t[s]);break;case 126:this.$=t[s-6],u.updateLinkInterpolate([t[s-4]],t[s]);break;case 127:this.$=t[s-6],u.updateLinkInterpolate(t[s-4],t[s]);break;case 128:case 130:this.$=[t[s]];break;case 129:case 131:t[s-2].push(t[s]),this.$=t[s-2];break;case 133:this.$=t[s-1]+t[s];break;case 181:this.$=t[s];break;case 182:this.$=t[s-1]+""+t[s];break;case 184:this.$=t[s-1]+""+t[s];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:i,10:r,12:a},{1:[3]},e(o,d,{5:6}),{4:7,9:i,10:r,12:a},{4:8,9:i,10:r,12:a},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:l,9:A,10:n,11:g,20:17,22:18,23:19,24:20,25:21,26:22,27:B,33:24,34:f,36:k,38:Y,42:28,43:39,44:F,45:40,47:41,60:_,84:b1,85:N1,86:j,87:h1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},e(o,[2,9]),e(o,[2,10]),e(o,[2,11]),{8:[1,55],9:[1,56],10:d1,15:54,18:57},e(T,[2,3]),e(T,[2,4]),e(T,[2,5]),e(T,[2,6]),e(T,[2,7]),e(T,[2,8]),{8:$,9:e1,11:t1,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:$,9:e1,11:t1,21:68},{8:$,9:e1,11:t1,21:69},{8:$,9:e1,11:t1,21:70},{8:$,9:e1,11:t1,21:71},{8:$,9:e1,11:t1,21:72},{8:$,9:e1,10:[1,73],11:t1,21:74},e(T,[2,36]),{35:[1,75]},{37:[1,76]},e(T,[2,39]),e(D1,[2,50],{18:77,39:78,10:d1,40:ae}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:E1,44:C1,60:T1,80:[1,87],89:S1,95:[1,84],97:[1,85],101:86,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1,120:88},e(T,[2,185]),e(T,[2,186]),e(T,[2,187]),e(T,[2,188]),e(T,[2,189]),e(A1,[2,51]),e(A1,[2,54],{46:[1,100]}),e(U,[2,72],{113:113,29:[1,101],44:F,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:_,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),e(q,[2,181]),e(q,[2,142]),e(q,[2,143]),e(q,[2,144]),e(q,[2,145]),e(q,[2,146]),e(q,[2,147]),e(q,[2,148]),e(q,[2,149]),e(q,[2,150]),e(q,[2,151]),e(q,[2,152]),e(o,[2,12]),e(o,[2,18]),e(o,[2,19]),{9:[1,114]},e(ne,[2,26],{18:115,10:d1}),e(T,[2,27]),{42:116,43:39,44:F,45:40,47:41,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(V1,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:ue,81:oe,116:j1,119:K1},{75:[1,126],77:[1,127]},e(le,[2,83]),e(T,[2,28]),e(T,[2,29]),e(T,[2,30]),e(T,[2,31]),e(T,[2,32]),{10:ce,12:he,14:de,27:pe,28:128,32:fe,44:ge,60:be,75:Ae,80:[1,130],81:[1,131],83:141,84:ke,85:me,86:De,87:Ee,88:Ce,89:Te,90:Se,91:129,105:ye,109:xe,111:Fe,114:_e,115:Be,116:ve},e(X1,d,{5:154}),e(T,[2,37]),e(T,[2,38]),e(D1,[2,48],{44:Le}),e(D1,[2,49],{18:156,10:d1,40:Ve}),e(A1,[2,44]),{44:F,47:158,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{102:[1,159],103:160,105:[1,161]},{44:F,47:162,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{44:F,47:163,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(x,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(x,[2,115],{120:168,10:[1,167],14:E1,44:C1,60:T1,89:S1,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1}),e(x,[2,117],{10:[1,169]}),e(H,[2,183]),e(H,[2,170]),e(H,[2,171]),e(H,[2,172]),e(H,[2,173]),e(H,[2,174]),e(H,[2,175]),e(H,[2,176]),e(H,[2,177]),e(H,[2,178]),e(H,[2,179]),e(H,[2,180]),{44:F,47:170,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{30:171,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:179,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:181,50:[1,180],67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:182,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:183,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:184,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{109:[1,185]},{30:186,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:187,65:[1,188],67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:189,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:190,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:191,67:m,80:z,81:W,82:172,116:D,117:E,118:C},e(q,[2,182]),e(o,[2,20]),e(ne,[2,25]),e(D1,[2,46],{39:192,18:193,10:d1,40:ae}),e(V1,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{77:[1,197],79:198,116:j1,119:K1},e(I1,[2,79]),e(I1,[2,81]),e(I1,[2,82]),e(I1,[2,168]),e(I1,[2,169]),{76:199,79:121,80:ue,81:oe,116:j1,119:K1},e(le,[2,84]),{8:$,9:e1,10:ce,11:t1,12:he,14:de,21:201,27:pe,29:[1,200],32:fe,44:ge,60:be,75:Ae,83:141,84:ke,85:me,86:De,87:Ee,88:Ce,89:Te,90:Se,91:202,105:ye,109:xe,111:Fe,114:_e,115:Be,116:ve},e(S,[2,101]),e(S,[2,103]),e(S,[2,104]),e(S,[2,157]),e(S,[2,158]),e(S,[2,159]),e(S,[2,160]),e(S,[2,161]),e(S,[2,162]),e(S,[2,163]),e(S,[2,164]),e(S,[2,165]),e(S,[2,166]),e(S,[2,167]),e(S,[2,90]),e(S,[2,91]),e(S,[2,92]),e(S,[2,93]),e(S,[2,94]),e(S,[2,95]),e(S,[2,96]),e(S,[2,97]),e(S,[2,98]),e(S,[2,99]),e(S,[2,100]),{6:11,7:12,8:l,9:A,10:n,11:g,20:17,22:18,23:19,24:20,25:21,26:22,27:B,32:[1,203],33:24,34:f,36:k,38:Y,42:28,43:39,44:F,45:40,47:41,60:_,84:b1,85:N1,86:j,87:h1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},{10:d1,18:204},{44:[1,205]},e(A1,[2,43]),{10:[1,206],44:F,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{10:[1,207]},{10:[1,208],106:[1,209]},e(Ie,[2,128]),{10:[1,210],44:F,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{10:[1,211],44:F,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{80:[1,212]},e(x,[2,109],{10:[1,213]}),e(x,[2,111],{10:[1,214]}),{80:[1,215]},e(H,[2,184]),{80:[1,216],98:[1,217]},e(A1,[2,55],{113:113,44:F,60:_,89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),{31:[1,218],67:m,82:219,116:D,117:E,118:C},e(p1,[2,86]),e(p1,[2,88]),e(p1,[2,89]),e(p1,[2,153]),e(p1,[2,154]),e(p1,[2,155]),e(p1,[2,156]),{49:[1,220],67:m,82:219,116:D,117:E,118:C},{30:221,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{51:[1,222],67:m,82:219,116:D,117:E,118:C},{53:[1,223],67:m,82:219,116:D,117:E,118:C},{55:[1,224],67:m,82:219,116:D,117:E,118:C},{57:[1,225],67:m,82:219,116:D,117:E,118:C},{60:[1,226]},{64:[1,227],67:m,82:219,116:D,117:E,118:C},{66:[1,228],67:m,82:219,116:D,117:E,118:C},{30:229,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{31:[1,230],67:m,82:219,116:D,117:E,118:C},{67:m,69:[1,231],71:[1,232],82:219,116:D,117:E,118:C},{67:m,69:[1,234],71:[1,233],82:219,116:D,117:E,118:C},e(D1,[2,45],{18:156,10:d1,40:Ve}),e(D1,[2,47],{44:Le}),e(V1,[2,75]),e(V1,[2,74]),{62:[1,235],67:m,82:219,116:D,117:E,118:C},e(V1,[2,77]),e(I1,[2,80]),{77:[1,236],79:198,116:j1,119:K1},{30:237,67:m,80:z,81:W,82:172,116:D,117:E,118:C},e(X1,d,{5:238}),e(S,[2,102]),e(T,[2,35]),{43:239,44:F,45:40,47:41,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{10:d1,18:240},{10:s1,60:i1,84:r1,92:241,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:252,104:[1,253],105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:254,104:[1,255],105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{105:[1,256]},{10:s1,60:i1,84:r1,92:257,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{44:F,47:258,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(x,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(x,[2,116]),e(x,[2,118],{10:[1,262]}),e(x,[2,119]),e(U,[2,56]),e(p1,[2,87]),e(U,[2,57]),{51:[1,263],67:m,82:219,116:D,117:E,118:C},e(U,[2,64]),e(U,[2,59]),e(U,[2,60]),e(U,[2,61]),{109:[1,264]},e(U,[2,63]),e(U,[2,65]),{66:[1,265],67:m,82:219,116:D,117:E,118:C},e(U,[2,67]),e(U,[2,68]),e(U,[2,70]),e(U,[2,69]),e(U,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(V1,[2,78]),{31:[1,266],67:m,82:219,116:D,117:E,118:C},{6:11,7:12,8:l,9:A,10:n,11:g,20:17,22:18,23:19,24:20,25:21,26:22,27:B,32:[1,267],33:24,34:f,36:k,38:Y,42:28,43:39,44:F,45:40,47:41,60:_,84:b1,85:N1,86:j,87:h1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},e(A1,[2,53]),{43:268,44:F,45:40,47:41,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(x,[2,121],{106:w1}),e(we,[2,130],{108:270,10:s1,60:i1,84:r1,105:a1,109:n1,110:u1,111:o1,112:l1}),e(Z,[2,132]),e(Z,[2,134]),e(Z,[2,135]),e(Z,[2,136]),e(Z,[2,137]),e(Z,[2,138]),e(Z,[2,139]),e(Z,[2,140]),e(Z,[2,141]),e(x,[2,122],{106:w1}),{10:[1,271]},e(x,[2,123],{106:w1}),{10:[1,272]},e(Ie,[2,129]),e(x,[2,105],{106:w1}),e(x,[2,106],{113:113,44:F,60:_,89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),e(x,[2,110]),e(x,[2,112],{10:[1,273]}),e(x,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:$,9:e1,11:t1,21:278},e(T,[2,34]),e(A1,[2,52]),{10:s1,60:i1,84:r1,105:a1,107:279,108:243,109:n1,110:u1,111:o1,112:l1},e(Z,[2,133]),{14:E1,44:C1,60:T1,89:S1,101:280,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1,120:88},{14:E1,44:C1,60:T1,89:S1,101:281,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1,120:88},{98:[1,282]},e(x,[2,120]),e(U,[2,58]),{30:283,67:m,80:z,81:W,82:172,116:D,117:E,118:C},e(U,[2,66]),e(X1,d,{5:284}),e(we,[2,131],{108:270,10:s1,60:i1,84:r1,105:a1,109:n1,110:u1,111:o1,112:l1}),e(x,[2,126],{120:168,10:[1,285],14:E1,44:C1,60:T1,89:S1,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1}),e(x,[2,127],{120:168,10:[1,286],14:E1,44:C1,60:T1,89:S1,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1}),e(x,[2,114]),{31:[1,287],67:m,82:219,116:D,117:E,118:C},{6:11,7:12,8:l,9:A,10:n,11:g,20:17,22:18,23:19,24:20,25:21,26:22,27:B,32:[1,288],33:24,34:f,36:k,38:Y,42:28,43:39,44:F,45:40,47:41,60:_,84:b1,85:N1,86:j,87:h1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},{10:s1,60:i1,84:r1,92:289,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:290,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},e(U,[2,62]),e(T,[2,33]),e(x,[2,124],{106:w1}),e(x,[2,125],{106:w1})],defaultActions:{},parseError:b(function(c,h){if(h.recoverable)this.trace(c);else{var p=new Error(c);throw p.hash=h,p}},"parseError"),parse:b(function(c){var h=this,p=[0],u=[],y=[null],t=[],G1=this.table,s="",v=0,Re=0,je=2,Ne=1,Ke=t.slice.call(arguments,1),M=Object.create(this.lexer),k1={yy:{}};for(var J1 in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J1)&&(k1.yy[J1]=this.yy[J1]);M.setInput(c,k1.yy),k1.yy.lexer=M,k1.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var Z1=M.yylloc;t.push(Z1);var Ye=M.options&&M.options.ranges;typeof k1.yy.parseError=="function"?this.parseError=k1.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function qe(X){p.length=p.length-2*X,y.length=y.length-X,t.length=t.length-X}b(qe,"popStack");function Ge(){var X;return X=u.pop()||M.lex()||Ne,typeof X!="number"&&(X instanceof Array&&(u=X,X=u.pop()),X=h.symbols_[X]||X),X}b(Ge,"lex");for(var K,m1,Q,$1,R1={},q1,c1,Pe,H1;;){if(m1=p[p.length-1],this.defaultActions[m1]?Q=this.defaultActions[m1]:((K===null||typeof K>"u")&&(K=Ge()),Q=G1[m1]&&G1[m1][K]),typeof Q>"u"||!Q.length||!Q[0]){var ee="";H1=[];for(q1 in G1[m1])this.terminals_[q1]&&q1>je&&H1.push("'"+this.terminals_[q1]+"'");M.showPosition?ee="Parse error on line "+(v+1)+`: +`+M.showPosition()+` +Expecting `+H1.join(", ")+", got '"+(this.terminals_[K]||K)+"'":ee="Parse error on line "+(v+1)+": Unexpected "+(K==Ne?"end of input":"'"+(this.terminals_[K]||K)+"'"),this.parseError(ee,{text:M.match,token:this.terminals_[K]||K,line:M.yylineno,loc:Z1,expected:H1})}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m1+", token: "+K);switch(Q[0]){case 1:p.push(K),y.push(M.yytext),t.push(M.yylloc),p.push(Q[1]),K=null,Re=M.yyleng,s=M.yytext,v=M.yylineno,Z1=M.yylloc;break;case 2:if(c1=this.productions_[Q[1]][1],R1.$=y[y.length-c1],R1._$={first_line:t[t.length-(c1||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(c1||1)].first_column,last_column:t[t.length-1].last_column},Ye&&(R1._$.range=[t[t.length-(c1||1)].range[0],t[t.length-1].range[1]]),$1=this.performAction.apply(R1,[s,Re,v,k1.yy,Q[1],y,t].concat(Ke)),typeof $1<"u")return $1;c1&&(p=p.slice(0,-1*c1*2),y=y.slice(0,-1*c1),t=t.slice(0,-1*c1)),p.push(this.productions_[Q[1]][0]),y.push(R1.$),t.push(R1._$),Pe=G1[p[p.length-2]][p[p.length-1]],p.push(Pe);break;case 3:return!0}}return!0},"parse")},We=(function(){var f1={EOF:1,parseError:b(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:b(function(c,h){return this.yy=h||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:b(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var h=c.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),c},"input"),unput:b(function(c){var h=c.length,p=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var u=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 y=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===u.length?this.yylloc.first_column:0)+u[u.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(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:b(function(c){this.unput(this.match.slice(c))},"less"),pastInput:b(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:b(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:b(function(){var c=this.pastInput(),h=new Array(c.length+1).join("-");return c+this.upcomingInput()+` +`+h+"^"},"showPosition"),test_match:b(function(c,h){var p,u,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),u=c[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(c[0].length),this.matched+=c[0],p=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var t in y)this[t]=y[t];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,h,p,u;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),t=0;th[0].length)){if(h=p,u=t,this.options.backtrack_lexer){if(c=this.test_match(p,y[t]),c!==!1)return c;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(c=this.test_match(h,y[u]),c!==!1?c:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var h=this.next();return h||this.lex()},"lex"),begin:b(function(h){this.conditionStack.push(h)},"begin"),popState:b(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:b(function(h){this.begin(h)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:b(function(h,p,u,y){switch(u){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),p.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const t=/\n\s*/g;return p.yytext=p.yytext.replace(t,"
"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return h.lex.firstGraph()&&this.begin("dir"),12;case 36:return h.lex.firstGraph()&&this.begin("dir"),12;case 37:return h.lex.firstGraph()&&this.begin("dir"),12;case 38:return h.lex.firstGraph()&&this.begin("dir"),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState("edgeText"),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState("thickEdgeText"),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState("dottedEdgeText"),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;case 83:return this.popState(),55;case 84:return this.pushState("text"),54;case 85:return this.popState(),57;case 86:return this.pushState("text"),56;case 87:return 58;case 88:return this.pushState("text"),67;case 89:return this.popState(),64;case 90:return this.pushState("text"),63;case 91:return this.popState(),49;case 92:return this.pushState("text"),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState("trapText"),68;case 97:return this.pushState("trapText"),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState("text"),62;case 111:return this.popState(),51;case 112:return this.pushState("text"),50;case 113:return this.popState(),31;case 114:return this.pushState("text"),29;case 115:return this.popState(),66;case 116:return this.pushState("text"),65;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}};return f1})();Q1.lexer=We;function Y1(){this.yy={}}return b(Y1,"Parser"),Y1.prototype=Q1,Q1.Parser=Y1,new Y1})();re.parser=re;var Me=re,Ue=Object.assign({},Me);Ue.parse=e=>{const i=e.replace(/}\s*\n/g,`} +`);return Me.parse(i)};var Et=Ue,Ct=b((e,i)=>{const r=gt,a=r(e,"r"),o=r(e,"g"),d=r(e,"b");return pt(a,o,d,i)},"fade"),Tt=b(e=>`.label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .cluster-label text { + fill: ${e.titleColor}; + } + .cluster-label span { + color: ${e.titleColor}; + } + .cluster-label span p { + background-color: transparent; + } + + .label text,span { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: ${e.strokeWidth??1}px; + } + .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label { + text-anchor: middle; + } + + .node .katex path { + fill: #000; + stroke: #000; + stroke-width: 1px; + } + + .rough-node .label,.node .label, .image-shape .label, .icon-shape .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + + .root .anchor path { + fill: ${e.lineColor} !important; + stroke-width: 0; + stroke: ${e.lineColor}; + } + + .arrowheadPath { + fill: ${e.arrowheadColor}; + } + + .edgePath .path { + stroke: ${e.lineColor}; + stroke-width: ${e.strokeWidth??2}px; + } + + .flowchart-link { + stroke: ${e.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + p { + background-color: ${e.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${Ct(e.edgeLabelBackground,.5)}; + // background-color: + } + + .cluster rect { + fill: ${e.clusterBkg}; + stroke: ${e.clusterBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor}; + } + + .cluster span { + color: ${e.titleColor}; + } + /* .cluster div { + color: ${e.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${e.fontFamily}; + font-size: 12px; + background: ${e.tertiaryColor}; + border: 1px solid ${e.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } + + rect.text { + fill: none; + stroke-width: 0; + } + + .icon-shape, .image-shape { + background-color: ${e.edgeLabelBackground}; + p { + background-color: ${e.edgeLabelBackground}; + padding: 2px; + } + .label rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + ${He()} +`,"getStyles"),St=Tt,ze=b(({defaultLayout:e,styles:i=St}={})=>({parser:Et,get db(){return new At},renderer:Dt,styles:i,init:b(r=>{r.flowchart||(r.flowchart={});const a=Je().layout??e??r.layout;a&&Oe({layout:a}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,Oe({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),yt=ze();const Vt=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:ze,diagram:yt},Symbol.toStringTag,{value:"Module"}));export{ze as c,Vt as f,St as s}; diff --git a/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-D1u5oYVA.js b/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-D1u5oYVA.js new file mode 100644 index 00000000000..93a9f28759f --- /dev/null +++ b/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-D1u5oYVA.js @@ -0,0 +1,292 @@ +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-WW7RuneT.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-UIDPGx_K.js";import{i as er}from"./init-Gi6I4Gst.js";import"./index-CiHMlsuo.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()+` +`+g+"^"},"showPosition"),test_match:d(function(c,g){var b,m,I;if(this.options.backtrack_lexer&&(I={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(I.yylloc.range=this.yylloc.range.slice(0))),m=c[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(c[0].length),this.matched+=c[0],b=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),b)return b;if(this._backtrack){for(var o in I)this[o]=I[o];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,g,b,m;this._more||(this.yytext="",this.match="");for(var I=this._currentRules(),o=0;og[0].length)){if(g=b,m=o,this.options.backtrack_lexer){if(c=this.test_match(b,I[o]),c!==!1)return c;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(c=this.test_match(g,I[m]),c!==!1?c:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var g=this.next();return g||this.lex()},"lex"),begin:d(function(g){this.conditionStack.push(g)},"begin"),popState:d(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:d(function(g){this.begin(g)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(g,b,m,I){switch(m){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return D})();x.lexer=C;function M(){this.yy={}}return d(M,"Parser"),M.prototype=x,x.Parser=M,new M})();we.parser=we;var Qi=we;it.extend(Oi);it.extend(Vi);it.extend(Bi);var rn={friday:5,saturday:6},lt="",Ye="",Fe=void 0,Ue="",Lt=[],At=[],Ee=new Map,Ie=[],se=[],Wt="",Le="",Yn=["active","done","crit","milestone","vert"],Ae=[],_t="",qt=!1,We=!1,$e="sunday",ae="saturday",De=0,Ji=d(function(){Ie=[],se=[],Wt="",Ae=[],te=0,Ce=void 0,ee=void 0,et=[],lt="",Ye="",Le="",Fe=void 0,Ue="",Lt=[],At=[],qt=!1,We=!1,De=0,Ee=new Map,_t="",Gn(),$e="sunday",ae="saturday"},"clear"),Ki=d(function(t){_t=t},"setDiagramId"),ts=d(function(t){Ye=t},"setAxisFormat"),es=d(function(){return Ye},"getAxisFormat"),ns=d(function(t){Fe=t},"setTickInterval"),rs=d(function(){return Fe},"getTickInterval"),is=d(function(t){Ue=t},"setTodayMarker"),ss=d(function(){return Ue},"getTodayMarker"),as=d(function(t){lt=t},"setDateFormat"),os=d(function(){qt=!0},"enableInclusiveEndDates"),cs=d(function(){return qt},"endDatesAreInclusive"),us=d(function(){We=!0},"enableTopAxis"),ls=d(function(){return We},"topAxisEnabled"),fs=d(function(t){Le=t},"setDisplayMode"),ds=d(function(){return Le},"getDisplayMode"),hs=d(function(){return lt},"getDateFormat"),Fn=d((t,e)=>{const n=e.toLowerCase().split(/[\s,]+/).filter(r=>r!=="");return[...new Set([...t,...n])]},"mergeTokens"),ms=d(function(t){Lt=Fn(Lt,t)},"setIncludes"),gs=d(function(){return Lt},"getIncludes"),ys=d(function(t){At=Fn(At,t)},"setExcludes"),ks=d(function(){return At},"getExcludes"),ps=d(function(){return Ee},"getLinks"),vs=d(function(t){Wt=t,Ie.push(t)},"addSection"),Ts=d(function(){return Ie},"getSections"),xs=d(function(){let t=sn();const e=10;let n=0;for(;!t&&ny))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,a]},"fixTaskDates"),Me=d(function(t,e,n){if(n=n.trim(),d(y=>{const F=y.trim();return F==="x"||F==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(n))return new Date(Number(n));const s=/^after\s+(?[\d\w- ]+)/.exec(n);if(s!==null){let y=null;for(const S of s.groups.ids.split(" ")){let w=Ct(S);w!==void 0&&(!y||w.endTime>y.endTime)&&(y=w)}if(y)return y.endTime;const F=new Date;return F.setHours(0,0,0,0),F}let a=it(n,e.trim(),!0);if(a.isValid())return a.toDate();{Tt.debug("Invalid date:"+n),Tt.debug("With date format:"+e.trim());const y=new Date(n);if(y===void 0||isNaN(y.getTime())||y.getFullYear()<-1e4||y.getFullYear()>1e4)throw new Error("Invalid date:"+n);return y}},"getStartDate"),In=d(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),Ln=d(function(t,e,n,r=!1){n=n.trim();const s=/^until\s+(?[\d\w- ]+)/.exec(n);if(s!==null){let w=null;for(const _ of s.groups.ids.split(" ")){let Y=Ct(_);Y!==void 0&&(!w||Y.startTime{window.open(n,"_self")}),Ee.set(r,n))}),Wn(t,"clickable")},"setLink"),Wn=d(function(t,e){t.split(",").forEach(function(n){let r=Ct(n);r!==void 0&&r.classes.push(e)})},"setClass"),Us=d(function(t,e,n){if(Yt().securityLevel!=="loose"||e===void 0)return;let r=[];if(typeof n=="string"){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s{jn.runFunc(e,...r)})},"setClickFun"),$n=d(function(t,e){Ae.push(function(){const n=_t?`${_t}-${t}`:t,r=document.querySelector(`[id="${n}"]`);r!==null&&r.addEventListener("click",function(){e()})},function(){const n=_t?`${_t}-${t}`:t,r=document.querySelector(`[id="${n}-text"]`);r!==null&&r.addEventListener("click",function(){e()})})},"pushFun"),Es=d(function(t,e,n){t.split(",").forEach(function(r){Us(r,e,n)}),Wn(t,"clickable")},"setClickEvent"),Is=d(function(t){Ae.forEach(function(e){e(t)})},"bindFunctions"),Ls={getConfig:d(()=>Yt().gantt,"getConfig"),clear:Ji,setDateFormat:as,getDateFormat:hs,enableInclusiveEndDates:os,endDatesAreInclusive:cs,enableTopAxis:us,topAxisEnabled:ls,setAxisFormat:ts,getAxisFormat:es,setTickInterval:ns,getTickInterval:rs,setTodayMarker:is,getTodayMarker:ss,setAccTitle:qn,getAccTitle:zn,setDiagramTitle:Rn,getDiagramTitle:Vn,setDiagramId:Ki,setDisplayMode:fs,getDisplayMode:ds,setAccDescription:Pn,getAccDescription:Nn,addSection:vs,getSections:Ts,getTasks:xs,addTask:_s,findTaskById:Ct,addTaskOrg:Ys,setIncludes:ms,getIncludes:gs,setExcludes:ys,getExcludes:ks,setClickEvent:Es,setLink:Fs,getLinks:ps,bindFunctions:Is,parseDuration:In,isInvalidDate:Un,setWeekday:bs,getWeekday:ws,setWeekend:Ds};function Oe(t,e,n){let r=!0;for(;r;)r=!1,n.forEach(function(i){const s="^\\s*"+i+"\\s*$",a=new RegExp(s);t[0].match(a)&&(e[i]=!0,t.shift(1),r=!0)})}d(Oe,"getTaskTags");it.extend(ji);var As=d(function(){Tt.debug("Something is calling, setConf, remove the call")},"setConf"),an={monday:Vt,tuesday:vn,wednesday:Tn,thursday:bt,friday:xn,saturday:bn,sunday:zt},Ws=d((t,e)=>{let n=[...t].map(()=>-1/0),r=[...t].sort((s,a)=>s.startTime-a.startTime||s.order-a.order),i=0;for(const s of r)for(let a=0;a=n[a]){n[a]=s.endTime,s.order=a+e,a>i&&(i=a);break}return i},"getMaxIntersections"),dt,Te=1e4,$s=d(function(t,e,n,r){const i=Yt().gantt;r.db.setDiagramId(e);const s=Yt().securityLevel;let a;s==="sandbox"&&(a=Zt("#i"+e));const y=s==="sandbox"?Zt(a.nodes()[0].contentDocument.body):Zt("body"),F=s==="sandbox"?a.nodes()[0].contentDocument:document,S=F.getElementById(e);dt=S.parentElement.offsetWidth,dt===void 0&&(dt=1200),i.useWidth!==void 0&&(dt=i.useWidth);const w=r.db.getTasks(),P=w.filter(x=>!x.vert);let _=[];for(const x of P)_.push(x.type);_=L(_);const Y={};let X=2*i.topPadding;if(r.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const x={};for(const M of P)x[M.section]===void 0?x[M.section]=[M]:x[M.section].push(M);let C=0;for(const M of Object.keys(x)){const D=Ws(x[M],C)+1;C+=D,X+=D*(i.barHeight+i.barGap),Y[M]=D}}else{X+=P.length*(i.barHeight+i.barGap);for(const x of _)Y[x]=P.filter(C=>C.type===x).length}S.setAttribute("viewBox","0 0 "+dt+" "+X);const B=y.select(`[id="${e}"]`),v=Li().domain([rr(w,function(x){return x.startTime}),nr(w,function(x){return x.endTime})]).rangeRound([0,dt-i.leftPadding-i.rightPadding]);function U(x,C){const M=x.startTime,D=C.startTime;let c=0;return M>D?c=1:Ml.vert===$.vert?0:l.vert?1:-1);const m=x.filter(l=>!l.vert),o=[...new Set(m.map(l=>l.order))].map(l=>m.find($=>$.order===l));B.append("g").selectAll("rect").data(o).enter().append("rect").attr("x",0).attr("y",function(l,$){return $=l.order,$*C+M-2}).attr("width",function(){return b-i.rightPadding/2}).attr("height",C).attr("class",function(l){for(const[$,O]of _.entries())if(l.type===O)return"section section"+$%i.numberSectionStyles;return"section section0"}).enter();const W=B.append("g").selectAll("rect").data(x).enter(),u=r.db.getLinks();if(W.append("rect").attr("id",function(l){return e+"-"+l.id}).attr("rx",3).attr("ry",3).attr("x",function(l){return l.milestone?v(l.startTime)+D+.5*(v(l.endTime)-v(l.startTime))-.5*c:v(l.startTime)+D}).attr("y",function(l,$){return $=l.order,l.vert?i.gridLineStartPadding:$*C+M}).attr("width",function(l){return l.milestone?c:l.vert?.08*c:v(l.renderEndTime||l.endTime)-v(l.startTime)}).attr("height",function(l){return l.vert?m.length*(i.barHeight+i.barGap)+i.barHeight*2:c}).attr("transform-origin",function(l,$){return $=l.order,(v(l.startTime)+D+.5*(v(l.endTime)-v(l.startTime))).toString()+"px "+($*C+M+.5*c).toString()+"px"}).attr("class",function(l){const $="task";let O="";l.classes.length>0&&(O=l.classes.join(" "));let j=0;for(const[J,h]of _.entries())l.type===h&&(j=J%i.numberSectionStyles);let H="";return l.active?l.crit?H+=" activeCrit":H=" active":l.done?l.crit?H=" doneCrit":H=" done":l.crit&&(H+=" crit"),H.length===0&&(H=" task"),l.milestone&&(H=" milestone "+H),l.vert&&(H=" vert "+H),H+=j,H+=" "+O,$+H}),W.append("text").attr("id",function(l){return e+"-"+l.id+"-text"}).text(function(l){return l.task}).attr("font-size",i.fontSize).attr("x",function(l){let $=v(l.startTime),O=v(l.renderEndTime||l.endTime);if(l.milestone&&($+=.5*(v(l.endTime)-v(l.startTime))-.5*c,O=$+c),l.vert)return v(l.startTime)+D;const j=this.getBBox().width;return j>O-$?O+j+1.5*i.leftPadding>b?$+D-5:O+D+5:(O-$)/2+$+D}).attr("y",function(l,$){return l.vert?i.gridLineStartPadding+m.length*(i.barHeight+i.barGap)+60:($=l.order,$*C+i.barHeight/2+(i.fontSize/2-2)+M)}).attr("text-height",c).attr("class",function(l){const $=v(l.startTime);let O=v(l.endTime);l.milestone&&(O=$+c);const j=this.getBBox().width;let H="";l.classes.length>0&&(H=l.classes.join(" "));let J=0;for(const[N,V]of _.entries())l.type===V&&(J=N%i.numberSectionStyles);let h="";return l.active&&(l.crit?h="activeCritText"+J:h="activeText"+J),l.done?l.crit?h=h+" doneCritText"+J:h=h+" doneText"+J:l.crit&&(h=h+" critText"+J),l.milestone&&(h+=" milestoneText"),l.vert&&(h+=" vertText"),j>O-$?O+j+1.5*i.leftPadding>b?H+" taskTextOutsideLeft taskTextOutside"+J+" "+h:H+" taskTextOutsideRight taskTextOutside"+J+" "+h+" width-"+j:H+" taskText taskText"+J+" "+h+" width-"+j}),Yt().securityLevel==="sandbox"){let l;l=Zt("#i"+e);const $=l.nodes()[0].contentDocument;W.filter(function(O){return u.has(O.id)}).each(function(O){var j=$.querySelector("#"+CSS.escape(e+"-"+O.id)),H=$.querySelector("#"+CSS.escape(e+"-"+O.id+"-text"));const J=j.parentNode;var h=$.createElement("a");h.setAttribute("xlink:href",u.get(O.id)),h.setAttribute("target","_top"),J.appendChild(h),h.appendChild(j),h.appendChild(H)})}}d(E,"drawRects");function z(x,C,M,D,c,g,b,m){if(b.length===0&&m.length===0)return;let I,o;for(const{startTime:O,endTime:j}of g)(I===void 0||Oo)&&(o=j);if(!I||!o)return;if(it(o).diff(it(I),"year")>5){Tt.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const W=r.db.getDateFormat(),u=[];let K=null,l=it(I);for(;l.valueOf()<=o;)r.db.isInvalidDate(l,W,b,m)?K?K.end=l:K={start:l,end:l}:K&&(u.push(K),K=null),l=l.add(1,"d");B.append("g").selectAll("rect").data(u).enter().append("rect").attr("id",O=>e+"-exclude-"+O.start.format("YYYY-MM-DD")).attr("x",O=>v(O.start.startOf("day"))+M).attr("y",i.gridLineStartPadding).attr("width",O=>v(O.end.endOf("day"))-v(O.start.startOf("day"))).attr("height",c-C-i.gridLineStartPadding).attr("transform-origin",function(O,j){return(v(O.start)+M+.5*(v(O.end)-v(O.start))).toString()+"px "+(j*x+.5*c).toString()+"px"}).attr("class","exclude-range")}d(z,"drawExcludeDays");function G(x,C,M,D){if(M<=0||x>C)return 1/0;const c=C-x,g=it.duration({[D??"day"]:M}).asMilliseconds();return g<=0?1/0:Math.ceil(c/g)}d(G,"getEstimatedTickCount");function T(x,C,M,D){const c=r.db.getDateFormat(),g=r.db.getAxisFormat();let b;g?b=g:c==="D"?b="%d":b=i.axisFormat??"%Y-%m-%d";let m=fr(v).tickSize(-D+C+i.gridLineStartPadding).tickFormat(ie(b));const o=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||i.tickInterval);if(o!==null){const W=parseInt(o[1],10);if(isNaN(W)||W<=0)Tt.warn(`Invalid tick interval value: "${o[1]}". Skipping custom tick interval.`);else{const u=o[2],K=r.db.getWeekday()||i.weekday,l=v.domain(),$=l[0],O=l[1],j=G($,O,W,u);if(j>Te)Tt.warn(`The tick interval "${W}${u}" would generate ${j} ticks, which exceeds the maximum allowed (${Te}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(u){case"millisecond":m.ticks(Et.every(W));break;case"second":m.ticks(vt.every(W));break;case"minute":m.ticks(Nt.every(W));break;case"hour":m.ticks(Pt.every(W));break;case"day":m.ticks(xt.every(W));break;case"week":m.ticks(an[K].every(W));break;case"month":m.ticks(Rt.every(W));break}}}if(B.append("g").attr("class","grid").attr("transform","translate("+x+", "+(D-50)+")").call(m).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),r.db.topAxisEnabled()||i.topAxis){let W=lr(v).tickSize(-D+C+i.gridLineStartPadding).tickFormat(ie(b));if(o!==null){const u=parseInt(o[1],10);if(isNaN(u)||u<=0)Tt.warn(`Invalid tick interval value: "${o[1]}". Skipping custom tick interval.`);else{const K=o[2],l=r.db.getWeekday()||i.weekday,$=v.domain(),O=$[0],j=$[1];if(G(O,j,u,K)<=Te)switch(K){case"millisecond":W.ticks(Et.every(u));break;case"second":W.ticks(vt.every(u));break;case"minute":W.ticks(Nt.every(u));break;case"hour":W.ticks(Pt.every(u));break;case"day":W.ticks(xt.every(u));break;case"week":W.ticks(an[l].every(u));break;case"month":W.ticks(Rt.every(u));break}}}B.append("g").attr("class","grid").attr("transform","translate("+x+", "+C+")").call(W).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}d(T,"makeGrid");function k(x,C){let M=0;const D=Object.keys(Y).map(c=>[c,Y[c]]);B.append("g").selectAll("text").data(D).enter().append(function(c){const g=c[0].split(Zn.lineBreakRegex),b=-(g.length-1)/2,m=F.createElementNS("http://www.w3.org/2000/svg","text");m.setAttribute("dy",b+"em");for(const[I,o]of g.entries()){const W=F.createElementNS("http://www.w3.org/2000/svg","tspan");W.setAttribute("alignment-baseline","central"),W.setAttribute("x","10"),I>0&&W.setAttribute("dy","1em"),W.textContent=o,m.appendChild(W)}return m}).attr("x",10).attr("y",function(c,g){if(g>0)for(let b=0;b` + .mermaid-main-font { + font-family: ${t.fontFamily}; + } + + .exclude-range { + fill: ${t.excludeBkgColor}; + } + + .section { + stroke: none; + opacity: 0.2; + } + + .section0 { + fill: ${t.sectionBkgColor}; + } + + .section2 { + fill: ${t.sectionBkgColor2}; + } + + .section1, + .section3 { + fill: ${t.altSectionBkgColor}; + opacity: 0.2; + } + + .sectionTitle0 { + fill: ${t.titleColor}; + } + + .sectionTitle1 { + fill: ${t.titleColor}; + } + + .sectionTitle2 { + fill: ${t.titleColor}; + } + + .sectionTitle3 { + fill: ${t.titleColor}; + } + + .sectionTitle { + text-anchor: start; + font-family: ${t.fontFamily}; + } + + + /* Grid and axis */ + + .grid .tick { + stroke: ${t.gridColor}; + opacity: 0.8; + shape-rendering: crispEdges; + } + + .grid .tick text { + font-family: ${t.fontFamily}; + fill: ${t.textColor}; + } + + .grid path { + stroke-width: 0; + } + + + /* Today line */ + + .today { + fill: none; + stroke: ${t.todayLineColor}; + stroke-width: 2px; + } + + + /* Task styling */ + + /* Default task */ + + .task { + stroke-width: 2; + } + + .taskText { + text-anchor: middle; + font-family: ${t.fontFamily}; + } + + .taskTextOutsideRight { + fill: ${t.taskTextDarkColor}; + text-anchor: start; + font-family: ${t.fontFamily}; + } + + .taskTextOutsideLeft { + fill: ${t.taskTextDarkColor}; + text-anchor: end; + } + + + /* Special case clickable */ + + .task.clickable { + cursor: pointer; + } + + .taskText.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideLeft.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideRight.clickable { + cursor: pointer; + fill: ${t.taskTextClickableColor} !important; + font-weight: bold; + } + + + /* Specific task settings for the sections*/ + + .taskText0, + .taskText1, + .taskText2, + .taskText3 { + fill: ${t.taskTextColor}; + } + + .task0, + .task1, + .task2, + .task3 { + fill: ${t.taskBkgColor}; + stroke: ${t.taskBorderColor}; + } + + .taskTextOutside0, + .taskTextOutside2 + { + fill: ${t.taskTextOutsideColor}; + } + + .taskTextOutside1, + .taskTextOutside3 { + fill: ${t.taskTextOutsideColor}; + } + + + /* Active task */ + + .active0, + .active1, + .active2, + .active3 { + fill: ${t.activeTaskBkgColor}; + stroke: ${t.activeTaskBorderColor}; + } + + .activeText0, + .activeText1, + .activeText2, + .activeText3 { + fill: ${t.taskTextDarkColor} !important; + } + + + /* Completed task */ + + .done0, + .done1, + .done2, + .done3 { + stroke: ${t.doneTaskBorderColor}; + fill: ${t.doneTaskBkgColor}; + stroke-width: 2; + } + + .doneText0, + .doneText1, + .doneText2, + .doneText3 { + fill: ${t.taskTextDarkColor} !important; + } + + /* Done task text displayed outside the bar sits against the diagram background, + not against the done-task bar, so it must use the outside/contrast color. */ + .doneText0.taskTextOutsideLeft, + .doneText0.taskTextOutsideRight, + .doneText1.taskTextOutsideLeft, + .doneText1.taskTextOutsideRight, + .doneText2.taskTextOutsideLeft, + .doneText2.taskTextOutsideRight, + .doneText3.taskTextOutsideLeft, + .doneText3.taskTextOutsideRight { + fill: ${t.taskTextOutsideColor} !important; + } + + + /* Tasks on the critical line */ + + .crit0, + .crit1, + .crit2, + .crit3 { + stroke: ${t.critBorderColor}; + fill: ${t.critBkgColor}; + stroke-width: 2; + } + + .activeCrit0, + .activeCrit1, + .activeCrit2, + .activeCrit3 { + stroke: ${t.critBorderColor}; + fill: ${t.activeTaskBkgColor}; + stroke-width: 2; + } + + .doneCrit0, + .doneCrit1, + .doneCrit2, + .doneCrit3 { + stroke: ${t.critBorderColor}; + fill: ${t.doneTaskBkgColor}; + stroke-width: 2; + cursor: pointer; + shape-rendering: crispEdges; + } + + .milestone { + transform: rotate(45deg) scale(0.8,0.8); + } + + .milestoneText { + font-style: italic; + } + .doneCritText0, + .doneCritText1, + .doneCritText2, + .doneCritText3 { + fill: ${t.taskTextDarkColor} !important; + } + + /* Done-crit task text outside the bar — same reasoning as doneText above. */ + .doneCritText0.taskTextOutsideLeft, + .doneCritText0.taskTextOutsideRight, + .doneCritText1.taskTextOutsideLeft, + .doneCritText1.taskTextOutsideRight, + .doneCritText2.taskTextOutsideLeft, + .doneCritText2.taskTextOutsideRight, + .doneCritText3.taskTextOutsideLeft, + .doneCritText3.taskTextOutsideRight { + fill: ${t.taskTextOutsideColor} !important; + } + + .vert { + stroke: ${t.vertLineColor}; + } + + .vertText { + font-size: 15px; + text-anchor: middle; + fill: ${t.vertLineColor} !important; + } + + .activeCritText0, + .activeCritText1, + .activeCritText2, + .activeCritText3 { + fill: ${t.taskTextDarkColor} !important; + } + + .titleText { + text-anchor: middle; + font-size: 18px; + fill: ${t.titleColor||t.textColor}; + font-family: ${t.fontFamily}; + } +`,"getStyles"),Ns=Hs,Zs={parser:Qi,db:Ls,renderer:Os,styles:Ns};export{Zs as diagram}; diff --git a/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-B9_pldp9.js b/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-B9_pldp9.js new file mode 100644 index 00000000000..e31149b2184 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-B9_pldp9.js @@ -0,0 +1,106 @@ +import{I as le}from"./chunk-2Q5K7J3B-NzojNxDT.js";import{p as he}from"./chunk-JWPE2WC7-BJMJfnyy.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-WW7RuneT.js";import{p as Ee}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.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} + ${t.posWithOffset+i/2+L},${x-c-R} + ${t.posWithOffset+i/2+L},${x+c+R} + ${t.posWithOffset-i/2-L},${x+c+R}`),f.attr("cy",x).attr("cx",s-i/2+L/2).attr("r",1.5).attr("class","tag-hole"),y==="TB"||y==="BT"){const u=s+$;g.attr("class","tag-label-bkg").attr("points",` + ${t.x},${u+2} + ${t.x},${u-2} + ${t.x+O},${u-c-2} + ${t.x+O+i+4},${u-c-2} + ${t.x+O+i+4},${u+c+2} + ${t.x+O},${u+c+2}`).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),f.attr("cx",t.x+L/2).attr("cy",u).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),l.attr("x",t.x+5).attr("y",u+3).attr("transform","translate(14,14) rotate(45, "+t.x+","+s+")")}}}},"drawCommitTags"),cr=h(e=>{switch(e.customType??e.type){case m.NORMAL:return"commit-normal";case m.REVERSE:return"commit-reverse";case m.HIGHLIGHT:return"commit-highlight";case m.MERGE:return"commit-merge";case m.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),ir=h((e,r,t,s)=>{const o={x:0,y:0};if(e.parents.length>0){const i=ce(e.parents);if(i){const n=s.get(i)??o;return r==="TB"?n.y+_:r==="BT"?(s.get(e.id)??o).y-_:n.x+_}}else return r==="TB"?F:r==="BT"?(s.get(e.id)??o).y-_:0;return 0},"calculatePosition"),dr=h((e,r,t)=>{const s=y==="BT"&&t?r:r+O,o=C.get(e.branch)?.pos,i=y==="TB"||y==="BT"?C.get(e.branch)?.pos:s;if(i===void 0||o===void 0)throw new Error(`Position were undefined for commit ${e.id}`);const n=j.has(q().theme??""),a=y==="TB"||y==="BT"?s:o+(n?X/2+1:-2);return{x:i,y:a,posWithOffset:s}},"getCommitPosition"),re=h((e,r,t,s)=>{const o=e.append("g").attr("class","commit-bullets"),i=e.append("g").attr("class","commit-labels");let n=y==="TB"||y==="BT"?F:0;const a=[...r.keys()],l=s.parallelCommits??!1,f=h(($,c)=>{const x=r.get($)?.seq,u=r.get(c)?.seq;return x!==void 0&&u!==void 0?x-u:0},"sortKeys");let g=a.sort(f);y==="BT"&&(l&&Ze(g,r,n),g=g.reverse()),g.forEach($=>{const c=r.get($);if(!c)throw new Error(`Commit not found for key ${$}`);l&&(n=ir(c,y,n,E));const x=dr(c,n,l);if(t){const u=cr(c),p=c.customType??c.type,b=C.get(c.branch)?.index??0;nr(o,c,x,u,b,p),sr(i,c,x,n,s),or(i,c,x,n)}y==="TB"||y==="BT"?E.set(c.id,{x:x.x,y:x.posWithOffset}):E.set(c.id,{x:x.posWithOffset,y:x.y}),n=y==="BT"&&l?n+_:n+_+O,n>I&&(I=n)})},"drawCommits"),lr=h((e,r,t,s,o)=>{const n=(y==="TB"||y==="BT"?t.xf.branch===n,"isOnBranchToGetCurve"),l=h(f=>f.seq>e.seq&&f.seql(f)&&a(f))},"shouldRerouteArrow"),W=h((e,r,t=0)=>{const s=e+Math.abs(e-r)/2;if(t>5)return s;if(z.every(n=>Math.abs(n-s)>=10))return z.push(s),s;const i=Math.abs(e-r);return W(e,r-i/5,t+1)},"findLane"),hr=h((e,r,t,s)=>{const{theme:o}=q(),i=Z.has(o??""),n=E.get(r.id),a=E.get(t.id);if(n===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${t.id}`);const l=lr(r,t,n,a,s);let f="",g="",$=0,c=0,x=C.get(t.branch)?.index;t.type===m.MERGE&&r.id!==t.parents[0]&&(x=C.get(r.branch)?.index);let u;if(l){f="A 10 10, 0, 0, 0,",g="A 10 10, 0, 0, 1,",$=10,c=10;const p=n.ya.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${g} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${f} ${a.x} ${n.y+c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):y==="BT"?(n.xa.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${f} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${g} ${a.x} ${n.y-c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):(n.ya.y&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${f} ${a.x} ${n.y-c} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${g} ${n.x+c} ${a.y} L ${a.x} ${a.y}`),n.y===a.y&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`));if(u===void 0)throw new Error("Line definition not found");e.append("path").attr("d",u).attr("class","arrow arrow"+H(x,G,i))},"drawArrow"),$r=h((e,r)=>{const t=e.append("g").attr("class","commit-arrows");[...r.keys()].forEach(s=>{const o=r.get(s);o.parents&&o.parents.length>0&&o.parents.forEach(i=>{hr(t,r.get(i),o,r)})})},"drawArrows"),fr=h((e,r,t,s)=>{const{look:o,theme:i,themeVariables:n}=q(),{dropShadow:a,THEME_COLOR_LIMIT:l}=n,f=j.has(i??""),g=Z.has(i??""),$=e.append("g");r.forEach((c,x)=>{const u=H(x,f?l:G,g),p=C.get(c.name)?.pos;if(p===void 0)throw new Error(`Position not found for branch ${c.name}`);const b=y==="TB"||y==="BT"?p:f?p+X/2+1:p-2,k=$.append("line");k.attr("x1",0),k.attr("y1",b),k.attr("x2",I),k.attr("y2",b),k.attr("class","branch branch"+u),y==="TB"?(k.attr("y1",F),k.attr("x1",p),k.attr("y2",I),k.attr("x2",p)):y==="BT"&&(k.attr("y1",I),k.attr("x1",p),k.attr("y2",F),k.attr("x2",p)),z.push(b);const U=c.name,D=oe(U),T=$.insert("rect"),M=$.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+u);M.node().appendChild(D);const v=D.getBBox(),ee=f?0:4,N=f?16:0,A=f?X:0;o==="neo"&&T.attr("data-look","neo"),T.attr("class","branchLabelBkg label"+u).attr("style",o==="neo"?`filter:${f?`url(#${s}-drop-shadow)`:a}`:"").attr("rx",ee).attr("ry",ee).attr("x",-v.width-4-(t.rotateCommitLabel===!0?30:0)).attr("y",-v.height/2+10).attr("width",v.width+18+N).attr("height",v.height+4+A),M.attr("transform","translate("+(-v.width-14-(t.rotateCommitLabel===!0?30:0)+N/2)+", "+(b-v.height/2-2)+")"),y==="TB"?(T.attr("x",p-v.width/2-10).attr("y",0),M.attr("transform","translate("+(p-v.width/2-5)+", 0)"),f&&(T.attr("transform",`translate(${-N/2-3}, ${-A-10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(-A*2+7)+")"))):y==="BT"?(T.attr("x",p-v.width/2-10).attr("y",I),M.attr("transform","translate("+(p-v.width/2-5)+", "+I+")"),f&&(T.attr("transform",`translate(${-N/2-3}, ${A+10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(I+A*2+4)+")"))):T.attr("transform","translate(-19, "+(b-12-A/2)+")")})},"drawBranches"),gr=h(function(e,r,t,s,o){return C.set(e,{pos:r,index:t}),r+=50+(o?40:0)+(y==="TB"||y==="BT"?s.width/2:0),r},"setBranchPosition"),ur=h(function(e,r,t,s){Je(),w.debug("in gitgraph renderer",e+` +`,"id:",r,t);const o=s.db;if(!o.getConfig){w.error("getConfig method is not available on db");return}const i=o.getConfig(),n=i.rotateCommitLabel??!1;P=o.getCommits();const a=o.getBranchesAsObjArray();y=o.getDirection();const l=me(`[id="${r}"]`),{look:f,theme:g,themeVariables:$}=q(),{useGradient:c,gradientStart:x,gradientStop:u,filterColor:p}=$;if(c){const k=l.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");k.append("stop").attr("offset","0%").attr("stop-color",x).attr("stop-opacity",1),k.append("stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}f==="neo"&&j.has(g??"")&&l.append("defs").append("filter").attr("id",r+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",p);let b=0;a.forEach((k,U)=>{const D=oe(k.name),T=l.append("g"),K=T.insert("g").attr("class","branchLabel"),M=K.insert("g").attr("class","label branch-label");M.node()?.appendChild(D);const v=D.getBBox();b=gr(k.name,b,U,v,n),M.remove(),K.remove(),T.remove()}),re(l,P,!1,i),i.showBranches&&fr(l,a,i,r),$r(l,P),re(l,P,!0,i),pe.insertTitle(l,"gitTitleText",i.titleTopMargin??0,o.getDiagramTitle()),be(void 0,l,i.diagramPadding,i.useMaxWidth)},"draw"),yr={draw:ur},ie=8,de=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),xr=new Set(["redux-color","redux-dark-color"]),mr=new Set(["neo","neo-dark"]),pr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),br=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),wr=h(e=>{const{svgId:r}=e;let t="";if(e.useGradient&&r)for(let s=0;s{const r=J(),{theme:t,themeVariables:s}=r,{borderColorArray:o}=s,i=de.has(t);if(mr.has(t)){let n="";for(let a=0;a`${Array.from({length:e.THEME_COLOR_LIMIT},(r,t)=>t).map(r=>{const t=r%ie;return` + .branch-label${r} { fill: ${e["gitBranchLabel"+t]}; } + .commit${r} { stroke: ${e["git"+t]}; fill: ${e["git"+t]}; } + .commit-highlight${r} { stroke: ${e["gitInv"+t]}; fill: ${e["gitInv"+t]}; } + .label${r} { fill: ${e["git"+t]}; } + .arrow${r} { stroke: ${e["git"+t]}; } + `}).join(` +`)}`,"normalTheme"),Cr=h(e=>{const r=J(),{theme:t}=r,s=br.has(t);return` + .commit-id, + .commit-msg, + .branch-label { + fill: lightgrey; + color: lightgrey; + font-family: 'trebuchet ms', verdana, arial, sans-serif; + font-family: var(--mermaid-font-family); + } + + ${s?kr(e):vr(e)} + + .branch { + stroke-width: ${e.strokeWidth}; + stroke: ${e.commitLineColor??e.lineColor}; + stroke-dasharray: ${s?"4 2":"2"}; + } + .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${s?e.nodeBorder:e.commitLabelColor}; ${s?`font-weight:${e.noteFontWeight};`:""}} + .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${s?"transparent":e.commitLabelBackground}; opacity: ${s?"":.5}; } + .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};} + .tag-label-bkg { fill: ${s?e.mainBkg:e.tagLabelBackground}; stroke: ${s?e.nodeBorder:e.tagLabelBorder}; ${s?`filter:${e.dropShadow}`:""} } + .tag-hole { fill: ${e.textColor}; } + + .commit-merge { + stroke: ${s?e.mainBkg:e.primaryColor}; + fill: ${s?e.mainBkg:e.primaryColor}; + } + .commit-reverse { + stroke: ${s?e.mainBkg:e.primaryColor}; + fill: ${s?e.mainBkg:e.primaryColor}; + stroke-width: ${s?e.strokeWidth:3}; + } + .commit-highlight-outer { + } + .commit-highlight-inner { + stroke: ${s?e.mainBkg:e.primaryColor}; + fill: ${s?e.mainBkg:e.primaryColor}; + } + + .arrow { + /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */ + stroke-width: ${de.has(t)?e.strokeWidth:8}; + stroke-linecap: round; + fill: none + } + .gitTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } +`},"getStyles"),Er=Cr,Or={parser:Ve,db:se,renderer:yr,styles:Er};export{Or as diagram}; diff --git a/apps/kimi-code/dist-web/assets/index-CBhxV_B2.js b/apps/kimi-code/dist-web/assets/index-CBhxV_B2.js new file mode 100644 index 00000000000..6e97a4ba7a2 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/index-CBhxV_B2.js @@ -0,0 +1,1428 @@ +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-DGMnuyIs.js";import{f as Ld}from"./index-DGMnuyIs.js";import{bR as k}from"./index-CiHMlsuo.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 ps(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function ir(e,t){return e==null||t==null?e===t:gs(e.customProperties,t.customProperties)&&e.type===t.type&&e.diffIndicators===t.diffIndicators&&e.disableBackground===t.disableBackground&&e.disableLineNumbers===t.disableLineNumbers&&e.overflow===t.overflow&&e.split===t.split&&e.totalLines===t.totalLines}const _n={};function gs(e=_n,t=_n){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function pn(e){const t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}function rr(){const e=document.createElement("div");return e.slot="gutter-utility-slot",e.style.position="absolute",e.style.top="0",e.style.bottom="0",e.style.textAlign="center",e.style.whiteSpace="normal",e.style.touchAction="none",e}function or(){const e=document.createElement("style");return e.setAttribute(Ri,""),e}var sr=`@layer base { + :host { + --diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono", + "Courier New", monospace; + --diffs-header-font-fallback: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", + "Noto Sans", "Liberation Sans", Arial, sans-serif; + --diffs-mixer: light-dark(#000, #fff); + --diffs-gap-fallback: 8px; + --diffs-scrollbar-gutter-fallback: 6px; + --diffs-scrollbar-gutter: var(--diffs-scrollbar-gutter-override, var(--diffs-scrollbar-gutter-measured, var(--diffs-scrollbar-gutter-fallback))); + --diffs-added-light: #0dbe4e; + --diffs-added-dark: #5ecc71; + --diffs-modified-light: #009fff; + --diffs-modified-dark: #69b1ff; + --diffs-deleted-light: #ff2e3f; + --diffs-deleted-dark: #ff6762; + color-scheme: light dark; + font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback)); + font-size: var(--diffs-font-size, 13px); + line-height: var(--diffs-line-height, 20px); + font-feature-settings: var(--diffs-font-features); + --diffs-bg: light-dark(var(--diffs-light-bg, #fff), var(--diffs-dark-bg, #000)); + --diffs-bg-buffer: var(--diffs-bg-buffer-override, light-dark(color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)))); + --diffs-bg-context: var(--diffs-bg-context-override, light-dark(color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer)))); + --diffs-bg-context-gutter: var(--diffs-bg-context-gutter-override, light-dark(color-mix(in lab, var(--diffs-bg-context) 90%, var(--diffs-bg)), color-mix(in lab, var(--diffs-bg-context) 45%, var(--diffs-bg)))); + --diffs-bg-separator: var(--diffs-bg-separator-override, light-dark(color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer)))); + --diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff)); + --diffs-fg-number: var(--diffs-fg-number-override, light-dark(color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)))); + --diffs-fg-conflict-marker: var(--diffs-fg-conflict-marker-override, var(--diffs-fg-number)); + --diffs-deletion-base: var(--diffs-deletion-color-override, light-dark(var(--diffs-light-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-light))), var(--diffs-dark-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-dark))))); + --diffs-addition-base: var(--diffs-addition-color-override, light-dark(var(--diffs-light-addition-color, var(--diffs-addition-color, var(--diffs-added-light))), var(--diffs-dark-addition-color, var(--diffs-addition-color, var(--diffs-added-dark))))); + --diffs-modified-base: var(--diffs-modified-color-override, light-dark(var(--diffs-light-modified-color, var(--diffs-modified-color, var(--diffs-modified-light))), var(--diffs-dark-modified-color, var(--diffs-modified-color, var(--diffs-modified-dark))))); + --diffs-bg-deletion: var(--diffs-bg-deletion-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base)))); + --diffs-bg-deletion-emphasis: var(--diffs-bg-deletion-emphasis-override, light-dark(rgb(from var(--diffs-deletion-base) r g b / .15), rgb(from var(--diffs-deletion-base) r g b / .2))); + --diffs-bg-addition: var(--diffs-bg-addition-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base)))); + --diffs-bg-addition-emphasis: var(--diffs-bg-addition-emphasis-override, light-dark(rgb(from var(--diffs-addition-base) r g b / .15), rgb(from var(--diffs-addition-base) r g b / .2))); + --diffs-selection-base: var(--diffs-modified-base); + --diffs-selection-number-fg: light-dark(color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer))); + background-color: var(--diffs-bg); + color: var(--diffs-fg); + display: block; + } + + pre, code, [data-error-wrapper] { + isolation: isolate; + font-family: var(--diffs-font-family, var(--diffs-font-fallback)); + outline: none; + margin: 0; + padding: 0; + display: block; + } + + pre, code { + background-color: var(--diffs-bg); + } + + code { + contain: content; + } + + *, :before, :after { + box-sizing: border-box; + } + + [data-icon-sprite] { + display: none; + } + + [data-diffs-header], [data-separator] { + font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback)); + } + + [data-diffs-header][data-sticky] { + z-index: 1; + background-color: var(--diffs-bg); + position: sticky; + top: 0; + } + + [data-file-info] { + color: var(--fg); + background-color: color-mix(in lab, var(--bg) 98%, var(--fg)); + border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg)); + padding: 10px; + font-weight: 700; + } + + [data-diff], [data-file] { + --diffs-grid-number-column-width: minmax(min-content, max-content); + --diffs-code-grid: var(--diffs-grid-number-column-width) 1fr; + + &[data-dehydrated] { + --diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr); + } + + &:hover [data-code]::-webkit-scrollbar-thumb { + background-color: var(--diffs-bg-context); + } + } + + @supports (-webkit-touch-callout: none) { + :host { + --diffs-scrollbar-gutter-fallback: 0px; + } + } + + [data-line] span { + color: light-dark(var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark))); + background-color: light-dark(var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit)); + font-weight: light-dark(var(--diffs-token-light-font-weight, inherit), var(--diffs-token-dark-font-weight, inherit)); + font-style: light-dark(var(--diffs-token-light-font-style, inherit), var(--diffs-token-dark-font-style, inherit)); + text-decoration: light-dark(var(--diffs-token-light-text-decoration, inherit), var(--diffs-token-dark-text-decoration, inherit)); + } + + [data-line], [data-gutter-buffer], [data-column-number], [data-line-annotation], [data-no-newline], [data-merge-conflict], [data-merge-conflict-actions] { + --diffs-computed-decoration-bg: var(--diffs-bg); + --diffs-computed-diff-line-bg: var(--diffs-bg); + --diffs-computed-selected-line-bg: var(--diffs-bg); + color: var(--diffs-fg); + background-color: var(--diffs-line-bg, var(--diffs-bg)); + + @media (pointer: fine) { + &:where([data-hovered]) { + --diffs-computed-hovered-line-bg: light-dark(color-mix(in lab, + var(--diffs-computed-selected-line-bg) 97%, + var(--diffs-bg-hover-override, var(--diffs-mixer))), color-mix(in lab, + var(--diffs-computed-selected-line-bg) 91%, + var(--diffs-bg-hover-override, var(--diffs-mixer)))); + --diffs-line-bg: var(--diffs-computed-hovered-line-bg, inherit); + } + } + } + + [data-line], [data-no-newline] { + &[data-decoration-bg] { + --mix-deco-light: 92%; + --mix-deco-dark: 85%; + + &[data-decoration-bg-depth="2"] { + --mix-deco-light: 88%; + --mix-deco-dark: 80%; + } + + &[data-decoration-bg-depth="3"] { + --mix-deco-light: 85%; + --mix-deco-dark: 78%; + } + + @media (pointer: fine) { + &[data-hovered]:not([data-selected-line]) { + --mix-deco-light: 85%; + --mix-deco-dark: 85%; + } + + &[data-hovered]:not([data-selected-line])[data-decoration-bg-depth="2"] { + --mix-deco-light: 83%; + --mix-deco-dark: 83%; + } + + &[data-hovered]:not([data-selected-line])[data-decoration-bg-depth="3"] { + --mix-deco-light: 81%; + --mix-deco-dark: 81%; + } + } + + --diffs-computed-decoration-bg: light-dark(color-mix(in lab, + var(--diffs-bg) var(--mix-deco-light), + var(--diffs-decoration-bg)), color-mix(in lab, + var(--diffs-bg) var(--mix-deco-dark), + var(--diffs-decoration-bg))); + --diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg); + --diffs-computed-selected-line-bg: var(--diffs-computed-decoration-bg); + --diffs-line-bg: var(--diffs-computed-decoration-bg); + } + } + + [data-line-annotation], [data-gutter-buffer="annotation"] { + --diffs-annotation-bg: var(--diffs-bg-context); + --diffs-computed-decoration-bg: var(--diffs-annotation-bg); + --diffs-computed-diff-line-bg: var(--diffs-annotation-bg); + --diffs-computed-selected-line-bg: var(--diffs-annotation-bg); + --diffs-line-bg: var(--diffs-annotation-bg); + } + + [data-merge-conflict-actions], [data-gutter-buffer="merge-conflict-action"], [data-gutter-buffer="merge-conflict-marker-base"], [data-gutter-buffer="merge-conflict-marker-separator"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"] { + --diffs-computed-decoration-bg: var(--diffs-bg-context); + --diffs-computed-diff-line-bg: var(--diffs-bg-context); + --diffs-computed-selected-line-bg: var(--diffs-bg-context); + --diffs-line-bg: var(--diffs-bg-context); + } + + [data-gutter-buffer="merge-conflict-marker-start"], [data-merge-conflict="marker-start"] { + --diffs-computed-decoration-bg: light-dark(color-mix(in lab, + var(--diffs-bg) 78%, + var(--conflict-bg-current-header-override, var(--diffs-addition-base))), color-mix(in lab, + var(--diffs-bg) 68%, + var(--conflict-bg-current-header-override, var(--diffs-addition-base)))); + --diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg); + --diffs-computed-selected-line-bg: var(--diffs-computed-decoration-bg); + --diffs-line-bg: var(--diffs-computed-decoration-bg); + } + + [data-gutter-buffer="merge-conflict-marker-end"], [data-merge-conflict="marker-end"] { + --diffs-computed-decoration-bg: light-dark(color-mix(in lab, + var(--diffs-bg) 78%, + var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))), color-mix(in lab, + var(--diffs-bg) 68%, + var(--conflict-bg-incoming-header-override, var(--diffs-modified-base)))); + --diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg); + --diffs-computed-selected-line-bg: var(--diffs-computed-decoration-bg); + --diffs-line-bg: var(--diffs-computed-decoration-bg); + } + + [data-has-merge-conflict] [data-line-annotation], [data-has-merge-conflict] [data-gutter-buffer="annotation"] { + --diffs-computed-decoration-bg: var(--diffs-bg); + --diffs-computed-diff-line-bg: var(--diffs-bg); + --diffs-computed-selected-line-bg: var(--diffs-bg); + --diffs-line-bg: var(--diffs-bg); + } + + :where([data-background]) { + & [data-gutter-buffer], & [data-column-number] { + --mix-light: 91%; + --mix-dark: 85%; + } + + & [data-line], & [data-no-newline] { + --mix-light: 88%; + --mix-dark: 80%; + } + + & [data-gutter-buffer], & [data-column-number], & [data-line], & [data-no-newline] { + --diffs-diff-line-mix-target: var(--diffs-bg); + + &[data-line-type="change-deletion"] { + --diffs-diff-line-mix-target: var(--diffs-bg-deletion-override, var(--diffs-deletion-base)); + + @media (pointer: fine) { + &[data-hovered] { + --mix-light: 80%; + --mix-dark: 75%; + } + } + + &:where([data-gutter-buffer], [data-column-number]) { + color: var(--diffs-fg-number-deletion-override, var(--diffs-deletion-base)); + --diffs-diff-line-mix-target: var(--diffs-bg-deletion-number-override, var(--diffs-deletion-base)); + } + + --diffs-computed-diff-line-bg: light-dark(color-mix(in lab, + var(--diffs-computed-decoration-bg) var(--mix-light), + var(--diffs-diff-line-mix-target)), color-mix(in lab, + var(--diffs-computed-decoration-bg) var(--mix-dark), + var(--diffs-diff-line-mix-target))); + --diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg); + --diffs-line-bg: var(--diffs-computed-diff-line-bg, inherit); + } + + &[data-line-type="change-addition"] { + --diffs-diff-line-mix-target: var(--diffs-bg-addition-override, var(--diffs-addition-base)); + + @media (pointer: fine) { + &[data-hovered] { + --mix-light: 80%; + --mix-dark: 70%; + } + } + + &:where([data-gutter-buffer], [data-column-number]) { + color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base)); + --diffs-diff-line-mix-target: var(--diffs-bg-addition-number-override, var(--diffs-addition-base)); + } + + --diffs-computed-diff-line-bg: light-dark(color-mix(in lab, + var(--diffs-computed-decoration-bg) var(--mix-light), + var(--diffs-diff-line-mix-target)), color-mix(in lab, + var(--diffs-computed-decoration-bg) var(--mix-dark), + var(--diffs-diff-line-mix-target))); + --diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg); + --diffs-line-bg: var(--diffs-computed-diff-line-bg, inherit); + } + + &[data-merge-conflict="current"] { + --diffs-diff-line-mix-target: var(--conflict-bg-current-override, var(--diffs-addition-base)); + + &:where([data-gutter-buffer], [data-column-number]) { + color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base)); + --diffs-diff-line-mix-target: var(--conflict-bg-current-number-override, var(--diffs-addition-base)); + } + + @media (pointer: fine) { + &[data-hovered] { + --mix-light: 80%; + --mix-dark: 70%; + } + } + + --diffs-computed-diff-line-bg: light-dark(color-mix(in lab, + var(--diffs-computed-decoration-bg) var(--mix-light), + var(--diffs-diff-line-mix-target)), color-mix(in lab, + var(--diffs-computed-decoration-bg) var(--mix-dark), + var(--diffs-diff-line-mix-target))); + --diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg); + --diffs-line-bg: var(--diffs-computed-diff-line-bg, inherit); + } + + &[data-merge-conflict="incoming"] { + --diffs-diff-line-mix-target: var(--conflict-bg-incoming-override, var(--diffs-modified-base)); + + &:where([data-gutter-buffer], [data-column-number]) { + color: var(--diffs-modified-base); + --diffs-diff-line-mix-target: var(--conflict-bg-incoming-number-override, var(--diffs-modified-base)); + } + + @media (pointer: fine) { + &[data-hovered] { + --mix-light: 80%; + --mix-dark: 70%; + } + } + + --diffs-computed-diff-line-bg: light-dark(color-mix(in lab, + var(--diffs-computed-decoration-bg) var(--mix-light), + var(--diffs-diff-line-mix-target)), color-mix(in lab, + var(--diffs-computed-decoration-bg) var(--mix-dark), + var(--diffs-diff-line-mix-target))); + --diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg); + --diffs-line-bg: var(--diffs-computed-diff-line-bg, inherit); + } + } + } + + [data-gutter-buffer], [data-column-number], [data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline] { + --diffs-selection-mix-target: var(--diffs-bg-selection-override, var(--diffs-selection-base)); + + &:where([data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline])[data-selected-line] { + --mix-selection-light: 82%; + --mix-selection-dark: 75%; + + @media (pointer: fine) { + &[data-hovered]:not([data-merge-conflict], [data-line-type="change-addition"], [data-line-type="change-deletion"]) { + --mix-selection-light: 75%; + --mix-selection-dark: 70%; + } + } + } + + &:where([data-gutter-buffer], [data-column-number])[data-selected-line] { + --mix-selection-light: 75%; + --mix-selection-dark: 60%; + --diffs-selection-mix-target: var(--diffs-bg-selection-number-override, var(--diffs-selection-base)); + + @media (pointer: fine) { + &[data-hovered]:not([data-merge-conflict], [data-line-type="change-addition"], [data-line-type="change-deletion"]) { + --mix-selection-light: 70%; + --mix-selection-dark: 55%; + } + } + } + + &[data-selected-line] { + --diffs-computed-selected-line-bg: light-dark(color-mix(in lab, + var(--diffs-computed-diff-line-bg) var(--mix-selection-light), + var(--diffs-selection-mix-target)), color-mix(in lab, + var(--diffs-computed-diff-line-bg) var(--mix-selection-dark), + var(--diffs-selection-mix-target))); + --diffs-line-bg: var(--diffs-computed-selected-line-bg, inherit); + } + } + + [data-gutter-buffer], [data-column-number] { + &[data-selected-line] { + color: var(--diffs-selection-number-fg); + } + } + + [data-no-newline] { + user-select: none; + + & span { + opacity: .6; + } + } + + [data-diff-type="split"][data-overflow="scroll"] { + grid-template-columns: 1fr 1fr; + display: grid; + + & [data-additions] { + border-left: 1px solid var(--diffs-bg); + } + + & [data-deletions] { + border-right: 1px solid var(--diffs-bg); + } + } + + [data-code] { + grid-auto-flow: dense; + grid-template-columns: var(--diffs-code-grid); + overflow: var(--diffs-overflow-override, scroll) clip; + overscroll-behavior-x: none; + tab-size: var(--diffs-tab-size, 2); + padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback)); + padding-bottom: max(0px, + calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) - + var(--diffs-scrollbar-gutter))); + scrollbar-gutter: stable; + align-self: flex-start; + display: grid; + } + + [data-diffs-scrollbar-measure] { + opacity: 0; + pointer-events: none; + scrollbar-gutter: auto; + grid-template-columns: none; + width: 100px; + height: 100px; + padding: 0; + position: absolute; + top: -200px; + left: -200px; + } + + [data-container-size] { + container-type: inline-size; + } + + [data-code]::-webkit-scrollbar { + width: 0; + height: var(--diffs-scrollbar-gutter); + } + + [data-code]::-webkit-scrollbar-track { + background: none; + } + + [data-code]::-webkit-scrollbar-thumb { + background-color: #0000; + background-clip: content-box; + border: 1px solid #0000; + border-radius: 3px; + } + + [data-code]::-webkit-scrollbar-corner { + background-color: #0000; + } + + @supports ((-moz-appearance: none)) { + [data-code] { + scrollbar-width: thin; + scrollbar-color: var(--diffs-bg-context) transparent; + padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback)); + } + } + + [data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] { + & [data-code], &[data-overflow="wrap"] { + padding-top: 0; + } + } + + [data-gutter] { + grid-template-rows: subgrid; + grid-template-columns: subgrid; + z-index: 3; + background-color: var(--diffs-bg); + grid-column: 1; + display: grid; + position: relative; + + & [data-gutter-buffer], & [data-column-number] { + border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg)); + } + } + + [data-content] { + grid-template-rows: subgrid; + grid-template-columns: subgrid; + background-color: var(--diffs-bg); + grid-column: 2; + min-width: 0; + display: grid; + } + + [data-diff-type="split"][data-overflow="wrap"] { + grid-auto-flow: dense; + grid-template-columns: repeat(2, var(--diffs-code-grid)); + padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback)); + display: grid; + + & [data-deletions] { + display: contents; + + & [data-gutter] { + grid-column: 1; + } + + & [data-content] { + border-right: 1px solid var(--diffs-bg); + grid-column: 2; + } + } + + & [data-additions] { + display: contents; + + & [data-gutter] { + border-left: 1px solid var(--diffs-bg); + grid-column: 3; + } + + & [data-content] { + grid-column: 4; + } + } + } + + [data-overflow="scroll"] [data-gutter] { + position: sticky; + left: 0; + } + + [data-interactive-lines] [data-line] { + cursor: pointer; + } + + [data-interactive-line-numbers] [data-column-number] { + cursor: pointer; + touch-action: none; + } + + [data-content-buffer], [data-gutter-buffer] { + user-select: none; + min-height: 1lh; + position: relative; + } + + [data-gutter-buffer] { + padding-left: 2ch; + padding-right: 1ch; + + &:before { + content: ""; + min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch)); + display: block; + } + } + + [data-gutter-buffer="annotation"] { + --diffs-annotation-bg: var(--diffs-bg-context-gutter); + min-height: 0; + } + + [data-gutter-buffer="buffer"] { + --diffs-line-bg: var(--diffs-bg-context-gutter); + } + + [data-content-buffer] { + background-position: 5px 0; + background-size: 8px 8px; + background-origin: border-box; + background-image: repeating-linear-gradient(-45deg, + transparent, + transparent calc(3px * 1.414), + var(--diffs-bg-buffer) calc(3px * 1.414), + var(--diffs-bg-buffer) calc(4px * 1.414)); + grid-column: 1; + } + + [data-separator] { + box-sizing: content-box; + background-color: var(--diffs-bg); + } + + [data-separator="simple"] { + min-height: 4px; + } + + [data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"], [data-separator="simple"] { + background-color: var(--diffs-bg-separator); + } + + [data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"] { + height: 32px; + position: relative; + } + + [data-separator-wrapper] { + user-select: none; + fill: currentColor; + background-color: var(--diffs-bg); + align-items: center; + height: 100%; + display: flex; + position: absolute; + inset-inline: 0; + } + + [data-content] [data-separator-wrapper] { + display: none; + } + + [data-separator="metadata"] [data-separator-wrapper] { + background-color: var(--diffs-bg-separator); + height: 100%; + color: var(--diffs-fg-number); + white-space: nowrap; + text-overflow: ellipsis; + min-width: min-content; + padding-inline: 1ch; + inset-inline: 100% auto; + overflow: hidden; + } + + [data-separator="line-info"] { + margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback)); + + & [data-separator-wrapper] { + min-width: 16px; + } + } + + [data-separator="line-info-basic"], [data-separator="metadata"] { + margin-block: 0; + } + + [data-separator="line-info"][data-separator-first] { + margin-top: 0; + } + + [data-separator="line-info"][data-separator-last] { + margin-bottom: 0; + } + + [data-expand-index] [data-separator-wrapper] { + grid-template-columns: 32px auto; + display: grid; + } + + [data-expand-index] [data-separator-wrapper][data-separator-multi-button] { + grid-template-columns: 32px 32px auto; + } + + [data-expand-button], [data-separator-content] { + background-color: var(--diffs-bg-separator); + flex: none; + align-items: center; + display: flex; + } + + [data-expand-index] [data-separator-content]:hover { + cursor: pointer; + text-decoration: underline; + } + + [data-expand-button] { + cursor: pointer; + min-width: 32px; + color: var(--diffs-fg-number); + border-right: 2px solid var(--diffs-bg); + flex-shrink: 0; + justify-content: center; + align-self: stretch; + + &:hover { + color: var(--diffs-fg); + } + + &[data-expand-all-button] { + display: none; + } + } + + [data-expand-down] [data-icon] { + transform: scaleY(-1); + } + + [data-separator-content] { + height: 100%; + color: var(--diffs-fg-number); + flex: auto; + justify-content: flex-start; + padding: 0 1ch; + overflow: hidden; + } + + [data-separator="line-info"], [data-separator="line-info-basic"] { + & [data-separator-content] { + user-select: none; + height: 100%; + overflow: clip; + } + } + + [data-unmodified-lines] { + text-overflow: ellipsis; + white-space: nowrap; + flex: 0 auto; + min-width: 0; + display: block; + overflow: hidden; + } + + @supports (width: 1cqi) { + [data-unified] { + & [data-separator="line-info"] [data-separator-wrapper] { + padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback)); + width: 100cqi; + + & [data-separator-content] { + border-radius: 6px; + } + } + + & [data-separator="line-info"][data-expand-index] [data-separator-wrapper] [data-separator-content] { + border-top-left-radius: unset; + border-bottom-left-radius: unset; + } + } + + [data-gutter] { + & [data-separator="line-info"] [data-separator-wrapper] { + padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback)); + } + + & [data-separator="line-info"] [data-separator-content] { + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; + } + + & [data-separator="line-info"][data-expand-index] [data-separator-content] { + border-top-left-radius: unset; + border-bottom-left-radius: unset; + } + } + + [data-additions] { + & [data-content] [data-separator="line-info"] { + background-color: var(--diffs-bg); + + & [data-separator-wrapper] { + display: none; + } + } + + & [data-gutter] [data-separator="line-info"] [data-separator-wrapper] { + background-color: var(--diffs-bg-separator); + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; + height: 100%; + display: block; + + & [data-separator-content], & [data-expand-button] { + display: none; + } + } + } + + [data-overflow="scroll"] [data-additions] [data-gutter] [data-separator="line-info"] [data-separator-wrapper] { + width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback))); + } + + [data-overflow="wrap"] [data-additions] [data-content] [data-separator="line-info"] [data-separator-wrapper] { + background-color: var(--diffs-bg-separator); + height: 100%; + margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback)); + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; + display: block; + + & [data-separator-content], & [data-expand-button] { + display: none; + } + } + + [data-separator="line-info"] [data-separator-wrapper] { + & [data-expand-both], & [data-expand-down], & [data-expand-up] { + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; + } + } + + @media (pointer: fine) { + [data-separator="line-info"] [data-separator-wrapper] { + &[data-separator-multi-button] { + & [data-expand-up] { + border-top-left-radius: 6px; + border-bottom-left-radius: unset; + } + + & [data-expand-down] { + border-bottom-left-radius: 6px; + border-top-left-radius: unset; + } + } + } + } + } + + @media (pointer: coarse) { + [data-separator="line-info-basic"] [data-separator-wrapper][data-separator-multi-button] { + grid-template-columns: 34px 34px auto; + + & [data-separator-content] { + grid-column: unset; + grid-row: unset; + } + } + + @supports (width: 1cqi) { + [data-separator="line-info"] [data-separator-wrapper] { + & [data-expand-both], & [data-expand-down], & [data-expand-up] { + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; + } + + &[data-separator-multi-button] { + & [data-expand-up] { + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; + } + + & [data-expand-down] { + border-bottom-left-radius: unset; + border-top-left-radius: unset; + } + } + } + } + } + + @media (pointer: fine) { + [data-separator-wrapper][data-separator-multi-button] { + grid-template-rows: 50% 50%; + display: grid; + + & [data-separator-content] { + grid-area: 1 / 2 / -1; + min-width: min-content; + } + + & [data-expand-button] { + grid-column: 1; + } + } + + [data-separator="line-info"] [data-separator-wrapper], [data-separator="line-info"] [data-separator-wrapper][data-separator-multi-button] { + grid-template-columns: 34px auto; + } + + [data-separator="line-info-basic"][data-expand-index] [data-separator-wrapper] { + grid-template-columns: 100% auto; + } + + [data-separator="line-info"], [data-separator="line-info-basic"] { + & [data-separator-multi-button] { + & [data-expand-up] { + border-bottom: 1px solid var(--diffs-bg); + border-right: 2px solid var(--diffs-bg); + } + + & [data-expand-down] { + border-top: 1px solid var(--diffs-bg); + border-right: 2px solid var(--diffs-bg); + } + } + } + } + + [data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator="line-info-basic"] [data-separator-wrapper], [data-content] [data-separator-wrapper] { + display: none; + } + + [data-line-annotation] { + min-height: var(--diffs-annotation-min-height, 0); + z-index: 2; + } + + [data-merge-conflict-actions] { + z-index: 2; + } + + [data-separator="custom"] { + grid-template-columns: subgrid; + display: grid; + } + + [data-line], [data-column-number], [data-no-newline] { + padding-inline: 1ch; + position: relative; + } + + [data-indicators="classic"] [data-line] { + padding-inline-start: 2ch; + } + + [data-indicators="classic"] { + & [data-line-type="change-addition"], & [data-line-type="change-deletion"] { + &[data-no-newline], &[data-line] { + &:before { + user-select: none; + width: 1ch; + height: 1lh; + display: inline-block; + position: absolute; + top: 0; + left: 0; + } + } + } + + & [data-line-type="change-addition"] { + &[data-line], &[data-no-newline] { + &:before { + content: "+"; + color: var(--diffs-addition-base); + } + } + } + + & [data-line-type="change-deletion"] { + &[data-line], &[data-no-newline] { + &:before { + content: "-"; + color: var(--diffs-deletion-base); + } + } + } + } + + [data-indicators="bars"] { + & [data-line-type="change-deletion"], & [data-line-type="change-addition"] { + &[data-column-number] { + &:before { + content: ""; + user-select: none; + contain: strict; + width: 4px; + height: 100%; + display: block; + position: absolute; + top: 0; + left: 0; + } + } + } + + & [data-line-type="change-deletion"] { + &[data-column-number] { + &:before { + background-image: linear-gradient(0deg, + var(--diffs-bg-deletion) 50%, + var(--diffs-deletion-base) 50%); + background-repeat: repeat; + background-size: 2px 2px; + background-size: calc(1lh / round(1lh / 2px)) + calc(1lh / round(1lh / 2px)); + } + } + } + + & [data-line-type="change-addition"] { + &[data-column-number] { + &:before { + background-color: var(--diffs-addition-base); + } + } + } + } + + [data-overflow="wrap"] { + & [data-line], & [data-annotation-content] { + white-space: pre-wrap; + word-break: break-word; + } + } + + [data-overflow="scroll"] [data-line] { + white-space: pre; + min-height: 1lh; + } + + [data-column-number] { + box-sizing: content-box; + text-align: right; + user-select: none; + color: var(--diffs-fg-number); + padding-left: 2ch; + } + + [data-line-number-content] { + min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch)); + z-index: 1; + display: inline-block; + position: relative; + } + + [data-disable-line-numbers] { + & [data-gutter-buffer], & [data-column-number] { + min-width: 4px; + padding: 0; + + &:before { + min-width: 0; + } + } + + & [data-line-number-content] { + display: none; + } + + & [data-gutter-utility-slot] { + right: unset; + justify-content: flex-start; + left: 0; + } + + &[data-indicators="bars"] [data-gutter-utility-slot] { + left: 6px; + } + } + + [data-file][data-disable-line-numbers] { + & [data-gutter-buffer], & [data-column-number] { + border-right: 0; + min-width: 0; + } + } + + [data-diff-span] { + box-decoration-break: clone; + border-radius: 3px; + } + + [data-line-type="change-addition"] [data-diff-span] { + background-color: var(--diffs-bg-addition-emphasis); + } + + [data-line-type="change-deletion"] [data-diff-span] { + background-color: var(--diffs-bg-deletion-emphasis); + } + + [data-merge-conflict="marker-start"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"], [data-merge-conflict="marker-end"] { + color: var(--diffs-fg); + padding-left: 1ch; + } + + [data-merge-conflict="marker-start"], [data-merge-conflict="marker-end"] { + align-items: center; + display: flex; + + &:after { + color: var(--diffs-fg-conflict-marker); + font-size: .75rem; + font-style: normal; + line-height: 1.25rem; + font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback)); + padding-left: 1ch; + } + } + + [data-merge-conflict="marker-start"]:after { + content: "(Current Change)"; + } + + [data-merge-conflict="marker-end"]:after { + content: "(Incoming Change)"; + } + + [data-merge-conflict-actions-content] { + min-height: 1.75rem; + font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback)); + color: var(--diffs-fg); + align-items: center; + gap: .25rem; + padding-inline: .5rem; + font-size: .75rem; + line-height: 1.2; + display: flex; + } + + [data-merge-conflict-action] { + appearance: none; + color: var(--diffs-fg-number); + font: inherit; + cursor: pointer; + background: none; + border: 0; + padding: 0; + font-style: normal; + } + + [data-merge-conflict-action]:hover { + color: var(--diffs-fg); + } + + [data-merge-conflict-action="current"]:hover { + color: var(--diffs-addition-base); + } + + [data-merge-conflict-action="incoming"]:hover { + color: var(--diffs-modified-base); + } + + [data-merge-conflict-action-separator] { + color: var(--diffs-fg-number); + opacity: .6; + user-select: none; + } + + [data-diffs-header="default"] { + background-color: var(--diffs-bg); + justify-content: space-between; + align-items: center; + gap: var(--diffs-gap-inline, var(--diffs-gap-fallback)); + min-height: calc(1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3)); + z-index: 2; + flex-direction: row; + padding-inline: 16px; + display: flex; + position: relative; + top: 0; + } + + [data-header-content] { + align-items: center; + gap: var(--diffs-gap-inline, var(--diffs-gap-fallback)); + white-space: nowrap; + flex-direction: row; + min-width: 0; + display: flex; + } + + [data-header-content] [data-prev-name], [data-header-content] [data-title] { + text-overflow: ellipsis; + white-space: nowrap; + direction: rtl; + min-width: 0; + overflow: hidden; + } + + [data-prev-name] { + opacity: .7; + } + + [data-rename-icon] { + fill: currentColor; + flex-grow: 0; + flex-shrink: 0; + } + + [data-diffs-header="default"] [data-metadata] { + white-space: nowrap; + align-items: center; + gap: 1ch; + display: flex; + } + + [data-diffs-header="default"] [data-additions-count] { + font-family: var(--diffs-font-family, var(--diffs-font-fallback)); + color: var(--diffs-addition-base); + } + + [data-diffs-header="default"] [data-deletions-count] { + font-family: var(--diffs-font-family, var(--diffs-font-fallback)); + color: var(--diffs-deletion-base); + } + + [data-change-icon] { + fill: currentColor; + flex-shrink: 0; + } + + [data-change-icon="change"], [data-change-icon="rename-pure"], [data-change-icon="rename-changed"] { + color: var(--diffs-modified-base); + } + + [data-change-icon="new"] { + color: var(--diffs-addition-base); + } + + [data-change-icon="deleted"] { + color: var(--diffs-deletion-base); + } + + [data-change-icon="file"] { + opacity: .6; + } + + [data-annotation-content] { + z-index: 2; + isolation: isolate; + align-self: flex-start; + min-width: 0; + display: flow-root; + position: relative; + } + + [data-overflow="scroll"] [data-annotation-content], [data-overflow="scroll"] [data-merge-conflict-actions-content] { + width: var(--diffs-column-content-width, auto); + left: var(--diffs-column-number-width, 0); + position: sticky; + } + + [data-annotation-slot] { + text-wrap-mode: wrap; + word-break: normal; + white-space-collapse: collapse; + } + + [data-gutter-utility-slot] { + touch-action: none; + justify-content: flex-end; + display: flex; + position: absolute; + top: 0; + bottom: 0; + right: 0; + } + + [data-utility-button] { + appearance: none; + cursor: pointer; + width: 1lh; + height: 1lh; + font-size: var(--diffs-font-size, 13px); + line-height: var(--diffs-line-height, 20px); + background-color: var(--diffs-modified-base); + color: var(--diffs-bg); + fill: currentColor; + z-index: 4; + touch-action: none; + border: none; + border-radius: 4px; + justify-content: center; + align-items: center; + margin-right: calc(-1lh + 1ch); + padding: 0; + display: flex; + position: relative; + + &:before { + content: ""; + display: block; + position: absolute; + inset: 0 0 0 -4px; + } + } + + [data-decoration-bar-stack] { + pointer-events: none; + isolation: isolate; + z-index: 1; + background-color: var(--diffs-decoration-bar-color, transparent); + box-sizing: content-box; + border-left: 2px solid var(--diffs-bg); + border-right: 2px solid var(--diffs-bg); + width: 6px; + position: absolute; + top: 0; + bottom: 0; + right: -2px; + + [data-decoration-bar-depth="1"] & { + background-color: color-mix(in lab, + var(--diffs-bg) 20%, + var(--diffs-decoration-bar-color, transparent)); + } + + [data-decoration-bar-depth="2"] & { + background-color: color-mix(in lab, + var(--diffs-bg) 45%, + var(--diffs-decoration-bar-color, transparent)); + } + + [data-decoration-bar-depth="3"] & { + background-color: color-mix(in lab, + var(--diffs-bg) 65%, + var(--diffs-decoration-bar-color, transparent)); + } + + [data-decoration-bar-start] & { + border-top-left-radius: 5px; + border-top-right-radius: 5px; + } + + [data-decoration-bar-end] & { + z-index: 3; + border-bottom-right-radius: 5px; + border-bottom-left-radius: 5px; + } + } + + [data-placeholder] { + contain: strict; + } + + [data-error-wrapper] { + padding: var(--diffs-gap-block, var(--diffs-gap-fallback)) + var(--diffs-gap-inline, var(--diffs-gap-fallback)); + scrollbar-width: none; + max-height: 400px; + overflow: auto; + + & [data-error-message] { + color: var(--diffs-deletion-base); + font-size: 18px; + font-weight: bold; + } + + & [data-error-stack] { + color: var(--diffs-fg-number); + } + } +} + +@layer theme, rendered, unsafe; +`;let nt;function Me(e){if(nt!=null)return nt;const t=e.host;if(typeof HTMLElement<"u"&&t instanceof HTMLElement&&!t.isConnected)return;const n=document.createElement("div");n.setAttribute("data-code",""),n.setAttribute(Jr,"true");const i=document.createElement("div");return i.style.position="relative",i.style.width="200%",i.style.height="200%",n.appendChild(i),e.appendChild(n),nt=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),nt}function ar(e){return`${Ai}: ${e==null?"var(--diffs-scrollbar-gutter-fallback)":`${e}px`};`}const gn="@layer base, theme, rendered, unsafe;",ms=new RegExp(`${bs(Ai)}\\s*:\\s*[^;]+;`);function vs(e){return`${gn} +${sr} +@layer theme { + ${e} +}`}function mn(e){return`${gn} +@layer unsafe { + ${e} +}`}function vn(e,t="system",n){return`${gn} +@layer rendered { + :host {${t==="system"?"":` + color-scheme: ${t};`} + ${ar(n)} + ${e} + } +}`}function lr(e,t){const n=ar(t);return e.replace(ms,n)}function bs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function je({code:e,pre:t,columnType:n,rowSpan:i,containerSize:r=!1}={}){return e==null&&(e=document.createElement("code"),e.setAttribute("data-code",""),n!=null&&e.setAttribute(`data-${n}`,""),t?.appendChild(e)),i!=null?e.style.setProperty("grid-row",`span ${i}`):e.style.removeProperty("grid-row"),r?e.setAttribute("data-container-size",""):e.removeAttribute("data-container-size"),e}function dr(e,t){if(t==null)return;const n=e.shadowRoot??e.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=t)}function bn(e,{type:t,diffIndicators:n,disableBackground:i,disableLineNumbers:r,overflow:o,split:s,totalLines:l,customProperties:a}){if(a!=null)for(const d in a){const h=a[d];h!=null&&e.setAttribute(d,`${h}`)}switch(t==="diff"?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),n){case"bars":case"classic":e.setAttribute("data-indicators",n);break;case"none":e.removeAttribute("data-indicators");break}return r?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),i?e.removeAttribute("data-background"):e.setAttribute("data-background",""),t==="diff"?e.setAttribute("data-diff-type",s?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",o),e.style.setProperty("--diffs-min-number-column-width-default",`${`${l}`.length}ch`),e}function Xe(e){if(typeof HTMLStyleElement<"u"&&e instanceof HTMLStyleElement)return!0;const t=e.tagName??e.nodeName;return typeof t=="string"&&t.toLowerCase()==="style"}function On(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,themeType:e?.themeType,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:e?.useTokenTransformer,tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function Cn({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===""){t?.remove();return}return t??=Cs(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function Cs(){const e=document.createElement("style");return e.setAttribute(Ii,""),e}if(typeof HTMLElement<"u"&&customElements.get("diffs-container")==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;const i=this.attachShadow({mode:"open"});e==null&&(e=new CSSStyleSheet,e.replaceSync(sr)),i.adoptedStyleSheets=[e]}connectedCallback(){Me(this.shadowRoot??this.attachShadow({mode:"open"}))}}customElements.define(Ei,t)}const Ss=[];let ys=-1;var xs=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file:${++ys}`;type="file";fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;cachedHeaderHTML;appliedPreAttributes;lastRowCount;mounted=!1;headerElement;headerCustom;headerPrefix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;file;renderRange;enabled=!0;constructor(e={theme:_},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.fileRenderer=new fs(e,this.handleHighlightRender,this.workerManager),this.resizeManager=new _i,this.interactionManager=new Pi("file",Ke(e)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){!this.enabled||this.file==null||this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.fileRenderer.clearRenderCache(),this.rerender()}setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Ke(this.options))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??"system")!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme=="string"||this.fileContainer==null||this.appliedThemeCSS==null)return!1;const t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType===t?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!De(this.appliedThemeCSS.theme,this.options.theme??_)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}const{overflow:e="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,e==="wrap"),this.managersDirty=!1}cleanUp(e=!1){this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.annotationCache.clear(),this.pre=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.placeHolder=void 0,this.unsafeCSSStyle=void 0,e?this.fileRenderer.recycle():(this.fileRenderer.cleanUp(),this.workerManager=void 0,this.file=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){const{fileContainer:t,prerenderedHTML:n,preventEmit:i=!1,file:r,lineAnnotations:o}=e;this.hydrateElements(t,n),Ls(this.pre,r,this.options.collapsed)||ks(this.headerElement,r,this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({file:r,lineAnnotations:o}),i||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),dr(e,t);for(const n of Array.from(e.shadowRoot?.children??[])){if(n instanceof SVGElement){this.spriteSVG=n;continue}if(n instanceof HTMLElement){if(n instanceof HTMLPreElement){this.pre=n,this.appliedPreAttributes=void 0;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-theme-css")){this.themeCSSStyle=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=n,this.appliedUnsafeCSS=n.textContent;continue}if("diffsHeader"in n.dataset){this.headerElement=n,this.lastRenderedHeaderHTML=void 0;continue}}}this.pre!=null&&(this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({file:e,lineAnnotations:t}){this.lineAnnotations=t??this.lineAnnotations,this.file=e,this.fileRenderer.setOptions(On(this.options)),this.syncInteractionOptions(),this.pre!=null&&(this.fileRenderer.hydrate(e),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}getOrCreateLineCache(e=this.file){return e!=null?this.fileRenderer.getOrCreateLineCache(e):Ss}render({file:e,fileContainer:t,forceRender:n=!1,preventEmit:i=!1,containerWrapper:r,deferManagers:o=!1,lineAnnotations:s,renderRange:l}){const{collapsed:a=!1,themeType:d="system"}=this.options;if(!this.enabled)throw new Error("File.render: attempting to call render after cleaned up");const h=a?void 0:l,c=this.renderRange,u=this.hasThemeChanged(),f=s!=null&&(s.length>0||this.lineAnnotations.length>0)?s!==this.lineAnnotations:!1,g=!ae(this.file,e);if(!a&&!n&&Lt(h,this.renderRange)&&!g&&!f&&!u)return this.applyCachedThemeState(d);this.renderRange=h,g&&(this.cachedHeaderHTML=void 0),this.file=e,this.fileRenderer.setOptions(On(this.options)),this.syncInteractionOptions(),s!=null&&this.setLineAnnotations(s),this.fileRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:b=!1,disableFileHeader:y=!1}=this.options;if(y&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),t=this.getOrCreateFileContainerNode(t,r),this.applyCachedThemeState(d),a){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const m=this.fileRenderer.renderFile(e,Hi);m!=null&&this.applyThemeState(t,m.themeStyles,d,m.baseThemeType),m?.headerAST!=null&&this.applyHeaderToDOM(m.headerAST,t),this.injectUnsafeCSS()}catch(m){if(b)throw m;console.error(m),m instanceof Error&&this.applyErrorToDOM(m,t)}return i||this.emitPostRender(),!0}try{const m=this.getOrCreatePreNode(t);if(!this.canPartiallyRender(n,f,g||u)||!this.applyPartialRender(c,h)){const p=this.fileRenderer.renderFile(e,h);if(p==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(t,p.themeStyles,d,p.baseThemeType),p.headerAST!=null&&this.applyHeaderToDOM(p.headerAST,t),this.applyFullRender(p,m)}this.applyBuffers(m,h),this.injectUnsafeCSS(),this.managersDirty=!0,o||this.flushManagers(),this.renderAnnotations(),this.renderGutterUtility()}catch(m){if(b)throw m;console.error(m),m instanceof Error&&this.applyErrorToDOM(m,t)}return i||this.emitPostRender(),!0}emitPostRender(e=!1){const{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;n?.(t,this,"unmount");return}if(t==null)return;const i=this.mounted?"update":"mount";this.mounted=!0,n?.(t,this,i)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(const{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(e,t,n){return!(e||t||n)}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){const t=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",t.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${e}px`),!0}primeHighlightCache(){const{file:e,workerManager:t}=this;e==null||e.cacheKey==null||t==null||Qt(e)||this.fileRenderer.getOrCreateLineCache(e).length>(this.options.tokenizeMaxLength??1e5)||t.primeFileHighlightCache(e)}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.gutterUtilityContent?.remove(),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.code=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.gutterUtilityContent=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:n}of this.annotationCache.values())n.remove();this.annotationCache.clear();return}const e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(const[n,i]of this.lineAnnotations.entries()){const r=`${n}-${ge(i)}`;let o=this.annotationCache.get(r);if(o==null||!ps(i,o.annotation)){o?.element.remove();const s=t(i);if(s==null)continue;o={element:pn(ge(i)),annotation:i},o.element.appendChild(s),this.fileContainer.appendChild(o.element),this.annotationCache.set(r,o)}e.delete(r)}for(const[n,{element:i}]of e.entries())this.annotationCache.delete(n),i.remove()}renderGutterUtility(){const{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const n=rr();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}injectUnsafeCSS(){const{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===""){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===t&&this.appliedUnsafeCSS===e||(this.unsafeCSSStyle??=or(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=mn(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,i){const r=e.shadowRoot??e.attachShadow({mode:"open"}),o=i??n,s=this.options.theme??_,l=typeof s=="string"?s:{...s},a=Me(r);if(this.themeCSSStyle?.parentNode===r&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===o&&this.appliedThemeCSS.scrollbarGutter===a){this.appliedThemeCSS.theme=l;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===r){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:l,themeStyles:t,themeType:o,baseThemeType:i,scrollbarGutter:a};return}this.themeCSSStyle=Cn({shadowRoot:r,currentNode:this.themeCSSStyle,themeCSS:vn(t,o,a)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:l,themeStyles:t,themeType:o,baseThemeType:i,scrollbarGutter:a}:void 0}hydrateMeasuredScrollbar(){const e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=lr(this.themeCSSStyle.textContent??"",Me(e)))}applyFullRender(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e),this.code=je({code:this.code}),this.code.innerHTML=this.fileRenderer.renderPartialHTML(this.fileRenderer.renderCodeAST(e)),t.replaceChildren(this.code),this.lastRowCount=e.rowCount}applyPartialRender(e,t){if(e==null||t==null)return!1;const{file:n,code:i}=this,r=i!=null?this.getColumns(i):void 0;if(n==null||i==null||r==null)return!1;const o=e.startingLine,s=t.startingLine,l=e.totalLines===1/0?Number.POSITIVE_INFINITY:o+e.totalLines,a=t.totalLines===1/0?Number.POSITIVE_INFINITY:s+t.totalLines,d=Math.max(o,s),h=Math.min(l,a);if(h<=d||!this.trimDOMToOverlap(r.gutter,d,h)||!this.trimDOMToOverlap(r.content,d,h))return!1;let{length:c}=r.content.children;const u=(y,m)=>{if(!(m<=0))return this.fileRenderer.renderFile(n,{startingLine:y,totalLines:m,bufferBefore:0,bufferAfter:0})},f=sh?u(h,g):void 0;return b===void 0&&a>h?!1:(this.cleanupErrorWrapper(),f!=null&&(r.gutter.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(f.gutterAST)),r.content.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(f.contentAST)),c+=f.rowCount),b!=null&&(r.gutter.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(b.gutterAST)),r.content.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(b.contentAST)),c+=b.rowCount),this.lastRowCount!==c&&(r.gutter.style.setProperty("grid-row",`span ${c}`),r.content.style.setProperty("grid-row",`span ${c}`),this.lastRowCount=c),!0)}getColumns(e){const t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}trimDOMToOverlap(e,t,n){const i=this.getDOMBoundaryIndices(e,[t,n]),r=i.get(t)??e.children.length,o=i.get(n)??e.children.length;if(r>o)return!1;for(let s=e.children.length-1;s>=o;s-=1)e.children[s]?.remove();for(let s=r-1;s>=0;s-=1)e.children[s]?.remove();return!0}getDOMBoundaryIndices(e,t){const n=[...new Set(t)].sort((l,a)=>l-a),i=new Map;if(n.length===0)return i;let r=0,o=n[r];const{children:s}=e;o===0&&(i.set(0,0),r+=1,o=n[r]);for(let l=0;l=o;)i.set(o,l),r+=1,o=n[r];if(r>=n.length)break}}for(const l of n)i.has(l)||i.set(l,s.length);return i}getLineIndexFromDOMNode(e){const t=e.dataset.lineIndex;if(t==null)return;const n=Number(t);return Number.isNaN(n)?void 0:n}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore==null&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",e.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${t.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${t.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyHeaderToDOM(e,t){const{file:n}=this;if(n==null)return;this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const i=this.cachedHeaderHTML??pe(e);if(this.cachedHeaderHTML=i,i!==this.lastRenderedHeaderHTML){const l=document.createElement("div");l.innerHTML=i;const a=l.firstElementChild;if(!(a instanceof HTMLElement))return;this.headerElement!=null?t.shadowRoot?.replaceChild(a,this.headerElement):t.shadowRoot?.prepend(a),this.headerElement=a,this.lastRenderedHeaderHTML=i}if(this.isContainerManaged)return;const{renderHeaderPrefix:r,renderCustomHeader:o,renderHeaderMetadata:s}=this.options;if(o!=null){const l=o(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,an,l),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0}else{const l=r?.(n)??void 0,a=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,on,l),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,sn,a),this.headerCustom?.remove(),this.headerCustom=void 0}}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,i){if(i==null){t?.remove();return}const r=t??this.createHeaderSlotElement(n);return t==null&&e.appendChild(r),this.replaceHeaderSlotContent(r,i),r}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){const t=document.createElement("div");return t.slot=e,t}getOrCreateFileContainerNode(e,t){const{fileContainer:n}=this,i=e??n??document.createElement("diffs-container"),r=n!==i;return r&&this.emitPostRender(!0),this.fileContainer=i,n!=null&&r&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),r&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){const{shadowRoot:t}=e;if(t!=null)for(const n of t.children)n instanceof SVGElement?this.spriteSVG??=n:Xe(n)&&n.hasAttribute("data-theme-css")?(this.themeCSSStyle??=n,this.hasAdoptedThemeCSS=!0):Xe(n)&&n.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=n,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){const n=document.createElement("div");n.innerHTML=nr;const i=n.firstChild;i instanceof SVGElement&&(this.spriteSVG=i)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.code=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(e.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(e){this.code=void 0;for(const t of Array.from(e.children))if(t instanceof HTMLElement&&t.hasAttribute("data-code")){this.code=t;return}}applyPreNodeAttributes(e,{totalLines:t}){const{overflow:n="scroll",disableLineNumbers:i=!1}=this.options,r={type:"file",split:!1,overflow:n,disableLineNumbers:i,diffIndicators:"none",disableBackground:!0,totalLines:t};ir(r,this.appliedPreAttributes)||(bn(e,r),this.appliedPreAttributes=r)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const n=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",n.appendChild(this.errorWrapper);const i=document.createElement("div");i.dataset.errorMessage="",i.innerText=e.message,this.errorWrapper.appendChild(i);const r=document.createElement("pre");r.dataset.errorStack="",r.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(r)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function Ls(e,t,n=!1){return!n&&e==null&&t!=null}function ks(e,t,n=!1){return e==null&&t!=null&&!n}function _t(e){return{...ln,...e}}function se(e,t){const n=ws(e,t);return t?n:e.diffHeaderHeight+n}function ws(e,t){return e.paddingTop??(t?e.spacing:0)}function yt(e){return e.paddingBottom??e.spacing}function Es(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}const Ts=5e3;let Is=-1;function Rs(e,t){return(e.overflow??"scroll")!==(t.overflow??"scroll")||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS}var As=class extends xs{virtualizer;metrics;__id=`virtualized-file:${++Is}`;top;height=0;cache={heights:new Map,checkpoints:[],fileAnnotationHeight:0};isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n=ln,i,r=!1){super(e,i,r),this.virtualizer=t,this.metrics=n}setMetrics(e,t=!1){!t&&He(this.metrics,e)||(this.metrics=e,this.resetLayoutCache())}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache()}syncLineAnnotations(e){return e==null||e===this.lineAnnotations||e.length===0&&this.lineAnnotations.length===0?!1:(super.setLineAnnotations(e),!0)}hasLineAnnotations(){return this.lineAnnotations.some(e=>e.lineNumber>0)}getLineHeight(e,t=!1){const n=this.cache.heights.get(e);if(n!=null)return n;const i=t?2:1;return this.metrics.lineHeight*i}setOptions(e){if(this.isAdvancedMode())throw new Error("VirtualizedFile.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(e==null)return;const{options:t}=this,n=!dn(t,e),i=Rs(t,e);super.setOptions(e),i&&this.resetLayoutCache(!0),n&&(this.forceRenderOverride=!0),n&&this.virtualizer.instanceChanged(this,i)}setThemeType(e){if(this.isAdvancedMode())throw new Error("VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache(e=!1){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heights.size>0&&this.cache.heights.clear(),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.renderRange!=null&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1;if(this.fileContainer==null||this.file==null)return this.height!==0&&(e=!0),this.height=0,e;const{overflow:t="scroll"}=this.options;if(this.top=this.getVirtualizedTop(),t==="scroll"&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled()||this.code==null)return e;const n=this.code.children[1];if(!(n instanceof HTMLElement))return e;const i=Yt(this.lineAnnotations);if(this.renderRange!=null&&i&&kt(this.renderRange)){const r=Hs(n)??0;r!==this.cache.fileAnnotationHeight&&(this.cache.fileAnnotationHeight=r,e=!0)}else!i&&this.cache.fileAnnotationHeight!==0&&(this.cache.fileAnnotationHeight=0,e=!0);for(const r of n.children){if(!(r instanceof HTMLElement))continue;const o=r.dataset.lineIndex;if(o==null)continue;const s=Number(o);let l=r.getBoundingClientRect().height,a=!1;r.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in r.nextElementSibling.dataset||"noNewline"in r.nextElementSibling.dataset)&&("noNewline"in r.nextElementSibling.dataset&&(a=!0),l+=r.nextElementSibling.getBoundingClientRect().height);const d=this.getLineHeight(s,a);l!==d&&(e=!0,l===this.metrics.lineHeight*(a?2:1)?this.cache.heights.delete(s):this.cache.heights.set(s,l))}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null||this.file==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render({file:this.file}));prepareCodeViewItem(e,t,n,i){const r=this.syncLineAnnotations(i);let o=n?.resetFileLayoutCache===!0||r;n?.metrics!=null&&(this.metrics=n.metrics,o=!0);const{collapsed:s=!1}=this.options;return this.currentCollapsed!==s&&(this.currentCollapsed=s,o=!0),o&&this.resetLayoutCache(),this.file!==e&&(this.layoutDirty=!0),this.file=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e){if(this.file==null||e<1)return;const{disableFileHeader:t=!1,collapsed:n=!1}=this.options,i=Nn(this.getOrCreateLineCache(this.file));let r=se(this.metrics,t);if(n||i<0)return{top:r,height:0};const o=Math.min(Math.max(e-1,0),i),{overflow:s="scroll"}=this.options,{lineHeight:l}=this.metrics;if(r+=this.cache.fileAnnotationHeight,s==="scroll"&&!this.hasLineAnnotations())return{top:r+o*l,height:l};const a=this.getLayoutCheckpointBeforeLineIndex(o);r=a?.top??r;for(let d=a?.lineIndex??0;dl?void 0:{lineNumber:u+1,top:o+a+u*h}}let d=o+(s===0?a:this.renderRange.bufferBefore);for(let h=s;h<=l;h++){if(d>=e)return{lineNumber:h+1,top:d};d+=this.getLineHeight(h)}}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.file==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};const t=e!=null?this.computeRenderRangeFromWindow(this.file,this.top,e):this.renderRange;if(t==null)return;const{bufferBefore:n,bufferAfter:i,totalLines:r}=t;let o=0;if(r===0){const s=e??this.virtualizer.getWindowSpecs();this.top{this.addLayoutCheckpoint(h,this.height),this.height+=this.getLineHeight(h,!1)}}),l.length>0&&(this.height+=d),this.fileContainer!=null&&t&&!n){const h=this.fileContainer.getBoundingClientRect();h.height!==this.height?console.log("VirtualizedFile.computeApproximateSize: computed height doesnt match",{name:this.file.name,elementHeight:h.height,computedHeight:this.height}):console.log("VirtualizedFile.computeApproximateSize: computed height IS CORRECT")}this.layoutDirty=!1}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.file==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}render({fileContainer:e,file:t,forceRender:n=!1,lineAnnotations:i,...r}){const{forceRenderOverride:o,isSetup:s}=this;this.forceRenderOverride=void 0;const l=this.syncLineAnnotations(i);if(l&&this.resetLayoutCache(),this.file??=t,e=this.getOrCreateFileContainerNode(e),this.file==null)return console.error("VirtualizedFile.render: attempting to virtually render when we dont have file"),!1;if(s)this.top??=this.getVirtualizedTop();else{this.computeApproximateSize();const c=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(c==null)throw new Error("VirtualizedFile.render: simple virtualizer is not available");c.connect(e,this),this.isVisible=c.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode())return this.renderPlaceholder(this.height);const a=this.virtualizer.getWindowSpecs(),d=this.top??0,h=this.computeRenderRangeFromWindow(this.file,d,a);return super.render({file:this.file,fileContainer:e,renderRange:h,lineAnnotations:i,forceRender:(o??n)||l,...r})}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}addLayoutCheckpoint(e,t){e%Ts===0&&this.cache.checkpoints.push({lineIndex:e,top:t})}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,i;for(;t<=n;){const r=t+n>>1,o=this.cache.checkpoints[r];if(o==null)throw new Error("VirtualizedFile: invalid checkpoint index");o.lineIndex<=e?(i=o,t=r+1):n=r-1}return i}getLayoutCheckpointBeforeTop(e,t){let n=0,i=this.cache.checkpoints.length-1,r=-1;for(;n<=i;){const o=n+i>>1,s=this.cache.checkpoints[o];if(s==null)throw new Error("VirtualizedFile: invalid checkpoint index");s.top<=e?(r=o,n=o+1):i=o-1}if(t==null)return r>=0?this.cache.checkpoints[r]:void 0;for(let o=r;o>=0;o--){const s=this.cache.checkpoints[o];if(s==null)throw new Error("VirtualizedFile: invalid checkpoint index");if(s.lineIndex%t===0)return s}}getVirtualizedTop(){return this.virtualizer.type==="advanced"?this.virtualizer.getLocalTopForInstance(this):this.fileContainer!=null?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return this.virtualizer.type==="simple"?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}computeRenderRangeFromWindow(e,t,{top:n,bottom:i}){const{disableFileHeader:r=!1,overflow:o="scroll"}=this.options,{hunkLineCount:s,lineHeight:l}=this.metrics,a=this.getOrCreateLineCache(e),d=a.length,h=this.height,c=se(this.metrics,r),u=d>0?yt(this.metrics):0,{fileAnnotationHeight:f}=this.cache,g=c+f,b=Math.max(0,h-c-f-u),y=Yt(this.lineAnnotations),m=t+c,p=f>0&&y&&mn;if(ti)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-c-u};if(d<=s)return{startingLine:0,totalLines:s,bufferBefore:0,bufferAfter:0};const C=Math.ceil(Math.max(i-n,0)/l),v=Math.ceil(C/s)*s+s*2,x=v/s,S=(n+i)/2;if(o==="scroll"&&!this.hasLineAnnotations()){const ee=t+g,be=ee+b;if(!p&&!(een))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-c-u};const le=Math.floor(p&&S{const be=H%s===0,le=Math.floor(H/s);if(be&&(E[le]=R-(t+g),M!=null)){if(M<=0)return!0;M--}const q=this.getLineHeight(ee,!1);return R>n-q&&RS&&(T??=le),M==null&&R>=i&&be&&(M=L),H++,R+=q,!1}}),I==null)if(p)I=0,T=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-c-u};T??=I;const N=Math.round(T-x/2),G=Math.max(0,Math.ceil(d/s)-x),D=Math.max(0,Math.min(N,G)),F=D*s,O=N<0?v+N*s:v,J=E[D]??0,me=F===0?0:f+J,ve=D+O/s,Le=ve0&&(f[f.length-1]===` +`||f[f.length-1]==="\r"||f[f.length-1]===`\r +`||f[f.length-1]==="");)f.pop();const{additionStart:v,deletionStart:x}=b;h=d?h:x-1,c=d?c:v-1;const S={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:b.additionCount,additionStart:v,additionLines:y,deletionCount:b.deletionCount,deletionStart:x,deletionLines:m,deletionLineIndex:h,additionLineIndex:c,hunkContent:[],hunkContext:Vn(b.hunkContext),hunkSpecs:U(g),noEOFCRAdditions:!1,noEOFCRDeletions:!1};let L=0,E=0;for(let w=1;w=S.additionCount&&E>=S.deletionCount&&!R.startsWith("\\")){if(o&&$s(R)&&!Ws(R))throw Error("parsePatchContent: hunk has more lines than expected");break}const H=R[0];if(H!=="+"&&H!=="-"&&H!==" "&&H!=="\\"){if(o)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${H}", full line: "${R}"`),console.error("processFile: invalid rawLine:",R);continue}const I=qs(H);if(I==="addition"){if(o&&L>=S.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");const T=Ot(R);(p==null||p.type!=="change")&&(p=Nt("change",h,c),S.hunkContent.push(p)),c++,L++,d&&a.additionLines.push(T),p.additions++,y++,C="addition"}else if(I==="deletion"){if(o&&E>=S.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");const T=Ot(R);(p==null||p.type!=="change")&&(p=Nt("change",h,c),S.hunkContent.push(p)),h++,E++,d&&a.deletionLines.push(T),p.deletions++,m++,C="deletion"}else if(I==="context"){if(o&&(E>=S.deletionCount||L>=S.additionCount))throw Error("parsePatchContent: hunk has too many context lines");const T=Ot(R);(p==null||p.type!=="context")&&(p=Nt("context",h,c),S.hunkContent.push(p)),c++,h++,L++,E++,d&&(a.deletionLines.push(T),a.additionLines.push(T)),p.lines++,C="context"}else if(I==="metadata"&&p!=null){if(p.type==="context"?(S.noEOFCRAdditions=!0,S.noEOFCRDeletions=!0):C==="deletion"?S.noEOFCRDeletions=!0:C==="addition"&&(S.noEOFCRAdditions=!0),d&&(C==="addition"||C==="context")){const T=a.additionLines.length-1;T>=0&&(a.additionLines[T]=xe(a.additionLines[T]))}if(d&&(C==="deletion"||C==="context")){const T=a.deletionLines.length-1;T>=0&&(a.deletionLines[T]=xe(a.deletionLines[T]))}}}if(o&&(L!==S.additionCount||E!==S.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");S.additionLines=y,S.deletionLines=m,S.collapsedBefore=Math.max(S.additionStart-1-s,0),a.hunks.push(S),s=S.additionStart+S.additionCount-1;for(const w of S.hunkContent)w.type==="context"?(S.splitLineCount+=w.lines,S.unifiedLineCount+=w.lines):(S.splitLineCount+=Math.max(w.additions,w.deletions),S.unifiedLineCount+=w.deletions+w.additions);S.splitLineStart=a.splitLineCount+S.collapsedBefore,S.unifiedLineStart=a.unifiedLineCount+S.collapsedBefore,a.splitLineCount+=S.collapsedBefore+S.splitLineCount,a.unifiedLineCount+=S.collapsedBefore+S.unifiedLineCount}if(a!=null){if(o&&d&&!n&&a.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(a.hunks.length>0&&!d&&a.additionLines.length>0&&a.deletionLines.length>0){const u=a.hunks[a.hunks.length-1],f=u.additionStart+u.additionCount-1,g=a.additionLines.length,b=Math.max(g-f,0);a.splitLineCount+=b,a.unifiedLineCount+=b}return n||(a.prevName!=null&&a.name!==a.prevName?a.hunks.length>0?a.type="rename-changed":a.type="rename-pure":(i==null||i.contents==="")&&r!=null&&r.contents!==""?a.type="new":i!=null&&i.contents!==""&&(r==null||r.contents==="")&&(a.type="deleted")),a.type!=="rename-pure"&&a.type!=="rename-changed"&&(a.prevName=void 0),a}}function Fs(e,t,n=!1){const i=[],r=zs(e)?e.split(Wr):[e];for(const o of r)try{i.push(_s(o,t!=null?`${t}-${i.length}`:void 0,n))}catch(s){if(n)throw s;console.error(s)}return i}function zs(e){return e.startsWith("From ")||e.includes(` +From `)}function Fn(e){const t=ur(e);for(let n=0;nn&&t.push(e.slice(n,i)),n=i,s=!0,i=Zt(e,l);continue}if(s&&e.startsWith("@@ -",i)){const d=pr(e.slice(i,l));d!=null&&(r=d.deletionCount,o=d.additionCount)}i=l;continue}const a=e[i];if(a==="\\"){i=l;continue}a===" "?(r=Math.max(r-1,0),o=Math.max(o-1,0)):a==="-"?r=Math.max(r-1,0):a==="+"&&(o=Math.max(o-1,0)),i=l}return t.push(e.slice(n)),t}function Bs(e){return fr(e,0)}function fr(e,t){const n=Zt(e,t);return zn(e,t,"---")&&zn(e,n,"+++")}function zn(e,t,n){if(!e.startsWith(n,t))return!1;const i=e[t+n.length];if(i!==" "&&i!==" ")return!1;for(let r=t+n.length+1;r9)break;i=i*10+r}if(n!==t)return{value:i,endIndex:n}}function Gs(e){return e.endsWith(`\r +`)?e.slice(0,-2):e.endsWith(` +`)?e.slice(0,-1):e}function js(e){return e.startsWith("diff --git")||e.includes(` +diff --git`)}function gr(e,t){if(e.length===0)return[""];const n=` +${t}`,i=e.startsWith(t)?0:Un(e,n,0);if(i===-1)return[e];const r=[];i>0&&r.push(e.slice(0,i));let o=i;for(;;){const s=Un(e,n,o+1);if(s===-1)break;r.push(e.slice(o,s)),o=s}return r.push(e.slice(o)),r}function Un(e,t,n){const i=e.indexOf(t,n);return i===-1?-1:i+1}function Vn(e){return e==null?e:U(e)}function qs(e){return e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}function Ot(e){const t=e.slice(1);return U(t===""?` +`:t)}function Nt(e,t,n){return e==="change"?{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:t}}class Sn{diff(t,n,i={}){let r;typeof i=="function"?(r=i,i={}):"callback"in i&&(r=i.callback);const o=this.castInput(t,i),s=this.castInput(n,i),l=this.removeEmpty(this.tokenize(o,i)),a=this.removeEmpty(this.tokenize(s,i));return this.diffWithOptionsObj(l,a,i,r)}diffWithOptionsObj(t,n,i,r){var o;const s=p=>{if(p=this.postProcess(p,i),r){setTimeout(function(){r(p)},0);return}else return p},l=n.length,a=t.length;let d=1,h=l+a;i.maxEditLength!=null&&(h=Math.min(h,i.maxEditLength));const c=(o=i.timeout)!==null&&o!==void 0?o:1/0,u=Date.now()+c,f=[{oldPos:-1,lastComponent:void 0}];let g=this.extractCommon(f[0],n,t,0,i);if(f[0].oldPos+1>=a&&g+1>=l)return s(this.buildValues(f[0].lastComponent,n,t));let b=-1/0,y=1/0;const m=()=>{for(let p=Math.max(b,-d);p<=Math.min(y,d);p+=2){let C;const v=f[p-1],x=f[p+1];v&&(f[p-1]=void 0);let S=!1;if(x){const E=x.oldPos-p;S=x&&0<=E&&E=a&&g+1>=l)return s(this.buildValues(C.lastComponent,n,t))||!0;f[p]=C,C.oldPos+1>=a&&(y=Math.min(y,p-1)),g+1>=l&&(b=Math.max(b,p+1))}d++};if(r)(function p(){setTimeout(function(){if(d>h||Date.now()>u)return r(void 0);m()||p()},0)})();else for(;d<=h&&Date.now()<=u;){const p=m();if(p)return p}}addToPath(t,n,i,r,o){const s=t.lastComponent;return s&&!o.oneChangePerToken&&s.added===n&&s.removed===i?{oldPos:t.oldPos+r,lastComponent:{count:s.count+1,added:n,removed:i,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+r,lastComponent:{count:1,added:n,removed:i,previousComponent:s}}}extractCommon(t,n,i,r,o){const s=n.length,l=i.length;let a=t.oldPos,d=a-r,h=0;for(;d+1u.length?g:u}),h.value=this.join(c)}else h.value=this.join(n.slice(a,a+h.count));a+=h.count,h.added||(d+=h.count)}}return r}}class Ks extends Sn{}const Ys=new Ks;function Xs(e,t,n){return Ys.diff(e,t,n)}const Bn="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Qs extends Sn{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${Bn}]+|[^\\S\\n\\r]+|[^${Bn}]`,"ug");return t.match(n)||[]}}const Js=new Qs;function Zs(e,t,n){return Js.diff(e,t,n)}class ea extends Sn{constructor(){super(...arguments),this.tokenize=na}equals(t,n,i){return i.ignoreWhitespace?((!i.newlineIsToken||!t.includes(` +`))&&(t=t.trim()),(!i.newlineIsToken||!n.includes(` +`))&&(n=n.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(t.endsWith(` +`)&&(t=t.slice(0,-1)),n.endsWith(` +`)&&(n=n.slice(0,-1))),super.equals(t,n,i)}}const ta=new ea;function $n(e,t,n){return ta.diff(e,t,n)}function na(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,` +`));const n=[],i=e.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let r=0;r"~"||e[t]==='"'||e[t]==="\\")return!0;return!1}function Ce(e){if(!ia(e))return e;let t='"';const n=new TextEncoder().encode(e);let i=0;for(;i=32&&r<=126?t+=String.fromCharCode(r):t+="\\"+r.toString(8).padStart(3,"0"),i++}return t+='"',t}const Wn={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function Gn(e,t,n,i,r,o,s){let l;s?typeof s=="function"?l={callback:s}:l=s:l={},typeof l.context>"u"&&(l.context=4);const a=l.context;if(l.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(l.callback){const{callback:h}=l;$n(n,i,Object.assign(Object.assign({},l),{callback:c=>{const u=d(c);h(u)}}))}else return d($n(n,i,l));function d(h){if(!h)return;h.push({value:"",lines:[]});function c(p){return p.map(function(C){return" "+C})}const u=[];let f=0,g=0,b=[],y=1,m=1;for(let p=0;p0?c(x.lines.slice(-a)):[],f-=b.length,g-=b.length)}for(const x of v)b.push((C.added?"+":"-")+x);C.added?m+=v.length:y+=v.length}else{if(f)if(v.length<=a*2&&p1&&!t.includeFileHeaders&&!e.every(h=>h.isGit))throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(h=>en(h,t)).join(` +`)}const a=[];if(e.isGit){if(t=Wn,!e.oldFileName)throw new Error("oldFileName must be specified for Git patches");if(!e.newFileName)throw new Error("newFileName must be specified for Git patches");let h=e.oldFileName,c=e.newFileName;e.isCreate&&h==="/dev/null"?h=c.replace(/^b\//,"a/"):e.isDelete&&c==="/dev/null"&&(c=h.replace(/^a\//,"b/")),a.push("diff --git "+Ce(h)+" "+Ce(c)),e.isDelete&&a.push("deleted file mode "+((n=e.oldMode)!==null&&n!==void 0?n:"100644")),e.isCreate&&a.push("new file mode "+((i=e.newMode)!==null&&i!==void 0?i:"100644")),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(a.push("old mode "+e.oldMode),a.push("new mode "+e.newMode)),e.isRename&&(a.push("rename from "+Ce(((r=e.oldFileName)!==null&&r!==void 0?r:"").replace(/^a\//,""))),a.push("rename to "+Ce(((o=e.newFileName)!==null&&o!==void 0?o:"").replace(/^b\//,"")))),e.isCopy&&(a.push("copy from "+Ce(((s=e.oldFileName)!==null&&s!==void 0?s:"").replace(/^a\//,""))),a.push("copy to "+Ce(((l=e.newFileName)!==null&&l!==void 0?l:"").replace(/^b\//,""))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&a.push("Index: "+e.oldFileName),t.includeUnderline&&a.push("===================================================================");const d=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||d)&&(a.push("--- "+Ce(e.oldFileName)+(e.oldHeader?" "+e.oldHeader:"")),a.push("+++ "+Ce(e.newFileName)+(e.newHeader?" "+e.newHeader:"")));for(let h=0;h{l(a?en(a,s.headerOptions):void 0)}}))}else{const l=Gn(e,t,n,i,r,o,s);return l?en(l,s?.headerOptions):void 0}}function oa(e){const t=e.endsWith(` +`),n=e.split(` +`).map(i=>i+` +`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function tn(e,t,n,i=!1){const r=Ns(ra(e.name,t.name,e.contents,t.contents,e.header,t.header,n),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:i});if(r==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return t.lang!=null&&(r.lang=t.lang),r}var sa=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,this.enabled=!1)}setup(e,t,n){if(t==null||n==null)for(const i of e.children??[])i instanceof HTMLElement&&("deletions"in i.dataset?t=i:"additions"in i.dataset&&(n=i));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener("scroll",this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function Fe(e,t){return De(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function rt(e){return A({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function ot(e){return A({tagName:"div",children:[A({tagName:"span",children:[W("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function Ft(e){return A({tagName:"div",children:[pt({name:e==="both"?"diffs-icon-expand-all":"diffs-icon-expand",properties:{"data-icon":""}})],properties:{role:"button","data-expand-button":"","data-expand-both":e==="both"?"":void 0,"data-expand-up":e==="up"?"":void 0,"data-expand-down":e==="down"?"":void 0}})}function ke({type:e,content:t,expandIndex:n,chunked:i=!1,slotName:r,isFirstHunk:o,isLastHunk:s}){let l=0;const a=[];if(e==="metadata"&&t!=null&&a.push(A({tagName:"div",children:[W(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const d=[];n!=null&&(i?(o||(d.push(Ft("up")),l++),s||(d.push(Ft("down")),l++)):(d.push(Ft(!o&&!s?"both":o?"down":"up")),l++)),d.push(A({tagName:"div",children:[A({tagName:"span",children:[W(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),i&&n!=null&&d.push(A({tagName:"div",children:[W("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),a.push(A({tagName:"div",children:d,properties:{"data-separator-wrapper":"","data-separator-multi-button":l>1?"":void 0}}))}return e==="custom"&&r!=null&&a.push(A({tagName:"slot",properties:{name:r}})),A({tagName:"div",children:a,properties:{"data-separator":a.length===0?"simple":e,"data-expand-index":n,"data-separator-first":o?"":void 0,"data-separator-last":s?"":void 0}})}function aa(e,t){return`hunk-separator-${e}-${t}`}function la(e){const t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function da(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function jn({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":""},alwaysWrap:!0}}function st({item:e,arr:t,enableJoin:n,isNeutral:i=!1,isLastItem:r=!1}){const o=t[t.length-1];if(o==null||r||!n){t.push([i?0:1,e.value]);return}const s=o[0]===0;if(i===s||i&&e.value.length===1&&!s){o[1]+=e.value;return}t.push([i?0:1,e.value])}function Qe({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}){const o=Math.max(t,0);if(o===0||e)return{fromStart:0,fromEnd:0,rangeSize:o,collapsedLines:o,renderAll:!1};if(n===!0||o<=r)return{fromStart:o,fromEnd:0,rangeSize:o,collapsedLines:0,renderAll:!0};const s=n?.get(i),l=Math.min(Math.max(s?.fromStart??0,0),o),a=Math.min(Math.max(s?.fromEnd??0,0),o),d=l+a,h=d>=o;return{fromStart:h?o:l,fromEnd:h?0:a,rangeSize:o,collapsedLines:Math.max(o-d,0),renderAll:h}}function mr({fileDiff:e,errorPrefix:t}){const n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;const i=e.additionLines.length-(n.additionLineIndex+n.additionCount),r=e.deletionLines.length-(n.deletionLineIndex+n.deletionCount);if(i<=0&&r<=0)return 0;if(i!==r)throw new Error(`${t}: trailing context mismatch (additions=${i}, deletions=${r}) for ${e.name}`);return Math.min(i,r)}function Je({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:i,errorPrefix:r}){if(t!==e.hunks.length-1)return;const o=mr({fileDiff:e,errorPrefix:r});if(o<=0)return;if(n===!0||o<=i)return{fromStart:o,fromEnd:0,rangeSize:o,collapsedLines:0,renderAll:!0};const s=n?.get(e.hunks.length),l=Math.min(Math.max(s?.fromStart??0,0),o);return{fromStart:l,fromEnd:0,rangeSize:o,collapsedLines:o-l,renderAll:l>=o}}function vr({type:e,metrics:t}){return t.hunkSeparatorHeight??Es(e)}function br({type:e,metrics:t}){return e==="simple"||e==="metadata"||e==="line-info-basic"?0:t.spacing}function ha({type:e,hunkIndex:t,hunkSpecs:n}){switch(e){case"simple":return t>0;case"metadata":return n!=null;case"line-info":case"line-info-basic":case"custom":return!0}}function ca(e){return e!=="simple"&&e!=="metadata"}function $e({type:e,metrics:t,hunkIndex:n,hunkSpecs:i}){if(!ha({type:e,hunkIndex:n,hunkSpecs:i}))return;const r=vr({type:e,metrics:t}),o=br({type:e,metrics:t}),s=n>0?o:0,l=o;return{height:r,gapBefore:s,gapAfter:l,totalHeight:s+r+l}}function We({type:e,metrics:t}){if(!ca(e))return;const n=vr({type:e,metrics:t}),i=br({type:e,metrics:t});return{height:n,gapBefore:i,gapAfter:0,totalHeight:i+n}}function qe({diff:e,diffStyle:t,startingLine:n=0,totalLines:i=1/0,expandedHunks:r,collapsedContextThreshold:o=1,callback:s}){const l=ua({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:o}),a={viewportStart:n,viewportEnd:n+i,isWindowedHighlight:n>0||i<1/0,splitCount:l.splitCount,unifiedCount:l.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!a.isWindowedHighlight)return!1;const d=a.unifiedCount>=n+i,h=a.splitCount>=n+i;return t==="unified"?d:(t==="split"||d)&&h},shouldSkip(d,h){if(!a.isWindowedHighlight)return!1;const c=a.unifiedCount+d=n-d&&a.unifiedCount=n-d&&a.splitCount0?0:t==="unified"?E===h.unifiedLineStart+h.unifiedLineCount-1?u.collapsedLines:0:w===h.splitLineStart+h.splitLineCount-1?u.collapsedLines:0},y=function(){return b?0:(b=!0,c.collapsedLines)};const h=e.hunks[d];if(h==null)throw new Error("iterateOverDiff: invalid hunk index");if(a.shouldBreak())break;const c=Qe({isPartial:e.isPartial,rangeSize:h.collapsedBefore,expandedHunks:r,hunkIndex:d,collapsedContextThreshold:o}),u=d===a.finalHunkIndex?Je({fileDiff:e,hunkIndex:d,expandedHunks:r,collapsedContextThreshold:o,errorPrefix:"iterateOverDiff"}):void 0,f=c.fromStart+c.fromEnd;let b=c.collapsedLines===0;if(a.shouldSkip(f,f))a.incrementCounts(f,f),y();else{let E=h.unifiedLineStart-c.rangeSize,w=h.splitLineStart-c.rangeSize,R=h.deletionLineIndex-c.rangeSize,H=h.additionLineIndex-c.rangeSize,I=h.deletionStart-c.rangeSize,T=h.additionStart-c.rangeSize;if(at(a,c.fromStart,t,M=>a.emit({hunkIndex:d,hunk:h,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:I+M,lineIndex:R+M,noEOFCR:!1,unifiedLineIndex:E+M,splitLineIndex:w+M},additionLine:{unifiedLineIndex:E+M,splitLineIndex:w+M,lineIndex:H+M,lineNumber:T+M,noEOFCR:!1}}))||(E=h.unifiedLineStart-c.fromEnd,w=h.splitLineStart-c.fromEnd,R=h.deletionLineIndex-c.fromEnd,H=h.additionLineIndex-c.fromEnd,I=h.deletionStart-c.fromEnd,T=h.additionStart-c.fromEnd,at(a,c.fromEnd,t,M=>a.emit({hunkIndex:d,hunk:h,collapsedBefore:y(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:I+M,lineIndex:R+M,noEOFCR:!1,unifiedLineIndex:E+M,splitLineIndex:w+M},additionLine:{unifiedLineIndex:E+M,splitLineIndex:w+M,lineIndex:H+M,lineNumber:T+M,noEOFCR:!1}}),()=>{y()})))break e}let m=h.unifiedLineStart,p=h.splitLineStart,C=h.deletionLineIndex,v=h.additionLineIndex,x=h.deletionStart,S=h.additionStart;const L=h.hunkContent.at(-1);for(const E of h.hunkContent){if(a.shouldBreak())break e;const w=E===L;if(E.type==="context"){if(a.shouldSkip(E.lines,E.lines))a.incrementCounts(E.lines,E.lines),y();else if(at(a,E.lines,t,R=>{const H=w&&R===E.lines-1,I=m+R,T=p+R;return a.emit({hunkIndex:d,hunk:h,collapsedBefore:y(),collapsedAfter:g(I,T),type:"context",deletionLine:{lineNumber:x+R,lineIndex:C+R,noEOFCR:H&&h.noEOFCRDeletions,unifiedLineIndex:I,splitLineIndex:T},additionLine:{unifiedLineIndex:I,splitLineIndex:T,lineIndex:v+R,lineNumber:S+R,noEOFCR:H&&h.noEOFCRAdditions}})},()=>{y()}))break e;m+=E.lines,p+=E.lines,C+=E.lines,v+=E.lines,x+=E.lines,S+=E.lines}else{const R=Math.max(E.deletions,E.additions),H=E.deletions+E.additions;if(!a.shouldSkip(H,R)){const I=ga(a,E,t);(I[0]?.[0]??0)>0&&y();for(const[T,M]of I)for(let N=T;N{const T=I===H-1;return a.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:T?E:0,type:"context-expanded",deletionLine:{lineNumber:x+I,lineIndex:C+I,noEOFCR:!1,unifiedLineIndex:m+I,splitLineIndex:p+I},additionLine:{unifiedLineIndex:m+I,splitLineIndex:p+I,lineIndex:v+I,lineNumber:S+I,noEOFCR:!1}})},void 0,()=>a.shouldBreak()))break e}}}function ua({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:r}){if(n<=0||t==="both")return{hunkIndex:0,splitCount:0,unifiedCount:0};const o=fa({diff:e,expandedHunks:i,collapsedContextThreshold:r});let s=0,l=e.hunks.length-1,a=e.hunks.length;for(;s<=l;){const h=s+l>>1,c=o[h+1];if(c==null)throw new Error("iterateOverDiff: invalid hunk prefix index");(t==="unified"?c.unifiedCount:c.splitCount)>n?(a=h,l=h-1):s=h+1}if(a>=e.hunks.length){const h=o[e.hunks.length];if(h==null)throw new Error("iterateOverDiff: invalid terminal hunk prefix index");return{hunkIndex:e.hunks.length,splitCount:h.splitCount,unifiedCount:h.unifiedCount}}const d=o[a];if(d==null)throw new Error("iterateOverDiff: invalid selected hunk prefix index");return{hunkIndex:a,splitCount:d.splitCount,unifiedCount:d.unifiedCount}}function fa({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let i=0,r=0;const o=e.hunks.length-1,s=[{splitCount:0,unifiedCount:0}];for(let l=0;la&&i.push([a,d])}if(n!=="split"&&r(e.unifiedCount),n!=="unified"&&r(e.splitCount),i.length===0)return[0,0];let o=i[0][0],s=i[0][1];for(let l=1;l0&&(e.incrementCounts(s,s),r?.());let a=s;for(;a=l){e.incrementCounts(t-a,t-a);break}if(e.isInWindow(0,0)){if(i(a)===!0)return!0}else e.incrementCounts(1,1);a++}return!1}function ga(e,t,n){if(!e.isWindowedHighlight)return[[0,n==="unified"?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];const i=n!=="split",r=n!=="unified",o=n==="unified"?"unified":"split",s=[];function l(c,u){if(c+u<=e.viewportStart||c>=e.viewportEnd)return;const f=Math.max(0,e.viewportStart-c),g=Math.min(u,e.viewportEnd-c);return g>f?[f,g]:void 0}function a(c,u){return o==="split"?c:u==="additions"?[c[0]+t.deletions,c[1]+t.deletions]:c}function d(c,u){if(c==null)return;const[f,g]=a(c,u);g>f&&s.push([f,g])}if(i&&(d(l(e.unifiedCount,t.deletions),"deletions"),d(l(e.unifiedCount+t.deletions,t.additions),"additions")),r&&(d(l(e.splitCount,t.deletions),"deletions"),d(l(e.splitCount,t.additions),"additions")),s.length===0)return s;s.sort((c,u)=>c[0]-u[0]);const h=[s[0]];for(const[c,u]of s.slice(1)){const f=h[h.length-1];c<=f[1]?f[1]=Math.max(f[1],u):h.push([c,u])}return h}function ma({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,diffStyle:r,index:o,unifiedLineIndex:s,splitLineIndex:l,additionLineIndex:a,deletionLineIndex:d,additionLineNumber:h,deletionLineNumber:c,content:u,isLastContent:f,unifiedCount:g,splitCount:b}){const y=o=u.deletions?s+o:void 0:o=u.deletions?a+(o-u.deletions):void 0:o=u.deletions?h+(o-u.deletions):void 0:o0||o<1/0,d=typeof n.theme=="string"?t.getTheme(n.theme).type:void 0,h=fn({theme:n.theme,highlighter:t}),c=i&&!a&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":n.lineDiffType,u={deletionLines:[],additionLines:[]},{maxLineDiffLength:f}=n,g=!i&&!e.isPartial,b=i?s:void 0,y=new Map;function m(C){const v=g?0:C,x=y.get(v)??Sa();return y.set(v,x),x}function p(C,v,x,S){if(a){let L=x.at(-1);(L==null||L.targetIndex+L.count!==v)&&(L={targetIndex:v,originalOffset:S.length,count:0},x.push(L)),L.count++}S.push(C)}qe({diff:e,diffStyle:"both",startingLine:r,totalLines:o,expandedHunks:a?b:!0,collapsedContextThreshold:l,callback:({hunkIndex:C,additionLine:v,deletionLine:x,type:S})=>{const L=m(C),E=v!=null?v.splitLineIndex:x.splitLineIndex;S==="change"&&v!=null&&x!=null&&Ca({additionLine:e.additionLines[v.lineIndex],deletionLine:e.deletionLines[x.lineIndex],deletionLineIndex:L.deletionContent.length,additionLineIndex:L.additionContent.length,deletionDecorations:L.deletionDecorations,additionDecorations:L.additionDecorations,lineDiffType:c,maxLineDiffLength:f}),x!=null&&(p(e.deletionLines[x.lineIndex],x.lineIndex,L.deletionSegments,L.deletionContent),L.deletionInfo.push({type:S==="change"?"change-deletion":S,lineNumber:x.lineNumber,altLineNumber:S==="change"?void 0:v.lineNumber??void 0,lineIndex:`${x.unifiedLineIndex},${E}`})),v!=null&&(p(e.additionLines[v.lineIndex],v.lineIndex,L.additionSegments,L.additionContent),L.additionInfo.push({type:S==="change"?"change-addition":S,lineNumber:v.lineNumber,altLineNumber:S==="change"?void 0:x.lineNumber??void 0,lineIndex:`${v.unifiedLineIndex},${E}`}))}});for(const C of y.values()){if(C.deletionContent.length===0&&C.additionContent.length===0)continue;const v={name:e.prevName??e.name,contents:C.deletionContent.value},x={name:e.name,contents:C.additionContent.value},{deletionLines:S,additionLines:L}=ya({deletionFile:v,deletionInfo:C.deletionInfo,deletionDecorations:C.deletionDecorations,additionFile:x,additionInfo:C.additionInfo,additionDecorations:C.additionDecorations,highlighter:t,options:n,languageOverride:i?"text":e.lang});if(g){u.deletionLines=S,u.additionLines=L;continue}if(C.deletionSegments.length>0)for(const E of C.deletionSegments)for(let w=0;w0)for(const E of C.additionSegments)for(let w=0;wl||t.length>l))return;const a=s==="char"?Xs(e,t):Zs(e,t),d=[],h=[],c=s==="word-alt",u=a.at(-1);for(const g of a){const b=g===u;!g.added&&!g.removed?(st({item:g,arr:d,enableJoin:c,isNeutral:!0,isLastItem:b}),st({item:g,arr:h,enableJoin:c,isNeutral:!0,isLastItem:b})):g.removed?st({item:g,arr:d,enableJoin:c,isLastItem:b}):st({item:g,arr:h,enableJoin:c,isLastItem:b})}let f=0;for(const g of d)g[0]===1&&r.push(jn({line:n,spanStart:f,spanLength:g[1].length})),f+=g[1].length;f=0;for(const g of h)g[0]===1&&o.push(jn({line:i,spanStart:f,spanLength:g[1].length})),f+=g[1].length}function Sa(){return{deletionContent:{push(e){this.value+=e,this.length++},value:"",length:0},additionContent:{push(e){this.value+=e,this.length++},value:"",length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function ya({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:i,highlighter:r,deletionDecorations:o,additionDecorations:s,languageOverride:l,options:{theme:a=_,...d}}){const h=l??Q(e.name),c=l??Q(t.name),{state:u,transformers:f}=Ji(d.useTokenTransformer),g=typeof a=="string"?{...d,lang:"text",theme:a,transformers:f,decorations:void 0,defaultColor:!1,cssVariablePrefix:B("token"),tokenizeTimeLimit:0}:{...d,lang:"text",themes:a,transformers:f,decorations:void 0,defaultColor:!1,cssVariablePrefix:B("token"),tokenizeTimeLimit:0};return{deletionLines:e.contents===""?[]:(g.lang=h,u.lineInfo=n,g.decorations=o,Kt(r.codeToHast(xe(e.contents),g))),additionLines:t.contents===""?[]:(g.lang=c,g.decorations=s,u.lineInfo=i,Kt(r.codeToHast(xe(t.contents),g)))}}function nn(e){const t=e.lang??Q(e.name),n=e.lang??(e.prevName!=null?Q(e.prevName):"text");return t==="text"&&n==="text"}let xa=-1;var Cr=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++xa}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;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)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this)}clearRenderCache(){this.renderCache=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){const i={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t==="up"||t==="both")&&(i.fromStart+=n),(t==="down"||t==="both")&&(i.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,i)}getExpandedHunk(e){return this.expandedHunks.get(e)??no}getExpandedHunksMap(){return this.expandedHunks}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(const t of e){const n=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),i=n[t.lineNumber]??[];n[t.lineNumber]=i,i.push(t)}}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e}}getSplitLineDecoration({side:e,type:t}){return t!=="change"?{gutterLineType:t}:{gutterLineType:e==="deletions"?"change-deletion":"change-addition"}}createAnnotationElement=e=>qt(e);getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:n=!1,disableFileHeader:i=!1,disableLineNumbers:r=!1,disableVirtualizationBuffers:o=!1,collapsed:s=!1,expandUnchanged:l=!1,collapsedContextThreshold:a=1,expansionLineCount:d=100,hunkSeparators:h="line-info",lineDiffType:c="word-alt",maxLineDiffLength:u=1e3,overflow:f="scroll",stickyHeader:g=!1,theme:b=_,headerRenderMode:y="default",tokenizeMaxLineLength:m=1e3,tokenizeMaxLength:p=Zr,useTokenTransformer:C=!1,useCSSClasses:v=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:i,disableLineNumbers:r,disableVirtualizationBuffers:o,collapsed:s,expandUnchanged:l,collapsedContextThreshold:a,expansionLineCount:d,hunkSeparators:h,lineDiffType:c,maxLineDiffLength:u,overflow:f,stickyHeader:g,theme:this.workerManager?.getDiffRenderOptions().theme??b,headerRenderMode:y,tokenizeMaxLineLength:m,tokenizeMaxLength:p,useTokenTransformer:C,useCSSClasses:v}}async initializeHighlighter(){return this.highlighter=await xt(un(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;const{options:t}=this.getRenderOptions(e),n=Ut(e,this.getTokenizeMaxLength());let i=this.workerManager?.getDiffResultCache(e);i!=null&&!Fe(t,i.options)&&(i=void 0),this.renderCache??={diff:e,highlighted:!n&&!nn(e),options:t,result:n?void 0:i?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter==null&&(this.computedLang=e.lang??Q(e.name),this.initializeHighlighter())}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();const{theme:i,tokenizeMaxLineLength:r,lineDiffType:o,maxLineDiffLength:s}=this.getOptionsWithDefaults();return{theme:i,useTokenTransformer:tr(this.options),tokenizeMaxLineLength:r,lineDiffType:o,maxLineDiffLength:s}})();this.getOptionsWithDefaults();const{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!Be(e,n.diff)||!Fe(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=Ae){if(e==null)return;const{expandUnchanged:n=!1,collapsedContextThreshold:i}=this.getOptionsWithDefaults();let{options:r,forceHighlight:o}=this.getRenderOptions(e);const s=this.getMatchingWorkerResultCache(e,r);s!=null&&!this.hasHighlightedRenderCache(e,r)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...s},o=!1),this.renderCache??={diff:e,highlighted:!1,options:r,result:void 0,renderRange:void 0};const l=e.additionLines.length>0||e.deletionLines.length>0,a=!l||nn(e)||Ut(e,this.getTokenizeMaxLength()),d=!Be(e,this.renderCache.diff),h=!Lt(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(a||this.renderCache.result==null||!this.renderCache.highlighted&&(d||h))&&(this.renderCache.diff=e,this.renderCache.options=r,this.renderCache.highlighted=!1,(this.renderCache.result==null||d||h||o)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,da(t)||n?!0:this.expandedHunks,i)),this.renderCache.renderRange=t),!a&&l&&(!this.renderCache.highlighted||o)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??Q(e.name);const c=this.highlighter!=null&&Ge(r.theme),u=this.highlighter!=null&&mt(this.computedLang),f=!a&&u;if(this.highlighter!=null&&c&&(o||a||!this.renderCache.highlighted&&f||this.renderCache.result==null)){const{result:g,options:b}=this.renderDiffWithHighlighter(e,this.highlighter,a||!u);this.renderCache={diff:e,options:b,highlighted:f,result:g,renderRange:void 0}}(!c||!a&&!u)&&this.asyncHighlight(e).then(({result:g,options:b})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,g,b,!a)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,t,this.renderCache.result):void 0}async asyncRender(e,t=Ae){const{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){const{diffIndicators:i,disableBackground:r,disableLineNumbers:o,overflow:s}=this.getOptionsWithDefaults();return Xi({type:"diff",diffIndicators:i,disableBackground:r,disableLineNumbers:o,overflow:s,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){const t=Ut(e,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??Q(e.name);const n=this.highlighter!=null&&Ge(this.options.theme??_),i=t||this.highlighter!=null&&mt(this.computedLang);return(this.highlighter==null||!n||!i)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){const{options:i}=this.getRenderOptions(e),{collapsedContextThreshold:r}=this.getOptionsWithDefaults();return{result:ba(e,t,i,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:r}),options:i}}onHighlightSuccess(e,t,n,i=!0){if(this.renderCache==null)return;const r=!this.renderCache.highlighted||!Fe(this.renderCache.options,n)||!Be(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:i,result:t,renderRange:void 0},r&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){const n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!Fe(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&Be(e,n.diff)&&Fe(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:i,baseThemeType:r}){const{diffStyle:o,disableFileHeader:s,expandUnchanged:l,expansionLineCount:a,collapsedContextThreshold:d,hunkSeparators:h}=this.getOptionsWithDefaults();this.diff=e;const c=o==="unified";let u=[],f=[],g=[];const b=[],{additionLines:y,deletionLines:m}=n,p={rowCount:0,hunkSeparators:h,additionsContentAST:u,deletionsContentAST:f,unifiedContentAST:g,unifiedGutterAST:Ee(),deletionsGutterAST:Ee(),additionsGutterAST:Ee(),expansionLineCount:a,hunkData:b,incrementRowCount(T=1){p.rowCount+=T},pushToGutter(T,M){switch(T){case"unified":p.unifiedGutterAST.children.push(M);break;case"deletions":p.deletionsGutterAST.children.push(M);break;case"additions":p.additionsGutterAST.children.push(M);break}}},C=mr({fileDiff:e,errorPrefix:"DiffHunksRenderer.processDiffResult"}),v={size:0,side:void 0,increment(){this.size+=1},flush(){if(o!=="unified"){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side==="additions"?(p.pushToGutter("additions",j(void 0,"buffer",this.size)),u?.push(rt(this.size))):(p.pushToGutter("deletions",j(void 0,"buffer",this.size)),f?.push(rt(this.size))),this.size=0,this.side=void 0}}},x=(T,M,N,G,D)=>{p.pushToGutter(T,Di(M,N,G,D))};function S(T){v.flush(),o==="unified"?zt("unified",T,p):(zt("deletions",T,p),zt("additions",T,p))}this.pushFileLevelAnnotations(e,o,t,p),qe({diff:e,diffStyle:o,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:l?!0:this.expandedHunks,collapsedContextThreshold:d,callback:({hunkIndex:T,hunk:M,collapsedBefore:N,collapsedAfter:G,additionLine:D,deletionLine:F,type:O})=>{const J=F!=null?F.splitLineIndex:D.splitLineIndex,me=D!=null?D.unifiedLineIndex:F.unifiedLineIndex;o==="split"&&O!=="change"&&v.flush(),N>0&&S({hunkIndex:T,collapsedLines:N,rangeSize:Math.max(M?.collapsedBefore??0,0),hunkSpecs:M?.hunkSpecs,isFirstHunk:T===0,isLastHunk:!1,isExpandable:!e.isPartial});const ve=o==="unified"?me:J,Le={type:O,hunkIndex:T,lineIndex:ve,unifiedLineIndex:me,splitLineIndex:J,deletionLine:F,additionLine:D};if(o==="unified"){const P=this.getUnifiedInjectedRowsForLine?.(Le);P?.before!=null&&Yn(P.before,p);let V=F!=null?m[F.lineIndex]:void 0,z=D!=null?y[D.lineIndex]:void 0;if(V==null&&z==null){const ne="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(ne,{file:e.name}),new Error(ne)}const de=O==="change"?D!=null?"change-addition":"change-deletion":O,te=this.getUnifiedLineDecoration({type:O,lineType:de,additionLineIndex:D?.lineIndex,deletionLineIndex:F?.lineIndex});x("unified",te.gutterLineType,D!=null?D.lineNumber:F.lineNumber,`${me},${J}`,te.gutterProperties),z!=null?z=dt(z,te.contentProperties):V!=null&&(V=dt(V,te.contentProperties)),lt({diffStyle:"unified",type:O,deletionLine:V,additionLine:z,unifiedSpan:this.getAnnotations("unified",F?.lineNumber,D?.lineNumber,T,ve),createAnnotationElement:ne=>this.createAnnotationElement(ne),context:p}),P?.after!=null&&Yn(P.after,p)}else{const P=this.getSplitInjectedRowsForLine?.(Le);P?.before!=null&&Xn(P.before,p,v);let V=F!=null?m[F.lineIndex]:void 0,z=D!=null?y[D.lineIndex]:void 0;const de=this.getSplitLineDecoration({side:"deletions",type:O,lineIndex:F?.lineIndex}),te=this.getSplitLineDecoration({side:"additions",type:O,lineIndex:D?.lineIndex});if(V==null&&z==null){const K="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(K,{file:e.name}),new Error(K)}const ne=(()=>{if(O==="change"){if(z==null)return"additions";if(V==null)return"deletions"}})();if(ne!=null){if(v.side!=null&&v.side!==ne)throw new Error("DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits");v.side=ne,v.increment()}const Pe=this.getAnnotations("split",F?.lineNumber,D?.lineNumber,T,ve);if(Pe!=null&&v.size>0&&v.flush(),F!=null){const K=dt(V,de.contentProperties);x("deletions",de.gutterLineType,F.lineNumber,`${F.unifiedLineIndex},${J}`,de.gutterProperties),K!=null&&(V=K)}if(D!=null){const K=dt(z,te.contentProperties);x("additions",te.gutterLineType,D.lineNumber,`${D.unifiedLineIndex},${J}`,te.gutterProperties),K!=null&&(z=K)}lt({diffStyle:"split",type:O,additionLine:z,deletionLine:V,...Pe,createAnnotationElement:K=>this.createAnnotationElement(K),context:p}),P?.after!=null&&Xn(P.after,p,v)}const ee=o==="split"&&M!=null&&J===M.splitLineStart+M.splitLineCount-1,be=ee?M.noEOFCRDeletions:!1,le=ee?M.noEOFCRAdditions:!1,q=(F?.noEOFCR??!1)||be,ye=(D?.noEOFCR??!1)||le;if(ye||q){if(o==="split"&&v.flush(),q){const P=O==="context"||O==="context-expanded"?O:"change-deletion";o==="unified"?(p.unifiedContentAST.push(ot(P)),p.pushToGutter("unified",j(P,"metadata",1))):(p.deletionsContentAST.push(ot(P)),p.pushToGutter("deletions",j(P,"metadata",1)),ye||(p.pushToGutter("additions",j(void 0,"buffer",1)),p.additionsContentAST.push(rt(1))))}if(ye){const P=O==="context"||O==="context-expanded"?O:"change-addition";o==="unified"?(p.unifiedContentAST.push(ot(P)),p.pushToGutter("unified",j(P,"metadata",1))):(p.additionsContentAST.push(ot(P)),p.pushToGutter("additions",j(P,"metadata",1)),q||(p.pushToGutter("deletions",j(void 0,"buffer",1)),p.deletionsContentAST.push(rt(1))))}p.incrementRowCount(1)}G>0&&h!=="simple"&&S({hunkIndex:O==="context-expanded"?T:T+1,collapsedLines:G,rangeSize:C,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!e.isPartial}),p.incrementRowCount(1)}}),o==="split"&&v.flush();const L=Math.max(la(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),E=t.bufferBefore>0||t.bufferAfter>0,w=!c&&e.type!=="deleted",R=!c&&e.type!=="new",H=p.rowCount>0||E;u=w&&H?u:void 0,f=R&&H?f:void 0,g=c&&H?g:void 0;const I=this.createPreElement(f!=null&&u!=null,L);return{unifiedGutterAST:c&&H?p.unifiedGutterAST.children:void 0,unifiedContentAST:g,deletionsGutterAST:R&&H?p.deletionsGutterAST.children:void 0,deletionsContentAST:f,additionsGutterAST:w&&H?p.additionsGutterAST.children:void 0,additionsContentAST:u,hunkData:b,preNode:I,themeStyles:i,baseThemeType:r,headerElement:s?void 0:this.renderHeader(this.diff),totalLines:L,rowCount:p.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderCodeAST(e,t){const n=e==="unified"?t.unifiedGutterAST:e==="deletions"?t.deletionsGutterAST:t.additionsGutterAST,i=e==="unified"?t.unifiedContentAST:e==="deletions"?t.deletionsContentAST:t.additionsContentAST;if(n==null||i==null)return;const r=Ee(n);return r.properties.style=`grid-row: span ${t.rowCount}`,[r,er(i,t.rowCount)]}renderFullAST(e,t=[]){const n=this.getOptionsWithDefaults().hunkSeparators==="line-info",i=this.renderCodeAST("unified",e);if(i!=null)return t.push(A({tagName:"code",children:i,properties:{"data-code":"","data-container-size":n?"":void 0,"data-unified":""}})),{...e.preNode,children:t};const r=this.renderCodeAST("deletions",e);r!=null&&t.push(A({tagName:"code",children:r,properties:{"data-code":"","data-container-size":n?"":void 0,"data-deletions":""}}));const o=this.renderCodeAST("additions",e);return o!=null&&t.push(A({tagName:"code",children:o,properties:{"data-code":"","data-container-size":n?"":void 0,"data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return pe(this.renderFullAST(e,t))}renderPartialHTML(e,t){return t==null?pe(e):pe(A({tagName:"code",children:e,properties:{"data-code":"","data-container-size":this.getOptionsWithDefaults().hunkSeparators==="line-info"?"":void 0,[`data-${t}`]:""}}))}pushFileLevelAnnotations(e,t,n,i){if(!kt(n))return;const r=e.type!=="new"?qn(Xt(this.deletionAnnotations)):[],o=e.type!=="deleted"?qn(Xt(this.additionAnnotations)):[];if(r.length===0&&o.length===0)return;const s=-1,l=-1,{createAnnotationElement:a}=this;if(t==="unified"){lt({diffStyle:t,type:"context",unifiedSpan:{type:"annotation",hunkIndex:s,lineIndex:l,annotations:r.concat(o)},createAnnotationElement:a,context:i});return}lt({diffStyle:t,type:"context",deletionSpan:{type:"annotation",hunkIndex:s,lineIndex:l,annotations:r},additionSpan:{type:"annotation",hunkIndex:s,lineIndex:l,annotations:o},createAnnotationElement:a,context:i})}getAnnotations(e,t,n,i,r){const o={type:"annotation",hunkIndex:i,lineIndex:r,annotations:[]};if(t!=null)for(const l of this.deletionAnnotations[t]??[])o.annotations.push(ge(l));const s={type:"annotation",hunkIndex:i,lineIndex:r,annotations:[]};if(n!=null)for(const l of this.additionAnnotations[n]??[])(e==="unified"?o:s).annotations.push(ge(l));if(e==="unified")return o.annotations.length>0?o:void 0;if(!(s.annotations.length===0&&o.annotations.length===0))return{deletionSpan:o,additionSpan:s}}renderHeader(e){const{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return Yi({fileOrDiff:e,mode:t,stickyHeader:n})}};function qn(e){return e?.map(t=>ge(t))??[]}const La=new Intl.PluralRules("en-US");function Kn(e){return`${e} unmodified line${La.select(e)==="one"?"":"s"}`}function Yn(e,t){for(const n of e)t.unifiedContentAST.push(n.content),t.pushToGutter("unified",n.gutter),t.incrementRowCount(1)}function Xn(e,t,n){for(const{deletion:i,addition:r}of e){if(i==null&&r==null)continue;const o=i!=null&&r!=null?void 0:i==null?"deletions":"additions";(o==null||n.side!==o)&&n.flush(),i!=null&&(t.deletionsContentAST.push(i.content),t.pushToGutter("deletions",i.gutter)),r!=null&&(t.additionsContentAST.push(r.content),t.pushToGutter("additions",r.gutter)),o!=null&&(n.side=o,n.increment()),t.incrementRowCount(1)}}function lt({diffStyle:e,type:t,deletionLine:n,additionLine:i,unifiedSpan:r,deletionSpan:o,additionSpan:s,createAnnotationElement:l,context:a}){let d=!1;if(e==="unified"){if(i!=null?a.unifiedContentAST.push(i):n!=null&&a.unifiedContentAST.push(n),r!=null){const h=t==="change"?n!=null?"change-deletion":"change-addition":t;a.unifiedContentAST.push(l(r)),a.pushToGutter("unified",j(h,"annotation",1)),d=!0}}else if(e==="split"){if(n!=null&&a.deletionsContentAST.push(n),i!=null&&a.additionsContentAST.push(i),o!=null){const h=t==="change"?n!=null?"change-deletion":"context":t;a.deletionsContentAST.push(l(o)),a.pushToGutter("deletions",j(h,"annotation",1)),d=!0}if(s!=null){const h=t==="change"?i!=null?"change-addition":"context":t;a.additionsContentAST.push(l(s)),a.pushToGutter("additions",j(h,"annotation",1)),d=!0}}d&&a.incrementRowCount(1)}function zt(e,{hunkIndex:t,collapsedLines:n,rangeSize:i,hunkSpecs:r,isFirstHunk:o,isLastHunk:s,isExpandable:l},a){if(n<=0)return;const d=e==="unified"?a.unifiedContentAST:e==="deletions"?a.deletionsContentAST:a.additionsContentAST;if(a.hunkSeparators==="metadata"){r!=null&&(a.pushToGutter(e,ke({type:"metadata",content:r,isFirstHunk:o,isLastHunk:s})),d.push(ke({type:"metadata",content:r,isFirstHunk:o,isLastHunk:s})),e!=="additions"&&a.incrementRowCount(1));return}if(a.hunkSeparators==="simple"){t>0&&(a.pushToGutter(e,ke({type:"simple",isFirstHunk:o,isLastHunk:!1})),d.push(ke({type:"simple",isFirstHunk:o,isLastHunk:!1})),e!=="additions"&&a.incrementRowCount(1));return}const h=aa(e,t),c=i>a.expansionLineCount,u=l?t:void 0;a.pushToGutter(e,ke({type:a.hunkSeparators,content:Kn(n),expandIndex:u,chunked:c,slotName:h,isFirstHunk:o,isLastHunk:s})),d.push(ke({type:a.hunkSeparators,content:Kn(n),expandIndex:u,chunked:c,slotName:h,isFirstHunk:o,isLastHunk:s})),e!=="additions"&&a.incrementRowCount(1),a.hunkData.push({slotName:h,hunkIndex:t,lines:n,type:e,expandable:l?{up:!o,down:!s,chunked:c}:void 0})}function dt(e,t){return e==null||e.type!=="element"||t==null?e:{...e,properties:{...e.properties,...t}}}function Ut(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function ka(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function wa(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function Ea(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:e?.useTokenTransformer,tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators=="function"?"custom":e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}let Ta=-1;var Sr=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++Ta}`;type="file-diff";fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;constructor(e={theme:_},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new _i,this.scrollSyncManager=new sa,this.interactionManager=new Pi("diff",Ke(e,typeof e.hunkSeparators=="function"||(e.hunkSeparators??"line-info")==="line-info"||e.hunkSeparators==="line-info-basic"?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return Ea(e)}createHunksRenderer(e){return new Cr(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t="additions")=>{if(this.fileDiff==null)return;const n=this.fileDiff.hunks.at(-1);let i,r;e:for(const o of this.fileDiff.hunks){let s=t==="deletions"?o.deletionStart:o.additionStart;const l=t==="deletions"?o.deletionCount:o.additionCount;let a=o.splitLineStart,d=o.unifiedLineStart;if(e=s+l){if(o===n){const h=e-(s+l);i=d+o.unifiedLineCount+h,r=a+o.splitLineCount+h;break e}continue}for(const h of o.hunkContent)if(h.type==="context")if(ethis.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators=="function")}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}const{diffStyle:e="split",overflow:t="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,t==="wrap"),t==="scroll"&&e==="split"?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}cleanUp(e=!1){this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){const{fileContainer:t,prerenderedHTML:n,preventEmit:i=!1,lineAnnotations:r,oldFile:o,newFile:s,fileDiff:l}=e;this.hydrateElements(t,n),Aa(this.pre,Ia({fileDiff:l,oldFile:o,newFile:s}),this.options.collapsed)||Ha(this.headerElement,Ra({fileDiff:l,oldFile:o,newFile:s}),this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:l,oldFile:o,newFile:s,lineAnnotations:r}),i||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),dr(e,t);for(const n of e.shadowRoot?.children??[]){if(n instanceof SVGElement){this.spriteSVG=n;continue}if(n instanceof HTMLElement){if(n instanceof HTMLPreElement){this.pre=n;for(const i of n.children)!(i instanceof HTMLElement)||i.tagName.toLowerCase()!=="code"||("deletions"in i.dataset&&(this.codeDeletions=i),"additions"in i.dataset&&(this.codeAdditions=i),"unified"in i.dataset&&(this.codeUnified=i));continue}if("diffsHeader"in n.dataset){this.headerElement=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-theme-css")){this.themeCSSStyle=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=n,this.appliedUnsafeCSS=n.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:i}){this.lineAnnotations=i??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!=null&&n!=null?tn(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.rerender()};render({oldFile:e,newFile:t,fileDiff:n,deferManagers:i=!1,forceRender:r=!1,preventEmit:o=!1,lineAnnotations:s,fileContainer:l,containerWrapper:a,renderRange:d}){if(!this.enabled)throw new Error("FileDiff.render: attempting to call render after cleaned up");const{collapsed:h=!1,themeType:c="system"}=this.options,u=h?void 0:d,f=this.hasThemeChanged(),g=e!=null&&t!=null&&(!ae(e,this.deletionFile)||!ae(t,this.additionFile));let b=n!=null&&n!==this.fileDiff;const y=s!=null&&(s.length>0||this.lineAnnotations.length>0)?s!==this.lineAnnotations:!1;if(!h&&Lt(u,this.renderRange)&&!r&&!y&&!f&&(n!=null&&n===this.fileDiff||n==null&&!g))return this.applyCachedThemeState(c);const{renderRange:m}=this;if(this.renderRange=u,this.deletionFile=e,this.additionFile=t,n!=null?this.fileDiff=n:e!=null&&t!=null&&g&&(b=!0,this.fileDiff=tn(e,t,this.options.parseDiffOptions)),b&&(this.cachedHeaderHTML=void 0),s!=null&&this.setLineAnnotations(s),this.fileDiff==null)return!1;this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:p=!1,disableFileHeader:C=!1}=this.options;if(C&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),l=this.getOrCreateFileContainer(l,a),this.applyCachedThemeState(c),h){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const v=this.hunksRenderer.renderDiff(this.fileDiff,Hi);v!=null&&this.applyThemeState(l,v.themeStyles,c,v.baseThemeType),v?.headerElement!=null&&this.applyHeaderToDOM(v.headerElement,l),this.renderSeparators([]),this.injectUnsafeCSS()}catch(v){if(p)throw v;console.error(v),v instanceof Error&&this.applyErrorToDOM(v,l)}return o||this.emitPostRender(),!0}try{const v=this.getOrCreatePreNode(l);if(!(this.canPartiallyRender(r,y,g||b||f)&&this.applyPartialRender({previousRenderRange:m,renderRange:u}))){const x=this.hunksRenderer.renderDiff(this.fileDiff,u);if(x==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(l,x.themeStyles,c,x.baseThemeType),x.headerElement!=null&&this.applyHeaderToDOM(x.headerElement,l),x.additionsContentAST!=null||x.deletionsContentAST!=null||x.unifiedContentAST!=null?this.applyHunksToDOM(v,x):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(x.hunkData)}this.applyBuffers(v,u),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,i||this.flushManagers()}catch(v){if(p)throw v;console.error(v),v instanceof Error&&this.applyErrorToDOM(v,l)}return o||this.emitPostRender(),!0}emitPostRender(e=!1){const{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,"unmount");return}if(t==null)return;const i=this.mounted?"update":"mount";this.mounted=!0,n?.(t,this,i)}removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(const{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(const{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){const t=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",t.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${e}px`),!0}primeHighlightCache(){const{fileDiff:e,workerManager:t}=this;if(e==null||t==null||nn(e))return;const n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||t.primeDiffHighlightCache(e)}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){const{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!="function"){for(const{element:i}of this.separatorCache.values())i.remove();this.separatorCache.clear();return}const n=new Map(this.separatorCache);for(const i of e){const r=i.slotName;let o=this.separatorCache.get(r);if(o==null||!wa(i,o.hunkData)){o?.element.remove();const s=document.createElement("div");s.style.display="contents",s.slot=i.slotName;const l=t(i,this);l!=null&&s.appendChild(l),this.fileContainer.appendChild(s),o={element:s,hunkData:i},this.separatorCache.set(r,o)}n.delete(r)}for(const[i,{element:r}]of n.entries())this.separatorCache.delete(i),r.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:n}of this.annotationCache.values())n.remove();this.annotationCache.clear();return}const e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(const[n,i]of this.lineAnnotations.entries()){const r=`${n}-${ge(i)}`;let o=this.annotationCache.get(r);if(o==null||!ka(i,o.annotation)){o?.element.remove();const s=t(i);if(s==null)continue;o={element:pn(ge(i)),annotation:i},o.element.appendChild(s),this.fileContainer.appendChild(o.element),this.annotationCache.set(r,o)}e.delete(r)}for(const[n,{element:i}]of e.entries())this.annotationCache.delete(n),i.remove()}renderGutterUtility(){const{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const n=rr();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){const{fileContainer:n}=this,i=e??n??document.createElement("diffs-container"),r=n!==i;return r&&this.emitPostRender(!0),this.fileContainer=i,n!=null&&r&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),r&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){const{shadowRoot:t}=e;if(t!=null)for(const n of t.children)n instanceof SVGElement?this.spriteSVG??=n:Xe(n)&&n.hasAttribute("data-theme-css")?(this.themeCSSStyle??=n,this.hasAdoptedThemeCSS=!0):Xe(n)&&n.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=n,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){const n=document.createElement("div");n.innerHTML=nr;const i=n.firstChild;i instanceof SVGElement&&(this.spriteSVG=i)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(const t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute("data-unified")?this.codeUnified=t:t.hasAttribute("data-deletions")?this.codeDeletions=t:t.hasAttribute("data-additions")&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const{fileDiff:n}=this,i=this.cachedHeaderHTML??pe(e);if(this.cachedHeaderHTML=i,i!==this.lastRenderedHeaderHTML){const d=document.createElement("div");d.innerHTML=i;const h=d.firstElementChild;if(!(h instanceof HTMLElement))return;this.headerElement!=null?t.shadowRoot?.replaceChild(h,this.headerElement):t.shadowRoot?.prepend(h),this.headerElement=h,this.lastRenderedHeaderHTML=i}if(this.isContainerManaged||n==null)return;const{renderCustomHeader:r,renderHeaderPrefix:o,renderHeaderMetadata:s}=this.options;if(r!=null){const d=r(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,an,d),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0;return}const l=o?.(n)??void 0,a=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,on,l),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,sn,a),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,i){if(i==null){t?.remove();return}const r=t??this.createHeaderSlotElement(n);return t==null&&e.appendChild(r),this.replaceHeaderSlotContent(r,i),r}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){const t=document.createElement("div");return t.slot=e,t}injectUnsafeCSS(){const{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===""){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===t&&this.appliedUnsafeCSS===e||(this.unsafeCSSStyle??=or(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=mn(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,i){const r=e.shadowRoot??e.attachShadow({mode:"open"}),o=i??n,s=this.options.theme??_,l=typeof s=="string"?s:{...s},a=Me(r);if(this.themeCSSStyle?.parentNode===r&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===o&&this.appliedThemeCSS.scrollbarGutter===a){this.appliedThemeCSS.theme=l;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===r){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:l,themeStyles:t,themeType:o,baseThemeType:i,scrollbarGutter:a};return}this.themeCSSStyle=Cn({shadowRoot:r,currentNode:this.themeCSSStyle,themeCSS:vn(t,o,a)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:l,themeStyles:t,themeType:o,baseThemeType:i,scrollbarGutter:a}:void 0}hydrateMeasuredScrollbar(){const e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=lr(this.themeCSSStyle.textContent??"",Me(e)))}applyHunksToDOM(e,t){const{overflow:n="scroll"}=this.options,i=(this.options.hunkSeparators??"line-info")==="line-info",r=n==="wrap"?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let o=!1;const s=[],l=this.hunksRenderer.renderCodeAST("unified",t),a=this.hunksRenderer.renderCodeAST("deletions",t),d=this.hunksRenderer.renderCodeAST("additions",t);l!=null?(o=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=je({code:this.codeUnified,columnType:"unified",rowSpan:r,containerSize:i}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(l),s.push(this.codeUnified)):a!=null||d!=null?(a!=null?(o=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=je({code:this.codeDeletions,columnType:"deletions",rowSpan:r,containerSize:i}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(a),s.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),d!=null?(o=o||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=je({code:this.codeAdditions,columnType:"additions",rowSpan:r,containerSize:i}),this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(d),s.push(this.codeAdditions)):(this.codeAdditions?.remove(),this.codeAdditions=void 0)):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0),s.length===0?e.textContent="":o&&e.replaceChildren(...s),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){const{pre:n,codeUnified:i,codeAdditions:r,codeDeletions:o,options:{diffStyle:s="split"}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;const l=this.getCodeColumns(s,i,o,r);if(l==null)return!1;const a=e.startingLine,d=t.startingLine,h=a+e.totalLines,c=d+t.totalLines,u=Math.max(a,d),f=Math.min(h,c);if(f<=u)return!1;const g=Math.max(0,u-a),b=Math.max(0,h-f),y=this.trimColumns({columns:l,trimStart:g,trimEnd:b,previousStart:a,overlapStart:u,overlapEnd:f,diffStyle:s});if(y<0)throw new Error("applyPartialRender: failed to trim to overlap");if(this.lastRowCount{if(!(L<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:S,totalLines:L,bufferBefore:0,bufferAfter:0})},C=p(d,Math.max(u-d,0));if(C==null&&df)return!1;const x=(S,L)=>{if(S!=null){if(s==="unified"&&!Array.isArray(l))this.insertPartialHTML(s,l,S,L);else if(s==="split"&&Array.isArray(l))this.insertPartialHTML(s,l,S,L);else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");m+=S.rowCount}};return this.cleanupErrorWrapper(),x(C,"afterbegin"),x(v,"beforeend"),this.lastRowCount!==m&&(this.applyRowSpan(s,l,m),this.lastRowCount=m),!0}insertPartialHTML(e,t,n,i){if(e==="unified"&&!Array.isArray(t)){const r=this.hunksRenderer.renderCodeAST("unified",n);this.renderPartialColumn(t,r,i)}else if(e==="split"&&Array.isArray(t)){const r=this.hunksRenderer.renderCodeAST("deletions",n),o=this.hunksRenderer.renderCodeAST("additions",n);this.renderPartialColumn(t[0],r,i),this.renderPartialColumn(t[1],o,i)}else throw new Error("FileDiff.insertPartialHTML: Invalid argument composition")}renderPartialColumn(e,t,n){if(e==null||t==null)return;const i=Qn(t[0]),r=Qn(t[1]);if(i==null||r==null)throw new Error("FileDiff.insertPartialHTML: Unexpected AST structure");const o=r.at(0);n==="beforeend"&&o?.type==="element"&&typeof o.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(o.properties["data-buffer-size"],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],i,r,!0);const s=r.at(-1);n==="afterbegin"&&s?.type==="element"&&typeof s.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(s.properties["data-buffer-size"],e.content.children[0],e.gutter.children[0],i,r,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r))}mergeBuffersIfNecessary(e,t,n,i,r,o){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;const s=this.getBufferSize(t.dataset);s!=null&&(o?(i.shift(),r.shift()):(i.pop(),r.pop()),this.updateBufferSize(t,s+e),this.updateBufferSize(n,s+e))}applyRowSpan(e,t,n){const i=r=>{r!=null&&(r.gutter.style.setProperty("grid-row",`span ${n}`),r.content.style.setProperty("grid-row",`span ${n}`))};if(e==="unified"&&!Array.isArray(t))i(t);else if(e==="split"&&Array.isArray(t))i(t[0]),i(t[1]);else throw new Error("dun fuuuuked up")}trimColumnRows(e,t,n){let i=0,r=0,o=0,s=!1;const l=n>=0;if(e==null)return 0;const a=Array.from(e.content.children),d=Array.from(e.gutter.children);if(a.length!==d.length)throw new Error("FileDiff.trimColumnRows: columns do not match");for(;o0||l&&i>=n)&&(h.remove(),c.remove(),t>0&&(t--,t===0&&(s=!0)),r++),i++;continue}if("separator"in h.dataset&&"separator"in c.dataset){(t>0||l&&i>=n)&&(h.remove(),c.remove(),r++);continue}if(h.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in c.dataset){(t>0||l&&i>=n)&&(h.remove(),c.remove(),r++);continue}if(h.dataset.gutterBuffer==="metadata"&&"noNewline"in c.dataset){(t>0||l&&i>=n)&&(h.remove(),c.remove(),r++);continue}if(h.dataset.gutterBuffer==="buffer"&&"contentBuffer"in c.dataset){const u=this.getBufferSize(c.dataset);if(u==null)throw new Error("FileDiff.trimColumnRows: invalid element");if(t>0){const f=Math.min(t,u),g=u-f;g>0?(this.updateBufferSize(h,g),this.updateBufferSize(c,g),r+=f):(h.remove(),c.remove(),r+=u),t-=f,t===0&&g===0&&(s=!0)}else if(l){const f=i,g=i+u-1;if(n<=f)h.remove(),c.remove(),r+=u;else if(n<=g){const b=g-n+1,y=u-b;this.updateBufferSize(h,y),this.updateBufferSize(c,y),r+=b}}i+=u;continue}throw console.error({gutterElement:h,contentElement:c}),new Error("FileDiff.trimColumnRows: unknown row elements")}return r}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:i,previousStart:r,trimEnd:o,trimStart:s}){const l=Math.max(0,i-r),a=n-r;if(a<0)throw new Error("FileDiff.trimColumns: overlap ends before previous");const d=s>0,h=o>0;if(!d&&!h)return 0;const c=d?l:0,u=h?a:-1;if(t==="unified"&&!Array.isArray(e))return this.trimColumnRows(e,c,u);if(t==="split"&&Array.isArray(e)){const f=this.trimColumnRows(e[0],c,u),g=this.trimColumnRows(e[1],c,u);if(e[0]!=null&&e[1]!=null&&f!==g)throw new Error("FileDiff.trimColumns: split columns out of sync");return e[0]!=null?f:g}else throw console.error({diffStyle:t,columns:e}),new Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(e){const t=Number.parseInt(e?.bufferSize??"",10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty("grid-row",`span ${t}`),e.style.setProperty("min-height",`calc(${t} * 1lh)`)}getCodeColumns(e,t,n,i){function r(o){if(o==null)return;const s=o.children[0],l=o.children[1];if(!(!(s instanceof HTMLElement)||!(l instanceof HTMLElement)||s.dataset.gutter==null||l.dataset.content==null))return{gutter:s,content:l}}if(e==="unified")return r(t);{const o=r(n),s=r(i);return o!=null||s!=null?[o,s]:void 0}}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore==null&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",e.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${t.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${t.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:i},r){const{diffIndicators:o="bars",disableBackground:s=!1,disableLineNumbers:l=!1,overflow:a="scroll",diffStyle:d="split"}=this.options,h={type:"diff",diffIndicators:o,disableBackground:s,disableLineNumbers:l,overflow:a,split:d==="unified"?!1:t!=null&&n!=null,totalLines:i,customProperties:r};ir(h,this.appliedPreAttributes)||(bn(e,h),this.appliedPreAttributes=h)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const n=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",n.appendChild(this.errorWrapper);const i=document.createElement("div");i.dataset.errorMessage="",i.innerText=e.message,this.errorWrapper.appendChild(i);const r=document.createElement("pre");r.dataset.errorStack="",r.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(r)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function Ia({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function Ra({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function Aa(e,t,n=!1){return!n&&e==null&&t}function Ha(e,t,n=!1){return e==null&&t&&!n}function Qn(e){if(!(e==null||e.type!=="element"))return e.children??[]}function Ma({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:i,expandUnchanged:r,expandedHunks:o,collapsedContextThreshold:s}){let l=se(t,n),a=l;const d=r?!0:o,h=e.hunks.length-1;for(let c=0;c0){const m=$e({type:i,metrics:t,hunkIndex:c,hunkSpecs:u.hunkSpecs})?.totalHeight??0;l+=m,a+=m}l+=u.splitLineCount*t.lineHeight,a+=u.unifiedLineCount*t.lineHeight;const b=Da(u);l+=b.split*t.lineHeight,a+=b.unified*t.lineHeight;const y=c===h?Je({fileDiff:e,hunkIndex:c,expandedHunks:d,collapsedContextThreshold:s,errorPrefix:"computeEstimatedDiffHeights"}):void 0;if(y!=null){const m=(y.fromStart+y.fromEnd)*t.lineHeight;if(l+=m,a+=m,y.collapsedLines>0){const p=We({type:i,metrics:t})?.totalHeight??0;l+=p,a+=p}}}if(e.hunks.length>0){const c=yt(t);l+=c,a+=c}return{splitHeight:l,unifiedHeight:a}}function Da(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};const t=e.hunkContent.at(-1);if(t==null)return{split:0,unified:0};if(t.type==="context"){const n=t.lines>0?1:0;return{split:n,unified:n}}return Pa(e,t)}function Pa(e,t){const n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),i=t.deletions>0&&e.noEOFCRDeletions,r=t.additions>0&&e.noEOFCRAdditions;return{split:i||r?1:0,unified:n}}const rn=5e3;let _a=-1;var Oa=class extends Sr{__id=`little-virtualized-file-diff:${++_a}`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n,i,r=!1){super(e,i,r),this.virtualizer=t,this.metrics=_t(n)}setMetrics(e,t=!1){const n=_t(e);!t&&He(this.metrics,n)||(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache({includeEstimatedHeights:!1})}syncLineAnnotations(e){return e==null||e===this.lineAnnotations||e.length===0&&this.lineAnnotations.length===0?!1:(super.setLineAnnotations(e),!0)}setFileAnnotationHeight(e){const t=this.cache.fileAnnotationHeight;return e===t?!1:(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e=this.fileDiff){return e==null||!Yt(this.lineAnnotations)?!1:this.lineAnnotations.some(t=>t.lineNumber!==0?!1:e.type==="new"?t.side==="additions":e.type==="deleted"?t.side==="deletions":!0)}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){const t=e?2:1;return this.metrics.lineHeight*t}setOptions(e){if(this.isAdvancedMode())throw new Error("VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(e==null)return;const{options:t}=this,n=!dn(t,e),i=n&&Ba(t,e);super.setOptions(e),i&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:$a(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,i)}setThemeType(e){if(this.isAdvancedMode())throw new Error("VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal!==0&&(this.cache.measuredHeightDeltaTotal=0),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),t&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1;const{overflow:t="scroll"}=this.options;if(this.fileContainer==null||this.fileDiff==null)return this.height!==0&&(e=!0),this.height=0,e;if(this.top=this.getVirtualizedTop(),t==="scroll"&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled())return e;const n=this.getDiffStyle(),i=n==="split"?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],r=this.hasFileAnnotations(this.fileDiff);if(this.renderRange!=null&&r&&kt(this.renderRange)){const o=Na(i)??0;this.setFileAnnotationHeight(o)&&(e=!0)}else!r&&this.setFileAnnotationHeight(0)&&(e=!0);for(const o of i){if(o==null)continue;const s=o.children[1];if(s instanceof HTMLElement)for(const l of s.children){if(!(l instanceof HTMLElement))continue;const a=l.dataset.lineIndex;if(a==null)continue;const d=Ga(a,n);let h=l.getBoundingClientRect().height,c=!1;l.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in l.nextElementSibling.dataset||"noNewline"in l.nextElementSibling.dataset)&&("noNewline"in l.nextElementSibling.dataset&&(c=!0),h+=l.nextElementSibling.getBoundingClientRect().height);const u=this.getEstimatedLineHeight(c),f=this.cache.heightDeltas.get(d)??0,g=h-u;g!==f&&(e=!0,this.cache.measuredHeightDeltaTotal+=g-f,g===0?this.cache.heightDeltas.delete(d):this.cache.heightDeltas.set(d,g))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render());prepareCodeViewItem(e,t,n,i){const r=!Be(this.fileDiff,e),o=this.syncLineAnnotations(i);let s=n?.resetDiffLayoutCache===!0||r||o,l=r||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;n?.metrics!=null&&(this.metrics=_t(n.metrics),s=!0,l=!0);const{collapsed:a=!1}=this.options;return this.currentCollapsed!==a&&(this.currentCollapsed=a,s=!0),s&&this.resetLayoutCache({includeEstimatedHeights:l}),this.fileDiff=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e,t="additions"){if(this.fileDiff==null||e<1)return;const n=this.getLineIndex(e,t);if(n==null)return;const{disableFileHeader:i=!1,expandUnchanged:r=!1,collapsed:o=!1,collapsedContextThreshold:s=1}=this.options,l=this.getDiffStyle(),a=this.getHunkSeparatorType(),d=l==="split"?n[1]:n[0];this.approximateLayoutCheckpoints();const h=se(this.metrics,i),c=this.getLayoutCheckpointBeforeLineIndex(d);let u=c?.top??h+this.cache.fileAnnotationHeight;if(o)return{top:h,height:0};let f;return qe({diff:this.fileDiff,diffStyle:l,startingLine:c?.renderedLineIndex??0,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:g,hunk:b,collapsedBefore:y,collapsedAfter:m,deletionLine:p,additionLine:C})=>{const v=l==="split"?C?.splitLineIndex??p?.splitLineIndex:C?.unifiedLineIndex??p?.unifiedLineIndex;if(v==null)throw new Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(y>0){const S=$e({type:a,metrics:this.metrics,hunkIndex:g,hunkSpecs:b?.hunkSpecs});if(S!=null){if(u+=S.gapBefore,d>=v-y&&d0){const S=We({type:a,metrics:this.metrics});if(S!=null){if(d>v&&d<=v+m)return f={top:u+S.gapBefore,height:S.height},!0;u+=S.totalHeight}}return!1}}),f}getNumericScrollAnchor(e){if(this.fileDiff==null)return;const{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsed:i=!1,collapsedContextThreshold:r=1}=this.options;if(i)return;const o=this.getDiffStyle(),s=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();const l=this.getLayoutCheckpointBeforeTop(e);let a=l?.top??se(this.metrics,t)+this.cache.fileAnnotationHeight,d;return qe({diff:this.fileDiff,diffStyle:o,startingLine:l?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,callback:({hunkIndex:h,hunk:c,collapsedBefore:u,collapsedAfter:f,deletionLine:g,additionLine:b})=>{const y=o==="split"?b?.splitLineIndex??g?.splitLineIndex:b?.unifiedLineIndex??g?.unifiedLineIndex;if(y==null)throw new Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(u>0){const p=$e({type:s,metrics:this.metrics,hunkIndex:h,hunkSpecs:c?.hunkSpecs});p!=null&&(a+=p.totalHeight)}if(a>=e&&(g!=null?d={lineNumber:g.lineNumber,side:"deletions",top:a}:b!=null&&(d={lineNumber:b.lineNumber,side:"additions",top:a}),d!=null))return!0;const m=this.getLineHeight(y,(b?.noEOFCR??!1)||(g?.noEOFCR??!1));if(a+=m,f>0){const p=We({type:s,metrics:this.metrics});p!=null&&(a+=p.totalHeight)}return!1}}),d}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.fileDiff==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};const t=e!=null?this.computeRenderRangeFromWindow(this.fileDiff,this.top,e):this.renderRange;if(t==null)return;const{bufferBefore:n,bufferAfter:i,totalLines:r}=t;let o=0;if(r===0){const s=e??this.virtualizer.getWindowSpecs();this.top{this.hunksRenderer.expandHunk(e,t,n),this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSimpleMode()&&this.computeApproximateSize(),this.virtualizer.instanceChanged(this,!0)};setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}computeApproximateSize(e=!1){const t=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!t)return;const n=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,this.fileDiff==null){this.layoutDirty=!1;return}const{disableFileHeader:i=!1,collapsed:r=!1}=this.options,o=se(this.metrics,i);if(this.height+=o,r){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight()+this.cache.measuredHeightDeltaTotal,t&&!n&&this.validateComputedHeight(),this.layoutDirty=!1}getActiveEstimatedHeight(){this.ensureEstimatedDiffHeights();const e=this.getDiffStyle()==="split"?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(e==null)throw new Error("VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height");return e}ensureEstimatedDiffHeights(){if(this.fileDiff==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;const{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=1}=this.options,{splitHeight:i,unifiedHeight:r}=Ma({fileDiff:this.fileDiff,metrics:this.metrics,disableFileHeader:e,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:t,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:n});this.cache.estimatedSplitHeight=i,this.cache.estimatedUnifiedHeight=r}validateComputedHeight(){if(this.fileContainer==null||this.fileDiff==null)return;const e=this.fileContainer.getBoundingClientRect();e.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:this.fileDiff.name,elementHeight:e.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:i,forceRender:r=!1,lineAnnotations:o,...s}={}){const{forceRenderOverride:l,isSetup:a}=this;this.forceRenderOverride=void 0;const d=this.syncLineAnnotations(o);if(d&&this.resetLayoutCache({includeEstimatedHeights:!1}),this.fileDiff??=i??(t!=null&&n!=null?tn(t,n,this.options.parseDiffOptions):void 0),e=this.getOrCreateFileContainer(e),this.fileDiff==null)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;if(a)this.top??=this.getVirtualizedTop();else{this.computeApproximateSize();const f=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(f==null)throw new Error("VirtualizedFileDiff.render: simple virtualizer is not available");f.connect(e,this),this.isVisible=f.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode())return this.renderPlaceholder(this.height);const h=this.virtualizer.getWindowSpecs(),c=this.top??0,u=this.computeRenderRangeFromWindow(this.fileDiff,c,h);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:u,oldFile:t,newFile:n,lineAnnotations:o,forceRender:(l??r)||d,...s})}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}getVirtualizedTop(){return this.virtualizer.type==="advanced"?this.virtualizer.getLocalTopForInstance(this):this.fileContainer!=null?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return this.virtualizer.type==="simple"?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??"split"}getHunkSeparatorType(){return Wa(this.options.hunkSeparators)}approximateLayoutCheckpoints(){if(this.cache.checkpoints.length>0||this.fileDiff==null||this.fileDiff.hunks.length===0||this.options.collapsed===!0)return;const{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=1}=this.options,i=this.fileDiff.hunks.length-1,r=this.getDiffStyle(),o=this.getHunkSeparatorType(),s=t?!0:this.hunksRenderer.getExpandedHunksMap(),l=Fa(this.cache.heightDeltas);let a=se(this.metrics,e)+this.cache.fileAnnotationHeight,d=0;const h=({rowCount:c,startLineIndex:u,preSeparatorHeight:f=0,postSeparatorHeight:g=0,metadataOffsets:b=[]})=>{if(c<=0)return;const y=d,m=d+c;let p=za(y);for(;p0?f:0)+C*this.metrics.lineHeight+Ua(b,C)*this.metrics.lineHeight+Jn(l,u,u+C);this.cache.checkpoints.push({renderedLineIndex:p,lineIndex:u+C,top:v}),p+=rn}a+=f+c*this.metrics.lineHeight+b.length*this.metrics.lineHeight+Jn(l,u,u+c)+g,d=m};for(let c=0;c0?$e({type:o,metrics:this.metrics,hunkIndex:c,hunkSpecs:u.hunkSpecs})?.totalHeight??0:0;h({rowCount:f.fromStart,startLineIndex:(r==="split"?u.splitLineStart:u.unifiedLineStart)-f.rangeSize});let b=g;h({rowCount:f.fromEnd,startLineIndex:(r==="split"?u.splitLineStart:u.unifiedLineStart)-f.fromEnd,preSeparatorHeight:b}),f.fromEnd>0&&(b=0);const y=c===i?Je({fileDiff:this.fileDiff,hunkIndex:c,expandedHunks:s,collapsedContextThreshold:n,errorPrefix:"VirtualizedFileDiff"}):void 0,m=y!=null&&y.collapsedLines>0?We({type:o,metrics:this.metrics})?.totalHeight??0:0,p=y!=null?y.fromStart+y.fromEnd:0,C=r==="split"?u.splitLineCount:u.unifiedLineCount,v=r==="split"?u.splitLineStart:u.unifiedLineStart;h({rowCount:C,startLineIndex:v,preSeparatorHeight:b,postSeparatorHeight:p===0?m:0,metadataOffsets:Va({diffStyle:r,hunk:u,rowCount:C})}),y!=null&&p>0&&h({rowCount:p,startLineIndex:v+C,postSeparatorHeight:m})}this.cache.totalLines=d}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,i;for(;t<=n;){const r=t+n>>1,o=this.cache.checkpoints[r];if(o==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");o.lineIndex<=e?(i=o,t=r+1):n=r-1}return i}getLayoutCheckpointBeforeTop(e,t){let n=0,i=this.cache.checkpoints.length-1,r=-1;for(;n<=i;){const o=n+i>>1,s=this.cache.checkpoints[o];if(s==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");s.top<=e?(r=o,n=o+1):i=o-1}if(t==null)return r>=0?this.cache.checkpoints[r]:void 0;for(let o=r;o>=0;o--){const s=this.cache.checkpoints[o];if(s==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");if(s.renderedLineIndex%t===0)return s}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(const l of e.hunks)n+=t==="split"?l.splitLineCount:l.unifiedLineCount;return n}const{expandUnchanged:i=!1,collapsedContextThreshold:r=1}=this.options,o=i?!0:this.hunksRenderer.getExpandedHunksMap();for(const[l,a]of e.hunks.entries()){const d=t==="split"?a.splitLineCount:a.unifiedLineCount;n+=d;const h=Math.max(a.collapsedBefore,0),{fromStart:c,fromEnd:u,renderAll:f}=Qe({isPartial:e.isPartial,rangeSize:h,expandedHunks:o,hunkIndex:l,collapsedContextThreshold:r});h>0&&(n+=f?h:c+u)}const s=Je({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:o,collapsedContextThreshold:r,errorPrefix:"VirtualizedFileDiff"});return s!=null&&(n+=s.fromStart+s.fromEnd),n}computeRenderRangeFromWindow(e,t,{top:n,bottom:i}){const{disableFileHeader:r=!1,expandUnchanged:o=!1,collapsedContextThreshold:s=1}=this.options,{hunkLineCount:l,lineHeight:a}=this.metrics,d=this.getDiffStyle(),h=this.getHunkSeparatorType(),c=this.height;let u=this.cache.totalLines>0?this.cache.totalLines:this.getExpandedLineCount(e,d);const f=se(this.metrics,r),g=e.hunks.length>0?yt(this.metrics):0,{fileAnnotationHeight:b}=this.cache,y=f+b,m=Math.max(0,c-f-b-g),p=this.hasFileAnnotations(e),C=t+f,v=b>0&&p&&Cn;if(ti)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:c-f-g};if(u<=l||e.hunks.length===0)return{startingLine:0,totalLines:l,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(),u=this.cache.totalLines>0?this.cache.totalLines:u;const x=Math.ceil(Math.max(i-n,0)/a),S=Math.ceil(x/l)*l+l,L=S/l,E=L,w=[],R=(n+i)/2,H=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-S*a*2),l);let I=t+(H?.top??y),T=H?.renderedLineIndex??0,M,N,G;if(qe({diff:e,diffStyle:d,startingLine:H?.renderedLineIndex??0,expandedHunks:o?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:le,hunk:q,collapsedBefore:ye,collapsedAfter:P,deletionLine:V,additionLine:z})=>{const de=z!=null?z.splitLineIndex:V.splitLineIndex,te=z!=null?z.unifiedLineIndex:V.unifiedLineIndex,ne=(z?.noEOFCR??!1)||(V?.noEOFCR??!1),Pe=(ye>0?$e({type:h,metrics:this.metrics,hunkIndex:le,hunkSpecs:q?.hunkSpecs}):void 0)?.totalHeight??0;I+=Pe;const K=T%l===0,wt=Math.floor(T/l);if(K&&(w[wt]=I-(t+y+Pe),G!=null)){if(G<=0)return!0;G--}const Et=this.getLineHeight(d==="split"?de:te,ne);return I>n-Et&&IR&&(N=wt),G==null&&I>=i&&K&&(G=E),T++,I+=Et,P>0&&(I+=We({type:h,metrics:this.metrics})?.totalHeight??0),!1}}),M==null)if(v)M=0,N=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:c-f-g};N??=M;const D=Math.round(N-L/2),F=Math.max(0,Math.ceil(u/l)-L),O=Math.max(0,Math.min(D,F)),J=O*l,me=D<0?S+D*l:S,ve=w[O]??0,Le=J===0?0:b+ve,ee=O+me/l,be=eeo[0]-s[0]),n=[],i=[0];let r=0;for(const[o,s]of t)n.push(o),r+=s,i.push(r);return{lineIndexes:n,prefixTotals:i}}function Jn({lineIndexes:e,prefixTotals:t},n,i){if(n>=i||e.length===0)return 0;const r=Zn(e,n);return(t[Zn(e,i)]??0)-(t[r]??0)}function Zn(e,t){let n=0,i=e.length;for(;n>1,o=e[r];if(o==null)throw new Error("VirtualizedFileDiff: invalid prefix index");o0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];const s=[],l=n-o;return i.deletions>0&&t.noEOFCRDeletions&&s.push(l+i.deletions-1),i.additions>0&&t.noEOFCRAdditions&&s.push(n-1),s}function Ba(e,t){return(e.diffStyle??"split")!==(t.diffStyle??"split")||(e.overflow??"scroll")!==(t.overflow??"scroll")||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??"bars")!==(t.diffIndicators??"bars")||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function $a(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function Wa(e){return typeof e=="function"?"custom":e??"line-info"}function Ga(e,t){const[n,i]=e.split(",").map(Number);return t==="split"?i:n}function re(e){const t=window.devicePixelRatio??1;return Math.round(e*t)/t}const ja=["theme","disableLineNumbers","overflow","themeType","disableFileHeader","disableVirtualizationBuffers","preferredHighlighter","useCSSClasses","useTokenTransformer","tokenizeMaxLineLength","tokenizeMaxLength","unsafeCSS","diffStyle","diffIndicators","disableBackground","expandUnchanged","collapsedContextThreshold","lineDiffType","maxLineDiffLength","expansionLineCount","lineHoverHighlight","enableTokenInteractionsOnWhitespace","enableGutterUtility","__debugPointerEvents","enableLineSelection","controlledSelection","disableErrorHandling"],qa=["theme","disableLineNumbers","overflow","themeType","disableFileHeader","disableVirtualizationBuffers","preferredHighlighter","useCSSClasses","useTokenTransformer","tokenizeMaxLineLength","tokenizeMaxLength","unsafeCSS","lineHoverHighlight","enableTokenInteractionsOnWhitespace","enableGutterUtility","__debugPointerEvents","enableLineSelection","controlledSelection","disableErrorHandling"],ei=["renderCustomHeader","renderHeaderPrefix","renderHeaderMetadata","renderAnnotation","renderGutterUtility","onPostRender","onGutterUtilityClick","onLineClick","onLineNumberClick","onLineEnter","onLineLeave","onTokenClick","onTokenEnter","onTokenLeave"],ti=["onLineSelected","onLineSelectionStart","onLineSelectionChange","onLineSelectionEnd"],yr=Symbol("CodeView.itemOptionsState");function ni(e,t){Object.defineProperty(e,yr,{configurable:!1,enumerable:!1,value:t})}function ze(e){return e[yr]}function ce(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get(){return n(this)}})}const Ka=120,ii="--diffs-overflow-override",yn=12e6,xr=1e6,Lr=2e6,Ya=yn-Lr,ri=yn-xr,Xa=(()=>{const{navigator:e}=globalThis,t=e.userAgent,n=/iP(?:hone|ad|od)/.test(t),i=e.platform==="MacIntel"&&e.maxTouchPoints>1;return(n||i)&&/AppleWebKit/.test(t)&&/Safari/.test(t)&&!/(CriOS|FxiOS|EdgiOS|OPiOS)/.test(t)})();var ed=class fe{static __STOP=!1;static __lastScrollPosition=0;type="advanced";config={overscrollSize:200,intersectionObserverMargin:0,resizeDebugging:!1};items=[];idToItem=new Map;selectedLines=null;instanceToItem=new Map;layoutDirtyIndex;pendingLayoutReset;renderOptionsRevision=0;slotCoordinator;slotSnapshot;scrollListeners=new Set;scrollHeight=0;containerHeight=-1;scrollTop=0;scrollPageOffset=0;scrollDirty=!0;scrollInteractionFixTimer;pointerEventsDisabled=!1;codeOverflowFix=!1;height=0;heightDirty=!0;windowSpecs={top:0,bottom:0};renderState={scrollTop:-1,firstIndex:-1,lastIndex:-1,stickyHeight:0,stickyTop:-1,stickyBottom:-1};itemMetricsCache=_e;fileOptionsPrototype;diffOptionsPrototype;pendingScrollTarget;pendingLayoutAnchor;shouldFixContainerFocus=!1;scrollAnimation;root;resizeObserver;container=document.createElement("div");stickyContainer=document.createElement("div");stickyOffset=document.createElement("div");elementPool=[];elementPoolVersion=0;elementPoolTracker=new WeakMap;pendingElementPool=[];options;workerManager;isContainerManaged;constructor(t={theme:_},n,i=!1){this.options=t,this.computeMetricsCache(t.itemMetrics),this.fileOptionsPrototype=this.createFileOptionsPrototype(),this.diffOptionsPrototype=this.createDiffOptionsPrototype(),this.workerManager=n,this.isContainerManaged=i,this.stickyOffset.style.contain="layout size",this.stickyContainer.style.position="sticky",this.stickyContainer.style.width="100%",this.stickyContainer.style.contain="layout style inline-size",this.stickyContainer.style.isolation="isolate",this.stickyContainer.style.display="flex",this.stickyContainer.style.flexDirection="column"}getLayout(){return this.options.layout??eo}computeMetricsCache(t){return this.itemMetricsCache={hunkLineCount:t?.hunkLineCount??_e.hunkLineCount,lineHeight:t?.lineHeight??_e.lineHeight,diffHeaderHeight:t?.diffHeaderHeight??_e.diffHeaderHeight,hunkSeparatorHeight:t?.hunkSeparatorHeight,spacing:t?.spacing??_e.spacing,paddingTop:t?.paddingTop,paddingBottom:t?.paddingBottom},this.itemMetricsCache}getSmoothScrollSettings(){return this.options.smoothScrollSettings??to}shouldDisablePointerEvents(){return this.options.pointerEventsOnScroll!==!0}shouldValidateItemHeights(){return $r&&this.options.__devOnlyValidateItemHeights===!0}validateRenderedItemHeight(t){if(!this.shouldValidateItemHeights()||t.element==null)return;const n=t.instance.getAdvancedStickySpecs();if(n==null)return;const i=n.height,r=t.element.getBoundingClientRect().height;i!==r&&console.error("CodeView: reconciled item height does not match DOM height",{id:t.item.id,type:t.type,index:t.index,version:t.version,expectedHeight:i,actualHeight:r,delta:r-i,stickyTopOffset:n.topOffset,virtualizedHeight:t.instance.getVirtualizedHeight(),top:t.top,scrollTop:this.getScrollTop(),windowSpecs:{...this.windowSpecs},element:t.element,instance:t.instance})}validateStickyContainerHeight(){if(!this.shouldValidateItemHeights())return;const{firstIndex:t,lastIndex:n,stickyHeight:i,stickyTop:r,stickyBottom:o}=this.renderState;if(t===-1||n===-1)return;const s=this.stickyContainer.getBoundingClientRect().height;Math.abs(s-i)<1||console.error("CodeView: sticky container height does not match computed layout",{computedStickyHeight:i,actualStickyHeight:s,delta:s-i,stickyTop:r,stickyBottom:o,firstIndex:t,lastIndex:n,firstStickySpecs:this.items[t]?.instance.getAdvancedStickySpecs(),lastStickySpecs:this.items[n]?.instance.getAdvancedStickySpecs(),scrollTop:this.getScrollTop(),scrollPageOffset:this.scrollPageOffset,windowSpecs:{...this.windowSpecs},stickyContainer:this.stickyContainer})}clearScrollInteractionTimer(){this.scrollInteractionFixTimer!=null&&(clearTimeout(this.scrollInteractionFixTimer),this.scrollInteractionFixTimer=void 0)}suspendScrollInteractions(){this.clearScrollInteractionTimer(),this.shouldDisablePointerEvents()&&!this.pointerEventsDisabled&&(this.stickyContainer.style.pointerEvents="none",this.pointerEventsDisabled=!0),Xa&&!this.codeOverflowFix&&(this.stickyContainer.style.setProperty(ii,"hidden"),this.codeOverflowFix=!0),this.scrollInteractionFixTimer=setTimeout(this.restoreScrollInteractions,Ka)}restoreScrollInteractions=()=>{this.clearScrollInteractionTimer(),this.pointerEventsDisabled&&(this.stickyContainer.style.removeProperty("pointer-events"),this.pointerEventsDisabled=!1),this.codeOverflowFix&&(this.stickyContainer.style.setProperty(ii,"auto"),this.codeOverflowFix=!1)};syncLayout(){const{gap:t,paddingBottom:n,paddingTop:i}=this.getLayout();this.stickyContainer.style.gap=`${t}px`,this.container?.style.setProperty("margin-top",`${i}px`),this.container?.style.setProperty("margin-bottom",`${n}px`)}setup(t){if(this.root!=null)throw new Error("CodeView.setup: already setup");this.workerManager?.subscribeToThemeChanges(this),this.root=t,this.root.style.overflowAnchor="none",this.root.hasAttribute("tabindex")||(this.root.tabIndex=-1),this.container??=document.createElement("div"),this.container.style.contain="layout style",this.syncLayout(),this.container.appendChild(this.stickyOffset),this.container.appendChild(this.stickyContainer),this.root.appendChild(this.container),this.scrollDirty=!0,this.heightDirty=!0,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.stickyContainer),this.root.addEventListener("scroll",this.handleScroll,{passive:!0}),this.root.addEventListener("wheel",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("touchstart",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("pointerdown",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("keydown",this.clearPendingScroll,{passive:!0}),this.resizeObserver.observe(this.root),this.render(!0),window.__INSTANCE=this,window.__TOGGLE=()=>{fe.__STOP?(fe.__STOP=!1,this.scrollTo({type:"position",position:fe.__lastScrollPosition,behavior:"instant"})):(fe.__lastScrollPosition=this.getScrollTop(),fe.__STOP=!0)}}reset(){this.restoreScrollInteractions(),this.cleanAllRenderedItems(),this.selectedLines=null,this.items.length=0,this.idToItem.clear(),this.instanceToItem.clear(),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,this.stickyContainer.textContent="",this.stickyOffset.style.height="",this.container?.style.removeProperty("height"),this.containerHeight=-1,this.windowSpecs={top:0,bottom:0},this.pendingLayoutAnchor=void 0,this.shouldFixContainerFocus=!1,this.height=0,this.scrollTop=0,this.scrollPageOffset=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.resetRenderState(),this.isContainerManaged||this.flushSlotCoordinator()}cleanUp(){this.reset(),this.clearElementPool(),this.restoreScrollInteractions(),this.workerManager?.unsubscribeToThemeChanges(this),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.root?.removeEventListener("scroll",this.handleScroll),this.root?.removeEventListener("wheel",this.clearPendingScroll),this.root?.removeEventListener("touchstart",this.clearPendingScroll),this.root?.removeEventListener("pointerdown",this.clearPendingScroll),this.root?.removeEventListener("keydown",this.clearPendingScroll),this.root?.style.removeProperty("overflow-anchor"),this.container?.remove(),this.stickyOffset.remove(),this.stickyContainer.remove(),this.stickyContainer.textContent="",this.root=void 0,this.container=void 0}cleanAllRenderedItems(){if(this.renderState.firstIndex!==-1)for(let t=this.renderState.firstIndex;t<=this.renderState.lastIndex;t++){const n=this.items[t];if(n==null)throw new Error(`CodeView.cleanAllRenderedItems: Item does not exist at index: ${t}`);this.releaseRenderedItem(n)}}primeScrollTarget(t){if(t.type==="position")return;const n=this.idToItem.get(t.id);n?.instance.primeHighlightCache()}getElementPoolLimit(){const t=this.getHeight()+this.config.overscrollSize*2,{diffHeaderHeight:n}=this.itemMetricsCache;return Math.max(8,Math.ceil(t/Math.max(n,10))+1)*(this.isContainerManaged?2:1)}acquireElement(){this.promotePendingPooledElements();let t=this.elementPool.pop();for(;t!=null&&!this.isElementPoolGenerationCurrent(t);)t=this.elementPool.pop();return t??=document.createElement(Ei),this.markElementPoolGenerationCurrent(t),t}releaseRenderedItem(t){const{element:n}=t;n!=null&&this.renderedItemOwnsFocus(n)&&(this.shouldFixContainerFocus=!0),t.instance.cleanUp(!0),t.element=void 0,n!=null&&(n.remove(),this.cleanElement(n),this.queueElementForPool(n))}renderedItemOwnsFocus(t){const{activeElement:n}=document;return n===t||t.contains(n)||t.shadowRoot?.activeElement!=null}fixContainerFocus(){this.shouldFixContainerFocus&&(this.shouldFixContainerFocus=!1,this.root?.focus({preventScroll:!0}))}cleanElement(t){const{shadowRoot:n}=t;if(n!=null)for(const i of Array.from(n.children))tl(i)||i.remove();this.isContainerManaged||t.replaceChildren()}queueElementForPool(t){const n=this.getElementPoolLimit();!this.isElementPoolGenerationCurrent(t)||this.getElementPoolSize()>=n||(this.isElementClean(t)?this.elementPool.push(t):this.pendingElementPool.push(t))}promotePendingPooledElements(){if(this.pendingElementPool.length===0)return;const{pendingElementPool:t}=this;this.pendingElementPool=[];const n=this.getElementPoolLimit();for(const i of t)this.isElementPoolGenerationCurrent(i)&&this.isElementClean(i)&&this.elementPool.lengththis.windowSpecs.bottom}onThemeChange(){this.invalidateElementPool()}setOptions(t){if(t==null)return;this.capturePendingLayoutAnchor();const{options:n}=this,i=this.getLayout(),{itemMetricsCache:r}=this;Ja(n,t)&&this.invalidateElementPool(),this.options=t;const o=this.computeMetricsCache(t.itemMetrics),s=!He(r,o),l=!He(i,this.getLayout());l&&this.syncLayout();const a=s||Za(n,t);if(a){const d=this.pendingLayoutReset;this.pendingLayoutReset={metrics:s?o:d?.metrics,resetFileLayoutCache:!0,resetDiffLayoutCache:!0,includeEstimatedDiffHeights:d?.includeEstimatedDiffHeights===!0||s||el(n,t)}}(l||a)&&(this.markLayoutDirtyFromIndex(0),this.scrollDirty=!0),dn(n,t)||this.renderOptionsRevision++,!this.isContainerManaged&&this.items.length>0&&this.render()}capturePendingLayoutAnchor(){this.root==null||this.items.length===0||this.pendingScrollTarget!=null||(this.pendingLayoutAnchor=this.getScrollAnchor(this.getScrollTop()))}render(t=!1){fe.__STOP||(t?(io(this.computeRenderRangeAndEmit),this.computeRenderRangeAndEmit()):Y(this.computeRenderRangeAndEmit))}instanceChanged(t,n){const i=this.instanceToItem.get(t);if(i==null)throw new Error("CodeView.instanceChanged: An instance has changed that is not registered");n&&this.markItemLayoutDirty(i),this.render()}getWindowSpecs(){return this.windowSpecs}getContainerElement(){return this.root}getRenderedItems(){const{firstIndex:t,lastIndex:n}=this.renderState;if(t===-1||n===-1||n{this.scrollListeners.delete(t)}}getLocalTopForInstance(t){const n=this.instanceToItem.get(t);if(n==null)throw new Error("CodeView.getLocalTopForInstance: unknown virtualized instance");return n.top}getTopForItem(t){const n=this.idToItem.get(t);if(n!=null)return n.top+this.getLayout().paddingTop}createItem(t,n,i){const{itemMetricsCache:r}=this;if(t.type==="diff"){const s=new Oa(this.createDiffOptions(t.id),this,r,this.workerManager,this.isContainerManaged);return{type:"diff",item:t,version:t.version,index:n,top:i,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:s}}const o=new As(this.createFileOptions(t.id),this,r,this.workerManager,this.isContainerManaged);return{type:"file",item:t,version:t.version,index:n,top:i,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:o}}applySelectedLines(t,n){const{selectedLines:i}=this;t==null&&i==null||t!=null&&i?.id===t.id&&Wt(i.range,t.range)||(i!=null&&i.id!==t?.id&&this.idToItem.get(i.id)?.instance.setSelectedLines(null,{notify:!1}),this.selectedLines=t,this.idToItem.get(t?.id??"")?.instance.setSelectedLines(t?.range??null,n))}syncSelection(){if(this.selectedLines==null)return;const t=this.idToItem.get(this.selectedLines.id);if(t==null){this.selectedLines=null;return}t.instance.setSelectedLines(this.selectedLines.range,{notify:!1})}renamePendingScrollTarget(t,n){const{pendingScrollTarget:i}=this;i==null||i.type==="position"||i.id!==t||(this.pendingScrollTarget={...i,id:n})}renamePendingLayoutAnchor(t,n){this.pendingLayoutAnchor?.id===t&&(this.pendingLayoutAnchor.id=n)}createFileOptionsPrototype(){const t={};for(const n of qa)ce(t,n,()=>this.options[n]);ce(t,"stickyHeader",()=>this.options.stickyHeaders),ce(t,"collapsed",n=>this.getItemOptions(ze(n),"file")?.item.collapsed===!0);for(const n of ei)this.defineItemSharedCallback(t,"file",n);for(const n of ti)this.defineItemSelectionCallback(t,"file",n);return t}createDiffOptionsPrototype(){const t={};for(const n of ja)ce(t,n,()=>this.options[n]);ce(t,"stickyHeader",()=>this.options.stickyHeaders),ce(t,"hunkSeparators",()=>this.options.hunkSeparators),ce(t,"collapsed",n=>this.getItemOptions(ze(n),"diff")?.item.collapsed===!0);for(const n of ei)this.defineItemSharedCallback(t,"diff",n);for(const n of ti)this.defineItemSelectionCallback(t,"diff",n);return t}createFileOptions(t){const n=Object.create(this.fileOptionsPrototype);return ni(n,{id:t}),n}createDiffOptions(t){const n=Object.create(this.diffOptionsPrototype);return ni(n,{id:t}),n}updateItemOptionsId(t,n){ze(t).id=n}getItemOptions(t,n){const i=this.idToItem.get(t.id);if(!(i==null||i.type!==n))return i}defineItemSharedCallback(t,n,i){ce(t,i,r=>{if(this.options[i]==null)return;const o=ze(r),s=o.callbackCache??={};let l=s[i];return l==null&&(l=((...a)=>{const d=this.getItemOptions(o,n);if(d==null)return;const h=this.options[i];return h?.(...a,d)}),s[i]=l),l})}defineItemSelectionCallback(t,n,i){ce(t,i,r=>{if(this.options.enableLineSelection!==!0)return;const o=ze(r),s=o.callbackCache??={};let l=s[i];return l==null&&(l=(a=>{const d=this.getItemOptions(o,n);if(d==null)return;const h=a==null?null:{id:d.item.id,range:a};this.options.controlledSelection!==!0&&(a!=null||this.selectedLines?.id===d.item.id)&&this.applySelectedLines(h,{notify:!1}),this.options.onSelectedLinesChange?.(h);const c=this.options[i];return c?.(a,d)}),s[i]=l),l})}markLayoutDirtyFromIndex(t){this.layoutDirtyIndex=Math.min(this.layoutDirtyIndex??t,t)}markItemLayoutDirty(t){if(this.items[t.index]!==t)throw new Error(`CodeView.markItemLayoutDirty: unknown item id "${t.item.id}"`);this.markLayoutDirtyFromIndex(t.index)}tryAppendItems(t){if(t.length<=this.items.length)return!1;for(let n=0;n=o.length?this.resetRenderState():this.renderState.lastIndex>=o.length&&(this.renderState.lastIndex=o.length-1),this.markLayoutDirtyFromIndex(a),this.scrollDirty=!0,this.render())}syncItemRecord(t,n){if(t.type!==n.type)throw new Error(`CodeView.syncItemRecord: type mismatch for id "${n.id}"`);return t.version===n.version?!1:(t.item=n,t.version=n.version,t.renderedOptionsRevision=-1,!0)}getMaxScrollTopForHeight(t){const{paddingBottom:n,paddingTop:i}=this.getLayout();return Math.max(i+t+n-this.getHeight(),0)}getMaxScrollTop(){return this.getMaxScrollTopForHeight(this.getScrollHeight())}shouldRebaseScroll(){return this.getMaxScrollTop()>ri}getPagedScrollHeight(){return this.shouldRebaseScroll()?Math.min(this.getScrollHeight(),yn):this.getScrollHeight()}getMaxPagedScrollTop(){return this.getMaxScrollTopForHeight(this.getPagedScrollHeight())}clampPagedScrollTop(t){const n=this.getMaxPagedScrollTop();return Math.max(0,Math.min(t,n))}clampScrollTop(t){const n=this.getMaxScrollTop();return Math.max(0,Math.min(t,n))}getMaxScrollPageOffset(){return Math.max(this.getMaxScrollTop()-this.getMaxPagedScrollTop(),0)}clampScrollPageOffset(t){const n=this.getMaxScrollPageOffset();return Math.max(0,Math.min(t,n))}resolveScrollPageWindow(t,n){let i=re(this.clampPagedScrollTop(n)),r=this.clampScrollPageOffset(t-i);return i=re(this.clampPagedScrollTop(t-r)),r=this.clampScrollPageOffset(t-i),{pagedScrollTop:i,scrollPageOffset:r}}resolvePagedScrollPosition(t){if(!this.shouldRebaseScroll())return{pagedScrollTop:this.clampPagedScrollTop(t),scrollPageOffset:0};const n=this.clampScrollPageOffset(this.scrollPageOffset),i=t-n,r=this.getMaxPagedScrollTop(),o=this.getMaxScrollPageOffset(),s=i>ri&&n0;return i<0||i>r||s||l?this.resolveScrollPageWindow(t,l?Math.min(Ya,r):Lr):{pagedScrollTop:re(this.clampPagedScrollTop(i)),scrollPageOffset:n}}needsScrollPageUpdate(t){const n=re(this.clampScrollTop(t)),{scrollPageOffset:i}=this.resolvePagedScrollPosition(n);return i!==this.scrollPageOffset}getPagedLayoutTop(t){return this.shouldRebaseScroll()?Math.max(t-this.scrollPageOffset,0):t}getStickyHeaderOffset(){return this.options.stickyHeaders===!0&&this.options.disableFileHeader!==!0?this.itemMetricsCache.diffHeaderHeight:0}getScrollTargetRect(t){const n=this.idToItem.get(t.id);if(n==null){console.warn(`CodeView.scrollTo: unknown item id "${t.id}"`);return}if(t.type==="item")return{top:n.top,height:n.height};if(t.type==="range"){const r=this.getRangeScrollPosition(n,t);if(r==null){console.warn(`CodeView.scrollTo: unable to resolve range ${oi(t.range)} for item "${t.id}"`);return}return{top:n.top+r.top,height:r.height}}const i=this.getLineScrollPosition(n,t);if(i==null){console.warn(`CodeView.scrollTo: unable to resolve line ${t.lineNumber} for item "${t.id}"`);return}return{top:n.top+i.top,height:i.height}}normalizeScrollTarget(t){if(t.type==="position"||t.align!=="nearest")return t;const n=this.getScrollTargetRect(t);if(n==null)return;const i=t.offset??0,r=this.getLayout().paddingTop+n.top,o=r+n.height,s=this.getScrollTop(),l=s+(t.type==="line"||t.type==="range"?this.getStickyHeaderOffset():0),a=s+this.getHeight();if(!(r-i<=l&&o+i>=a)){if(r-ia)return{...t,align:"end"}}}resolveScrollTargetTop(t){if(t.type==="position"){const r=this.clampScrollTop(t.position);return r!==t.position?r:this.clampScrollTop(t.position-this.getStickyHeaderOffset())}const n=this.idToItem.get(t.id);if(n==null){console.warn(`CodeView.scrollTo: unknown item id "${t.id}"`);return}if(t.type==="item")return this.clampScrollTop(this.resolveAlignedScrollPosition(n.top,n.height,t.align,t.offset));if(t.type==="range"){const r=this.getRangeScrollPosition(n,t);if(r==null){console.warn(`CodeView.scrollTo: unable to resolve range ${oi(t.range)} for item "${t.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(n.top+r.top,r.height,t.align,t.offset,this.getStickyHeaderOffset()))}const i=this.getLineScrollPosition(n,t);if(i==null){console.warn(`CodeView.scrollTo: unable to resolve line ${t.lineNumber} for item "${t.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(n.top+i.top,i.height,t.align,t.offset,this.getStickyHeaderOffset()))}resolveAlignedScrollPosition(t,n,i,r=0,o=0){t+=this.getLayout().paddingTop;const s=this.getHeight();return i==="center"&&n+r{if(fe.__STOP||this.container==null)return;const n=this.getHeight(),i=this.getScrollTop();let r=i,o=this.pendingLayoutAnchor!=null,s=this.getScrollAnchor(r);if(this.layoutDirtyIndex!=null&&(this.recomputeLayout(this.layoutDirtyIndex,this.pendingLayoutReset),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,o=!0),o&&s!=null){const S=this.resolveAnchoredScrollTop(s);if(S!=null){const L=S-r;r=S,this.scrollAnimation!=null&&(this.scrollAnimation.position+=L)}}o&&(r=this.clampScrollTop(r),this.syncContainerHeight());const l=this.computeTargetScrollTopForFrame(r,t),a=!o&&(this.renderState.scrollTop===-1||Math.abs(l-this.renderState.scrollTop)>n+this.config.overscrollSize*2);a&&(s=void 0),this.windowSpecs=Gt({scrollTop:l,height:n,scrollHeight:this.getScrollHeight(),fitPerfectly:a,fitPerfectlyOverscroll:this.getFitPerfectlyOverscroll(),overscrollSize:this.config.overscrollSize});let d=i;(this.pendingScrollTarget!=null&&l!==d||this.needsScrollPageUpdate(l))&&(this.applyScrollFix(l,d,this.windowSpecs),d=l);const{top:h,bottom:c}=this.windowSpecs,{firstIndex:u,lastIndex:f}=this.renderState;if(u>=0)for(let S=u;S<=f;S++){const L=this.items[S];if(L==null)throw new Error(`CodeView.computeRenderRangeAndEmit: No item at index: ${S}`);L.top>h-L.height&&L.top<=c||this.releaseRenderedItem(L)}let g;const b=new Set,y=this.findFirstVisibleIndex(h),m=this.findLastVisibleIndex(c);for(let S=y;S<=m;S++){const L=this.items[S];if(L==null)throw new Error("CodeView.computeRenderRangeAndEmit: missing item");const{instance:E}=L;L.element==null?(L.element=this.acquireElement(),li(this.stickyContainer,L.element,g),E.virtualizedSetup(),ai(L,L.element)&&(L.renderedOptionsRevision=this.renderOptionsRevision,b.add(L)),g=L.element):(li(this.stickyContainer,L.element,g),ai(L,void 0,L.renderedOptionsRevision!==this.renderOptionsRevision)&&(L.renderedOptionsRevision=this.renderOptionsRevision,b.add(L)),g=L.element)}this.renderState.firstIndex=y<=m?y:-1,this.renderState.lastIndex=m,this.flushSlotCoordinator(),this.reconcileRenderedItems(b),this.syncContainerHeight(),this.updateStickyPositioning();const p=s!=null?this.resolveAnchoredScrollTop(s):void 0;s===this.pendingLayoutAnchor&&(this.pendingLayoutAnchor=void 0);const C=p!=null?p-r:0;let v=l,x=!1;if(this.pendingScrollTarget!=null){const S=this.advanceScrollAnimation(t,C);S!=null?(v=S,x=!0):v=r}else v=p??l;v!==d&&(this.applyScrollFix(v,d,this.windowSpecs),d=v),x&&this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.renderState.scrollTop=re(d),this.flushManagers(b),this.validateStickyContainerHeight(),this.fixContainerFocus(),(a||this.scrollAnimation!=null)&&this.render()};flushManagers(t){for(const n of t)n.instance.flushManagers()}syncContainerHeight(){const t=this.getPagedScrollHeight();this.container==null||this.containerHeight===t||(this.container.style.height=`${t}px`,this.containerHeight=t)}getStickyBounds(t){const{firstIndex:n,lastIndex:i}=t!=null?{firstIndex:this.findFirstVisibleIndex(t.top),lastIndex:this.findLastVisibleIndex(t.bottom)}:this.renderState;if(n===-1||i===-1||n>i)return;const r=this.items[n]?.instance.getAdvancedStickySpecs(t),o=this.items[i]?.instance.getAdvancedStickySpecs(t);if(!(r==null||o==null))return{stickyTop:this.getPagedLayoutTop(Math.max(r.topOffset,0)),stickyBottom:this.getPagedLayoutTop(o.topOffset+o.height)}}applyStickyPositioning({stickyTop:t,stickyBottom:n}){const i=this.getHeight(),{itemMetricsCache:r}=this,o=n-t;this.renderState.stickyHeight=o,this.renderState.stickyTop=t,this.renderState.stickyBottom=n,this.stickyOffset.style.height=`${t}px`;const s=(Math.random()*r.lineHeight>>0)*-1,l=-Math.max(o+s,0)+i;this.stickyContainer.style.top=`${l}px`,this.stickyContainer.style.bottom=`${l+r.diffHeaderHeight}px`}syncPagedScrollScaffolding(t){this.syncContainerHeight();const n=this.getStickyBounds(t);n!=null&&this.applyStickyPositioning(n)}reconcileRenderedItems(t){const{firstIndex:n,lastIndex:i}=this.renderState;if(n===-1)return;let r=-1,o=!1;for(let s=n;si);s++){const l=this.items[s];if(l==null)throw new Error("CodeView.reconcileRenderedItems: Invalid item");r===-1?r=l.top:l.top!==r&&(l.top=r,l.instance.syncVirtualizedTop(),o=!0),(t==null?s<=i:t.has(l))&&(l.instance.reconcileHeights()&&(o=!0,l.height=l.instance.getVirtualizedHeight()),this.validateRenderedItemHeight(l)),r+=l.instance.getVirtualizedHeight(),s{fe.__STOP||(this.suspendScrollInteractions(),this.scrollDirty=!0,this.notifyScroll(),this.render())};clearPendingScroll=()=>{this.pendingScrollTarget=void 0,this.pendingLayoutAnchor=void 0,this.scrollAnimation=void 0};handleResize=t=>{for(const n of t)if(n.target===this.stickyContainer){if(n.borderBoxSize[0].blockSize!==this.renderState.stickyHeight){const i=this.getScrollTop(),r=this.getScrollAnchor(i);this.reconcileRenderedItems(),this.updateStickyPositioning();const o=r!=null?this.resolveAnchoredScrollTop(r):void 0;if(o!=null){const s=o-i;this.applyScrollFix(o,i,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=s)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0)}}else this.scrollDirty=!0,this.heightDirty=!0,this.render()};getScrollAnchorViewportTop(t,n){return t=t+s)break;if(d>=t)return{type:"item",id:a.item.id,viewportOffset:d-t};const h=this.getScrollAnchorViewportTop(d,t)-d,c=a.instance.getNumericScrollAnchor(h);if(c!=null){const u=d+c.top;return{type:"line",id:a.item.id,lineNumber:c.lineNumber,side:c.side,viewportOffset:u-t}}}}resolveAnchoredScrollTop(t){const n=this.idToItem.get(t.id);if(n==null)return;const{paddingTop:i}=this.getLayout();if(t.type==="item"){const s=i+n.top;return this.clampScrollTop(s-t.viewportOffset)}const r=n.type==="diff"?n.instance.getLinePosition(t.lineNumber,t.side):n.instance.getLinePosition(t.lineNumber);if(r==null)return;const o=i+n.top+r.top;return this.clampScrollTop(o-t.viewportOffset)}applyScrollFix(t,n,i){if(this.root==null)return;const r=re(this.clampScrollTop(t)),o=re(n),{scrollPageOffset:s}=this,l=re(this.clampPagedScrollTop(o-s)),{pagedScrollTop:a,scrollPageOffset:d}=this.resolvePagedScrollPosition(r),h=a,c=s!==d;r===this.renderState.scrollTop&&r===o&&h===l&&!c||(this.suspendScrollInteractions(),(h!==l||c)&&(this.scrollPageOffset=d,this.syncPagedScrollScaffolding(i)),h!==l&&this.root.scrollTo({top:h,behavior:"instant"}),this.renderState.scrollTop=r,this.scrollTop=r,this.scrollDirty=!1)}isPendingTargetSettled(t){const n=this.resolveScrollTargetTop(t);return n==null?!0:re(this.getScrollTop())===re(n)}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;const t=this.root?.scrollTop??0;return this.scrollTop=this.clampScrollTop(t+this.scrollPageOffset),this.scrollTop}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root?.getBoundingClientRect().height??0,this.height):this.height}getScrollHeight(){return this.scrollHeight}flushSlotCoordinator(){if(this.slotCoordinator==null)return;const{onSnapshotChange:t}=this.slotCoordinator,n=di(this.getRenderedItems(),this.slotCoordinator);il(this.slotSnapshot,n)||(this.slotSnapshot=n,t(n))}notifyScroll(){if(this.scrollListeners.size===0)return;const t=this.getScrollTop();for(const n of this.scrollListeners)n(t,this)}findFirstVisibleIndex(t){let n=0,i=this.items.length-1,r=this.items.length;for(;n<=i;){const o=n+i>>1,s=this.items[o];if(s==null)throw new Error("CodeView.findFirstVisibleIndex: invalid item index");s.top+s.height>t?(r=o,i=o-1):n=o+1}return r}findLastVisibleIndex(t){let n=0,i=this.items.length-1,r=-1;for(;n<=i;){const o=n+i>>1,s=this.items[o];if(s==null)throw new Error("CodeView.findLastVisibleIndex: invalid item index");s.top<=t?(r=o,n=o+1):i=o-1}return r}recomputeLayout(t=0,n){if(this.items.length===0){this.scrollHeight=0;return}const i=this.getLayout();let r=0;if(t>0){const o=this.items[t-1];if(o==null)throw new Error("CodeView.recomputeLayout: invalid dirty index");r=o.top+o.height+i.gap}for(let o=t;o0}function di(e,{hasHeaderRenderers:t,hasAnnotationRenderer:n,hasGutterRenderer:i}){if(e.length===0)return;if(t||i)return e;if(!n)return;const r=[];for(const o of e)nl(o.item)&&r.push(o);return r.length>0?r:void 0}function il(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n{const a=l===n.length-1,d=this.options.highlighter.codeToTokens(s,{...this.options,grammarState:this.lastStableGrammarState}),h=d.tokens[0];a||h.push({content:` +`,offset:0}),a?(r=h,this.lastUnstableCodeChunk=s):(this.lastStableGrammarState=d.grammarState,i.push(...h))}),this.tokensStable.push(...i),this.tokensUnstable=r,{recall:o,stable:i,unstable:r}}close(){const t=this.tokensUnstable;return this.tokensUnstable=[],this.lastUnstableCodeChunk="",this.lastStableGrammarState=void 0,{stable:t}}clear(){this.tokensStable=[],this.tokensUnstable=[],this.lastUnstableCodeChunk="",this.lastStableGrammarState=void 0}clone(){const t=new kr(this.options);return t.lastUnstableCodeChunk=this.lastUnstableCodeChunk,t.tokensUnstable=this.tokensUnstable,t.tokensStable=this.tokensStable,t.lastStableGrammarState=this.lastStableGrammarState,t}},hi=class extends TransformStream{tokenizer;options;constructor(e){const t=new rl(e),{allowRecalls:n=!1}=e;super({async transform(i,r){const{stable:o,unstable:s,recall:l}=await t.enqueue(i);n&&l>0&&r.enqueue({recall:l});for(const a of o)r.enqueue(a);if(n)for(const a of s)r.enqueue(a)},async flush(i){const{stable:r}=t.close();if(!n)for(const o of r)i.enqueue(o)}}),this.tokenizer=t,this.options=e}};function ol(e){const t=document.createElement("span");return t.style=Ur(e.htmlStyle??Vr(e)),t.textContent=e.content,t}let sl=-1;var td=class{options;__id=`file-stream:${++sl}`;highlighter;stream;abortController;fileContainer;pre;code;gutterElement;contentElement;themeCSSStyle;appliedThemeCSS;currentRowCount=0;constructor(e={theme:_}){this.options=e,this.currentLineIndex=this.options.startingLineIndex??1}cleanUp(){this.abortController?.abort(),this.abortController=void 0}setThemeType(e){(this.options.themeType??"system")!==e&&(this.options={...this.options,themeType:e},!(typeof this.options.theme=="string"||this.fileContainer==null||this.appliedThemeCSS==null)&&this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType))}async initializeHighlighter(){return this.highlighter=await xt(un(this.options.lang,this.options)),this.highlighter}queuedSetupArgs;async setup(e,t){const n=this.queuedSetupArgs!=null;if(this.queuedSetupArgs=[e,t],n)return;this.highlighter??=await this.initializeHighlighter();const[i,r]=this.queuedSetupArgs;this.queuedSetupArgs=void 0;const o=i;this.setupStream(o,r,this.highlighter)}setupStream(e,t,n){const{disableLineNumbers:i=!1,overflow:r="scroll",theme:o=_,themeType:s="system"}=this.options,l=this.getOrCreateFileContainer();l.parentElement==null&&t.appendChild(l),this.pre??=document.createElement("pre"),this.pre.parentElement==null&&l.shadowRoot?.appendChild(this.pre);const a=typeof o=="string"?n.getTheme(o).type:void 0,d=fn({theme:o,highlighter:n});this.applyThemeState(l,d,s,a);const h=bn(this.pre,{type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:i,overflow:r,split:!1,totalLines:0});h.textContent="",this.pre=h,this.code=je({code:this.code,pre:h}),this.gutterElement=void 0,this.contentElement=void 0,this.currentRowCount=0,this.currentLineElement=void 0,this.currentLineIndex=this.options.startingLineIndex??1,this.abortController?.abort(),this.abortController=new AbortController;const{onStreamStart:c,onStreamClose:u,onStreamAbort:f}=this.options;this.stream?.cancel().catch(()=>{}),this.stream=e,this.stream.pipeThrough(typeof o=="string"?new hi({...this.options,theme:o,highlighter:n,allowRecalls:!0,defaultColor:!1,cssVariablePrefix:B("token"),tokenizeTimeLimit:0}):new hi({...this.options,themes:o,highlighter:n,allowRecalls:!0,defaultColor:!1,cssVariablePrefix:B("token"),tokenizeTimeLimit:0})).pipeTo(new WritableStream({start(g){c?.(g)},close(){u?.()},abort(g){f?.(g)},write:this.handleWrite}),{signal:this.abortController.signal}).catch(g=>{g.name!=="AbortError"&&console.error("FileStream pipe error:",g)})}queuedTokens=[];handleWrite=e=>{"recall"in e&&this.queuedTokens.length>=e.recall?this.queuedTokens.length=this.queuedTokens.length-e.recall:this.queuedTokens.push(e),Y(this.render),this.options.onStreamWrite?.(e)};currentLineIndex;currentLineElement;render=()=>{this.options.onPreRender?.(this);const{gutter:e,content:t}=this.getOrCreateStreamColumns(),n=document.createDocumentFragment(),i=document.createDocumentFragment();for(const r of this.queuedTokens)if("recall"in r){if(this.currentLineElement==null)throw new Error("FileStream.render: no current line element, shouldnt be possible to get here");if(r.recall>this.currentLineElement.childNodes.length)throw new Error("FileStream.render: Token recall exceed the current line, there's probably a bug...");for(let o=0;o0&&e.appendChild(n),i.childNodes.length>0&&t.appendChild(i),this.queuedTokens.length=0,this.options.onPostRender?.(this)};getOrCreateStreamColumns(){if(this.code==null)throw new Error("FileStream: expected code element to exist");if(this.gutterElement!=null&&this.contentElement!=null)return{gutter:this.gutterElement,content:this.contentElement};const e=document.createElement("div");e.dataset.gutter="";const t=document.createElement("div");return t.dataset.content="",this.code.appendChild(e),this.code.appendChild(t),this.gutterElement=e,this.contentElement=t,{gutter:e,content:t}}updateRowSpan(){this.gutterElement!=null&&(this.gutterElement.style.gridRow=`span ${this.currentRowCount}`),this.contentElement!=null&&(this.contentElement.style.gridRow=`span ${this.currentRowCount}`)}createLine(){const e=this.currentLineIndex,t=`${e-1}`,n=document.createElement("div");n.dataset.columnNumber=`${e}`,n.dataset.lineType="context",n.dataset.lineIndex=t;const i=document.createElement("span");i.dataset.lineNumberContent="",i.textContent=`${e}`,n.appendChild(i);const r=document.createElement("div");return r.dataset.line=`${e}`,r.dataset.lineType="context",r.dataset.lineIndex=t,this.currentRowCount+=1,this.updateRowSpan(),this.currentLineElement=r,{gutterLine:n,contentLine:r}}getOrCreateFileContainer(e){return e!=null&&e===this.fileContainer||e==null&&this.fileContainer!=null?this.fileContainer:(this.fileContainer!=null&&e!=null&&e!==this.fileContainer&&(this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0),this.fileContainer=e??document.createElement("diffs-container"),this.fileContainer)}applyThemeState(e,t,n,i){const r=e.shadowRoot??e.attachShadow({mode:"open"}),o=i??n,s=this.options.theme??_,l=typeof s=="string"?s:{...s},a=Me(r);if(this.themeCSSStyle?.parentNode===r&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===o&&this.appliedThemeCSS.scrollbarGutter===a){this.appliedThemeCSS.theme=l;return}this.themeCSSStyle=Cn({shadowRoot:r,currentNode:this.themeCSSStyle,themeCSS:vn(t,o,a)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:l,themeStyles:t,themeType:o,baseThemeType:i,scrollbarGutter:a}:void 0}};function wr(e,t){const{resolution:n,hunkIndex:i,startContentIndex:r,endContentIndex:o,indexesToDelete:s=new Set}=t,l=e.hunks[i];if(l==null)throw console.error({diff:e,hunkIndex:i}),new Error(`resolveRegion: Invalid hunk index: ${i}`);if(r<0||o>=l.hunkContent.length||r>o)throw new Error(`resolveRegion: Invalid content range, ${r}, ${o}`);const{hunks:a,additionLines:d,deletionLines:h}=e,c={...e,hunks:[],deletionLines:[],additionLines:[],splitLineCount:0,unifiedLineCount:0,cacheKey:e.cacheKey!=null?`${e.cacheKey}:${n[0]}-${i}:${r}-${o}`:void 0},u={nextAdditionLineIndex:0,nextDeletionLineIndex:0,nextAdditionStart:1,nextDeletionStart:1,splitLineCount:0,unifiedLineCount:0},f=i===a.length-1&&o===l.hunkContent.length-1,g=!e.isPartial;for(const[y,m]of a.entries()){al(e,c,u,m.deletionLineIndex-m.collapsedBefore,m.additionLineIndex-m.collapsedBefore,m.collapsedBefore,g);const p={...m,hunkContent:[],additionStart:u.nextAdditionStart,deletionStart:u.nextDeletionStart,additionLineIndex:u.nextAdditionLineIndex,deletionLineIndex:u.nextDeletionLineIndex,additionCount:0,deletionCount:0,deletionLines:0,additionLines:0,splitLineStart:u.splitLineCount,unifiedLineStart:u.unifiedLineCount,splitLineCount:0,unifiedLineCount:0};for(const[C,v]of m.hunkContent.entries())if(y!==i||Co){ci(v,c,h,d);const x={...v,additionLineIndex:u.nextAdditionLineIndex,deletionLineIndex:u.nextDeletionLineIndex};p.hunkContent.push(x),Vt(x,u,p)}else if(s.has(C))p.hunkContent.push({type:"context",lines:0,deletionLineIndex:u.nextDeletionLineIndex,additionLineIndex:u.nextAdditionLineIndex});else if(v.type==="context"){ci(v,c,h,d);const x={...v,deletionLineIndex:u.nextDeletionLineIndex,additionLineIndex:u.nextAdditionLineIndex};p.hunkContent.push(x),Vt(x,u,p)}else{ll(n,v,c,h,d);const x={type:"context",lines:n==="deletions"?v.deletions:n==="additions"?v.additions:v.deletions+v.additions,deletionLineIndex:u.nextDeletionLineIndex,additionLineIndex:u.nextAdditionLineIndex};p.hunkContent.push(x),Vt(x,u,p)}if(y===i&&f){const C=n==="deletions"?m.noEOFCRDeletions:m.noEOFCRAdditions;p.noEOFCRAdditions=C,p.noEOFCRDeletions=C}c.hunks.push(p)}const b=a.at(-1);return b!=null&&!e.isPartial&&Er(c,h,d,b.deletionLineIndex+b.deletionCount,b.additionLineIndex+b.additionCount,Math.min(h.length-(b.deletionLineIndex+b.deletionCount),d.length-(b.additionLineIndex+b.additionCount))),c.splitLineCount=u.splitLineCount,c.unifiedLineCount=u.unifiedLineCount,c}function Er(e,t,n,i,r,o){for(let s=0;s0){let c=0,u=0,f=i.indexOf(` +`,c);for(;f!==-1;)fi(n,i.slice(c,f+1),u),c=f+1,u++,f=i.indexOf(` +`,c);c0)throw new Error("parseMergeConflictDiffFromFile: unfinished merge conflict marker stack");n.activeHunk!=null&&n.activeHunk.hunkContent.length>0&&(xn(n,n.activeHunk,"trailing"),Mr(n));for(let c=0;c0&&n.additionLines.length>0&&n.deletionLines.length>0){const c=n.hunks[n.hunks.length-1],u=Math.max(n.additionLines.length-(c.additionStart+c.additionCount-1),0);n.splitLineCount+=u,n.unifiedLineCount+=u}const o=n.deletionLines.join(""),s=n.additionLines.join(""),l=Ci(e,"current",o),a=Ci(e,"incoming",s);let d="change";s===""?d="deleted":o===""&&(d="new");const h={name:e.name,prevName:void 0,type:d,hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,isPartial:!1,deletionLines:n.deletionLines,additionLines:n.additionLines,cacheKey:e.cacheKey!=null?`${e.cacheKey}:merge-conflict-diff`:void 0};return{fileDiff:h,currentFile:l,incomingFile:a,actions:n.actions,markerRows:Pr(h,n.actions)}}function fi(e,t,n){const i=e.conflictStack[e.conflictStack.length-1];if(i==null){if(t.length>=7&&t.charCodeAt(0)===60&&bi(t)==="start"){mi(e,t,n);return}pi(e,t);return}const r=bi(t);if(r==="start"){mi(e,t,n);return}if(r==="base"){i.stage="base",i.baseMarkerLineIndex=n,i.markerLines.base=t;return}if(r==="separator"){i.stage="incoming",i.separatorLineIndex=n,i.markerLines.separator=t;return}if(r==="end"){const o=e.conflictStack.pop();if(o==null)throw new Error("parseMergeConflictDiffFromFile: encountered end marker before start marker");fl(e,o,n,t);return}i.stage==="current"?gi(e,"deletion",t,i.conflictIndex,"current"):i.stage==="base"?pi(e,t,i.conflictIndex):gi(e,"addition",t,i.conflictIndex,"incoming")}function Ar(e){return e.activeHunk??=Dr(e.additionLines.length+1,e.deletionLines.length+1),e.activeHunk}function Hr(e,t,n,i){const r=e.conflictBuilders[t];if(r==null)throw new Error(`parseMergeConflictDiffFromFile: failed to locate conflict action ${t}`);const o=r.action,s=e.hunks.length;if(o.hunkIndex<0)o.hunkIndex=s;else if(o.hunkIndex!==s)throw new Error(`parseMergeConflictDiffFromFile: conflict ${t} spans multiple hunks and cannot be anchored`);if(o.startContentIndex<0&&(o.startContentIndex=i),o.endContentIndex=i,o.endMarkerContentIndex=i,n==="current"){o.currentContentIndex??=i;return}if(n==="base"){o.baseContentIndex??=i;return}o.incomingContentIndex=i}function cl(e,t,n,i){const r=e.hunkContent,o=r[r.length-1];return o?.type==="change"?(t==="addition"?o.additions++:o.deletions++,r.length-1):(r.push({type:"change",additions:t==="addition"?1:0,deletions:t==="deletion"?1:0,additionLineIndex:n,deletionLineIndex:i}),r.length-1)}function xn(e,t,n){let i=t.contextBufferCount,r=t.contextBufferAdditionStart,o=t.contextBufferDeletionStart;if(n==="leading"&&i>e.maxContextLines){const h=i-e.maxContextLines;r+=h,o+=h,i=e.maxContextLines,t.additionStart+=h,t.deletionStart+=h,t.additionLineIndex+=h,t.deletionLineIndex+=h}if(n==="trailing"&&i>e.maxContextLines&&(i=e.maxContextLines),i===0){t.contextBufferCount=0,t.contextBufferBaseConflicts=void 0;return}const s=t.hunkContent,l=s[s.length-1];let a;l?.type==="context"?(l.lines+=i,a=s.length-1):(s.push({type:"context",lines:i,additionLineIndex:r,deletionLineIndex:o}),a=s.length-1),t.additionCount+=i,t.deletionCount+=i;const d=t.contextBufferBaseConflicts;if(d!=null){const h=r-t.contextBufferAdditionStart;for(const[c,u]of d)c>=h&&c=d&&(s??=new Map,s.set(h-d,c))}xn(e,t,"trailing");const l=t.additionCount,a=t.deletionCount;Mr(e),e.activeHunk=Dr(t.additionStart+l+i,t.deletionStart+a+i),e.activeHunk.contextBufferAdditionStart=r,e.activeHunk.contextBufferDeletionStart=o,e.activeHunk.contextBufferCount=e.maxContextLines,e.activeHunk.contextBufferBaseConflicts=s}function pi(e,t,n=-1){const i=Ar(e);i.contextBufferCount===0&&(i.contextBufferAdditionStart=e.additionLines.length,i.contextBufferDeletionStart=e.deletionLines.length),e.additionLines.push(t),e.deletionLines.push(t),n>=0&&(i.contextBufferBaseConflicts??=new Map,i.contextBufferBaseConflicts.set(i.contextBufferCount,n)),i.contextBufferCount++}function gi(e,t,n,i,r){let o=Ar(e);o.hunkContent.length>0&&o.contextBufferCount>e.maxContextLines2&&(ul(e),o=e.activeHunk),xn(e,o,o.hunkContent.length===0?"leading":"before-change");const s=e.additionLines.length,l=e.deletionLines.length;t==="addition"?e.additionLines.push(n):e.deletionLines.push(n);const a=cl(o,t,s,l);t==="addition"?(o.additionCount++,o.additionLines++):(o.deletionCount++,o.deletionLines++),Hr(e,i,r,a)}function fl(e,t,n,i){if(t.separatorLineIndex==null||t.markerLines.separator==null)throw new Error(`parseMergeConflictDiffFromFile: conflict ${t.conflictIndex} is missing a separator marker`);const r=e.conflictBuilders[t.conflictIndex];if(r==null)throw new Error(`parseMergeConflictDiffFromFile: failed to finalize conflict ${t.conflictIndex}`);const o=r.action;o.markerLines.separator=t.markerLines.separator,o.markerLines.end=i,t.markerLines.base!=null&&(o.markerLines.base=t.markerLines.base),o.conflict={conflictIndex:t.conflictIndex,startLineIndex:t.startLineIndex,startLineNumber:t.startLineIndex+1,separatorLineIndex:t.separatorLineIndex,separatorLineNumber:t.separatorLineIndex+1,endLineIndex:n,endLineNumber:n+1,baseMarkerLineIndex:t.baseMarkerLineIndex,baseMarkerLineNumber:t.baseMarkerLineIndex!=null?t.baseMarkerLineIndex+1:void 0};const s=o.currentContentIndex??o.incomingContentIndex;if(o.currentContentIndex??=s,o.incomingContentIndex??=s,o.startContentIndex<0&&s!=null&&(o.startContentIndex=s),o.endContentIndex<0&&s!=null&&(o.endContentIndex=s),o.endMarkerContentIndex<0&&s!=null&&(o.endMarkerContentIndex=s),o.hunkIndex<0||o.startContentIndex<0||o.endContentIndex<0||o.endMarkerContentIndex<0)throw new Error(`parseMergeConflictDiffFromFile: failed to anchor merge conflict ${t.conflictIndex}`);e.actions[o.conflictIndex]=o,r.completed=!0}function mi(e,t,n){const i=e.nextConflictIndex;e.nextConflictIndex++,e.conflictStack.push({conflictIndex:i,stage:"current",startLineIndex:n,markerLines:{start:t}}),e.conflictBuilders[i]={completed:!1,action:{conflict:{conflictIndex:i,startLineIndex:n,startLineNumber:n+1,separatorLineIndex:n,separatorLineNumber:n+1,endLineIndex:n,endLineNumber:n+1,baseMarkerLineIndex:void 0,baseMarkerLineNumber:void 0},conflictIndex:i,hunkIndex:-1,startContentIndex:-1,endContentIndex:-1,endMarkerContentIndex:-1,markerLines:{start:t,separator:"",end:""}}}}function Dr(e,t){return{additionStart:e,deletionStart:t,additionCount:0,deletionCount:0,additionLines:0,deletionLines:0,additionLineIndex:Math.max(e-1,0),deletionLineIndex:Math.max(t-1,0),hunkContent:[],contextBufferAdditionStart:Math.max(e-1,0),contextBufferDeletionStart:Math.max(t-1,0),contextBufferCount:0,contextBufferBaseConflicts:void 0}}function vi(e,t){return t===1?`${e}`:`${e},${t}`}function bi(e){if(e.length<7)return;const t=e.charCodeAt(0);if(t!==60&&t!==62&&t!==61&&t!==124)return;const n=pl(e);if(n<7)return;let i=1;for(;i0&&e.charCodeAt(t-1)===10&&t--,t>0&&e.charCodeAt(t-1)===13&&t--,t}function gl(e){return e===9||e===10||e===11||e===12||e===13||e===32}function Ci(e,t,n){return{...e,contents:n,cacheKey:e.cacheKey!=null?`${e.cacheKey}:merge-conflict-${t}`:void 0}}function Pr(e,t){const n=[],i=new Array(e.hunks.length),r=(s,l)=>{const a=e.hunks[s];if(a==null)return 0;let d=i[s];if(d==null){d=new Array(a.hunkContent.length+1);let h=a.unifiedLineStart;d[0]=h;for(let c=0;c{const a=r(s,l),d=i[s]?.[Math.max(l+1,0)]??r(s,l+1);return Math.max(a,d-1)};for(const s of t){if(s==null)continue;const l=e.hunks[s.hunkIndex];if(l==null)continue;const a=r(s.hunkIndex,s.startContentIndex);if(n.push(we(s,"marker-start",s.startContentIndex,s.markerLines.start,a)),s.baseContentIndex!=null){const f=s.currentContentIndex,g=s.incomingContentIndex;if(f==null||g==null)continue;const b=s.markerLines.base;if(b==null)continue;const y=l.hunkContent[f],m=l.hunkContent[s.baseContentIndex],p=l.hunkContent[g];if(y?.type!=="change"||m?.type!=="context"||p?.type!=="change")continue;const C=r(s.hunkIndex,f),v=r(s.hunkIndex,g);n.push(we(s,"marker-base",s.baseContentIndex,b,C+y.deletions)),n.push(we(s,"marker-separator",s.baseContentIndex,s.markerLines.separator,v),we(s,"marker-end",s.endMarkerContentIndex,s.markerLines.end,o(s.hunkIndex,s.endMarkerContentIndex)));continue}const d=s.currentContentIndex;if(d==null)continue;const h=l.hunkContent[d];if(h?.type!=="change")continue;const c=r(s.hunkIndex,d),u=h.deletions>0?c+h.deletions:a;n.push(we(s,"marker-separator",d,s.markerLines.separator,u),we(s,"marker-end",s.endMarkerContentIndex,s.markerLines.end,o(s.hunkIndex,s.endMarkerContentIndex)))}return n}function we(e,t,n,i,r){return{type:t,hunkIndex:e.hunkIndex,contentIndex:n,conflictIndex:e.conflictIndex,lineText:i,lineIndex:r}}function ml(e,t){let n=e.unifiedLineStart;for(let i=0;i{const t=this.injectedRows.get(`${e.hunkIndex}:${e.lineIndex}`);if(t==null||t.length===0)return;const{mergeConflictActionsType:n}=this.getOptionsWithDefaults(),i=[],r=[];for(const o of t){if(o.type==="actions"){i.push({content:vl({row:o,includeDefaultActions:n==="default",includeSlot:!0}),gutter:Li("action")});continue}(o.type==="marker-end"?r:i).push({content:bl(o),gutter:Li("marker",o.type)})}return{before:i.length>0?i:void 0,after:r.length>0?r:void 0}};getOptionsWithDefaults(){const e=super.getOptionsWithDefaults();return e.diffStyle="unified",e.lineDiffType="none",e.mergeConflictActionsType=this.options.mergeConflictActionsType??"default",e}};function yi(e){return e!=null?{"data-merge-conflict":e}:void 0}function xi(e,t){if(t!=null){if(e==="change")return t==="current"||t==="incoming"?{"data-line-type":"context","data-merge-conflict":t}:void 0;if(t==="marker-start"||t==="marker-base"||t==="marker-separator"||t==="marker-end")return{"data-merge-conflict":t}}}function Li(e,t){const n=j(void 0,"annotation",1);return n.properties["data-gutter-buffer"]=e==="action"?"merge-conflict-action":`merge-conflict-${t??"marker"}`,n}function vl({row:e,includeDefaultActions:t,includeSlot:n}){const i=t?Cl(e.conflictIndex):[];return i.push(A({tagName:"slot",properties:{name:Ir({hunkIndex:e.hunkIndex,lineIndex:e.lineIndex,conflictIndex:e.conflictIndex}),"data-merge-conflict-action-slot":""}})),A({tagName:"div",properties:{"data-merge-conflict-actions":""},children:[A({tagName:"div",properties:{"data-merge-conflict-actions-content":""},children:i})]})}function bl(e){return A({tagName:"div",properties:{"data-merge-conflict":e.type,"data-merge-conflict-marker-row":""},children:[W(e.lineText.replace(/(?:\r\n|\n|\r)$/,""))]})}function Cl(e){return[Bt({resolution:"current",label:"Accept current change",conflictIndex:e}),ki(),Bt({resolution:"incoming",label:"Accept incoming change",conflictIndex:e}),ki(),Bt({resolution:"both",label:"Accept both",conflictIndex:e})]}function Bt({resolution:e,label:t,conflictIndex:n}){return A({tagName:"button",properties:{type:"button","data-merge-conflict-action":e,"data-merge-conflict-conflict-index":`${n}`},children:[W(t)]})}function ki(){return A({tagName:"span",properties:{"data-merge-conflict-action-separator":""},children:[W("|")]})}function Sl(e,t){return e.hunkIndex===t.hunkIndex&&e.startContentIndex===t.startContentIndex&&e.endContentIndex===t.endContentIndex&&e.currentContentIndex===t.currentContentIndex&&e.baseContentIndex===t.baseContentIndex&&e.incomingContentIndex===t.incomingContentIndex&&e.endMarkerContentIndex===t.endMarkerContentIndex&&e.conflictIndex===t.conflictIndex&&yl(e.conflict,t.conflict)}function yl(e,t){return e.conflictIndex===t.conflictIndex&&e.startLineIndex===t.startLineIndex&&e.startLineNumber===t.startLineNumber&&e.separatorLineIndex===t.separatorLineIndex&&e.separatorLineNumber===t.separatorLineNumber&&e.endLineIndex===t.endLineIndex&&e.endLineNumber===t.endLineNumber&&e.baseMarkerLineIndex===t.baseMarkerLineIndex&&e.baseMarkerLineNumber===t.baseMarkerLineNumber}let xl=-1;var nd=class extends Sr{options;__id=`unresolved-file:${++xl}`;type="unresolved-file";computedCache={file:void 0,fileDiff:void 0,actions:void 0,markerRows:void 0};conflictActions=[];markerRows=[];conflictActionCache=new Map;constructor(e={theme:_},t,n=!1){super(void 0,t,n),this.options=e,this.setOptions(e)}setOptions(e){if(e!=null){if(e.onMergeConflictAction!=null&&e.onMergeConflictResolve!=null)throw new Error("UnresolvedFile: onMergeConflictAction and onMergeConflictResolve are mutually exclusive. Use only one callback.");this.options=e,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions()}}syncInteractionOptions(){this.interactionManager.setOptions(Ke(this.options,typeof this.options.hunkSeparators=="function"||(this.options.hunkSeparators??"line-info")==="line-info"||this.options.hunkSeparators==="line-info-basic"?this.handleExpandHunk:void 0,this.getLineIndex,this.handleMergeConflictActionClick))}createHunksRenderer(e){return new Si(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getHunksRendererOptions(e){return Hl(e,this.options)}applyPreNodeAttributes(e,t){super.applyPreNodeAttributes(e,t,{"data-has-merge-conflict":""})}cleanUp(){this.emitPostRender(!0),this.clearMergeConflictActionCache(),this.computedCache={file:void 0,fileDiff:void 0,actions:void 0,markerRows:void 0},this.conflictActions=[],super.cleanUp()}getOrComputeDiff({file:e,fileDiff:t,actions:n,markerRows:i}){const{maxContextLines:r,onMergeConflictAction:o}=this.options;e:if(o!=null){const s=t!=null;if(s!==(n!=null)||s!==(i!=null))throw new Error("UnresolvedFile.getOrComputeDiff: fileDiff, actions, and markerRows must be passed together");if(t!=null&&n!=null&&i!=null){this.computedCache={file:e??this.computedCache.file,fileDiff:t,actions:n,markerRows:i};break e}else if(e!=null||this.computedCache.file!=null){if(e!=null&&this.computedCache.file!=null&&!ae(e,this.computedCache.file)&&this.computedCache.fileDiff!=null&&this.computedCache.actions!=null)throw new Error("UnresolvedFile.getOrComputeDiff: file can only be used to initialize unresolved state once. Pass fileDiff and actions for subsequent updates.");if(e??=this.computedCache.file,e==null)throw new Error("UnresolvedFile.getOrComputeDiff: file is null, should be impossible");if(!ae(e,this.computedCache.file)||this.computedCache.fileDiff==null||this.computedCache.actions==null){const l=ui(e,r);this.computedCache={file:e,fileDiff:l.fileDiff,actions:l.actions,markerRows:l.markerRows}}t=this.computedCache.fileDiff,n=this.computedCache.actions,i=this.computedCache.markerRows;break e}else{t=this.computedCache.fileDiff,n=this.computedCache.actions,i=this.computedCache.markerRows;break e}}else{if(t!=null||n!=null||i!=null)throw new Error("UnresolvedFile.getOrComputeDiff: fileDiff, actions, and markerRows are only usable in controlled mode, you must pass in `onMergeConflictAction`");if(e!=null&&this.computedCache.file!=null&&!ae(e,this.computedCache.file))throw new Error("UnresolvedFile.getOrComputeDiff: uncontrolled unresolved files parse the file only once. Later updates must come from the cached diff state.");if(this.computedCache.file??=e,this.computedCache.fileDiff==null&&this.computedCache.file!=null){const s=ui(this.computedCache.file,r);this.computedCache.fileDiff=s.fileDiff,this.computedCache.actions=s.actions,this.computedCache.markerRows=s.markerRows}t=this.computedCache.fileDiff,n=this.computedCache.actions,i=this.computedCache.markerRows;break e}if(!(t==null||n==null||i==null))return{fileDiff:t,actions:n,markerRows:i}}hydrate(e){const{file:t,fileDiff:n,actions:i,markerRows:r,lineAnnotations:o,fileContainer:s,prerenderedHTML:l,preventEmit:a=!1}=e,d=this.getOrComputeDiff({file:t,fileDiff:n,actions:i,markerRows:r});d!=null&&(this.hydrateElements(s,l),this.setActiveMergeConflictState(d.actions,d.markerRows),Rl(this.pre,d.fileDiff,this.options.collapsed)||Al(this.headerElement,d.fileDiff,this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):(this.hydrationSetup({fileDiff:d.fileDiff,lineAnnotations:o}),this.pre!=null&&this.renderMergeConflictActionSlots()),a||this.emitPostRender())}rerender(){!this.enabled||this.fileDiff==null||this.render({forceRender:!0,renderRange:this.renderRange})}render(e={}){const{file:t,fileDiff:n,actions:i,markerRows:r,lineAnnotations:o,preventEmit:s=!1,...l}=e,a=this.getOrComputeDiff({file:t,fileDiff:n,actions:i,markerRows:r});if(a==null)return!1;this.setActiveMergeConflictState(a.actions,a.markerRows);const d=super.render({...l,fileDiff:a.fileDiff,lineAnnotations:o,preventEmit:!0});return d&&(this.renderMergeConflictActionSlots(),s||this.emitPostRender()),d}resolveConflict(e,t,n=this.computedCache.fileDiff){const i=this.conflictActions[e];if(n==null||i==null)return;if(i.conflictIndex!==e)throw console.error({conflictIndex:e,action:i}),new Error("UnresolvedFile.resolveConflict: conflictIndex and conflictAction don't match");const r=dl(n,i,t),o=this.computedCache.file,{file:s,actions:l,markerRows:a}=Ll({fileDiff:r,previousActions:this.conflictActions,resolvedConflictIndex:e,previousFile:o,resolution:t});return{file:s,fileDiff:r,actions:l,markerRows:a}}resolveConflictAndRender(e,t){const n=this.conflictActions[e];if(n==null)return;if(n.conflictIndex!==e)throw console.error({conflictIndex:e,action:n}),new Error("UnresolvedFile.resolveConflictAndRender: conflictIndex and conflictAction don't match");const i={resolution:t,conflict:n.conflict},{file:r,fileDiff:o,actions:s,markerRows:l}=this.resolveConflict(e,t)??{};r==null||o==null||s==null||l==null||(this.computedCache={file:r,fileDiff:o,actions:s,markerRows:l},this.setActiveMergeConflictState(s,l),this.workerManager!=null?this.hunksRenderer.renderDiff(o):this.render({forceRender:!0}),this.options.onMergeConflictResolve?.(r,i))}setActiveMergeConflictState(e=this.conflictActions,t=this.markerRows){this.conflictActions=e,this.markerRows=t,this.computedCache.fileDiff!=null&&this.hunksRenderer instanceof Si&&this.hunksRenderer.setConflictState(this.options.mergeConflictActionsType==="none"?[]:e,t,this.computedCache.fileDiff)}handleMergeConflictActionClick=e=>{const t=this.conflictActions[e.conflictIndex];if(t==null)return;if(t.conflictIndex!==e.conflictIndex)throw console.error({conflictIndex:e.conflictIndex,action:t}),new Error("UnresolvedFile.handleMergeConflictActionClick: conflictIndex and conflictAction don't match");const n={resolution:e.resolution,conflict:t.conflict};if(this.options.onMergeConflictAction!=null){this.options.onMergeConflictAction(n,this);return}this.resolveConflictAndRender(e.conflictIndex,e.resolution)};renderMergeConflictActionSlots(){const{fileDiff:e}=this.computedCache;if(this.isContainerManaged||this.fileContainer==null||typeof this.options.mergeConflictActionsType!="function"||this.conflictActions.length===0||e==null){this.clearMergeConflictActionCache();return}const t=new Map(this.conflictActionCache);for(let n=0;n{if(s!==t&&o!=null)return o.conflict.startLineIndex>n.conflict.endLineIndex?{...o,conflict:Il(o.conflict,r)}:o})}function Tl(e,t){const n=(e.baseMarkerLineIndex??e.separatorLineIndex)-e.startLineIndex-1,i=e.endLineIndex-e.separatorLineIndex-1;return(t==="current"?n:t==="incoming"?i:n+i)-(e.endLineIndex-e.startLineIndex+1)}function Il(e,t){return{...e,startLineIndex:e.startLineIndex+t,startLineNumber:e.startLineNumber+t,separatorLineIndex:e.separatorLineIndex+t,separatorLineNumber:e.separatorLineNumber+t,endLineIndex:e.endLineIndex+t,endLineNumber:e.endLineNumber+t,baseMarkerLineIndex:e.baseMarkerLineIndex!=null?e.baseMarkerLineIndex+t:void 0,baseMarkerLineNumber:e.baseMarkerLineNumber!=null?e.baseMarkerLineNumber+t:void 0}}function Rl(e,t,n=!1){return!n&&e==null&&t!=null}function Al(e,t,n=!1){return e==null&&t!=null&&!n}function Hl(e,t){return{...t,...e,hunkSeparators:typeof e?.hunkSeparators=="function"?"custom":e?.hunkSeparators,mergeConflictActionsType:typeof e?.mergeConflictActionsType=="function"?"custom":e?.mergeConflictActionsType}}function Ml(e,t){return e==null||t==null?e===t:e.top===t.top&&e.bottom===t.bottom}const _r=1e3,Dl=_r*4,Pl=[0,1e-6,.99999,1],_l={overscrollSize:_r,intersectionObserverMargin:Dl,resizeDebugging:!1};let ht=0,Ol=-1;var id=class oe{static __STOP=!1;static __lastScrollPosition=0;__id=`virtualizer-${++Ol}`;config;type="simple";intersectionObserver;scrollTop=0;height=0;scrollHeight=0;windowSpecs={top:0,bottom:0};root;contentContainer;resizeObserver;observers=new Map;visibleInstances=new Map;visibleInstancesDirty=!1;instancesChanged=new Set;scrollDirty=!0;heightDirty=!0;scrollHeightDirty=!0;renderedObservers=0;connectQueue=new Map;constructor(t){this.config={..._l,...t}}setup(t,n){if(this.root==null){this.root=t,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:Pl,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),t instanceof Document?this.setupWindow():this.setupElement(n),window.__INSTANCE=this,window.__TOGGLE=()=>{oe.__STOP?(oe.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:oe.__lastScrollPosition}),Y(this.computeRenderRangeAndEmit)):(oe.__lastScrollPosition=this.getScrollTop(),oe.__STOP=!0)};for(const[i,r]of this.connectQueue.entries())this.connect(i,r);this.connectQueue.clear(),this.markDOMDirty(),Y(this.computeRenderRangeAndEmit)}}instanceChanged(t,n){this.instancesChanged.add(t),n&&this.markDOMDirty(),Y(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=Gt({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}isInstanceVisible(t,n){const i=this.getScrollTop(),r=this.getHeight(),o=this.config.intersectionObserverMargin,s=i-o,l=i+r+o;return!(tl)}handleContainerResize=t=>{if(this.root==null)return;let n=!1;for(const i of t){const r=i.borderBoxSize[0].blockSize;this.root instanceof Document?r!==this.scrollHeight&&(this.scrollHeightDirty=!0,n=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:r-ht,newSize:r}),ht=r)):i.target===this.root?r!==this.height&&(this.heightDirty=!0,n=!0):i.target===this.contentContainer&&(this.scrollHeightDirty=!0,n=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:r-ht,newSize:r}),ht=r))}n&&Y(this.computeRenderRangeAndEmit)};setupWindow(){if(this.root==null||!(this.root instanceof Document))throw new Error("Virtualizer.setupWindow: Invalid setup method");window.addEventListener("scroll",this.handleWindowScroll,{passive:!0}),window.addEventListener("resize",this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(t){if(this.root==null||this.root instanceof Document)throw new Error("Virtualizer.setupElement: Invalid setup method");this.root.addEventListener("scroll",this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),t??=this.root.firstElementChild??void 0,t instanceof HTMLElement&&(this.contentContainer=t,this.resizeObserver?.observe(t))}cleanUp(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0}getOffsetInScrollContainer(t){return this.getScrollTop()+Ue(t,this.getScrollContainerElement())}connect(t,n){if(this.observers.has(t))throw new Error("Virtualizer.connect: instance is already connected...");return this.intersectionObserver==null?this.connectQueue.set(t,n):(this.intersectionObserver.observe(t),this.observers.set(t,n),this.instancesChanged.add(n),this.markDOMDirty(),Y(this.computeRenderRangeAndEmit)),()=>this.disconnect(t)}disconnect(t){const n=this.observers.get(t);this.connectQueue.delete(t),n!=null&&(this.intersectionObserver?.unobserve(t),this.observers.delete(t),this.visibleInstances.delete(t)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),Y(this.computeRenderRangeAndEmit))}handleWindowResize=()=>{oe.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,Y(this.computeRenderRangeAndEmit))};handleWindowScroll=()=>{oe.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,Y(this.computeRenderRangeAndEmit))};handleElementScroll=()=>{oe.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,Y(this.computeRenderRangeAndEmit))};computeRenderRangeAndEmit=()=>{if(oe.__STOP)return;const t=this.heightDirty||this.scrollHeightDirty;if(!this.scrollDirty&&!this.scrollHeightDirty&&!this.heightDirty&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.instancesChanged.size===0)return;let n=this.instancesChanged.size>0;if(this.instancesChanged.size===0){const o=Gt({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!t&&Ml(this.windowSpecs,o)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty)return;this.windowSpecs=o}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;const i=this.getScrollAnchor(this.height),r=new Set;for(const o of t?this.observers.values():this.visibleInstances.values())o.onRender(t)&&r.add(o);for(const o of this.instancesChanged)r.has(o)||o.onRender(t)&&r.add(o);this.scrollFix(i);for(const o of r)o.reconcileHeights();n||=this.instancesChanged.size>0,n&&this.markDOMDirty(),(n||t)&&Y(this.computeRenderRangeAndEmit),r.clear(),this.instancesChanged.clear()};scrollFix(t){if(t==null)return;const n=this.getScrollContainerElement(),{lineIndex:i,lineOffset:r,fileElement:o,fileOffset:s,fileTypeOffset:l}=t;if(i!=null&&r!=null){const d=o.shadowRoot?.querySelector(`[data-line][data-line-index="${i}"]`);if(d instanceof HTMLElement){const h=Ue(d,n);if(h!==r){const c=h-r;this.applyScrollFix(c)}return}}const a=Ue(o,n);if(l==="top")a!==s&&this.applyScrollFix(a-s);else{const d=a+o.getBoundingClientRect().height;d!==s&&this.applyScrollFix(d-s)}}applyScrollFix(t){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+t,behavior:"instant"}):this.root.scrollTo({top:this.root.scrollTop+t,behavior:"instant"}),this.markDOMDirty()}getScrollAnchor(t){const n=this.getScrollContainerElement();let i;for(const[r]of this.visibleInstances.entries()){const o=Ue(r,n),s=o+r.offsetHeight;let l,a;s<=0?(l=s,a="bottom"):(l=o,a="top");let d,h;if(s>0&&o=0&&(i.fileOffset<0||li.fileOffset))&&(c=!0),c&&(i={fileElement:r,fileTypeOffset:a,fileOffset:l,lineIndex:d,lineOffset:h})}return i}handleIntersectionChange=t=>{this.scrollDirty=!0;for(const{target:n,isIntersecting:i}of t){if(!(n instanceof HTMLElement))throw new Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");const r=this.observers.get(n);r!=null&&(i&&!this.visibleInstances.has(n)?(r.setVisibility(!0),this.visibleInstances.set(n,r),this.visibleInstancesDirty=!0):!i&&this.visibleInstances.has(n)&&(r.setVisibility(!1),this.visibleInstances.delete(n),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&Y(this.computeRenderRangeAndEmit)};getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let t=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return t=Math.max(0,Math.min(t,this.getScrollHeight()-this.getHeight())),this.scrollTop=t,t}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}};function Ue(e,t){const n=e.getBoundingClientRect(),i=t?.getBoundingClientRect().top??0;return n.top-i}function rd(e){const t=[];for(const n of e){const i=Se.get(n);if(i==null)throw new Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(i)}return t}function od(e){for(const t of Array.isArray(e)?e:[e])if(!Se.has(t))return!1;return!0}function sd(e,t,n=[]){if(e==="text"||e==="ansi")throw new Error("registerCustomLanguage: 'text' and 'ansi' are reserved language names");if(jt.has(e)){console.error(`registerCustomLanguage: lang: ${e} is already registered`);return}jt.set(e,t);for(const i of n)Xo(i,e)}async function ad(e){const t=[],n=[];for(const i of e){if(i==="text"||i==="ansi")continue;const r=Fi(i)??Ni(i);"then"in r?n.push(r):t.push(r)}return n.length>0&&await Promise.all(n).then(i=>{for(const r of i){if(r==null)throw new Error("resolvedLanguages: unable to resolve language");t.push(r)}}),t}function ld(e){return X.getResolvedThemes(e)}function Nl(e,t){try{const n=hn({name:e,load:t});X.registerTheme(n.name,n.load)}catch(n){if(n instanceof Vi){console.error("SharedHighlight.registerCustomTheme: theme name already registered",e);return}throw n}}function dd(e,t,n=!1){const i=Br({name:e,variablePrefix:B("global"),variableDefaults:t,fontStyle:n});Nl(e,()=>Promise.resolve(i))}async function hd(e){for(const n of e)ji(n);const t=await X.resolveThemes(e);for(let n=0;n0&&(ct(i,t,"trailing"),$t(i,n)),i=void 0);const l=parseInt(s[3]),a=parseInt(s[1]),d=parseInt(s[4]??"1"),h=parseInt(s[2]??"1");isNaN(l)||isNaN(a)||isNaN(d)||isNaN(h)?n.push(o):i={additionStart:l,deletionStart:a,additionCount:0,deletionCount:0,hunkLines:[],contextLines:[]};continue}if(i==null){n.push(o);continue}if(o.startsWith(" "))i.contextLines.push(o);else if(o!==""){if(i.hunkLines.length>0&&i.contextLines.length>t*2){const l=i.contextLines.length-t*2,a=i.contextLines.slice(-t);ct(i,t,"trailing");const{additionCount:d,deletionCount:h}=i;$t(i,n),i={additionStart:i.additionStart+d+l,deletionStart:i.deletionStart+h+l,deletionCount:0,additionCount:0,contextLines:a,hunkLines:[]}}ct(i,t,i.hunkLines.length===0?"leading":"before-change"),i.hunkLines.push(o),o.startsWith("+")?i.additionCount+=1:o.startsWith("-")&&(i.deletionCount+=1)}}i!=null&&i.hunkLines.length>0&&(ct(i,t,"trailing"),$t(i,n));const r=n.join(` +`);return e.endsWith(` +`)?`${r} +`:r}function ct(e,t,n){if(n==="leading"&&e.contextLines.length>t){const i=e.contextLines.length-t;e.contextLines.splice(0,i),e.additionStart+=i,e.deletionStart+=i}return n==="trailing"&&e.contextLines.length>t&&(e.contextLines.length=t),e.contextLines.length>0&&(e.hunkLines.push(...e.contextLines),e.additionCount+=e.contextLines.length,e.deletionCount+=e.contextLines.length,e.contextLines.length=0),e}function $t(e,t){t.push(`@@ -${wi(e.deletionStart,e.deletionCount)} +${wi(e.additionStart,e.additionCount)} @@`),t.push(...e.hunkLines)}function wi(e,t){return t===1?`${e}`:`${e},${t}`}export{Yr as ALTERNATE_FILE_NAMES_GIT,gt as AttachedLanguages,vt as AttachedThemes,Wr as COMMIT_METADATA_SPLIT,Qr as CORE_CSS_ATTRIBUTE,an as CUSTOM_HEADER_SLOT_ID,hi as CodeToTokenTransformStream,ed as CodeView,_e as DEFAULT_CODE_VIEW_FILE_METRICS,eo as DEFAULT_CODE_VIEW_LAYOUT,jl as DEFAULT_COLLAPSED_CONTEXT_THRESHOLD,no as DEFAULT_EXPANDED_REGION,Ae as DEFAULT_RENDER_RANGE,to as DEFAULT_SMOOTH_SCROLL_SETTINGS,_ as DEFAULT_THEMES,Zr as DEFAULT_TOKENIZE_MAX_LENGTH,ln as DEFAULT_VIRTUAL_FILE_METRICS,$r as DIFFS_DEVELOPMENT_BUILD,Ai as DIFFS_SCROLLBAR_GUTTER_MEASURED_PROPERTY,Jr as DIFFS_SCROLLBAR_MEASURE_ATTRIBUTE,Ei as DIFFS_TAG_NAME,Cr as DiffHunksRenderer,Hi as EMPTY_RENDER_RANGE,Ne as EXTENSION_TO_FILE_FORMAT,qr as FILENAME_HEADER_REGEX,Kr as FILENAME_HEADER_REGEX_GIT,Vl as FILE_CONTEXT_BLOB,xs as File,Sr as FileDiff,fs as FileRenderer,td as FileStream,Ti as GIT_DIFF_FILE_BREAK_REGEX,sn as HEADER_METADATA_SLOT_ID,on as HEADER_PREFIX_SLOT_ID,Gr as HUNK_HEADER,Xr as INDEX_LINE_METADATA,Pi as InteractionManager,$l as MERGE_CONFLICT_BASE_MARKER_REGEX,Gl as MERGE_CONFLICT_END_MARKER_REGEX,Wl as MERGE_CONFLICT_SEPARATOR_MARKER_REGEX,Bl as MERGE_CONFLICT_START_MARKER_REGEX,jt as RegisteredCustomLanguages,_i as ResizeManager,Se as ResolvedLanguages,It as ResolvingLanguages,jr as SPLIT_WITH_NEWLINES,nr as SVGSpriteSheet,sa as ScrollSyncManager,rl as ShikiStreamTokenizer,Ii as THEME_CSS_ATTRIBUTE,Ul as UNIFIED_DIFF_FILE_BREAK_REGEX,Ri as UNSAFE_CSS_ATTRIBUTE,nd as UnresolvedFile,As as VirtualizedFile,Oa as VirtualizedFileDiff,id as Virtualizer,ka as areDiffLineAnnotationsEqual,Fe as areDiffRenderOptionsEqual,Be as areDiffTargetsEqual,Oe as areFileRenderOptionsEqual,ae as areFilesEqual,wa as areHunkDataEqual,mt as areLanguagesAttached,ps as areLineAnnotationsEqual,He as areObjectsEqual,dn as areOptionsEqual,ir as arePrePropertiesEqual,Lt as areRenderRangesEqual,Wt as areSelectionsEqual,Ge as areThemesAttached,De as areThemesEqual,Ml as areVirtualWindowSpecsEqual,cd as areWorkerStatsEqual,Rn as attachResolvedLanguages,An as attachResolvedThemes,xe as cleanLastNewline,So as cleanUpResolvedLanguages,To as cleanUpResolvedThemes,Ld as codeToHtml,qt as createAnnotationElement,pn as createAnnotationWrapperNode,Br as createCSSVariablesTheme,jn as createDiffSpanDecoration,rt as createEmptyRowBuffer,Yi as createFileHeaderElement,j as createGutterGap,Di as createGutterItem,rr as createGutterUtilityContentNode,so as createGutterUtilityElement,Ee as createGutterWrapper,A as createHastElement,pt as createIconElement,ot as createNoNewlineElement,Xi as createPreElement,Yo as createPreWrapperProperties,ud as createRowNodes,ke as createSeparator,ol as createSpanFromToken,fd as createStyleElement,W as createTextNodeElement,pd as createThemeStyleElement,Ji as createTransformerWithState,or as createUnsafeCSSStyleNode,Gt as createWindowFromScrollPosition,io as dequeueRender,U as detachString,gd as diffAcceptRejectHunk,Xl as disposeHighlighter,oo as findCodeElement,B as formatCSSVariablePrefix,Zl as getCustomExtensionsMap,Jl as getCustomExtensionsVersion,Q as getFiletypeFromFileName,Ki as getHighlighterIfLoaded,un as getHighlighterOptions,fn as getHighlighterThemeStyles,aa as getHunkSeparatorSlotName,jo as getIconForType,ge as getLineAnnotationName,md as getLineEndingType,Kt as getLineNodes,je as getOrCreateCodeNode,rd as getResolvedLanguages,Fi as getResolvedOrResolveLanguage,$o as getResolvedOrResolveTheme,ld as getResolvedThemes,xt as getSharedHighlighter,vd as getSingularPatch,cn as getThemes,la as getTotalLineCountFromHunks,Hl as getUnresolvedDiffHunksRendererOptions,od as hasResolvedLanguages,Go as hasResolvedThemes,da as isDefaultRenderRange,ql as isHighlighterLoaded,Wo as isHighlighterLoading,Kl as isHighlighterNull,Oi as isWorkerContext,tn as parseDiffFromFile,bd as parseLineType,Fs as parsePatchFiles,lr as patchScrollbarGutterSize,Ke as pluckInteractionOptions,ro as prefersReducedMotion,Yl as preloadHighlighter,dr as prerenderHTMLIfNecessary,Ns as processFile,Qo as processLine,_s as processPatch,st as pushOrJoinSpan,Y as queueRender,dd as registerCustomCSSVariableTheme,sd as registerCustomLanguage,Nl as registerCustomTheme,hr as releaseStringDetachBuffer,ba as renderDiffWithHighlighter,hs as renderFileWithHighlighter,Ql as replaceCustomExtensions,dl as resolveConflict,Ni as resolveLanguage,ad as resolveLanguages,wr as resolveRegion,Bo as resolveTheme,hd as resolveThemes,Xo as setCustomExtension,Cd as setLanguageOverride,bn as setPreNodeProperties,Sd as trimPatchContext,vs as wrapCoreCSS,vn as wrapThemeCSS,mn as wrapUnsafeCSS}; diff --git a/apps/kimi-code/dist-web/assets/index-CiHMlsuo.js b/apps/kimi-code/dist-web/assets/index-CiHMlsuo.js new file mode 100644 index 00000000000..f3b2480e632 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/index-CiHMlsuo.js @@ -0,0 +1,824 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/mermaid.core-WW7RuneT.js","assets/_commonjsHelpers-CqkleIqs.js","assets/CodeBlockNode-Dh6YGbd1.js","assets/safeRaf-DGuzXxDK.js","assets/index5-CI5HVqyi.js","assets/index11-oTpPg1Iy.js","assets/rive-CeXCFBdn.js"])))=>i.map(i=>d[i]); +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const r of s.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();/** +* @vue/shared v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function s4(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const di={},K1=[],za=()=>{},uB=()=>!1,t2=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),r4=e=>e.startsWith("onUpdate:"),$i=Object.assign,f7=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},VY=Object.prototype.hasOwnProperty,_i=(e,t)=>VY.call(e,t),bn=Array.isArray,Z1=e=>zm(e)==="[object Map]",Ep=e=>zm(e)==="[object Set]",UI=e=>zm(e)==="[object Date]",KY=e=>zm(e)==="[object RegExp]",Pn=e=>typeof e=="function",Zi=e=>typeof e=="string",fa=e=>typeof e=="symbol",Ti=e=>e!==null&&typeof e=="object",h7=e=>(Ti(e)||Pn(e))&&Pn(e.then)&&Pn(e.catch),cB=Object.prototype.toString,zm=e=>cB.call(e),ZY=e=>zm(e).slice(8,-1),l4=e=>zm(e)==="[object Object]",a4=e=>Zi(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Xh=s4(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),u4=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},GY=/-\w/g,Ds=u4(e=>e.replace(GY,t=>t.slice(1).toUpperCase())),QY=/\B([A-Z])/g,Cl=u4(e=>e.replace(QY,"-$1").toLowerCase()),c4=u4(e=>e.charAt(0).toUpperCase()+e.slice(1)),k9=u4(e=>e?`on${c4(e)}`:""),Zs=(e,t)=>!Object.is(e,t),G1=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:n})},d4=e=>{const t=parseFloat(e);return isNaN(t)?e:t},dk=e=>{const t=Zi(e)?Number(e):NaN;return isNaN(t)?e:t};let VI;const f4=()=>VI||(VI=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),YY="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",JY=s4(YY);function on(e){if(bn(e)){const t={};for(let n=0;n{if(n){const i=n.split(eJ);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function De(e){let t="";if(Zi(e))t=e;else if(bn(e))for(let n=0;nod(n,t))}const hB=e=>!!(e&&e.__v_isRef===!0),B=e=>Zi(e)?e:e==null?"":bn(e)||Ti(e)&&(e.toString===cB||!Pn(e.toString))?hB(e)?B(e.value):JSON.stringify(e,pB,2):String(e),pB=(e,t)=>hB(t)?pB(e,t.value):Z1(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[i,o],s)=>(n[r3(i,s)+" =>"]=o,n),{})}:Ep(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>r3(n))}:fa(t)?r3(t):Ti(t)&&!bn(t)&&!l4(t)?String(t):t,r3=(e,t="")=>{var n;return fa(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function lJ(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/** +* @vue/reactivity v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Is;class mB{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Is&&(Is.active?(this.parent=Is,this.index=(Is.scopes||(Is.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0){if(Is===this)Is=this.prevScope;else{let t=Is;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,i;for(n=0,i=this.effects.length;n0)return;if(M0){let t=M0;for(M0=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;I0;){let t=I0;for(I0=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(i){e||(e=i)}t=n}}if(e)throw e}function yB(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function kB(e){let t,n=e.depsTail,i=n;for(;i;){const o=i.prevDep;i.version===-1?(i===n&&(n=o),g7(i),aJ(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=o}e.deps=t,e.depsTail=n}function Z5(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(bB(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function bB(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===hv)||(e.globalVersion=hv,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Z5(e))))return;e.flags|=2;const t=e.dep,n=no,i=vu;no=e,vu=!0;try{yB(e);const o=e.fn(e._value);(t.version===0||Zs(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{no=n,vu=i,kB(e),e.flags&=-3}}function g7(e,t=!1){const{dep:n,prevSub:i,nextSub:o}=e;if(i&&(i.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=i,e.nextSub=void 0),n.subs===e&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)g7(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function aJ(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function R3t(e,t){e.effect instanceof fk&&(e=e.effect.fn);const n=new fk(e);t&&$i(n,t);try{n.run()}catch(o){throw n.stop(),o}const i=n.run.bind(n);return i.effect=n,i}function O3t(e){e.effect.stop()}let vu=!0;const wB=[];function cc(){wB.push(vu),vu=!1}function dc(){const e=wB.pop();vu=e===void 0?!0:e}function KI(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=no;no=void 0;try{t()}finally{no=n}}}let hv=0,uJ=class{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class m4{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!no||!vu||no===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==no)n=this.activeLink=new uJ(no,this),no.deps?(n.prevDep=no.depsTail,no.depsTail.nextDep=n,no.depsTail=n):no.deps=no.depsTail=n,CB(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const i=n.nextDep;i.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=i),n.prevDep=no.depsTail,n.nextDep=void 0,no.depsTail.nextDep=n,no.depsTail=n,no.deps===n&&(no.deps=i)}return n}trigger(t){this.version++,hv++,this.notify(t)}notify(t){p7();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{m7()}}}function CB(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let i=t.deps;i;i=i.nextDep)CB(i)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const hk=new WeakMap,ep=Symbol(""),G5=Symbol(""),pv=Symbol("");function Ir(e,t,n){if(vu&&no){let i=hk.get(e);i||hk.set(e,i=new Map);let o=i.get(n);o||(i.set(n,o=new m4),o.map=i,o.key=n),o.track()}}function Hc(e,t,n,i,o,s){const r=hk.get(e);if(!r){hv++;return}const l=a=>{a&&a.trigger()};if(p7(),t==="clear")r.forEach(l);else{const a=bn(e),u=a&&a4(n);if(a&&n==="length"){const c=Number(i);r.forEach((d,f)=>{(f==="length"||f===pv||!fa(f)&&f>=c)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),u&&l(r.get(pv)),t){case"add":a?u&&l(r.get("length")):(l(r.get(ep)),Z1(e)&&l(r.get(G5)));break;case"delete":a||(l(r.get(ep)),Z1(e)&&l(r.get(G5)));break;case"set":Z1(e)&&l(r.get(ep));break}}m7()}function cJ(e,t){const n=hk.get(e);return n&&n.get(t)}function t1(e){const t=hi(e);return t===e?t:(Ir(t,"iterate",pv),sa(e)?t:t.map(Cu))}function g4(e){return Ir(e=hi(e),"iterate",pv),e}function Vu(e,t){return sd(e)?ym(yu(e)?Cu(t):t):Cu(t)}const dJ={__proto__:null,[Symbol.iterator](){return a3(this,Symbol.iterator,e=>Vu(this,e))},concat(...e){return t1(this).concat(...e.map(t=>bn(t)?t1(t):t))},entries(){return a3(this,"entries",e=>(e[1]=Vu(this,e[1]),e))},every(e,t){return Ec(this,"every",e,t,void 0,arguments)},filter(e,t){return Ec(this,"filter",e,t,n=>n.map(i=>Vu(this,i)),arguments)},find(e,t){return Ec(this,"find",e,t,n=>Vu(this,n),arguments)},findIndex(e,t){return Ec(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ec(this,"findLast",e,t,n=>Vu(this,n),arguments)},findLastIndex(e,t){return Ec(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ec(this,"forEach",e,t,void 0,arguments)},includes(...e){return u3(this,"includes",e)},indexOf(...e){return u3(this,"indexOf",e)},join(e){return t1(this).join(e)},lastIndexOf(...e){return u3(this,"lastIndexOf",e)},map(e,t){return Ec(this,"map",e,t,void 0,arguments)},pop(){return Mg(this,"pop")},push(...e){return Mg(this,"push",e)},reduce(e,...t){return ZI(this,"reduce",e,t)},reduceRight(e,...t){return ZI(this,"reduceRight",e,t)},shift(){return Mg(this,"shift")},some(e,t){return Ec(this,"some",e,t,void 0,arguments)},splice(...e){return Mg(this,"splice",e)},toReversed(){return t1(this).toReversed()},toSorted(e){return t1(this).toSorted(e)},toSpliced(...e){return t1(this).toSpliced(...e)},unshift(...e){return Mg(this,"unshift",e)},values(){return a3(this,"values",e=>Vu(this,e))}};function a3(e,t,n){const i=g4(e),o=i[t]();return i!==e&&!sa(e)&&(o._next=o.next,o.next=()=>{const s=o._next();return s.done||(s.value=n(s.value)),s}),o}const fJ=Array.prototype;function Ec(e,t,n,i,o,s){const r=g4(e),l=r!==e&&!sa(e),a=r[t];if(a!==fJ[t]){const d=a.apply(e,s);return l?Cu(d):d}let u=n;r!==e&&(l?u=function(d,f){return n.call(this,Vu(e,d),f,e)}:n.length>2&&(u=function(d,f){return n.call(this,d,f,e)}));const c=a.call(r,u,i);return l&&o?o(c):c}function ZI(e,t,n,i){const o=g4(e),s=o!==e&&!sa(e);let r=n,l=!1;o!==e&&(s?(l=i.length===0,r=function(u,c,d){return l&&(l=!1,u=Vu(e,u)),n.call(this,u,Vu(e,c),d,e)}):n.length>3&&(r=function(u,c,d){return n.call(this,u,c,d,e)}));const a=o[t](r,...i);return l?Vu(e,a):a}function u3(e,t,n){const i=hi(e);Ir(i,"iterate",pv);const o=i[t](...n);return(o===-1||o===!1)&&k4(n[0])?(n[0]=hi(n[0]),i[t](...n)):o}function Mg(e,t,n=[]){cc(),p7();const i=hi(e)[t].apply(e,n);return m7(),dc(),i}const hJ=s4("__proto__,__v_isRef,__isVue"),AB=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(fa));function pJ(e){fa(e)||(e=String(e));const t=hi(this);return Ir(t,"has",e),t.hasOwnProperty(e)}class xB{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,i){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return s;if(n==="__v_raw")return i===(o?s?EB:TB:s?MB:IB).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;const r=bn(t);if(!o){let a;if(r&&(a=dJ[n]))return a;if(n==="hasOwnProperty")return pJ}const l=Reflect.get(t,n,Gi(t)?t:i);if((fa(n)?AB.has(n):hJ(n))||(o||Ir(t,"get",n),s))return l;if(Gi(l)){const a=r&&a4(n)?l:l.value;return o&&Ti(a)?pk(a):a}return Ti(l)?o?pk(l):po(l):l}}class SB extends xB{constructor(t=!1){super(!1,t)}set(t,n,i,o){let s=t[n];const r=bn(t)&&a4(n);if(!this._isShallow){const u=sd(s);if(!sa(i)&&!sd(i)&&(s=hi(s),i=hi(i)),!r&&Gi(s)&&!Gi(i))return u||(s.value=i),!0}const l=r?Number(n)e,iy=e=>Reflect.getPrototypeOf(e);function kJ(e,t,n){return function(...i){const o=this.__v_raw,s=hi(o),r=Z1(s),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,u=o[e](...i),c=n?Q5:t?ym:Cu;return!t&&Ir(s,"iterate",a?G5:ep),$i(Object.create(u),{next(){const{value:d,done:f}=u.next();return f?{value:d,done:f}:{value:l?[c(d[0]),c(d[1])]:c(d),done:f}}})}}function oy(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function bJ(e,t){const n={get(o){const s=this.__v_raw,r=hi(s),l=hi(o);e||(Zs(o,l)&&Ir(r,"get",o),Ir(r,"get",l));const{has:a}=iy(r),u=t?Q5:e?ym:Cu;if(a.call(r,o))return u(s.get(o));if(a.call(r,l))return u(s.get(l));s!==r&&s.get(o)},get size(){const o=this.__v_raw;return!e&&Ir(hi(o),"iterate",ep),o.size},has(o){const s=this.__v_raw,r=hi(s),l=hi(o);return e||(Zs(o,l)&&Ir(r,"has",o),Ir(r,"has",l)),o===l?s.has(o):s.has(o)||s.has(l)},forEach(o,s){const r=this,l=r.__v_raw,a=hi(l),u=t?Q5:e?ym:Cu;return!e&&Ir(a,"iterate",ep),l.forEach((c,d)=>o.call(s,u(c),u(d),r))}};return $i(n,e?{add:oy("add"),set:oy("set"),delete:oy("delete"),clear:oy("clear")}:{add(o){const s=hi(this),r=iy(s),l=hi(o),a=!t&&!sa(o)&&!sd(o)?l:o;return r.has.call(s,a)||Zs(o,a)&&r.has.call(s,o)||Zs(l,a)&&r.has.call(s,l)||(s.add(a),Hc(s,"add",a,a)),this},set(o,s){!t&&!sa(s)&&!sd(s)&&(s=hi(s));const r=hi(this),{has:l,get:a}=iy(r);let u=l.call(r,o);u||(o=hi(o),u=l.call(r,o));const c=a.call(r,o);return r.set(o,s),u?Zs(s,c)&&Hc(r,"set",o,s):Hc(r,"add",o,s),this},delete(o){const s=hi(this),{has:r,get:l}=iy(s);let a=r.call(s,o);a||(o=hi(o),a=r.call(s,o)),l&&l.call(s,o);const u=s.delete(o);return a&&Hc(s,"delete",o,void 0),u},clear(){const o=hi(this),s=o.size!==0,r=o.clear();return s&&Hc(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=kJ(o,e,t)}),n}function v4(e,t){const n=bJ(e,t);return(i,o,s)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?i:Reflect.get(_i(n,o)&&o in i?n:i,o,s)}const wJ={get:v4(!1,!1)},CJ={get:v4(!1,!0)},AJ={get:v4(!0,!1)},xJ={get:v4(!0,!0)},IB=new WeakMap,MB=new WeakMap,TB=new WeakMap,EB=new WeakMap;function SJ(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function po(e){return sd(e)?e:y4(e,!1,mJ,wJ,IB)}function hp(e){return y4(e,!1,vJ,CJ,MB)}function pk(e){return y4(e,!0,gJ,AJ,TB)}function B3t(e){return y4(e,!0,yJ,xJ,EB)}function y4(e,t,n,i,o){if(!Ti(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const s=o.get(e);if(s)return s;const r=SJ(ZY(e));if(r===0)return e;const l=new Proxy(e,r===2?i:n);return o.set(e,l),l}function yu(e){return sd(e)?yu(e.__v_raw):!!(e&&e.__v_isReactive)}function sd(e){return!!(e&&e.__v_isReadonly)}function sa(e){return!!(e&&e.__v_isShallow)}function k4(e){return e?!!e.__v_raw:!1}function hi(e){const t=e&&e.__v_raw;return t?hi(t):e}function Lt(e){return!_i(e,"__v_skip")&&Object.isExtensible(e)&&dB(e,"__v_skip",!0),e}const Cu=e=>Ti(e)?po(e):e,ym=e=>Ti(e)?pk(e):e;function Gi(e){return e?e.__v_isRef===!0:!1}function q(e){return LB(e,!1)}function _u(e){return LB(e,!0)}function LB(e,t){return Gi(e)?e:new _J(e,t)}class _J{constructor(t,n){this.dep=new m4,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:hi(t),this._value=n?t:Cu(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,i=this.__v_isShallow||sa(t)||sd(t);t=i?t:hi(t),Zs(t,n)&&(this._rawValue=t,this._value=i?t:Cu(t),this.dep.trigger())}}function IJ(e){e.dep&&e.dep.trigger()}function p(e){return Gi(e)?e.value:e}function lu(e){return Pn(e)?e():p(e)}const MJ={get:(e,t,n)=>t==="__v_raw"?e:p(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const o=e[t];return Gi(o)&&!Gi(n)?(o.value=n,!0):Reflect.set(e,t,n,i)}};function NB(e){return yu(e)?e:new Proxy(e,MJ)}class TJ{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new m4,{get:i,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=i,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function EJ(e){return new TJ(e)}function LJ(e){const t=bn(e)?new Array(e.length):{};for(const n in e)t[n]=FB(e,n);return t}class NJ{constructor(t,n,i){this._object=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._key=fa(n)?n:String(n),this._raw=hi(t);let o=!0,s=t;if(!bn(t)||fa(this._key)||!a4(this._key))do o=!k4(s)||sa(s);while(o&&(s=s.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=p(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Gi(this._raw[this._key])){const n=this._object[this._key];if(Gi(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return cJ(this._raw,this._key)}}class FJ{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function DJ(e,t,n){return Gi(e)?e:Pn(e)?new FJ(e):Ti(e)&&arguments.length>1?FB(e,t,n):q(e)}function FB(e,t,n){return new NJ(e,t,n)}class RJ{constructor(t,n,i){this.fn=t,this.setter=n,this._value=void 0,this.dep=new m4(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=hv-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&no!==this)return vB(this,!0),!0}get value(){const t=this.dep.track();return bB(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function OJ(e,t,n=!1){let i,o;return Pn(e)?i=e:(i=e.get,o=e.set),new RJ(i,o,n)}const $3t={GET:"get",HAS:"has",ITERATE:"iterate"},z3t={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},sy={},mk=new WeakMap;let jd;function j3t(){return jd}function PJ(e,t=!1,n=jd){if(n){let i=mk.get(n);i||mk.set(n,i=[]),i.push(e)}}function BJ(e,t,n=di){const{immediate:i,deep:o,once:s,scheduler:r,augmentJob:l,call:a}=n,u=w=>o?w:sa(w)||o===!1||o===0?Wc(w,1):Wc(w);let c,d,f,h,m=!1,g=!1;if(Gi(e)?(d=()=>e.value,m=sa(e)):yu(e)?(d=()=>u(e),m=!0):bn(e)?(g=!0,m=e.some(w=>yu(w)||sa(w)),d=()=>e.map(w=>{if(Gi(w))return w.value;if(yu(w))return u(w);if(Pn(w))return a?a(w,2):w()})):Pn(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){cc();try{f()}finally{dc()}}const w=jd;jd=c;try{return a?a(e,3,[h]):e(h)}finally{jd=w}}:d=za,t&&o){const w=d,M=o===!0?1/0:o;d=()=>Wc(w(),M)}const y=jm(),k=()=>{c.stop(),y&&y.active&&f7(y.effects,c)};if(s&&t){const w=t;t=(...M)=>{const L=w(...M);return k(),L}}let v=g?new Array(e.length).fill(sy):sy;const C=w=>{if(!(!(c.flags&1)||!c.dirty&&!w))if(t){const M=c.run();if(w||o||m||(g?M.some((L,E)=>Zs(L,v[E])):Zs(M,v))){f&&f();const L=jd;jd=c;try{const E=[M,v===sy?void 0:g&&v[0]===sy?[]:v,h];v=M,a?a(t,3,E):t(...E)}finally{jd=L}}}else c.run()};return l&&l(C),c=new fk(d),c.scheduler=r?()=>r(C,!1):C,h=w=>PJ(w,!1,c),f=c.onStop=()=>{const w=mk.get(c);if(w){if(a)a(w,4);else for(const M of w)M();mk.delete(c)}},t?i?C(!0):v=c.run():r?r(C.bind(null,!0),!0):c.run(),k.pause=c.pause.bind(c),k.resume=c.resume.bind(c),k.stop=k,k}function Wc(e,t=1/0,n){if(t<=0||!Ti(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Gi(e))Wc(e.value,t,n);else if(bn(e))for(let i=0;i{Wc(i,t,n)});else if(l4(e)){for(const i in e)Wc(e[i],t,n);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&Wc(e[i],t,n)}return e}/** +* @vue/runtime-core v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const DB=[];function $J(e){DB.push(e)}function zJ(){DB.pop()}function H3t(e,t){}const W3t={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},jJ={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function n2(e,t,n,i){try{return i?e(...i):e()}catch(o){Hm(o,t,n)}}function qa(e,t,n,i){if(Pn(e)){const o=n2(e,t,n,i);return o&&h7(o)&&o.catch(s=>{Hm(s,t,n)}),o}if(bn(e)){const o=[];for(let s=0;s>>1,o=Kr[i],s=mv(o);s=mv(n)?Kr.push(e):Kr.splice(WJ(t),0,e),e.flags|=1,OB()}}function OB(){gk||(gk=RB.then(PB))}function vk(e){bn(e)?Q1.push(...e):Hd&&e.id===-1?Hd.splice(b1+1,0,e):e.flags&1||(Q1.push(e),e.flags|=1),OB()}function GI(e,t,n=Hu+1){for(;nmv(n)-mv(i));if(Q1.length=0,Hd){Hd.push(...t);return}for(Hd=t,b1=0;b1e.id==null?e.flags&2?-1:1/0:e.id;function PB(e){try{for(Hu=0;Huw1.emit(o,...s)),ry=[]):typeof window<"u"&&window.HTMLElement&&!((i=(n=window.navigator)==null?void 0:n.userAgent)!=null&&i.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{BB(s,t)}),setTimeout(()=>{w1||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ry=[])},3e3)):ry=[]}let ur=null,b4=null;function gv(e){const t=ur;return ur=e,b4=e&&e.type.__scopeId||null,t}function q3t(e){b4=e}function U3t(){b4=null}const V3t=e=>de;function de(e,t=ur,n){if(!t||e._n)return e;const i=(...o)=>{i._d&&xk(-1);const s=gv(t);let r;try{r=e(...o)}finally{gv(s),i._d&&xk(1)}return r};return i._n=!0,i._c=!0,i._d=!0,i}function si(e,t){if(ur===null)return e;const n=s2(ur),i=e.dirs||(e.dirs=[]);for(let o=0;o1)return n&&Pn(t)?t.call(i&&i.proxy):t}}function qJ(){return!!(gs()||tp)}const UJ=Symbol.for("v-scx"),VJ=()=>en(UJ);function Y1(e,t){return i2(e,null,t)}function K3t(e,t){return i2(e,null,{flush:"post"})}function KJ(e,t){return i2(e,null,{flush:"sync"})}function ze(e,t,n){return i2(e,t,n)}function i2(e,t,n=di){const{immediate:i,deep:o,flush:s,once:r}=n,l=$i({},n),a=t&&i||!t&&s!=="post";let u;if(mp){if(s==="sync"){const h=VJ();u=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=za,h.resume=za,h.pause=za,h}}const c=rr;l.call=(h,m,g)=>qa(h,c,m,g);let d=!1;s==="post"?l.scheduler=h=>{es(h,c&&c.suspense)}:s!=="sync"&&(d=!0,l.scheduler=(h,m)=>{m?h():v7(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,c&&(h.id=c.uid,h.i=c))};const f=BJ(e,t,l);return mp&&(u?u.push(f):a&&f()),f}function ZJ(e,t,n){const i=this.proxy,o=Zi(e)?e.includes(".")?$B(i,e):()=>i[e]:e.bind(i,i);let s;Pn(t)?s=t:(s=t.handler,n=t);const r=Um(this),l=i2(o,s.bind(i),n);return r(),l}function $B(e,t){const n=t.split(".");return()=>{let i=e;for(let o=0;oe.__isTeleport,Th=e=>e&&(e.disabled||e.disabled===""),GJ=e=>e&&(e.defer||e.defer===""),QI=e=>typeof SVGElement<"u"&&e instanceof SVGElement,YI=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Y5=(e,t)=>{const n=e&&e.to;return Zi(n)?t?t(n):null:n},QJ={name:"Teleport",__isTeleport:!0,process(e,t,n,i,o,s,r,l,a,u){const{mc:c,pc:d,pbc:f,o:{insert:h,querySelector:m,createText:g,createComment:y,parentNode:k}}=u,v=Th(t.props);let{dynamicChildren:C}=t;const w=(E,S,x)=>{E.shapeFlag&16&&c(E.children,S,x,o,s,r,l,a)},M=(E=t)=>{const S=Th(E.props),x=E.target=Y5(E.props,m),A=J5(x,E,g,h);x&&(r!=="svg"&&QI(x)?r="svg":r!=="mathml"&&YI(x)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(x),S||(w(E,x,A),e0(E,!1)))},L=E=>{const S=()=>{if(Dd.get(E)===S){if(Dd.delete(E),Th(E.props)){const x=k(E.el)||n;w(E,x,E.anchor),e0(E,!0)}M(E)}};Dd.set(E,S),es(S,s)};if(e==null){const E=t.el=g(""),S=t.anchor=g("");if(h(E,n,i),h(S,n,i),GJ(t.props)||s&&s.pendingBranch){L(t);return}v&&(w(t,n,S),e0(t,!0)),M()}else{t.el=e.el;const E=t.anchor=e.anchor,S=Dd.get(e);if(S){S.flags|=8,Dd.delete(e),L(t);return}t.targetStart=e.targetStart;const x=t.target=e.target,A=t.targetAnchor=e.targetAnchor,T=Th(e.props),I=T?n:x,O=T?E:A;if(r==="svg"||QI(x)?r="svg":(r==="mathml"||YI(x))&&(r="mathml"),C?(f(e.dynamicChildren,C,I,o,s,r,l),I7(e,t,!0)):a||d(e,t,I,O,o,s,r,l,!1),v)T?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ly(t,n,E,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const H=Y5(t.props,m);H&&(t.target=H,ly(t,H,null,u,0))}else T&&ly(t,x,A,u,1);e0(t,v)}},remove(e,t,n,{um:i,o:{remove:o}},s){const{shapeFlag:r,children:l,anchor:a,targetStart:u,targetAnchor:c,target:d,props:f}=e,h=Th(f),m=s||!h,g=Dd.get(e);if(g&&(g.flags|=8,Dd.delete(e)),d&&(o(u),o(c)),s&&o(a),!g&&(h||d)&&r&16)for(let y=0;y{e.isMounted=!0}),ii(()=>{e.isUnmounting=!0}),e}const xa=[Function,Array],WB={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:xa,onEnter:xa,onAfterEnter:xa,onEnterCancelled:xa,onBeforeLeave:xa,onLeave:xa,onAfterLeave:xa,onLeaveCancelled:xa,onBeforeAppear:xa,onAppear:xa,onAfterAppear:xa,onAppearCancelled:xa},qB=e=>{const t=e.subTree;return t.component?qB(t.component):t},JJ={name:"BaseTransition",props:WB,setup(e,{slots:t}){const n=gs(),i=HB();return()=>{const o=t.default&&y7(t.default(),!0),s=o&&o.length?UB(o):n.subTree?X():void 0;if(!s)return;const r=hi(e),{mode:l}=r;if(i.isLeaving)return c3(s);const a=JI(s);if(!a)return c3(s);let u=vv(a,r,i,n,d=>u=d);a.type!==as&&yf(a,u);let c=n.subTree&&JI(n.subTree);if(c&&c.type!==as&&!cu(c,a)&&qB(n).type!==as){let d=vv(c,r,i,n);if(yf(c,d),l==="out-in"&&a.type!==as)return i.isLeaving=!0,d.afterLeave=()=>{i.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,c=void 0},c3(s);l==="in-out"&&a.type!==as?d.delayLeave=(f,h,m)=>{const g=VB(i,c);g[String(c.key)]=c,f[La]=()=>{h(),f[La]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{m(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return s}}};function UB(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==as){t=n;break}}return t}const XJ=JJ;function VB(e,t){const{leavingVNodes:n}=e;let i=n.get(t.type);return i||(i=Object.create(null),n.set(t.type,i)),i}function vv(e,t,n,i,o){const{appear:s,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:u,onAfterEnter:c,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:m,onLeaveCancelled:g,onBeforeAppear:y,onAppear:k,onAfterAppear:v,onAppearCancelled:C}=t,w=String(e.key),M=VB(n,e),L=(x,A)=>{x&&qa(x,i,9,A)},E=(x,A)=>{const T=A[1];L(x,A),bn(x)?x.every(I=>I.length<=1)&&T():x.length<=1&&T()},S={mode:r,persisted:l,beforeEnter(x){let A=a;if(!n.isMounted)if(s)A=y||a;else return;x[La]&&x[La](!0);const T=M[w];T&&cu(e,T)&&T.el[La]&&T.el[La](),L(A,[x])},enter(x){if(M[w]===e)return;let A=u,T=c,I=d;if(!n.isMounted)if(s)A=k||u,T=v||c,I=C||d;else return;let O=!1;x[Tg]=R=>{O||(O=!0,R?L(I,[x]):L(T,[x]),S.delayedLeave&&S.delayedLeave(),x[Tg]=void 0)};const H=x[Tg].bind(null,!1);A?E(A,[x,H]):H()},leave(x,A){const T=String(e.key);if(x[Tg]&&x[Tg](!0),n.isUnmounting)return A();L(f,[x]);let I=!1;x[La]=H=>{I||(I=!0,A(),H?L(g,[x]):L(m,[x]),x[La]=void 0,M[T]===e&&delete M[T])};const O=x[La].bind(null,!1);M[T]=e,h?E(h,[x,O]):O()},clone(x){const A=vv(x,t,n,i,o);return o&&o(A),A}};return S}function c3(e){if(o2(e))return e=rd(e),e.children=null,e}function JI(e){if(!o2(e))return jB(e.type)&&e.children?UB(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Pn(n.default))return n.default()}}function yf(e,t){e.shapeFlag&6&&e.component?(e.transition=t,yf(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function y7(e,t=!1,n){let i=[],o=0;for(let s=0;s1)for(let s=0;sn.value,set:s=>n.value=s})}return n}function XI(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const kk=new WeakMap;function J1(e,t,n,i,o=!1){if(bn(e)){e.forEach((g,y)=>J1(g,t&&(bn(t)?t[y]:t),n,i,o));return}if(Jc(i)&&!o){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&J1(e,t,n,i.component.subTree);return}const s=i.shapeFlag&4?s2(i.component):i.el,r=o?null:s,{i:l,r:a}=e,u=t&&t.r,c=l.refs===di?l.refs={}:l.refs,d=l.setupState,f=hi(d),h=d===di?uB:g=>XI(c,g)?!1:_i(f,g),m=(g,y)=>!(y&&XI(c,y));if(u!=null&&u!==a){if(eM(t),Zi(u))c[u]=null,h(u)&&(d[u]=null);else if(Gi(u)){const g=t;m(u,g.k)&&(u.value=null),g.k&&(c[g.k]=null)}}if(Pn(a)){cc();try{n2(a,l,12,[r,c])}finally{dc()}}else{const g=Zi(a),y=Gi(a);if(g||y){const k=()=>{if(e.f){const v=g?h(a)?d[a]:c[a]:m()||!e.k?a.value:c[e.k];if(o)bn(v)&&f7(v,s);else if(bn(v))v.includes(s)||v.push(s);else if(g)c[a]=[s],h(a)&&(d[a]=c[a]);else{const C=[s];m(a,e.k)&&(a.value=C),e.k&&(c[e.k]=C)}}else g?(c[a]=r,h(a)&&(d[a]=r)):y&&(m(a,e.k)&&(a.value=r),e.k&&(c[e.k]=r))};if(r){const v=()=>{k(),kk.delete(e)};v.id=-1,kk.set(e,v),es(v,n)}else eM(e),k()}}}function eM(e){const t=kk.get(e);t&&(t.flags|=8,kk.delete(e))}let tM=!1;const n1=()=>{tM||(console.error("Hydration completed but contains mismatches."),tM=!0)},tX=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",nX=e=>e.namespaceURI.includes("MathML"),ay=e=>{if(e.nodeType===1){if(tX(e))return"svg";if(nX(e))return"mathml"}},N1=e=>e.nodeType===8;function iX(e){const{mt:t,p:n,o:{patchProp:i,createText:o,nextSibling:s,parentNode:r,remove:l,insert:a,createComment:u}}=e,c=(C,w)=>{if(!w.hasChildNodes()){n(null,C,w),yk(),w._vnode=C;return}d(w.firstChild,C,null,null,null),yk(),w._vnode=C},d=(C,w,M,L,E,S=!1)=>{S=S||!!w.dynamicChildren;const x=N1(C)&&C.data==="[",A=()=>g(C,w,M,L,E,x),{type:T,ref:I,shapeFlag:O,patchFlag:H}=w;let R=C.nodeType;w.el=C,H===-2&&(S=!1,w.dynamicChildren=null);let F=null;switch(T){case lf:R!==3?w.children===""?(a(w.el=o(""),r(C),C),F=C):F=A():(C.data!==w.children&&(n1(),C.data=w.children),F=s(C));break;case as:v(C)?(F=s(C),k(w.el=C.content.firstChild,C,M)):R!==8||x?F=A():F=s(C);break;case em:if(x&&(C=s(C),R=C.nodeType),R===1||R===3){F=C;const P=!w.children.length;for(let z=0;z{S=S||!!w.dynamicChildren;const{type:x,dynamicProps:A,props:T,patchFlag:I,shapeFlag:O,dirs:H,transition:R}=w,F=x==="input"||x==="option",P=!!A;if(F||P||I!==-1){H&&Uu(w,null,M,"created");let z=!1;if(v(C)){z=p$(null,R)&&M&&M.vnode.props&&M.vnode.props.appear;const $=C.content.firstChild;if(z){const K=$.getAttribute("class");K&&($.$cls=K),R.beforeEnter($)}k($,C,M),w.el=C=$}if(O&16&&!(T&&(T.innerHTML||T.textContent))){let $=h(C.firstChild,w,C,M,L,E,S);for($&&!b9(C,1)&&n1();$;){const K=$;$=$.nextSibling,l(K)}}else if(O&8){let $=w.children;$[0]===` +`&&(C.tagName==="PRE"||C.tagName==="TEXTAREA")&&($=$.slice(1));const{textContent:K}=C;K!==$&&K!==$.replace(/\r\n|\r/g,` +`)&&(b9(C,0)||n1(),C.textContent=w.children)}if(T){if(F||P||!S||I&48){const $=C.tagName.includes("-");for(const K in T)(F&&(K.endsWith("value")||K==="indeterminate")||t2(K)&&!Xh(K)||K[0]==="."||$&&!Xh(K)||A&&A.includes(K))&&i(C,K,null,T[K],void 0,M)}else if(T.onClick)i(C,"onClick",null,T.onClick,void 0,M);else if(I&4&&yu(T.style))for(const $ in T.style)T.style[$]}let W;(W=T&&T.onVnodeBeforeMount)&&yl(W,M,w),H&&Uu(w,null,M,"beforeMount"),((W=T&&T.onVnodeMounted)||H||z)&&y$(()=>{W&&yl(W,M,w),z&&R.enter(C),H&&Uu(w,null,M,"mounted")},L)}return C.nextSibling},h=(C,w,M,L,E,S,x)=>{x=x||!!w.dynamicChildren;const A=w.children,T=A.length;let I=!1;for(let O=0;O{const{slotScopeIds:x}=w;x&&(E=E?E.concat(x):x);const A=r(C),T=h(s(C),w,A,M,L,E,S);return T&&N1(T)&&T.data==="]"?s(w.anchor=T):(n1(),a(w.anchor=u("]"),A,T),T)},g=(C,w,M,L,E,S)=>{if(sX(C,w)||n1(),w.el=null,S){const T=y(C);for(;;){const I=s(C);if(I&&I!==T)l(I);else break}}const x=s(C),A=r(C);return l(C),n(null,w,A,x,M,L,ay(A),E),M&&(M.vnode.el=w.el,A4(M,w.el)),x},y=(C,w="[",M="]")=>{let L=0;for(;C;)if(C=s(C),C&&N1(C)&&(C.data===w&&L++,C.data===M)){if(L===0)return s(C);L--}return C},k=(C,w,M)=>{const L=w.parentNode;L&&L.replaceChild(C,w);let E=M;for(;E;)E.vnode.el===w&&(E.vnode.el=E.subTree.el=C),E=E.parent},v=C=>C.nodeType===1&&C.tagName==="TEMPLATE";return[c,d]}const bk="data-allow-mismatch",oX={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function b9(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(bk);)e=e.parentElement;return b7(e&&e.getAttribute(bk),t)}function b7(e,t){if(e==null)return!1;if(e==="")return!0;{const n=e.split(",");return t===0&&n.includes("children")?!0:n.includes(oX[t])}}function sX(e,t){return b9(e.parentElement,1)||rX(e)||lX(t)}function rX(e){return e.nodeType===1&&b7(e.getAttribute(bk),1)}function lX({props:e}){const t=e&&e[bk];return typeof t=="string"&&b7(t,1)}const aX=f4().requestIdleCallback||(e=>setTimeout(e,1)),uX=f4().cancelIdleCallback||(e=>clearTimeout(e)),G3t=(e=1e4)=>t=>{const n=aX(t,{timeout:e});return()=>uX(n)};function cX(e){const{top:t,left:n,bottom:i,right:o}=e.getBoundingClientRect(),{innerHeight:s,innerWidth:r}=window;return(t>0&&t0&&i0&&n0&&o(t,n)=>{const i=new IntersectionObserver(o=>{for(const s of o)if(s.isIntersecting){i.disconnect(),t();break}},e);return n(o=>{if(o instanceof Element){if(cX(o))return t(),i.disconnect(),!1;i.observe(o)}}),()=>i.disconnect()},Y3t=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},J3t=(e=[])=>(t,n)=>{Zi(e)&&(e=[e]);let i=!1;const o=r=>{i||(i=!0,s(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},s=()=>{n(r=>{for(const l of e)r.removeEventListener(l,o)})};return n(r=>{for(const l of e)r.addEventListener(l,o,{once:!0})}),s};function dX(e,t){if(N1(e)&&e.data==="["){let n=1,i=e.nextSibling;for(;i;){if(i.nodeType===1){if(t(i)===!1)break}else if(N1(i))if(i.data==="]"){if(--n===0)break}else i.data==="["&&n++;i=i.nextSibling}}else t(e)}const Jc=e=>!!e.type.__asyncLoader;function Xu(e){Pn(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:i,delay:o=200,hydrate:s,timeout:r,suspensible:l=!0,onError:a}=e;let u=null,c,d=0;const f=()=>(d++,u=null,h()),h=()=>{let m;return u||(m=u=t().catch(g=>{if(g=g instanceof Error?g:new Error(String(g)),a)return new Promise((y,k)=>{a(g,()=>y(f()),()=>k(g),d+1)});throw g}).then(g=>m!==u&&u?u:(g&&(g.__esModule||g[Symbol.toStringTag]==="Module")&&(g=g.default),c=g,g)))};return ot({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(m,g,y){let k=!1;(g.bu||(g.bu=[])).push(()=>k=!0);const v=()=>{k||y()},C=s?()=>{const w=s(v,M=>dX(m,M));w&&(g.bum||(g.bum=[])).push(w)}:v;c?C():h().then(()=>!g.isUnmounted&&C())},get __asyncResolved(){return c},setup(){const m=rr;if(k7(m),c)return()=>uy(c,m);const g=M=>{u=null,Hm(M,m,13,!i)};if(l&&m.suspense||mp)return h().then(M=>()=>uy(M,m)).catch(M=>(g(M),()=>i?V(i,{error:M}):null));const y=q(!1),k=q(),v=q(!!o);let C,w;return Tn(()=>{C!=null&&clearTimeout(C),w!=null&&clearTimeout(w)}),o&&(w=setTimeout(()=>{m.isUnmounted||(v.value=!1)},o)),r!=null&&(C=setTimeout(()=>{if(!m.isUnmounted&&!y.value&&!k.value){const M=new Error(`Async component timed out after ${r}ms.`);g(M),k.value=M}},r)),h().then(()=>{m.isUnmounted||(y.value=!0,m.parent&&o2(m.parent.vnode)&&m.parent.update())}).catch(M=>{if(m.isUnmounted){u=null;return}g(M),k.value=M}),()=>{if(y.value&&c)return uy(c,m);if(k.value&&i)return V(i,{error:k.value});if(n&&!v.value)return uy(n,m)}}})}function uy(e,t){const{ref:n,props:i,children:o,ce:s}=t.vnode,r=V(e,i,o);return r.ref=n,r.ce=s,delete t.vnode.ce,r}const o2=e=>e.type.__isKeepAlive,fX={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=gs(),i=n.ctx;if(!i.renderer)return()=>{const v=t.default&&t.default();return v&&v.length===1?v[0]:v};const o=new Map,s=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:u,um:c,o:{createElement:d}}}=i,f=d("div");i.activate=(v,C,w,M,L)=>{const E=v.component;u(v,C,w,0,l),a(E.vnode,v,C,w,E,l,M,v.slotScopeIds,L),es(()=>{E.isDeactivated=!1,E.a&&G1(E.a);const S=v.props&&v.props.onVnodeMounted;S&&yl(S,E.parent,v)},l)},i.deactivate=v=>{const C=v.component;Ck(C.m),Ck(C.a),u(v,f,null,1,l),es(()=>{C.da&&G1(C.da);const w=v.props&&v.props.onVnodeUnmounted;w&&yl(w,C.parent,v),C.isDeactivated=!0},l)};function h(v){d3(v),c(v,n,l,!0)}function m(v){o.forEach((C,w)=>{const M=lC(Jc(C)?C.type.__asyncResolved||{}:C.type);M&&!v(M)&&g(w)})}function g(v){const C=o.get(v);C&&(!r||!cu(C,r))?h(C):r&&d3(r),o.delete(v),s.delete(v)}ze(()=>[e.include,e.exclude],([v,C])=>{v&&m(w=>t0(v,w)),C&&m(w=>!t0(C,w))},{flush:"post",deep:!0});let y=null;const k=()=>{y!=null&&(Ak(n.subTree.type)?es(()=>{o.set(y,cy(n.subTree))},n.subTree.suspense):o.set(y,cy(n.subTree)))};return gn(k),Wm(k),ii(()=>{o.forEach(v=>{const{subTree:C,suspense:w}=n,M=cy(C);if(v.type===M.type&&v.key===M.key){d3(M);const L=M.component.da;L&&es(L,w);return}h(v)})}),()=>{if(y=null,!t.default)return r=null;const v=t.default(),C=v[0];if(v.length>1)return r=null,v;if(!kf(C)||!(C.shapeFlag&4)&&!(C.shapeFlag&128))return r=null,C;let w=cy(C);if(w.type===as)return r=null,w;const M=w.type,L=lC(Jc(w)?w.type.__asyncResolved||{}:M),{include:E,exclude:S,max:x}=e;if(E&&(!L||!t0(E,L))||S&&L&&t0(S,L))return w.shapeFlag&=-257,r=w,C;const A=w.key==null?M:w.key,T=o.get(A);return w.el&&(w=rd(w),C.shapeFlag&128&&(C.ssContent=w)),y=A,T?(w.el=T.el,w.component=T.component,w.transition&&yf(w,w.transition),w.shapeFlag|=512,s.delete(A),s.add(A)):(s.add(A),x&&s.size>parseInt(x,10)&&g(s.values().next().value)),w.shapeFlag|=256,r=w,Ak(C.type)?C:w}}},X3t=fX;function t0(e,t){return bn(e)?e.some(n=>t0(n,t)):Zi(e)?e.split(",").includes(t):KY(e)?(e.lastIndex=0,e.test(t)):!1}function hX(e,t){KB(e,"a",t)}function pX(e,t){KB(e,"da",t)}function KB(e,t,n=rr){const i=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(w4(t,i,n),n){let o=n.parent;for(;o&&o.parent;)o2(o.parent.vnode)&&mX(i,t,n,o),o=o.parent}}function mX(e,t,n,i){const o=w4(t,e,i,!0);Tn(()=>{f7(i[t],o)},n)}function d3(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function cy(e){return e.shapeFlag&128?e.ssContent:e}function w4(e,t,n=rr,i=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...r)=>{cc();const l=Um(n),a=qa(t,n,e,r);return l(),dc(),a});return i?o.unshift(s):o.push(s),s}}const dd=e=>(t,n=rr)=>{(!mp||e==="sp")&&w4(e,(...i)=>t(...i),n)},gX=dd("bm"),gn=dd("m"),ZB=dd("bu"),Wm=dd("u"),ii=dd("bum"),Tn=dd("um"),vX=dd("sp"),yX=dd("rtg"),kX=dd("rtc");function GB(e,t=rr){w4("ec",e,t)}const w7="components",bX="directives";function QB(e,t){return C7(w7,e,!0,t)||e}const YB=Symbol.for("v-ndc");function To(e){return Zi(e)?C7(w7,e,!1)||e:e||YB}function e8t(e){return C7(bX,e)}function C7(e,t,n=!0,i=!1){const o=ur||rr;if(o){const s=o.type;if(e===w7){const l=lC(s,!1);if(l&&(l===t||l===Ds(t)||l===c4(Ds(t))))return s}const r=nM(o[e]||s[e],t)||nM(o.appContext[e],t);return!r&&i?s:r}}function nM(e,t){return e&&(e[t]||e[Ds(t)]||e[c4(Ds(t))])}function Ct(e,t,n,i){let o;const s=n&&n[i],r=bn(e);if(r||Zi(e)){const l=r&&yu(e);let a=!1,u=!1;l&&(a=!sa(e),u=sd(e),e=g4(e)),o=new Array(e.length);for(let c=0,d=e.length;ct(l,a,void 0,s&&s[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,u=l.length;a{const s=i.fn(...o);return s&&(s.key=i.key),s}:i.fn)}return e}function Hn(e,t,n={},i,o){if(ur.ce||ur.parent&&Jc(ur.parent)&&ur.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),b(),fe(Le,null,[V("slot",n,i&&i())],u?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),b();const r=s&&A7(s(n)),l=n.key||r&&r.key,a=fe(Le,{key:(l&&!fa(l)?l:`_${t}`)+(!r&&i?"_fb":"")},r||(i?i():[]),r&&e._===1?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),s&&s._c&&(s._d=!0),a}function A7(e){return e.some(t=>kf(t)?!(t.type===as||t.type===Le&&!A7(t.children)):!0)?e:null}function t8t(e,t){const n={};for(const i in e)n[t&&/[A-Z]/.test(i)?`on:${i}`:k9(i)]=e[i];return n}const X5=e=>e?x$(e)?s2(e):X5(e.parent):null,T0=$i(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>X5(e.parent),$root:e=>X5(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>x7(e),$forceUpdate:e=>e.f||(e.f=()=>{v7(e.update)}),$nextTick:e=>e.n||(e.n=ft.bind(e.proxy)),$watch:e=>ZJ.bind(e)}),f3=(e,t)=>e!==di&&!e.__isScriptSetup&&_i(e,t),eC={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:i,data:o,props:s,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return i[t];case 2:return o[t];case 4:return n[t];case 3:return s[t]}else{if(f3(i,t))return r[t]=1,i[t];if(o!==di&&_i(o,t))return r[t]=2,o[t];if(_i(s,t))return r[t]=3,s[t];if(n!==di&&_i(n,t))return r[t]=4,n[t];tC&&(r[t]=0)}}const u=T0[t];let c,d;if(u)return t==="$attrs"&&Ir(e.attrs,"get",""),u(e);if((c=l.__cssModules)&&(c=c[t]))return c;if(n!==di&&_i(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,_i(d,t))return d[t]},set({_:e},t,n){const{data:i,setupState:o,ctx:s}=e;return f3(o,t)?(o[t]=n,!0):i!==di&&_i(i,t)?(i[t]=n,!0):_i(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:o,props:s,type:r}},l){let a;return!!(n[l]||e!==di&&l[0]!=="$"&&_i(e,l)||f3(t,l)||_i(s,l)||_i(i,l)||_i(T0,l)||_i(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:_i(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},wX=$i({},eC,{get(e,t){if(t!==Symbol.unscopables)return eC.get(e,t,e)},has(e,t){return t[0]!=="_"&&!JY(t)}});function n8t(){return null}function i8t(){return null}function o8t(e){}function s8t(e){}function r8t(){return null}function l8t(){}function a8t(e,t){return null}function u8t(){return XB().slots}function qm(){return XB().attrs}function XB(e){const t=gs();return t.setupContext||(t.setupContext=I$(t))}function yv(e){return bn(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function c8t(e,t){const n=yv(e);for(const i in t){if(i.startsWith("__skip"))continue;let o=n[i];o?bn(o)||Pn(o)?o=n[i]={type:o,default:t[i]}:o.default=t[i]:o===null&&(o=n[i]={default:t[i]}),o&&t[`__skip_${i}`]&&(o.skipFactory=!0)}return n}function d8t(e,t){return!e||!t?e||t:bn(e)&&bn(t)?e.concat(t):$i({},yv(e),yv(t))}function f8t(e,t){const n={};for(const i in e)t.includes(i)||Object.defineProperty(n,i,{enumerable:!0,get:()=>e[i]});return n}function h8t(e){const t=gs(),n=mp;let i=e();bv(),n&&tm(!1);const o=()=>{Um(t),n&&tm(!0)},s=()=>{gs()!==t&&t.scope.off(),bv(),n&&tm(!1)};return h7(i)&&(i=i.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(s)),r})),[i,()=>{o(),Promise.resolve().then(s)}]}let tC=!0;function CX(e){const t=x7(e),n=e.proxy,i=e.ctx;tC=!1,t.beforeCreate&&iM(t.beforeCreate,e,"bc");const{data:o,computed:s,methods:r,watch:l,provide:a,inject:u,created:c,beforeMount:d,mounted:f,beforeUpdate:h,updated:m,activated:g,deactivated:y,beforeDestroy:k,beforeUnmount:v,destroyed:C,unmounted:w,render:M,renderTracked:L,renderTriggered:E,errorCaptured:S,serverPrefetch:x,expose:A,inheritAttrs:T,components:I,directives:O,filters:H}=t;if(u&&AX(u,i,null),r)for(const P in r){const z=r[P];Pn(z)&&(i[P]=z.bind(n))}if(o){const P=o.call(n,n);Ti(P)&&(e.data=po(P))}if(tC=!0,s)for(const P in s){const z=s[P],W=Pn(z)?z.bind(n,n):Pn(z.get)?z.get.bind(n,n):za,$=!Pn(z)&&Pn(z.set)?z.set.bind(n):za,K=D({get:W,set:$});Object.defineProperty(i,P,{enumerable:!0,configurable:!0,get:()=>K.value,set:ne=>K.value=ne})}if(l)for(const P in l)e$(l[P],i,n,P);if(a){const P=Pn(a)?a.call(n):a;Reflect.ownKeys(P).forEach(z=>{Gn(z,P[z])})}c&&iM(c,e,"c");function F(P,z){bn(z)?z.forEach(W=>P(W.bind(n))):z&&P(z.bind(n))}if(F(gX,d),F(gn,f),F(ZB,h),F(Wm,m),F(hX,g),F(pX,y),F(GB,S),F(kX,L),F(yX,E),F(ii,v),F(Tn,w),F(vX,x),bn(A))if(A.length){const P=e.exposed||(e.exposed={});A.forEach(z=>{Object.defineProperty(P,z,{get:()=>n[z],set:W=>n[z]=W,enumerable:!0})})}else e.exposed||(e.exposed={});M&&e.render===za&&(e.render=M),T!=null&&(e.inheritAttrs=T),I&&(e.components=I),O&&(e.directives=O),x&&k7(e)}function AX(e,t,n=za){bn(e)&&(e=nC(e));for(const i in e){const o=e[i];let s;Ti(o)?"default"in o?s=en(o.from||i,o.default,!0):s=en(o.from||i):s=en(o),Gi(s)?Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:r=>s.value=r}):t[i]=s}}function iM(e,t,n){qa(bn(e)?e.map(i=>i.bind(t.proxy)):e.bind(t.proxy),t,n)}function e$(e,t,n,i){let o=i.includes(".")?$B(n,i):()=>n[i];if(Zi(e)){const s=t[e];Pn(s)&&ze(o,s)}else if(Pn(e))ze(o,e.bind(n));else if(Ti(e))if(bn(e))e.forEach(s=>e$(s,t,n,i));else{const s=Pn(e.handler)?e.handler.bind(n):t[e.handler];Pn(s)&&ze(o,s,e)}}function x7(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:o,optionsCache:s,config:{optionMergeStrategies:r}}=e.appContext,l=s.get(t);let a;return l?a=l:!o.length&&!n&&!i?a=t:(a={},o.length&&o.forEach(u=>wk(a,u,r,!0)),wk(a,t,r)),Ti(t)&&s.set(t,a),a}function wk(e,t,n,i=!1){const{mixins:o,extends:s}=t;s&&wk(e,s,n,!0),o&&o.forEach(r=>wk(e,r,n,!0));for(const r in t)if(!(i&&r==="expose")){const l=xX[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const xX={data:oM,props:sM,emits:sM,methods:n0,computed:n0,beforeCreate:jr,created:jr,beforeMount:jr,mounted:jr,beforeUpdate:jr,updated:jr,beforeDestroy:jr,beforeUnmount:jr,destroyed:jr,unmounted:jr,activated:jr,deactivated:jr,errorCaptured:jr,serverPrefetch:jr,components:n0,directives:n0,watch:_X,provide:oM,inject:SX};function oM(e,t){return t?e?function(){return $i(Pn(e)?e.call(this,this):e,Pn(t)?t.call(this,this):t)}:t:e}function SX(e,t){return n0(nC(e),nC(t))}function nC(e){if(bn(e)){const t={};for(let n=0;n{let c,d=di,f;return KJ(()=>{const h=e[o];Zs(c,h)&&(c=h,u())}),{get(){return a(),n.get?n.get(c):c},set(h){const m=n.set?n.set(h):h;if(!Zs(m,c)&&!(d!==di&&Zs(h,d)))return;const g=i.vnode.props,y=!!(g&&(t in g||o in g||s in g)&&(`onUpdate:${t}`in g||`onUpdate:${o}`in g||`onUpdate:${s}`in g));y||(c=h,u()),i.emit(`update:${t}`,m),Zs(h,d)&&(Zs(h,m)&&!Zs(m,f)||y&&d!==di&&!Zs(m,c))&&u(),d=h,f=m}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||di:l,done:!1}:{done:!0}}}},l}const n$=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ds(t)}Modifiers`]||e[`${Cl(t)}Modifiers`];function TX(e,t,...n){if(e.isUnmounted)return;const i=e.vnode.props||di;let o=n;const s=t.startsWith("update:"),r=s&&n$(i,t.slice(7));r&&(r.trim&&(o=n.map(c=>Zi(c)?c.trim():c)),r.number&&(o=n.map(d4)));let l,a=i[l=k9(t)]||i[l=k9(Ds(t))];!a&&s&&(a=i[l=k9(Cl(t))]),a&&qa(a,e,6,o);const u=i[l+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,qa(u,e,6,o)}}const EX=new WeakMap;function i$(e,t,n=!1){const i=n?EX:t.emitsCache,o=i.get(e);if(o!==void 0)return o;const s=e.emits;let r={},l=!1;if(!Pn(e)){const a=u=>{const c=i$(u,t,!0);c&&(l=!0,$i(r,c))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!s&&!l?(Ti(e)&&i.set(e,null),null):(bn(s)?s.forEach(a=>r[a]=null):$i(r,s),Ti(e)&&i.set(e,r),r)}function C4(e,t){return!e||!t2(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),_i(e,t[0].toLowerCase()+t.slice(1))||_i(e,Cl(t))||_i(e,t))}function w9(e){const{type:t,vnode:n,proxy:i,withProxy:o,propsOptions:[s],slots:r,attrs:l,emit:a,render:u,renderCache:c,props:d,data:f,setupState:h,ctx:m,inheritAttrs:g}=e,y=gv(e);let k,v;try{if(n.shapeFlag&4){const w=o||i,M=w;k=wl(u.call(M,w,c,d,h,f,m)),v=l}else{const w=t;k=wl(w.length>1?w(d,{attrs:l,slots:r,emit:a}):w(d,null)),v=t.props?l:NX(l)}}catch(w){E0.length=0,Hm(w,e,1),k=V(as)}let C=k;if(v&&g!==!1){const w=Object.keys(v),{shapeFlag:M}=C;w.length&&M&7&&(s&&w.some(r4)&&(v=FX(v,s)),C=rd(C,v,!1,!0))}return n.dirs&&(C=rd(C,null,!1,!0),C.dirs=C.dirs?C.dirs.concat(n.dirs):n.dirs),n.transition&&yf(C,n.transition),k=C,gv(y),k}function LX(e,t=!0){let n;for(let i=0;i{let t;for(const n in e)(n==="class"||n==="style"||t2(n))&&((t||(t={}))[n]=e[n]);return t},FX=(e,t)=>{const n={};for(const i in e)(!r4(i)||!(i.slice(9)in t))&&(n[i]=e[i]);return n};function DX(e,t,n){const{props:i,children:o,component:s}=e,{props:r,children:l,patchFlag:a}=t,u=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return i?rM(i,r,u):!!r;if(a&8){const c=t.dynamicProps;for(let d=0;dObject.create(s$),l$=e=>Object.getPrototypeOf(e)===s$;function RX(e,t,n,i=!1){const o={},s=r$();e.propsDefaults=Object.create(null),a$(e,t,o,s);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=i?o:hp(o):e.type.props?e.props=o:e.props=s,e.attrs=s}function OX(e,t,n,i){const{props:o,attrs:s,vnode:{patchFlag:r}}=e,l=hi(o),[a]=e.propsOptions;let u=!1;if((i||r>0)&&!(r&16)){if(r&8){const c=e.vnode.dynamicProps;for(let d=0;d{a=!0;const[f,h]=u$(d,t,!0);$i(r,f),h&&l.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!s&&!a)return Ti(e)&&i.set(e,K1),K1;if(bn(s))for(let c=0;ce==="_"||e==="_ctx"||e==="$stable",_7=e=>bn(e)?e.map(wl):[wl(e)],BX=(e,t,n)=>{if(t._n)return t;const i=de((...o)=>_7(t(...o)),n);return i._c=!1,i},c$=(e,t,n)=>{const i=e._ctx;for(const o in e){if(S7(o))continue;const s=e[o];if(Pn(s))t[o]=BX(o,s,i);else if(s!=null){const r=_7(s);t[o]=()=>r}}},d$=(e,t)=>{const n=_7(t);e.slots.default=()=>n},f$=(e,t,n)=>{for(const i in t)(n||!S7(i))&&(e[i]=t[i])},$X=(e,t,n)=>{const i=e.slots=r$();if(e.vnode.shapeFlag&32){const o=t._;o?(f$(i,t,n),n&&dB(i,"_",o,!0)):c$(t,i)}else t&&d$(e,t)},zX=(e,t,n)=>{const{vnode:i,slots:o}=e;let s=!0,r=di;if(i.shapeFlag&32){const l=t._;l?n&&l===1?s=!1:f$(o,t,n):(s=!t.$stable,c$(t,o)),r=t}else t&&(d$(e,t),r={default:1});if(s)for(const l in o)!S7(l)&&r[l]==null&&delete o[l]},es=y$;function jX(e){return h$(e)}function HX(e){return h$(e,iX)}function h$(e,t){const n=f4();n.__VUE__=!0;const{insert:i,remove:o,patchProp:s,createElement:r,createText:l,createComment:a,setText:u,setElementText:c,parentNode:d,nextSibling:f,setScopeId:h=za,insertStaticContent:m}=e,g=(U,Q,ue,me=null,pe=null,ee=null,re=void 0,ge=null,ae=!!Q.dynamicChildren)=>{if(U===Q)return;U&&!cu(U,Q)&&(me=_e(U),ne(U,pe,ee,!0),U=null),Q.patchFlag===-2&&(ae=!1,Q.dynamicChildren=null);const{type:Ce,ref:ve,shapeFlag:ce}=Q;switch(Ce){case lf:y(U,Q,ue,me);break;case as:k(U,Q,ue,me);break;case em:U==null&&v(Q,ue,me,re);break;case Le:I(U,Q,ue,me,pe,ee,re,ge,ae);break;default:ce&1?M(U,Q,ue,me,pe,ee,re,ge,ae):ce&6?O(U,Q,ue,me,pe,ee,re,ge,ae):(ce&64||ce&128)&&Ce.process(U,Q,ue,me,pe,ee,re,ge,ae,he)}ve!=null&&pe?J1(ve,U&&U.ref,ee,Q||U,!Q):ve==null&&U&&U.ref!=null&&J1(U.ref,null,ee,U,!0)},y=(U,Q,ue,me)=>{if(U==null)i(Q.el=l(Q.children),ue,me);else{const pe=Q.el=U.el;Q.children!==U.children&&u(pe,Q.children)}},k=(U,Q,ue,me)=>{U==null?i(Q.el=a(Q.children||""),ue,me):Q.el=U.el},v=(U,Q,ue,me)=>{[U.el,U.anchor]=m(U.children,Q,ue,me,U.el,U.anchor)},C=({el:U,anchor:Q},ue,me)=>{let pe;for(;U&&U!==Q;)pe=f(U),i(U,ue,me),U=pe;i(Q,ue,me)},w=({el:U,anchor:Q})=>{let ue;for(;U&&U!==Q;)ue=f(U),o(U),U=ue;o(Q)},M=(U,Q,ue,me,pe,ee,re,ge,ae)=>{if(Q.type==="svg"?re="svg":Q.type==="math"&&(re="mathml"),U==null)L(Q,ue,me,pe,ee,re,ge,ae);else{const Ce=U.el&&U.el._isVueCE?U.el:null;try{Ce&&Ce._beginPatch(),x(U,Q,pe,ee,re,ge,ae)}finally{Ce&&Ce._endPatch()}}},L=(U,Q,ue,me,pe,ee,re,ge)=>{let ae,Ce;const{props:ve,shapeFlag:ce,transition:Te,dirs:ke}=U;if(ae=U.el=r(U.type,ee,ve&&ve.is,ve),ce&8?c(ae,U.children):ce&16&&S(U.children,ae,null,me,pe,h3(U,ee),re,ge),ke&&Uu(U,null,me,"created"),E(ae,U,U.scopeId,re,me),ve){for(const Ne in ve)Ne!=="value"&&!Xh(Ne)&&s(ae,Ne,null,ve[Ne],ee,me);"value"in ve&&s(ae,"value",null,ve.value,ee),(Ce=ve.onVnodeBeforeMount)&&yl(Ce,me,U)}ke&&Uu(U,null,me,"beforeMount");const Ae=p$(pe,Te);Ae&&Te.beforeEnter(ae),i(ae,Q,ue),((Ce=ve&&ve.onVnodeMounted)||Ae||ke)&&es(()=>{try{Ce&&yl(Ce,me,U),Ae&&Te.enter(ae),ke&&Uu(U,null,me,"mounted")}finally{}},pe)},E=(U,Q,ue,me,pe)=>{if(ue&&h(U,ue),me)for(let ee=0;ee{for(let Ce=ae;Ce{const ge=Q.el=U.el;let{patchFlag:ae,dynamicChildren:Ce,dirs:ve}=Q;ae|=U.patchFlag&16;const ce=U.props||di,Te=Q.props||di;let ke;if(ue&&ch(ue,!1),(ke=Te.onVnodeBeforeUpdate)&&yl(ke,ue,Q,U),ve&&Uu(Q,U,ue,"beforeUpdate"),ue&&ch(ue,!0),Ce&&(!U.dynamicChildren||U.dynamicChildren.length!==Ce.length)&&(ae=0,re=!1,Ce=null),(ce.innerHTML&&Te.innerHTML==null||ce.textContent&&Te.textContent==null)&&c(ge,""),Ce?A(U.dynamicChildren,Ce,ge,ue,me,h3(Q,pe),ee):re||z(U,Q,ge,null,ue,me,h3(Q,pe),ee,!1),ae>0){if(ae&16)T(ge,ce,Te,ue,pe);else if(ae&2&&ce.class!==Te.class&&s(ge,"class",null,Te.class,pe),ae&4&&s(ge,"style",ce.style,Te.style,pe),ae&8){const Ae=Q.dynamicProps;for(let Ne=0;Ne{ke&&yl(ke,ue,Q,U),ve&&Uu(Q,U,ue,"updated")},me)},A=(U,Q,ue,me,pe,ee,re)=>{for(let ge=0;ge{if(Q!==ue){if(Q!==di)for(const ee in Q)!Xh(ee)&&!(ee in ue)&&s(U,ee,Q[ee],null,pe,me);for(const ee in ue){if(Xh(ee))continue;const re=ue[ee],ge=Q[ee];re!==ge&&ee!=="value"&&s(U,ee,ge,re,pe,me)}"value"in ue&&s(U,"value",Q.value,ue.value,pe)}},I=(U,Q,ue,me,pe,ee,re,ge,ae)=>{const Ce=Q.el=U?U.el:l(""),ve=Q.anchor=U?U.anchor:l("");let{patchFlag:ce,dynamicChildren:Te,slotScopeIds:ke}=Q;ke&&(ge=ge?ge.concat(ke):ke),U==null?(i(Ce,ue,me),i(ve,ue,me),S(Q.children||[],ue,ve,pe,ee,re,ge,ae)):ce>0&&ce&64&&Te&&U.dynamicChildren&&U.dynamicChildren.length===Te.length?(A(U.dynamicChildren,Te,ue,pe,ee,re,ge),(Q.key!=null||pe&&Q===pe.subTree)&&I7(U,Q,!0)):z(U,Q,ue,ve,pe,ee,re,ge,ae)},O=(U,Q,ue,me,pe,ee,re,ge,ae)=>{Q.slotScopeIds=ge,U==null?Q.shapeFlag&512?pe.ctx.activate(Q,ue,me,re,ae):H(Q,ue,me,pe,ee,re,ae):R(U,Q,ae)},H=(U,Q,ue,me,pe,ee,re)=>{const ge=U.component=A$(U,me,pe);if(o2(U)&&(ge.ctx.renderer=he),S$(ge,!1,re),ge.asyncDep){if(pe&&pe.registerDep(ge,F,re),!U.el){const ae=ge.subTree=V(as);k(null,ae,Q,ue),U.placeholder=ae.el}}else F(ge,U,Q,ue,pe,ee,re)},R=(U,Q,ue)=>{const me=Q.component=U.component;if(DX(U,Q,ue))if(me.asyncDep&&!me.asyncResolved){P(me,Q,ue);return}else me.next=Q,me.update();else Q.el=U.el,me.vnode=Q},F=(U,Q,ue,me,pe,ee,re)=>{const ge=()=>{if(U.isMounted){let{next:ce,bu:Te,u:ke,parent:Ae,vnode:Ne}=U;{const Ot=m$(U);if(Ot){ce&&(ce.el=Ne.el,P(U,ce,re)),Ot.asyncDep.then(()=>{es(()=>{U.isUnmounted||Ce()},pe)});return}}let Ze=ce,rt;ch(U,!1),ce?(ce.el=Ne.el,P(U,ce,re)):ce=Ne,Te&&G1(Te),(rt=ce.props&&ce.props.onVnodeBeforeUpdate)&&yl(rt,Ae,ce,Ne),ch(U,!0);const pt=w9(U),Rt=U.subTree;U.subTree=pt,g(Rt,pt,d(Rt.el),_e(Rt),U,pe,ee),ce.el=pt.el,Ze===null&&A4(U,pt.el),ke&&es(ke,pe),(rt=ce.props&&ce.props.onVnodeUpdated)&&es(()=>yl(rt,Ae,ce,Ne),pe)}else{let ce;const{el:Te,props:ke}=Q,{bm:Ae,m:Ne,parent:Ze,root:rt,type:pt}=U,Rt=Jc(Q);if(ch(U,!1),Ae&&G1(Ae),!Rt&&(ce=ke&&ke.onVnodeBeforeMount)&&yl(ce,Ze,Q),ch(U,!0),Te&&J){const Ot=()=>{U.subTree=w9(U),J(Te,U.subTree,U,pe,null)};Rt&&pt.__asyncHydrate?pt.__asyncHydrate(Te,U,Ot):Ot()}else{rt.ce&&rt.ce._hasShadowRoot()&&rt.ce._injectChildStyle(pt,U.parent?U.parent.type:void 0);const Ot=U.subTree=w9(U);g(null,Ot,ue,me,U,pe,ee),Q.el=Ot.el}if(Ne&&es(Ne,pe),!Rt&&(ce=ke&&ke.onVnodeMounted)){const Ot=Q;es(()=>yl(ce,Ze,Ot),pe)}(Q.shapeFlag&256||Ze&&Jc(Ze.vnode)&&Ze.vnode.shapeFlag&256)&&U.a&&es(U.a,pe),U.isMounted=!0,Q=ue=me=null}};U.scope.on();const ae=U.effect=new fk(ge);U.scope.off();const Ce=U.update=ae.run.bind(ae),ve=U.job=ae.runIfDirty.bind(ae);ve.i=U,ve.id=U.uid,ae.scheduler=()=>v7(ve),ch(U,!0),Ce()},P=(U,Q,ue)=>{Q.component=U;const me=U.vnode.props;U.vnode=Q,U.next=null,OX(U,Q.props,me,ue),zX(U,Q.children,ue),cc(),GI(U),dc()},z=(U,Q,ue,me,pe,ee,re,ge,ae=!1)=>{const Ce=U&&U.children,ve=U?U.shapeFlag:0,ce=Q.children,{patchFlag:Te,shapeFlag:ke}=Q;if(Te>0){if(Te&128){$(Ce,ce,ue,me,pe,ee,re,ge,ae);return}else if(Te&256){W(Ce,ce,ue,me,pe,ee,re,ge,ae);return}}ke&8?(ve&16&&ie(Ce,pe,ee),ce!==Ce&&c(ue,ce)):ve&16?ke&16?$(Ce,ce,ue,me,pe,ee,re,ge,ae):ie(Ce,pe,ee,!0):(ve&8&&c(ue,""),ke&16&&S(ce,ue,me,pe,ee,re,ge,ae))},W=(U,Q,ue,me,pe,ee,re,ge,ae)=>{U=U||K1,Q=Q||K1;const Ce=U.length,ve=Q.length,ce=Math.min(Ce,ve);let Te;for(Te=0;Teve?ie(U,pe,ee,!0,!1,ce):S(Q,ue,me,pe,ee,re,ge,ae,ce)},$=(U,Q,ue,me,pe,ee,re,ge,ae)=>{let Ce=0;const ve=Q.length;let ce=U.length-1,Te=ve-1;for(;Ce<=ce&&Ce<=Te;){const ke=U[Ce],Ae=Q[Ce]=ae?zc(Q[Ce]):wl(Q[Ce]);if(cu(ke,Ae))g(ke,Ae,ue,null,pe,ee,re,ge,ae);else break;Ce++}for(;Ce<=ce&&Ce<=Te;){const ke=U[ce],Ae=Q[Te]=ae?zc(Q[Te]):wl(Q[Te]);if(cu(ke,Ae))g(ke,Ae,ue,null,pe,ee,re,ge,ae);else break;ce--,Te--}if(Ce>ce){if(Ce<=Te){const ke=Te+1,Ae=keTe)for(;Ce<=ce;)ne(U[Ce],pe,ee,!0),Ce++;else{const ke=Ce,Ae=Ce,Ne=new Map;for(Ce=Ae;Ce<=Te;Ce++){const be=Q[Ce]=ae?zc(Q[Ce]):wl(Q[Ce]);be.key!=null&&Ne.set(be.key,Ce)}let Ze,rt=0;const pt=Te-Ae+1;let Rt=!1,Ot=0;const Fe=new Array(pt);for(Ce=0;Ce=pt){ne(be,pe,ee,!0);continue}let Oe;if(be.key!=null)Oe=Ne.get(be.key);else for(Ze=Ae;Ze<=Te;Ze++)if(Fe[Ze-Ae]===0&&cu(be,Q[Ze])){Oe=Ze;break}Oe===void 0?ne(be,pe,ee,!0):(Fe[Oe-Ae]=Ce+1,Oe>=Ot?Ot=Oe:Rt=!0,g(be,Q[Oe],ue,null,pe,ee,re,ge,ae),rt++)}const Pe=Rt?WX(Fe):K1;for(Ze=Pe.length-1,Ce=pt-1;Ce>=0;Ce--){const be=Ae+Ce,Oe=Q[be],Ke=Q[be+1],Qe=be+1{const{el:ee,type:re,transition:ge,children:ae,shapeFlag:Ce}=U;if(Ce&6){K(U.component.subTree,Q,ue,me);return}if(Ce&128){U.suspense.move(Q,ue,me);return}if(Ce&64){re.move(U,Q,ue,he);return}if(re===Le){i(ee,Q,ue);for(let ce=0;cege.enter(ee),pe));else{const{leave:ce,delayLeave:Te,afterLeave:ke}=ge,Ae=()=>{U.ctx.isUnmounted?o(ee):i(ee,Q,ue)},Ne=()=>{const Ze=ee._isLeaving||!!ee[La];ee._isLeaving&&ee[La](!0),ge.persisted&&!Ze?Ae():ce(ee,()=>{Ae(),ke&&ke()})};Te?Te(ee,Ae,Ne):Ne()}else i(ee,Q,ue)},ne=(U,Q,ue,me=!1,pe=!1)=>{const{type:ee,props:re,ref:ge,children:ae,dynamicChildren:Ce,shapeFlag:ve,patchFlag:ce,dirs:Te,cacheIndex:ke,memo:Ae}=U;if(ce===-2&&(pe=!1),ge!=null&&(cc(),J1(ge,null,ue,U,!0),dc()),ke!=null&&(Q.renderCache[ke]=void 0),ve&256){Q.ctx.deactivate(U);return}const Ne=ve&1&&Te,Ze=!Jc(U);let rt;if(Ze&&(rt=re&&re.onVnodeBeforeUnmount)&&yl(rt,Q,U),ve&6)le(U.component,ue,me);else{if(ve&128){U.suspense.unmount(ue,me);return}Ne&&Uu(U,null,Q,"beforeUnmount"),ve&64?U.type.remove(U,Q,ue,he,me):Ce&&!Ce.hasOnce&&(ee!==Le||ce>0&&ce&64)?ie(Ce,Q,ue,!1,!0):(ee===Le&&ce&384||!pe&&ve&16)&&ie(ae,Q,ue),me&&G(U)}const pt=Ae!=null&&ke==null;(Ze&&(rt=re&&re.onVnodeUnmounted)||Ne||pt)&&es(()=>{rt&&yl(rt,Q,U),Ne&&Uu(U,null,Q,"unmounted"),pt&&(U.el=null)},ue)},G=U=>{const{type:Q,el:ue,anchor:me,transition:pe}=U;if(Q===Le){te(ue,me);return}if(Q===em){w(U);return}const ee=()=>{o(ue),pe&&!pe.persisted&&pe.afterLeave&&pe.afterLeave()};if(U.shapeFlag&1&&pe&&!pe.persisted){const{leave:re,delayLeave:ge}=pe,ae=()=>re(ue,ee);ge?ge(U.el,ee,ae):ae()}else ee()},te=(U,Q)=>{let ue;for(;U!==Q;)ue=f(U),o(U),U=ue;o(Q)},le=(U,Q,ue)=>{const{bum:me,scope:pe,job:ee,subTree:re,um:ge,m:ae,a:Ce}=U;Ck(ae),Ck(Ce),me&&G1(me),pe.stop(),ee&&(ee.flags|=8,ne(re,U,Q,ue)),ge&&es(ge,Q),es(()=>{U.isUnmounted=!0},Q)},ie=(U,Q,ue,me=!1,pe=!1,ee=0)=>{for(let re=ee;re{if(U.shapeFlag&6)return _e(U.component.subTree);if(U.shapeFlag&128)return U.suspense.next();const Q=f(U.anchor||U.el),ue=Q&&Q[zB];return ue?f(ue):Q};let Z=!1;const se=(U,Q,ue)=>{let me;U==null?Q._vnode&&(ne(Q._vnode,null,null,!0),me=Q._vnode.component):g(Q._vnode||null,U,Q,null,null,null,ue),Q._vnode=U,Z||(Z=!0,GI(me),yk(),Z=!1)},he={p:g,um:ne,m:K,r:G,mt:H,mc:S,pc:z,pbc:A,n:_e,o:e};let Y,J;return t&&([Y,J]=t(he)),{render:se,hydrate:Y,createApp:MX(se,Y)}}function h3({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function ch({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function p$(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function I7(e,t,n=!1){const i=e.children,o=t.children;if(bn(i)&&bn(o))for(let s=0;s>1,e[n[l]]0&&(t[i]=n[s-1]),n[s]=i)}}for(s=n.length,r=n[s-1];s-- >0;)n[s]=r,r=t[r];return n}function m$(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:m$(t)}function Ck(e){if(e)for(let t=0;te.__isSuspense;let oC=0;const qX={name:"Suspense",__isSuspense:!0,process(e,t,n,i,o,s,r,l,a,u){if(e==null)UX(t,n,i,o,s,r,l,a,u);else{if(s&&s.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}VX(e,t,n,i,o,r,l,a,u)}},hydrate:KX,normalize:ZX},m8t=qX;function kv(e,t){const n=e.props&&e.props[t];Pn(n)&&n()}function UX(e,t,n,i,o,s,r,l,a){const{p:u,o:{createElement:c}}=a,d=c("div"),f=e.suspense=v$(e,o,i,t,d,n,s,r,l,a);u(null,f.pendingBranch=e.ssContent,d,null,i,f,s,r),f.deps>0?(kv(e,"onPending"),kv(e,"onFallback"),u(null,e.ssFallback,t,n,i,null,s,r),X1(f,e.ssFallback)):f.resolve(!1,!0)}function VX(e,t,n,i,o,s,r,l,{p:a,um:u,o:{createElement:c}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,h=t.ssFallback,{activeBranch:m,pendingBranch:g,isInFallback:y,isHydrating:k}=d;if(g)d.pendingBranch=f,cu(g,f)?(a(g,f,d.hiddenContainer,null,o,d,s,r,l),d.deps<=0?d.resolve():y&&(k||(a(m,h,n,i,o,null,s,r,l),X1(d,h)))):(d.pendingId=oC++,k?(d.isHydrating=!1,d.activeBranch=g):u(g,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=c("div"),y?(a(null,f,d.hiddenContainer,null,o,d,s,r,l),d.deps<=0?d.resolve():(a(m,h,n,i,o,null,s,r,l),X1(d,h))):m&&cu(m,f)?(a(m,f,n,i,o,d,s,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,o,d,s,r,l),d.deps<=0&&d.resolve()));else if(m&&cu(m,f))a(m,f,n,i,o,d,s,r,l),X1(d,f);else if(kv(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=oC++,a(null,f,d.hiddenContainer,null,o,d,s,r,l),d.deps<=0)d.resolve();else{const{timeout:v,pendingId:C}=d;v>0?setTimeout(()=>{d.pendingId===C&&d.fallback(h)},v):v===0&&d.fallback(h)}}function v$(e,t,n,i,o,s,r,l,a,u,c=!1){const{p:d,m:f,um:h,n:m,o:{parentNode:g,remove:y}}=u;let k;const v=GX(e);v&&t&&t.pendingBranch&&(k=t.pendingId,t.deps++);const C=e.props?dk(e.props.timeout):void 0,w=s,M={vnode:e,parent:t,parentComponent:n,namespace:r,container:i,hiddenContainer:o,deps:0,pendingId:oC++,timeout:typeof C=="number"?C:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!c,isHydrating:c,isUnmounted:!1,effects:[],resolve(L=!1,E=!1){const{vnode:S,activeBranch:x,pendingBranch:A,pendingId:T,effects:I,parentComponent:O,container:H,isInFallback:R}=M;let F=!1;if(M.isHydrating)M.isHydrating=!1;else if(!L){F=x&&A.transition&&A.transition.mode==="out-in";let W=!1;F&&(x.transition.afterLeave=()=>{T===M.pendingId&&(f(A,H,s===w&&!W?m(x):s,0),vk(I),R&&S.ssFallback&&(S.ssFallback.el=null))}),x&&!M.isFallbackMountPending&&(g(x.el)===H&&(s=m(x),W=!0),h(x,O,M,!0),!F&&R&&S.ssFallback&&es(()=>S.ssFallback.el=null,M)),F||f(A,H,s,0)}M.isFallbackMountPending=!1,X1(M,A),M.pendingBranch=null,M.isInFallback=!1;let P=M.parent,z=!1;for(;P;){if(P.pendingBranch){P.effects.push(...I),z=!0;break}P=P.parent}!z&&!F&&vk(I),M.effects=[],v&&t&&t.pendingBranch&&k===t.pendingId&&(t.deps--,t.deps===0&&!E&&t.resolve()),kv(S,"onResolve")},fallback(L){if(!M.pendingBranch)return;const{vnode:E,activeBranch:S,parentComponent:x,container:A,namespace:T}=M;kv(E,"onFallback");const I=m(S),O=()=>{M.isFallbackMountPending=!1,M.isInFallback&&(d(null,L,A,I,x,null,T,l,a),X1(M,L))},H=L.transition&&L.transition.mode==="out-in";H&&(M.isFallbackMountPending=!0,S.transition.afterLeave=O),M.isInFallback=!0,h(S,x,null,!0),H||O()},move(L,E,S){M.activeBranch&&f(M.activeBranch,L,E,S),M.container=L},next(){return M.activeBranch&&m(M.activeBranch)},registerDep(L,E,S){const x=!!M.pendingBranch;x&&M.deps++;const A=L.vnode.el;L.asyncDep.catch(T=>{Hm(T,L,0)}).then(T=>{if(L.isUnmounted||M.isUnmounted||M.pendingId!==L.suspenseId)return;bv(),L.asyncResolved=!0;const{vnode:I}=L;sC(L,T,!1),A&&(I.el=A);const O=!A&&L.subTree.el;E(L,I,g(A||L.subTree.el),A?null:m(L.subTree),M,r,S),O&&(I.placeholder=null,y(O)),A4(L,I.el),x&&--M.deps===0&&M.resolve()})},unmount(L,E){M.isUnmounted=!0,M.activeBranch&&h(M.activeBranch,n,L,E),M.pendingBranch&&h(M.pendingBranch,n,L,E)}};return M}function KX(e,t,n,i,o,s,r,l,a){const u=t.suspense=v$(t,i,n,e.parentNode,document.createElement("div"),null,o,s,r,l,!0),c=a(e,u.pendingBranch=t.ssContent,n,u,s,r);return u.deps===0&&u.resolve(!1,!0),c}function ZX(e){const{shapeFlag:t,children:n}=e,i=t&32;e.ssContent=aM(i?n.default:n),e.ssFallback=i?aM(n.fallback):V(as)}function aM(e){let t;if(Pn(e)){const n=pp&&e._c;n&&(e._d=!1,b()),e=e(),n&&(e._d=!0,t=Tr,k$())}return bn(e)&&(e=LX(e)),e=wl(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function y$(e,t){t&&t.pendingBranch?bn(e)?t.effects.push(...e):t.effects.push(e):vk(e)}function X1(e,t){e.activeBranch=t;const{vnode:n,parentComponent:i}=e;let o=t.el;for(;!o&&t.component;)t=t.component.subTree,o=t.el;n.el=o,i&&i.subTree===n&&(i.vnode.el=o,A4(i,o))}function GX(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Le=Symbol.for("v-fgt"),lf=Symbol.for("v-txt"),as=Symbol.for("v-cmt"),em=Symbol.for("v-stc"),E0=[];let Tr=null;function b(e=!1){E0.push(Tr=e?null:[])}function k$(){E0.pop(),Tr=E0[E0.length-1]||null}let pp=1;function xk(e,t=!1){pp+=e,e<0&&Tr&&t&&(Tr.hasOnce=!0)}function b$(e){return e.dynamicChildren=pp>0?Tr||K1:null,k$(),pp>0&&Tr&&Tr.push(e),e}function N(e,t,n,i,o,s){return b$(_(e,t,n,i,o,s,!0))}function fe(e,t,n,i,o){return b$(V(e,t,n,i,o,!0))}function kf(e){return e?e.__v_isVNode===!0:!1}function cu(e,t){return e.type===t.type&&e.key===t.key}function g8t(e){}const w$=({key:e})=>e??null,C9=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Zi(e)||Gi(e)||Pn(e)?{i:ur,r:e,k:t,f:!!n}:e:null);function _(e,t=null,n=null,i=0,o=null,s=e===Le?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&w$(t),ref:t&&C9(t),scopeId:b4,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:ur};return l?(Sk(a,n),s&128&&e.normalize(a)):n&&(a.shapeFlag|=Zi(n)?8:16),pp>0&&!r&&Tr&&(a.patchFlag>0||s&6)&&a.patchFlag!==32&&Tr.push(a),a}const V=QX;function QX(e,t=null,n=null,i=0,o=null,s=!1){if((!e||e===YB)&&(e=as),kf(e)){const l=rd(e,t,!0);return n&&Sk(l,n),pp>0&&!s&&Tr&&(l.shapeFlag&6?Tr[Tr.indexOf(e)]=l:Tr.push(l)),l.patchFlag=-2,l}if(tee(e)&&(e=e.__vccOpts),t){t=C$(t);let{class:l,style:a}=t;l&&!Zi(l)&&(t.class=De(l)),Ti(a)&&(k4(a)&&!bn(a)&&(a=$i({},a)),t.style=on(a))}const r=Zi(e)?1:Ak(e)?128:jB(e)?64:Ti(e)?4:Pn(e)?2:0;return _(e,t,n,i,o,r,s,!0)}function C$(e){return e?k4(e)||l$(e)?$i({},e):e:null}function rd(e,t,n=!1,i=!1){const{props:o,ref:s,patchFlag:r,children:l,transition:a}=e,u=t?ci(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&w$(u),ref:t&&t.ref?n&&s?bn(s)?s.concat(C9(t)):[s,C9(t)]:C9(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Le?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&rd(e.ssContent),ssFallback:e.ssFallback&&rd(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&i&&yf(c,a.clone(c)),c}function Be(e=" ",t=0){return V(lf,null,e,t)}function Pf(e,t){const n=V(em,null,e);return n.staticCount=t,n}function X(e="",t=!1){return t?(b(),fe(as,null,e)):V(as,null,e)}function wl(e){return e==null||typeof e=="boolean"?V(as):bn(e)?V(Le,null,e.slice()):kf(e)?zc(e):V(lf,null,String(e))}function zc(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:rd(e)}function Sk(e,t){let n=0;const{shapeFlag:i}=e;if(t==null)t=null;else if(bn(t))n=16;else if(typeof t=="object")if(i&65){const o=t.default;o&&(o._c&&(o._d=!1),Sk(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!l$(t)?t._ctx=ur:o===3&&ur&&(ur.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(Pn(t)){if(i&65){Sk(e,{default:t});return}t={default:t,_ctx:ur},n=32}else t=String(t),i&64?(n=16,t=[Be(t)]):n=8;e.children=t,e.shapeFlag|=n}function ci(...e){const t={};for(let n=0;nrr||ur;let _k,tm;{const e=f4(),t=(n,i)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(i),s=>{o.length>1?o.forEach(r=>r(s)):o[0](s)}};_k=t("__VUE_INSTANCE_SETTERS__",n=>rr=n),tm=t("__VUE_SSR_SETTERS__",n=>mp=n)}const Um=e=>{const t=rr;return _k(e),e.scope.on(),()=>{e.scope.off(),_k(t)}},bv=()=>{rr&&rr.scope.off(),_k(null)};function x$(e){return e.vnode.shapeFlag&4}let mp=!1;function S$(e,t=!1,n=!1){t&&tm(t);const{props:i,children:o}=e.vnode,s=x$(e);RX(e,i,s,t),$X(e,o,n||t);const r=s?XX(e,t):void 0;return t&&tm(!1),r}function XX(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,eC);const{setup:i}=n;if(i){cc();const o=e.setupContext=i.length>1?I$(e):null,s=Um(e),r=n2(i,e,0,[e.props,o]),l=h7(r);if(dc(),s(),(l||e.sp)&&!Jc(e)&&k7(e),l){if(r.then(bv,bv),t)return r.then(a=>{sC(e,a,t)}).catch(a=>{Hm(a,e,0)});e.asyncDep=r}else sC(e,r,t)}else _$(e,t)}function sC(e,t,n){Pn(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ti(t)&&(e.setupState=NB(t)),_$(e,n)}let Ik,rC;function v8t(e){Ik=e,rC=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,wX))}}const y8t=()=>!Ik;function _$(e,t,n){const i=e.type;if(!e.render){if(!t&&Ik&&!i.render){const o=i.template||x7(e).template;if(o){const{isCustomElement:s,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=i,u=$i($i({isCustomElement:s,delimiters:l},r),a);i.render=Ik(o,u)}}e.render=i.render||za,rC&&rC(e)}{const o=Um(e);cc();try{CX(e)}finally{dc(),o()}}}const eee={get(e,t){return Ir(e,"get",""),e[t]}};function I$(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,eee),slots:e.slots,emit:e.emit,expose:t}}function s2(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(NB(Lt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in T0)return T0[n](e)},has(t,n){return n in t||n in T0}})):e.proxy}function lC(e,t=!0){return Pn(e)?e.displayName||e.name:e.name||t&&e.__name}function tee(e){return Pn(e)&&"__vccOpts"in e}const D=(e,t)=>OJ(e,t,mp);function Fn(e,t,n){try{xk(-1);const i=arguments.length;return i===2?Ti(t)&&!bn(t)?kf(t)?V(e,null,[t]):V(e,t):V(e,null,t):(i>3?n=Array.prototype.slice.call(arguments,2):i===3&&kf(n)&&(n=[n]),V(e,t,n))}finally{xk(1)}}function k8t(){}function b8t(e,t,n,i){const o=n[i];if(o&&nee(o,e))return o;const s=t();return s.memo=e.slice(),s.cacheIndex=i,n[i]=s}function nee(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let i=0;i0&&Tr&&Tr.push(e),!0}const iee="3.5.39",w8t=za,C8t=jJ,A8t=w1,x8t=BB,oee={createComponentInstance:A$,setupComponent:S$,renderComponentRoot:w9,setCurrentRenderingInstance:gv,isVNode:kf,normalizeVNode:wl,getComponentPublicInstance:s2,ensureValidVNode:A7,pushWarningContext:$J,popWarningContext:zJ},S8t=oee,_8t=null,I8t=null,M8t=null;/** +* @vue/runtime-dom v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let aC;const uM=typeof window<"u"&&window.trustedTypes;if(uM)try{aC=uM.createPolicy("vue",{createHTML:e=>e})}catch{}const M$=aC?e=>aC.createHTML(e):e=>e,see="http://www.w3.org/2000/svg",ree="http://www.w3.org/1998/Math/MathML",Pc=typeof document<"u"?document:null,cM=Pc&&Pc.createElement("template"),lee={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const o=t==="svg"?Pc.createElementNS(see,e):t==="mathml"?Pc.createElementNS(ree,e):n?Pc.createElement(e,{is:n}):Pc.createElement(e);return e==="select"&&i&&i.multiple!=null&&o.setAttribute("multiple",i.multiple),o},createText:e=>Pc.createTextNode(e),createComment:e=>Pc.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Pc.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,i,o,s){const r=n?n.previousSibling:t.lastChild;if(o&&(o===s||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===s||!(o=o.nextSibling)););else{cM.innerHTML=M$(i==="svg"?`${e}`:i==="mathml"?`${e}`:e);const l=cM.content;if(i==="svg"||i==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},_d="transition",Eg="animation",km=Symbol("_vtc"),T$={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},E$=$i({},WB,T$),aee=e=>(e.displayName="Transition",e.props=E$,e),mo=aee((e,{slots:t})=>Fn(XJ,L$(e),t)),dh=(e,t=[])=>{bn(e)?e.forEach(n=>n(...t)):e&&e(...t)},dM=e=>e?bn(e)?e.some(t=>t.length>1):e.length>1:!1;function L$(e){const t={};for(const I in e)I in T$||(t[I]=e[I]);if(e.css===!1)return t;const{name:n="v",type:i,duration:o,enterFromClass:s=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=s,appearActiveClass:u=r,appearToClass:c=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,m=uee(o),g=m&&m[0],y=m&&m[1],{onBeforeEnter:k,onEnter:v,onEnterCancelled:C,onLeave:w,onLeaveCancelled:M,onBeforeAppear:L=k,onAppear:E=v,onAppearCancelled:S=C}=t,x=(I,O,H,R)=>{I._enterCancelled=R,Rd(I,O?c:l),Rd(I,O?u:r),H&&H()},A=(I,O)=>{I._isLeaving=!1,Rd(I,d),Rd(I,h),Rd(I,f),O&&O()},T=I=>(O,H)=>{const R=I?E:v,F=()=>x(O,I,H);dh(R,[O,F]),fM(()=>{Rd(O,I?a:s),zu(O,I?c:l),dM(R)||hM(O,i,g,F)})};return $i(t,{onBeforeEnter(I){dh(k,[I]),zu(I,s),zu(I,r)},onBeforeAppear(I){dh(L,[I]),zu(I,a),zu(I,u)},onEnter:T(!1),onAppear:T(!0),onLeave(I,O){I._isLeaving=!0;const H=()=>A(I,O);zu(I,d),I._enterCancelled?(zu(I,f),uC(I)):(uC(I),zu(I,f)),fM(()=>{I._isLeaving&&(Rd(I,d),zu(I,h),dM(w)||hM(I,i,y,H))}),dh(w,[I,H])},onEnterCancelled(I){x(I,!1,void 0,!0),dh(C,[I])},onAppearCancelled(I){x(I,!0,void 0,!0),dh(S,[I])},onLeaveCancelled(I){A(I),dh(M,[I])}})}function uee(e){if(e==null)return null;if(Ti(e))return[p3(e.enter),p3(e.leave)];{const t=p3(e);return[t,t]}}function p3(e){return dk(e)}function zu(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[km]||(e[km]=new Set)).add(t)}function Rd(e,t){t.split(/\s+/).forEach(i=>i&&e.classList.remove(i));const n=e[km];n&&(n.delete(t),n.size||(e[km]=void 0))}function fM(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let cee=0;function hM(e,t,n,i){const o=e._endId=++cee,s=()=>{o===e._endId&&i()};if(n!=null)return setTimeout(s,n);const{type:r,timeout:l,propCount:a}=N$(e,t);if(!r)return i();const u=r+"end";let c=0;const d=()=>{e.removeEventListener(u,f),s()},f=h=>{h.target===e&&++c>=a&&d()};setTimeout(()=>{c(n[m]||"").split(", "),o=i(`${_d}Delay`),s=i(`${_d}Duration`),r=pM(o,s),l=i(`${Eg}Delay`),a=i(`${Eg}Duration`),u=pM(l,a);let c=null,d=0,f=0;t===_d?r>0&&(c=_d,d=r,f=s.length):t===Eg?u>0&&(c=Eg,d=u,f=a.length):(d=Math.max(r,u),c=d>0?r>u?_d:Eg:null,f=c?c===_d?s.length:a.length:0);const h=c===_d&&/\b(?:transform|all)(?:,|$)/.test(i(`${_d}Property`).toString());return{type:c,timeout:d,propCount:f,hasTransform:h}}function pM(e,t){for(;e.lengthmM(n)+mM(e[i])))}function mM(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function uC(e){return(e?e.ownerDocument:document).body.offsetHeight}function dee(e,t,n){const i=e[km];i&&(t=(t?[t,...i]:[...i]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Mk=Symbol("_vod"),M7=Symbol("_vsh"),Eo={name:"show",beforeMount(e,{value:t},{transition:n}){e[Mk]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Lg(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:i}){!t!=!n&&(i?t?(i.beforeEnter(e),Lg(e,!0),i.enter(e)):i.leave(e,()=>{Lg(e,!1)}):Lg(e,t))},beforeUnmount(e,{value:t}){Lg(e,t)}};function Lg(e,t){e.style.display=t?e[Mk]:"none",e[M7]=!t}function fee(){Eo.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const F$=Symbol("");function T8t(e){const t=gs();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(s=>Tk(s,o))},i=()=>{const o=e(t.proxy);t.ce?Tk(t.ce,o):cC(t.subTree,o),n(o)};ZB(()=>{vk(i)}),gn(()=>{ze(i,za,{flush:"post"});const o=new MutationObserver(i);o.observe(t.subTree.el.parentNode,{childList:!0}),Tn(()=>o.disconnect())})}function cC(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{cC(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Tk(e.el,t);else if(e.type===Le)e.children.forEach(n=>cC(n,t));else if(e.type===em){let{el:n,anchor:i}=e;for(;n&&(Tk(n,t),n!==i);)n=n.nextSibling}}function Tk(e,t){if(e.nodeType===1){const n=e.style;let i="";for(const o in t){const s=lJ(t[o]);n.setProperty(`--${o}`,s),i+=`--${o}: ${s};`}n[F$]=i}}const hee=/(?:^|;)\s*display\s*:/;function pee(e,t,n){const i=e.style,o=Zi(n);let s=!1;if(n&&!o){if(t)if(Zi(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&i0(i,l,"")}else for(const r in t)n[r]==null&&i0(i,r,"");for(const r in n){r==="display"&&(s=!0);const l=n[r];l!=null?gee(e,r,!Zi(t)&&t?t[r]:void 0,l)||i0(i,r,l):i0(i,r,"")}}else if(o){if(t!==n){const r=i[F$];r&&(n+=";"+r),i.cssText=n,s=hee.test(n)}}else t&&e.removeAttribute("style");Mk in e&&(e[Mk]=s?i.display:"",e[M7]&&(i.display="none"))}const gM=/\s*!important$/;function i0(e,t,n){if(bn(n))n.forEach(i=>i0(e,t,i));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=mee(e,t);gM.test(n)?e.setProperty(Cl(i),n.replace(gM,""),"important"):e[i]=n}}const vM=["Webkit","Moz","ms"],m3={};function mee(e,t){const n=m3[t];if(n)return n;let i=Ds(t);if(i!=="filter"&&i in e)return m3[t]=i;i=c4(i);for(let o=0;og3||(Cee.then(()=>g3=0),g3=Date.now());function xee(e,t){const n=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=n.attached)return;const o=n.value;if(bn(o)){const s=i.stopImmediatePropagation;i.stopImmediatePropagation=()=>{s.call(i),i._stopped=!0};const r=o.slice(),l=[i];for(let a=0;ae.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,See=(e,t,n,i,o,s)=>{const r=o==="svg";t==="class"?dee(e,i,r):t==="style"?pee(e,n,i):t2(t)?r4(t)||yee(e,t,n,i,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):_ee(e,t,i,r))?(bM(e,t,i),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&kM(e,t,i,r,s,t!=="value")):e._isVueCE&&(Iee(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Zi(i)))?bM(e,Ds(t),i,s,t):(t==="true-value"?e._trueValue=i:t==="false-value"&&(e._falseValue=i),kM(e,t,i,r))};function _ee(e,t,n,i){if(i)return!!(t==="innerHTML"||t==="textContent"||t in e&&CM(t)&&Pn(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return CM(t)&&Zi(n)?!1:t in e}function Iee(e,t){const n=e._def.props;if(!n)return!1;const i=Ds(t);return Array.isArray(n)?n.some(o=>Ds(o)===i):Object.keys(n).some(o=>Ds(o)===i)}const AM={};function Mee(e,t,n){let i=ot(e,t);l4(i)&&(i=$i({},i,t));class o extends T7{constructor(r){super(i,r,n)}}return o.def=i,o}const E8t=((e,t)=>Mee(e,t,qee)),Tee=typeof HTMLElement<"u"?HTMLElement:class{};class T7 extends Tee{constructor(t,n={},i=Nk){super(),this._def=t,this._props=n,this._createApp=i,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&i!==Nk?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow($i({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof T7){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,ft(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let i=0;i{this._resolved=!0,this._pendingResolve=void 0;const{props:s,styles:r}=i;let l;if(s&&!bn(s))for(const a in s){const u=s[a];(u===Number||u&&u.type===Number)&&(a in this._props&&(this._props[a]=dk(this._props[a])),(l||(l=Object.create(null)))[Ds(a)]=!0)}this._numberProps=l,this._resolveProps(i),this.shadowRoot&&this._applyStyles(r),this._mount(i)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(i=>{i.configureApp=this._def.configureApp,t(this._def=i,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const i in n)_i(this,i)||Object.defineProperty(this,i,{get:()=>p(n[i])})}_resolveProps(t){const{props:n}=t,i=bn(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&i.includes(o)&&this._setProp(o,this[o]);for(const o of i.map(Ds))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(s){this._setProp(o,s,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let i=n?this.getAttribute(t):AM;const o=Ds(t);n&&this._numberProps&&this._numberProps[o]&&(i=dk(i)),this._setProp(o,i,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,i=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===AM?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),i)){const s=this._ob;s&&(this._processMutations(s.takeRecords()),s.disconnect()),n===!0?this.setAttribute(Cl(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Cl(t),n+""):n||this.removeAttribute(Cl(t)),s&&s.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),Wee(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=V(this._def,$i(t,this._props));return this._instance||(n.ce=i=>{this._instance=i,i.ce=this,i.isCE=!0;const o=(s,r)=>{this.dispatchEvent(new CustomEvent(s,l4(r[0])?$i({detail:r},r[0]):{detail:r}))};i.emit=(s,...r)=>{o(s,r),Cl(s)!==s&&o(Cl(s),r)},this._setParent()}),n}_applyStyles(t,n,i){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce,s=this.shadowRoot,r=i?this._getStyleAnchor(i)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(s);let l=null;for(let a=t.length-1;a>=0;a--){const u=document.createElement("style");o&&u.setAttribute("nonce",o),u.textContent=t[a],s.insertBefore(u,l||r),l=u,a===0&&(i||this._styleAnchors.set(this._def,u),n&&this._styleAnchors.set(n,u))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n(delete e.props.mode,e),Nee=Lee({name:"TransitionGroup",props:$i({},E$,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=gs(),i=HB();let o,s;return Wm(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!Oee(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(Fee),o.forEach(Dee);const l=o.filter(Ree);uC(n.vnode.el),l.forEach(a=>{const u=a.el,c=u.style;zu(u,r),c.transform=c.webkitTransform=c.transitionDuration="";const d=u[Ek]=f=>{f&&f.target!==u||(!f||f.propertyName.endsWith("transform"))&&(u.removeEventListener("transitionend",d),u[Ek]=null,Rd(u,r))};u.addEventListener("transitionend",d)}),o=[]}),()=>{const r=hi(e),l=L$(r);let a=r.tag||Le;if(o=[],s)for(let u=0;u{l.split(/\s+/).forEach(a=>a&&i.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&i.classList.add(l)),i.style.display="none";const s=t.nodeType===1?t:t.parentNode;s.appendChild(i);const{hasTransform:r}=N$(i);return s.removeChild(i),r}const bf=e=>{const t=e.props["onUpdate:modelValue"]||!1;return bn(t)?n=>G1(t,n):t};function Pee(e){e.target.composing=!0}function SM(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ja=Symbol("_assign");function _M(e,t,n){return t&&(e=e.trim()),n&&(e=d4(e)),e}const dr={created(e,{modifiers:{lazy:t,trim:n,number:i}},o){e[ja]=bf(o);const s=i||o.props&&o.props.type==="number";qc(e,t?"change":"input",r=>{r.target.composing||e[ja](_M(e.value,n,s))}),(n||s)&&qc(e,"change",()=>{e.value=_M(e.value,n,s)}),t||(qc(e,"compositionstart",Pee),qc(e,"compositionend",SM),qc(e,"change",SM))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:i,trim:o,number:s}},r){if(e[ja]=bf(r),e.composing)return;const l=(s||e.type==="number")&&!/^0\d/.test(e.value)?d4(e.value):e.value,a=t??"";if(l===a)return;const u=e.getRootNode();(u instanceof Document||u instanceof ShadowRoot)&&u.activeElement===e&&e.type!=="range"&&(i&&t===n||o&&e.value.trim()===a)||(e.value=a)}},Lk={deep:!0,created(e,t,n){e[ja]=bf(n),qc(e,"change",()=>{const i=e._modelValue,o=bm(e),s=e.checked,r=e[ja];if(bn(i)){const l=h4(i,o),a=l!==-1;if(s&&!a)r(i.concat(o));else if(!s&&a){const u=[...i];u.splice(l,1),r(u)}}else if(Ep(i)){const l=new Set(i);s?l.add(o):l.delete(o),r(l)}else r($$(e,s))})},mounted:IM,beforeUpdate(e,t,n){e[ja]=bf(n),IM(e,t,n)}};function IM(e,{value:t,oldValue:n},i){e._modelValue=t;let o;if(bn(t))o=h4(t,i.props.value)>-1;else if(Ep(t))o=t.has(i.props.value);else{if(t===n)return;o=od(t,$$(e,!0))}e.checked!==o&&(e.checked=o)}const B$={created(e,{value:t},n){e.checked=od(t,n.props.value),e[ja]=bf(n),qc(e,"change",()=>{e[ja](bm(e))})},beforeUpdate(e,{value:t,oldValue:n},i){e[ja]=bf(i),t!==n&&(e.checked=od(t,i.props.value))}},dC={deep:!0,created(e,{value:t,modifiers:{number:n}},i){const o=Ep(t);qc(e,"change",()=>{const s=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?d4(bm(r)):bm(r));e[ja](e.multiple?o?new Set(s):s:s[0]),e._assigning=!0,ft(()=>{e._assigning=!1})}),e[ja]=bf(i)},mounted(e,{value:t}){MM(e,t)},beforeUpdate(e,t,n){e[ja]=bf(n)},updated(e,{value:t}){e._assigning||MM(e,t)}};function MM(e,t){const n=e.multiple,i=bn(t);if(!(n&&!i&&!Ep(t))){for(let o=0,s=e.options.length;oString(u)===String(l)):r.selected=h4(t,l)>-1}else r.selected=t.has(l);else if(od(bm(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function bm(e){return"_value"in e?e._value:e.value}function $$(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Bee={created(e,t,n){dy(e,t,n,null,"created")},mounted(e,t,n){dy(e,t,n,null,"mounted")},beforeUpdate(e,t,n,i){dy(e,t,n,i,"beforeUpdate")},updated(e,t,n,i){dy(e,t,n,i,"updated")}};function z$(e,t){switch(e){case"SELECT":return dC;case"TEXTAREA":return dr;default:switch(t){case"checkbox":return Lk;case"radio":return B$;default:return dr}}}function dy(e,t,n,i,o){const r=z$(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,i)}function $ee(){dr.getSSRProps=({value:e})=>({value:e}),B$.getSSRProps=({value:e},t)=>{if(t.props&&od(t.props.value,e))return{checked:!0}},Lk.getSSRProps=({value:e},t)=>{if(bn(e)){if(t.props&&h4(e,t.props.value)>-1)return{checked:!0}}else if(Ep(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},Bee.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=z$(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const zee=["ctrl","shift","alt","meta"],jee={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>zee.some(n=>e[`${n}Key`]&&!t.includes(n))},Et=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),i=t.join(".");return n[i]||(n[i]=((o,...s)=>{for(let r=0;r{const n=e._withKeys||(e._withKeys={}),i=t.join(".");return n[i]||(n[i]=(o=>{if(!("key"in o))return;const s=Cl(o.key);if(t.some(r=>r===s||Hee[r]===s))return e(o)}))},j$=$i({patchProp:See},lee);let L0,TM=!1;function H$(){return L0||(L0=jX(j$))}function W$(){return L0=TM?L0:HX(j$),TM=!0,L0}const Wee=((...e)=>{H$().render(...e)}),F8t=((...e)=>{W$().hydrate(...e)}),Nk=((...e)=>{const t=H$().createApp(...e),{mount:n}=t;return t.mount=i=>{const o=U$(i);if(!o)return;const s=t._component;!Pn(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,q$(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),qee=((...e)=>{const t=W$().createApp(...e),{mount:n}=t;return t.mount=i=>{const o=U$(i);if(o)return n(o,!0,q$(o))},t});function q$(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function U$(e){return Zi(e)?document.querySelector(e):e}let EM=!1;const D8t=()=>{EM||(EM=!0,$ee(),fee())},V$=Symbol("IconResolver"),Uee={sm:14,md:16,lg:20},xe=ot({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=en(V$,()=>{}),i=D(()=>n(t.name)),o=D(()=>Uee[t.size]);return(s,r)=>i.value?(b(),fe(To(i.value),{key:0,class:"kw-icon",width:o.value,height:o.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):X("",!0)}}),Vee=["disabled"],Kee={key:0,class:"ui-action-card__leading"},Zee={class:"ui-action-card__text"},Gee={class:"ui-action-card__title"},Qee={key:0,class:"ui-action-card__hint"},Yee=ot({__name:"ActionCard",props:{disabled:{type:Boolean,default:!1}},emits:["select"],setup(e){return(t,n)=>(b(),N("button",{class:"ui-action-card",type:"button",disabled:e.disabled,onClick:n[0]||(n[0]=i=>t.$emit("select"))},[t.$slots.leading?(b(),N("span",Kee,[Hn(t.$slots,"leading",{},void 0,!0)])):X("",!0),_("span",Zee,[_("span",Gee,[Hn(t.$slots,"default",{},void 0,!0),Hn(t.$slots,"badge",{},void 0,!0)]),t.$slots.hint?(b(),N("span",Qee,[Hn(t.$slots,"hint",{},void 0,!0)])):X("",!0)]),V(xe,{name:"chevron-right",size:"lg",class:"ui-action-card__chevron"})],8,Vee))}}),St=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},fC=St(Yee,[["__scopeId","data-v-e52e7748"]]);/*! + * shared v11.4.6 + * (c) 2026 kazuya kawaguchi + * Released under the MIT License. + */function Jee(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const Fk=typeof window<"u",Bf=(e,t=!1)=>t?Symbol.for(e):Symbol(e),Xee=(e,t,n)=>ete({l:e,k:t,s:n}),ete=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),ds=e=>typeof e=="number"&&isFinite(e),K$=e=>L7(e)==="[object Date]",wm=e=>L7(e)==="[object RegExp]",x4=e=>gi(e)&&Object.keys(e).length===0,hs=Object.assign,tte=Object.create,Ki=(e=null)=>tte(e);let LM;const zh=()=>LM||(LM=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Ki());function NM(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function nte(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}const ite=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,ote=/^(?:href|src|action|formaction)$/i;function E7(e){return ite.test(e)}function ste(e){const t=/url\s*\(/gi;let n="",i=0,o;for(;(o=t.exec(e))!==null;){const s=o.index,r=t.lastIndex-1;let l=r+1,a=1,u=null;for(;l`${i}="${FM(i,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,i,o)=>`${i}='${FM(i,o)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,i,o)=>E7(o)?`${i}about:blank`:n),e}const lte=Object.prototype.hasOwnProperty;function Oa(e,t){return lte.call(e,t)}const Lo=Array.isArray,ho=e=>typeof e=="function",dn=e=>typeof e=="string",wi=e=>typeof e=="boolean",Ci=e=>e!==null&&typeof e=="object",ate=e=>Ci(e)&&ho(e.then)&&ho(e.catch),Z$=Object.prototype.toString,L7=e=>Z$.call(e),gi=e=>L7(e)==="[object Object]",ute=e=>e==null?"":Lo(e)||gi(e)&&e.toString===Z$?JSON.stringify(e,null,2):String(e);function N7(e,t=""){return e.reduce((n,i,o)=>o===0?n+i:n+t+i,"")}const fy=e=>!Ci(e)||Lo(e);function A9(e,t){if(fy(e)||fy(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:i,des:o}=n.pop();Object.keys(i).forEach(s=>{s!=="__proto__"&&(Ci(i[s])&&!Ci(o[s])&&(o[s]=Array.isArray(i[s])?[]:Ki()),fy(o[s])||fy(i[s])?o[s]=i[s]:n.push({src:i[s],des:o[s]}))})}}/*! + * message-compiler v11.4.6 + * (c) 2026 kazuya kawaguchi + * Released under the MIT License. + */function cte(e,t,n){return{line:e,column:t,offset:n}}function hC(e,t,n){return{start:e,end:t}}const Ni={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},dte=17;function S4(e,t,n={}){const{domain:i,messages:o,args:s}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=i,l}function fte(e){throw e}const Ou=" ",hte="\r",xr=` +`,pte="\u2028",mte="\u2029";function gte(e){const t=e;let n=0,i=1,o=1,s=0;const r=E=>t[E]===hte&&t[E+1]===xr,l=E=>t[E]===xr,a=E=>t[E]===mte,u=E=>t[E]===pte,c=E=>r(E)||l(E)||a(E)||u(E),d=()=>n,f=()=>i,h=()=>o,m=()=>s,g=E=>r(E)||a(E)||u(E)?xr:t[E],y=()=>g(n),k=()=>g(n+s);function v(){return s=0,c(n)&&(i++,o=0),r(n)&&n++,n++,o++,t[n]}function C(){return r(n+s)&&s++,s++,t[n+s]}function w(){n=0,i=1,o=1,s=0}function M(E=0){s=E}function L(){const E=n+s;for(;E!==n;)v();s=0}return{index:d,line:f,column:h,peekOffset:m,charAt:g,currentChar:y,currentPeek:k,next:v,peek:C,reset:w,resetPeek:M,skipToPeek:L}}const Lc=void 0,vte=".",DM="'",yte="tokenizer";function kte(e,t={}){const n=t.location!==!1,i=gte(e),o=()=>i.index(),s=()=>cte(i.line(),i.column(),i.index()),r=s(),l=o(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},u=()=>a,{onError:c}=t;function d(ee,re,ge,...ae){const Ce=u();if(re.column+=ge,re.offset+=ge,c){const ve=n?hC(Ce.startLoc,re):null,ce=S4(ee,ve,{domain:yte,args:ae});c(ce)}}function f(ee,re,ge){ee.endLoc=s(),ee.currentType=re;const ae={type:re};return n&&(ae.loc=hC(ee.startLoc,ee.endLoc)),ge!=null&&(ae.value=ge),ae}const h=ee=>f(ee,13);function m(ee,re){return ee.currentChar()===re?(ee.next(),re):(d(Ni.EXPECTED_TOKEN,s(),0,re),"")}function g(ee){let re="";for(;ee.currentPeek()===Ou||ee.currentPeek()===xr;)re+=ee.currentPeek(),ee.peek();return re}function y(ee){const re=g(ee);return ee.skipToPeek(),re}function k(ee){if(ee===Lc)return!1;const re=ee.charCodeAt(0);return re>=97&&re<=122||re>=65&&re<=90||re===95}function v(ee){if(ee===Lc)return!1;const re=ee.charCodeAt(0);return re>=48&&re<=57}function C(ee,re){const{currentType:ge}=re;if(ge!==2)return!1;g(ee);const ae=k(ee.currentPeek());return ee.resetPeek(),ae}function w(ee,re){const{currentType:ge}=re;if(ge!==2)return!1;g(ee);const ae=ee.currentPeek()==="-"?ee.peek():ee.currentPeek(),Ce=v(ae);return ee.resetPeek(),Ce}function M(ee,re){const{currentType:ge}=re;if(ge!==2)return!1;g(ee);const ae=ee.currentPeek()===DM;return ee.resetPeek(),ae}function L(ee,re){const{currentType:ge}=re;if(ge!==7)return!1;g(ee);const ae=ee.currentPeek()===".";return ee.resetPeek(),ae}function E(ee,re){const{currentType:ge}=re;if(ge!==8)return!1;g(ee);const ae=k(ee.currentPeek());return ee.resetPeek(),ae}function S(ee,re){const{currentType:ge}=re;if(!(ge===7||ge===11))return!1;g(ee);const ae=ee.currentPeek()===":";return ee.resetPeek(),ae}function x(ee,re){const{currentType:ge}=re;if(ge!==9)return!1;const ae=()=>{const ve=ee.currentPeek();return ve==="{"?k(ee.peek()):ve==="@"||ve==="|"||ve===":"||ve==="."||ve===Ou||!ve?!1:ve===xr?(ee.peek(),ae()):T(ee,!1)},Ce=ae();return ee.resetPeek(),Ce}function A(ee){g(ee);const re=ee.currentPeek()==="|";return ee.resetPeek(),re}function T(ee,re=!0){const ge=(Ce=!1,ve="")=>{const ce=ee.currentPeek();return ce==="{"||ce==="@"||!ce?Ce:ce==="|"?!(ve===Ou||ve===xr):ce===Ou?(ee.peek(),ge(!0,Ou)):ce===xr?(ee.peek(),ge(!0,xr)):!0},ae=ge();return re&&ee.resetPeek(),ae}function I(ee,re){const ge=ee.currentChar();return ge===Lc?Lc:re(ge)?(ee.next(),ge):null}function O(ee){const re=ee.charCodeAt(0);return re>=97&&re<=122||re>=65&&re<=90||re>=48&&re<=57||re===95||re===36}function H(ee){return I(ee,O)}function R(ee){const re=ee.charCodeAt(0);return re>=97&&re<=122||re>=65&&re<=90||re>=48&&re<=57||re===95||re===36||re===45}function F(ee){return I(ee,R)}function P(ee){const re=ee.charCodeAt(0);return re>=48&&re<=57}function z(ee){return I(ee,P)}function W(ee){const re=ee.charCodeAt(0);return re>=48&&re<=57||re>=65&&re<=70||re>=97&&re<=102}function $(ee){return I(ee,W)}function K(ee){let re="",ge="";for(;re=z(ee);)ge+=re;return ge}function ne(ee){let re="";for(;;){const ge=ee.currentChar();if(ge==="\\"){const ae=ee.peek();ae==="{"||ae==="}"||ae==="@"||ae==="|"||ae==="\\"?(re+=ge+ae,ee.next(),ee.next()):(ee.resetPeek(),re+=ge,ee.next())}else{if(ge==="{"||ge==="}"||ge==="@"||ge==="|"||!ge)break;if(ge===Ou||ge===xr)if(T(ee))re+=ge,ee.next();else{if(A(ee))break;re+=ge,ee.next()}else re+=ge,ee.next()}}return re}function G(ee){y(ee);let re="",ge="";for(;re=F(ee);)ge+=re;const ae=ee.currentChar();if(ae&&ae!=="}"&&ae!==Lc&&ae!==Ou&&ae!==xr&&ae!==" "){const Ce=he(ee);return d(Ni.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,ge+Ce),ge+Ce}return ee.currentChar()===Lc&&d(Ni.UNTERMINATED_CLOSING_BRACE,s(),0),ge}function te(ee){y(ee);let re="";return ee.currentChar()==="-"?(ee.next(),re+=`-${K(ee)}`):re+=K(ee),ee.currentChar()===Lc&&d(Ni.UNTERMINATED_CLOSING_BRACE,s(),0),re}function le(ee){return ee!==DM&&ee!==xr}function ie(ee){y(ee),m(ee,"'");let re="",ge="";for(;re=I(ee,le);)re==="\\"?ge+=_e(ee):ge+=re;const ae=ee.currentChar();return ae===xr||ae===Lc?(d(Ni.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),ae===xr&&(ee.next(),m(ee,"'")),ge):(m(ee,"'"),ge)}function _e(ee){const re=ee.currentChar();switch(re){case"\\":case"'":return ee.next(),`\\${re}`;case"u":return Z(ee,re,4);case"U":return Z(ee,re,6);default:return d(Ni.UNKNOWN_ESCAPE_SEQUENCE,s(),0,re),""}}function Z(ee,re,ge){m(ee,re);let ae="";for(let Ce=0;Ce{const ae=ee.currentChar();return ae==="{"||ae==="@"||ae==="|"||ae==="("||ae===")"||!ae||ae===Ou?ge:(ge+=ae,ee.next(),re(ge))};return re("")}function U(ee){y(ee);const re=m(ee,"|");return y(ee),re}function Q(ee,re){let ge=null;switch(ee.currentChar()){case"{":return re.braceNest>=1&&d(Ni.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),ee.next(),ge=f(re,2,"{"),y(ee),re.braceNest++,ge;case"}":return re.braceNest>0&&re.currentType===2&&d(Ni.EMPTY_PLACEHOLDER,s(),0),ee.next(),ge=f(re,3,"}"),re.braceNest--,re.braceNest>0&&y(ee),re.inLinked&&re.braceNest===0&&(re.inLinked=!1),ge;case"@":return re.braceNest>0&&d(Ni.UNTERMINATED_CLOSING_BRACE,s(),0),ge=ue(ee,re)||h(re),re.braceNest=0,ge;default:{let Ce=!0,ve=!0,ce=!0;if(A(ee))return re.braceNest>0&&d(Ni.UNTERMINATED_CLOSING_BRACE,s(),0),ge=f(re,1,U(ee)),re.braceNest=0,re.inLinked=!1,ge;if(re.braceNest>0&&(re.currentType===4||re.currentType===5||re.currentType===6))return d(Ni.UNTERMINATED_CLOSING_BRACE,s(),0),re.braceNest=0,me(ee,re);if(Ce=C(ee,re))return ge=f(re,4,G(ee)),y(ee),ge;if(ve=w(ee,re))return ge=f(re,5,te(ee)),y(ee),ge;if(ce=M(ee,re))return ge=f(re,6,ie(ee)),y(ee),ge;if(!Ce&&!ve&&!ce)return ge=f(re,12,he(ee)),d(Ni.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,ge.value),y(ee),ge;break}}return ge}function ue(ee,re){const{currentType:ge}=re;let ae=null;const Ce=ee.currentChar();switch((ge===7||ge===8||ge===11||ge===9)&&(Ce===xr||Ce===Ou)&&d(Ni.INVALID_LINKED_FORMAT,s(),0),Ce){case"@":return ee.next(),ae=f(re,7,"@"),re.inLinked=!0,ae;case".":return y(ee),ee.next(),f(re,8,".");case":":return y(ee),ee.next(),f(re,9,":");default:return A(ee)?(ae=f(re,1,U(ee)),re.braceNest=0,re.inLinked=!1,ae):L(ee,re)||S(ee,re)?(y(ee),ue(ee,re)):E(ee,re)?(y(ee),f(re,11,Y(ee))):x(ee,re)?(y(ee),Ce==="{"?Q(ee,re)||ae:f(re,10,J(ee))):(ge===7&&d(Ni.INVALID_LINKED_FORMAT,s(),0),re.braceNest=0,re.inLinked=!1,me(ee,re))}}function me(ee,re){let ge={type:13};if(re.braceNest>0)return Q(ee,re)||h(re);if(re.inLinked)return ue(ee,re)||h(re);switch(ee.currentChar()){case"{":return Q(ee,re)||h(re);case"}":return d(Ni.UNBALANCED_CLOSING_BRACE,s(),0),ee.next(),f(re,3,"}");case"@":return ue(ee,re)||h(re);default:{if(A(ee))return ge=f(re,1,U(ee)),re.braceNest=0,re.inLinked=!1,ge;if(T(ee))return f(re,0,ne(ee));break}}return ge}function pe(){const{currentType:ee,offset:re,startLoc:ge,endLoc:ae}=a;return a.lastType=ee,a.lastOffset=re,a.lastStartLoc=ge,a.lastEndLoc=ae,a.offset=o(),a.startLoc=s(),i.currentChar()===Lc?f(a,13):me(i,a)}return{nextToken:pe,currentOffset:o,currentPosition:s,context:u}}const bte="parser",wte=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,Cte=/\\([\\@{}|])/g;function Ate(e,t){return t}function xte(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(t||n,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function Ste(e={}){const t=e.location!==!1,{onError:n}=e;function i(k,v,C,w,...M){const L=k.currentPosition();if(L.offset+=w,L.column+=w,n){const E=t?hC(C,L):null,S=S4(v,E,{domain:bte,args:M});n(S)}}function o(k,v,C){const w={type:k};return t&&(w.start=v,w.end=v,w.loc={start:C,end:C}),w}function s(k,v,C,w){t&&(k.end=v,k.loc&&(k.loc.end=C))}function r(k,v){const C=k.context(),w=o(3,C.offset,C.startLoc);return w.value=v.replace(Cte,Ate),s(w,k.currentOffset(),k.currentPosition()),w}function l(k,v){const C=k.context(),{lastOffset:w,lastStartLoc:M}=C,L=o(5,w,M);return L.index=parseInt(v,10),k.nextToken(),s(L,k.currentOffset(),k.currentPosition()),L}function a(k,v){const C=k.context(),{lastOffset:w,lastStartLoc:M}=C,L=o(4,w,M);return L.key=v,k.nextToken(),s(L,k.currentOffset(),k.currentPosition()),L}function u(k,v){const C=k.context(),{lastOffset:w,lastStartLoc:M}=C,L=o(9,w,M);return L.value=v.replace(wte,xte),k.nextToken(),s(L,k.currentOffset(),k.currentPosition()),L}function c(k){const v=k.nextToken(),C=k.context(),{lastOffset:w,lastStartLoc:M}=C,L=o(8,w,M);return v.type!==11?(i(k,Ni.UNEXPECTED_EMPTY_LINKED_MODIFIER,C.lastStartLoc,0),L.value="",s(L,w,M),{nextConsumeToken:v,node:L}):(v.value==null&&i(k,Ni.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,Pu(v)),L.value=v.value||"",s(L,k.currentOffset(),k.currentPosition()),{node:L})}function d(k,v){const C=k.context(),w=o(7,C.offset,C.startLoc);return w.value=v,s(w,k.currentOffset(),k.currentPosition()),w}function f(k){const v=k.context(),C=o(6,v.offset,v.startLoc);let w=k.nextToken();if(w.type===8){const M=c(k);C.modifier=M.node,w=M.nextConsumeToken||k.nextToken()}switch(w.type!==9&&i(k,Ni.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Pu(w)),w=k.nextToken(),w.type===2&&(w=k.nextToken()),w.type){case 10:w.value==null&&i(k,Ni.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Pu(w)),C.key=d(k,w.value||"");break;case 4:w.value==null&&i(k,Ni.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Pu(w)),C.key=a(k,w.value||"");break;case 5:w.value==null&&i(k,Ni.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Pu(w)),C.key=l(k,w.value||"");break;case 6:w.value==null&&i(k,Ni.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Pu(w)),C.key=u(k,w.value||"");break;default:{i(k,Ni.UNEXPECTED_EMPTY_LINKED_KEY,v.lastStartLoc,0);const M=k.context(),L=o(7,M.offset,M.startLoc);return L.value="",s(L,M.offset,M.startLoc),C.key=L,s(C,M.offset,M.startLoc),{nextConsumeToken:w,node:C}}}return s(C,k.currentOffset(),k.currentPosition()),{node:C}}function h(k){const v=k.context(),C=v.currentType===1?k.currentOffset():v.offset,w=v.currentType===1?v.endLoc:v.startLoc,M=o(2,C,w);M.items=[];let L=null;do{const x=L||k.nextToken();switch(L=null,x.type){case 0:x.value==null&&i(k,Ni.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Pu(x)),M.items.push(r(k,x.value||""));break;case 5:x.value==null&&i(k,Ni.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Pu(x)),M.items.push(l(k,x.value||""));break;case 4:x.value==null&&i(k,Ni.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Pu(x)),M.items.push(a(k,x.value||""));break;case 6:x.value==null&&i(k,Ni.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Pu(x)),M.items.push(u(k,x.value||""));break;case 7:{const A=f(k);M.items.push(A.node),L=A.nextConsumeToken||null;break}}}while(v.currentType!==13&&v.currentType!==1);const E=v.currentType===1?v.lastOffset:k.currentOffset(),S=v.currentType===1?v.lastEndLoc:k.currentPosition();return s(M,E,S),M}function m(k,v,C,w){const M=k.context();let L=w.items.length===0;const E=o(1,v,C);E.cases=[],E.cases.push(w);do{const S=h(k);L||(L=S.items.length===0),E.cases.push(S)}while(M.currentType!==13);return L&&i(k,Ni.MUST_HAVE_MESSAGES_IN_PLURAL,C,0),s(E,k.currentOffset(),k.currentPosition()),E}function g(k){const v=k.context(),{offset:C,startLoc:w}=v,M=h(k);return v.currentType===13?M:m(k,C,w,M)}function y(k){const v=kte(k,hs({},e)),C=v.context(),w=o(0,C.offset,C.startLoc);return t&&w.loc&&(w.loc.source=k),w.body=g(v),e.onCacheKey&&(w.cacheKey=e.onCacheKey(k)),C.currentType!==13&&i(v,Ni.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,k[C.offset]||""),s(w,v.currentOffset(),v.currentPosition()),w}return{parse:y}}function Pu(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function _te(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:s=>(n.helpers.add(s),s)}}function RM(e,t){for(let n=0;nOM(n)),e}function OM(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;nr;function a(g,y){r.code+=g}function u(g,y=!0){const k=y?i:"";a(o?k+" ".repeat(g):k)}function c(g=!0){const y=++r.indentLevel;g&&u(y)}function d(g=!0){const y=--r.indentLevel;g&&u(y)}function f(){u(r.indentLevel)}return{context:l,push:a,indent:c,deindent:d,newline:f,helper:g=>`_${g}`,needIndent:()=>r.needIndent}}function Ete(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Cm(e,t.key),t.modifier?(e.push(", "),Cm(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function Lte(e,t){const{helper:n,needIndent:i}=e;e.push(`${n("normalize")}([`),e.indent(i());const o=t.items.length;for(let s=0;s1){e.push(`${n("plural")}([`),e.indent(i());const o=t.cases.length;for(let s=0;s{const n=dn(t.mode)?t.mode:"normal",i=dn(t.filename)?t.filename:"message.intl";t.sourceMap;const o=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":` +`,s=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=Tte(e,{filename:i,breakLineCode:o,needIndent:s});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(s),r.length>0&&(l.push(`const { ${N7(r.map(c=>`${c}: _${c}`),", ")} } = ctx`),l.newline()),l.push("return "),Cm(l,e),l.deindent(s),l.push("}"),delete e.helpers;const{code:a,map:u}=l.context();return{ast:e,code:a,map:u?u.toJSON():void 0}};function Rte(e,t={}){const n=hs({},t),i=!!n.jit,o=!!n.minify,s=n.optimize==null?!0:n.optimize,l=Ste(n).parse(e);return i?(s&&Mte(l),o&&C1(l),{ast:l,code:""}):(Ite(l,n),Dte(l,n))}/*! + * core-base v11.4.6 + * (c) 2026 kazuya kawaguchi + * Released under the MIT License. + */function Ote(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(zh().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(zh().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function lc(e){return Ci(e)&&D7(e)===0&&(Oa(e,"b")||Oa(e,"body"))}const G$=["b","body"];function Pte(e){return $f(e,G$)}const Q$=["c","cases"];function Bte(e){return $f(e,Q$,[])}const Y$=["s","static"];function $te(e){return $f(e,Y$)}const J$=["i","items"];function zte(e){return $f(e,J$,[])}const X$=["t","type"];function D7(e){return $f(e,X$)}const ez=["v","value"];function hy(e,t){const n=$f(e,ez);if(n!=null)return n;throw wv(t)}const tz=["m","modifier"];function jte(e){return $f(e,tz)}const nz=["k","key"];function Hte(e){const t=$f(e,nz);if(t)return t;throw wv(6)}function $f(e,t,n){for(let i=0;iWte(n,e)}function Wte(e,t){const n=Pte(t);if(n==null)throw wv(0);if(D7(n)===1){const s=Bte(n);return e.plural(s.reduce((r,l)=>[...r,PM(e,l)],[]))}else return PM(e,n)}function PM(e,t){const n=$te(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const i=zte(t).reduce((o,s)=>[...o,pC(e,s)],[]);return e.normalize(i)}}function pC(e,t){const n=D7(t);switch(n){case 3:return hy(t,n);case 9:return hy(t,n);case 4:{const i=t;if(Oa(i,"k")&&i.k)return e.interpolate(e.named(i.k));if(Oa(i,"key")&&i.key)return e.interpolate(e.named(i.key));throw wv(n)}case 5:{const i=t;if(Oa(i,"i")&&ds(i.i))return e.interpolate(e.list(i.i));if(Oa(i,"index")&&ds(i.index))return e.interpolate(e.list(i.index));throw wv(n)}case 6:{const i=t,o=jte(i),s=Hte(i);return e.linked(pC(e,s),o?pC(e,o):void 0,e.type)}case 7:return hy(t,n);case 8:return hy(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const qte=e=>e;let py=Ki();function Ute(e,t={}){let n=!1;const i=t.onError||fte;return t.onError=o=>{n=!0,i(o)},{...Rte(e,t),detectError:n}}function Vte(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&dn(e)){wi(t.warnHtmlMessage)&&t.warnHtmlMessage;const i=(t.onCacheKey||qte)(e),o=py[i];if(o)return o;const{ast:s,detectError:r}=Ute(e,{...t,location:!1,jit:!0}),l=v3(s);return r?l:py[i]=l}else{const n=e.cacheKey;if(n){const i=py[n];return i||(py[n]=v3(e))}else return v3(e)}}let Cv=null;function Kte(e){Cv=e}function Zte(e,t,n){Cv&&Cv.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const Gte=Qte("function:translate");function Qte(e){return t=>Cv&&Cv.emit(e,t)}const Vc={INVALID_ARGUMENT:dte,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},Yte=24;function Kc(e){return S4(e,null,void 0)}function R7(e,t){return t.locale!=null?BM(t.locale):BM(e.locale)}let y3;function BM(e){if(dn(e))return e;if(ho(e)){if(e.resolvedOnce&&y3!=null)return y3;if(e.constructor.name==="Function"){const t=e();if(ate(t))throw Kc(Vc.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return y3=t}else throw Kc(Vc.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Kc(Vc.NOT_SUPPORT_LOCALE_TYPE)}function Jte(e,t,n){return[...new Set([n,...Lo(t)?t:Ci(t)?Object.keys(t):dn(t)?[t]:[n]])]}function mC(e,t,n){const i=dn(n)?n:Av,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let s=o.__localeChainCache.get(i);if(!s){s=[];let r=[n];for(;Lo(r);)r=$M(s,r,t);const l=Lo(t)||!gi(t)?t:t.default?t.default:null;r=dn(l)?[l]:l,Lo(r)&&$M(s,r,!1),o.__localeChainCache.set(i,s)}return s}function $M(e,t,n){let i=!0;for(let o=0;o{r===void 0?r=l:r+=l},f[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},f[2]=()=>{f[0](),o++},f[3]=()=>{if(o>0)o--,i=4,f[0]();else{if(o=0,r===void 0||(r=sne(r),r===!1))return!1;f[1]()}};function h(){const m=e[n+1];if(i===5&&m==="'"||i===6&&m==='"')return n++,l="\\"+m,f[0](),!0}for(;i!==null;)if(n++,s=e[n],!(s==="\\"&&h())){if(a=one(s),d=zf[i],u=d[a]||d.l||8,u===8||(i=u[0],u[1]!==void 0&&(c=f[u[1]],c&&(l=s,c()===!1))))return;if(i===7)return t}}const zM=new Map;function lne(e,t){return Ci(e)?e[t]:null}function ane(e,t){if(!Ci(e))return null;let n=zM.get(t);if(n||(n=rne(t),n&&zM.set(t,n)),!n)return null;const i=n.length;let o=e,s=0;for(;s`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function cne(){return{upper:(e,t)=>t==="text"&&dn(e)?e.toUpperCase():t==="vnode"&&Ci(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&dn(e)?e.toLowerCase():t==="vnode"&&Ci(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&dn(e)?jM(e):t==="vnode"&&Ci(e)&&"__v_isVNode"in e?jM(e.children):e}}let oz;function dne(e){oz=e}let sz;function fne(e){sz=e}let rz;function hne(e){rz=e}let lz=null;const pne=e=>{lz=e},mne=()=>lz;let az=null;const HM=e=>{az=e},gne=()=>az;let WM=0;function vne(e={}){const t=ho(e.onWarn)?e.onWarn:Jee,n=dn(e.version)?e.version:une,i=dn(e.locale)||ho(e.locale)?e.locale:Av,o=ho(i)?Av:i,s=Lo(e.fallbackLocale)||gi(e.fallbackLocale)||dn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=gi(e.messages)?e.messages:k3(o),l=gi(e.datetimeFormats)?e.datetimeFormats:k3(o),a=gi(e.numberFormats)?e.numberFormats:k3(o),u=hs(Ki(),e.modifiers,cne()),c=e.pluralRules||Ki(),d=ho(e.missing)?e.missing:null,f=wi(e.missingWarn)||wm(e.missingWarn)?e.missingWarn:!0,h=wi(e.fallbackWarn)||wm(e.fallbackWarn)?e.fallbackWarn:!0,m=!!e.fallbackFormat,g=!!e.unresolving,y=ho(e.postTranslation)?e.postTranslation:null,k=gi(e.processor)?e.processor:null,v=wi(e.warnHtmlMessage)?e.warnHtmlMessage:!0,C=!!e.escapeParameter,w=ho(e.messageCompiler)?e.messageCompiler:oz,M=ho(e.messageResolver)?e.messageResolver:sz||lne,L=ho(e.localeFallbacker)?e.localeFallbacker:rz||Jte,E=Ci(e.fallbackContext)?e.fallbackContext:void 0,S=e,x=Ci(S.__datetimeFormatters)?S.__datetimeFormatters:new Map,A=Ci(S.__numberFormatters)?S.__numberFormatters:new Map,T=Ci(S.__meta)?S.__meta:{};WM++;const I={version:n,cid:WM,locale:i,fallbackLocale:s,messages:r,modifiers:u,pluralRules:c,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:m,unresolving:g,postTranslation:y,processor:k,warnHtmlMessage:v,escapeParameter:C,messageCompiler:w,messageResolver:M,localeFallbacker:L,fallbackContext:E,onWarn:t,__meta:T};return I.datetimeFormats=l,I.numberFormats=a,I.__datetimeFormatters=x,I.__numberFormatters=A,__INTLIFY_PROD_DEVTOOLS__&&Zte(I,n,T),I}const k3=e=>({[e]:Ki()});function O7(e,t,n,i,o){const{missing:s,onWarn:r}=e;if(s!==null){const l=s(e,n,t,o);return dn(l)?l:t}else return t}function Ng(e,t,n){const i=e;i.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function yne(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function kne(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let i=n+1;i{uz.includes(a)?r[a]=n[a]:s[a]=n[a]}),dn(i)?s.locale=i:gi(i)&&(r=i),gi(o)&&(r=o),[s.key||"",l,s,r]}function UM(e,t,n){const i=e;for(const o in n){const s=`${t}__${o}`;i.__datetimeFormatters.has(s)&&i.__datetimeFormatters.delete(s)}}function VM(e,...t){const{numberFormats:n,unresolving:i,fallbackLocale:o,onWarn:s,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!ds(t[0]))return Dk;const[a,u,c,d]=vC(...t),f=wi(c.missingWarn)?c.missingWarn:e.missingWarn;wi(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn;const h=!!c.part,m=R7(e,c),g=r(e,o,m);if(!dn(a)||a===""){const L=new Intl.NumberFormat(m.replace(/!/g,""),d);return h?L.formatToParts(u):L.format(u)}let y={},k,v=null;const C="number format";for(let L=0;L{cz.includes(a)?r[a]=n[a]:s[a]=n[a]}),dn(i)?s.locale=i:gi(i)&&(r=i),gi(o)&&(r=o),[s.key||"",l,s,r]}function KM(e,t,n){const i=e;for(const o in n){const s=`${t}__${o}`;i.__numberFormatters.has(s)&&i.__numberFormatters.delete(s)}}const bne=e=>e,wne=e=>"",Cne="text",Ane=e=>e.length===0?"":N7(e),xne=ute;function b3(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function Sne(e){const t=ds(e.pluralIndex)?e.pluralIndex:-1;return ds(e.named?.count)?e.named.count:ds(e.named?.n)?e.named.n:t}function _ne(e={}){const t=e.locale,n=Sne(e),i=dn(t)&&ho(e.pluralRules?.[t])?e.pluralRules[t]:b3,o=i===b3?void 0:b3,s=k=>k[i(n,k.length,o)],r=e.list||[],l=k=>r[k],a=e.named||Ki();ds(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const u=k=>a[k];function c(k,v){const C=ho(e.messages)?e.messages(k,!!v):Ci(e.messages)?e.messages[k]:!1;return C||(e.parent?e.parent.message(k):wne)}const d=k=>e.modifiers?e.modifiers[k]:bne,f=ho(e.processor?.normalize)?e.processor.normalize:Ane,h=ho(e.processor?.interpolate)?e.processor.interpolate:xne,m=dn(e.processor?.type)?e.processor.type:Cne,y={list:l,named:u,plural:s,linked:(k,...v)=>{const[C,w]=v;let M="text",L="";v.length===1?Ci(C)?(L=C.modifier||L,M=C.type||M):dn(C)&&(L=C||L):v.length===2&&(dn(C)&&(L=C||L),dn(w)&&(M=w||M));const E=c(k,!0)(y),S=E===""||E===void 0?k:E,x=M==="vnode"&&Lo(S)&&L?S[0]:S;return L?d(L)(x,M):x},message:c,type:m,interpolate:h,normalize:f,values:hs(Ki(),r,a)};return y}const ZM=()=>"",Fa=e=>ho(e);function GM(e,...t){const{fallbackFormat:n,postTranslation:i,unresolving:o,messageCompiler:s,fallbackLocale:r,messages:l}=e,[a,u]=yC(...t),c=wi(u.missingWarn)?u.missingWarn:e.missingWarn,d=wi(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn,f=wi(u.escapeParameter)?u.escapeParameter:e.escapeParameter,h=!!u.resolvedMessage,m=dn(u.default)||wi(u.default)?wi(u.default)?s?a:()=>a:u.default:n?s?a:()=>a:null,g=n||m!=null&&(dn(m)||ho(m)),y=R7(e,u);f&&Ine(u);let[k,v,C]=h?[a,y,l[y]||Ki()]:dz(e,a,y,r,d,c),w=k,M=a;if(!h&&!(dn(w)||lc(w)||Fa(w))&&g&&(w=m,M=w),!h&&(!(dn(w)||lc(w)||Fa(w))||!dn(v)))return o?_4:a;let L=!1;const E=()=>{L=!0},S=Fa(w)?w:fz(e,a,v,w,M,E);if(L)return w;const x=Ene(e,v,C,u),A=_ne(x),T=Mne(e,S,A);let I=i?i(T,a):T;if(f&&dn(I)&&(I=rte(I)),__INTLIFY_PROD_DEVTOOLS__){const O={timestamp:Date.now(),key:dn(a)?a:Fa(w)?w.key:"",locale:v||(Fa(w)?w.locale:""),format:dn(w)?w:Fa(w)?w.source:"",message:I};O.meta=hs({},e.__meta,mne()||{}),Gte(O)}return I}function Ine(e){Lo(e.list)?e.list=e.list.map(t=>dn(t)?NM(t):t):Ci(e.named)&&Object.keys(e.named).forEach(t=>{dn(e.named[t])&&(e.named[t]=NM(e.named[t]))})}function dz(e,t,n,i,o,s){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:u}=e,c=u(e,i,n);let d=Ki(),f,h=null;const m="translate";for(let g=0;gi);return u.locale=n,u.key=t,u}const a=r(i,Tne(e,n,o,i,l,s));return a.locale=n,a.key=t,a.source=i,a}function Mne(e,t,n){return t(n)}function yC(...e){const[t,n,i]=e,o=Ki();if(!dn(t)&&!ds(t)&&!Fa(t)&&!lc(t))throw Kc(Vc.INVALID_ARGUMENT);const s=ds(t)?String(t):(Fa(t),t);return ds(n)?o.plural=n:dn(n)?o.default=n:gi(n)&&!x4(n)?o.named=n:Lo(n)&&(o.list=n),ds(i)?o.plural=i:dn(i)?o.default=i:gi(i)&&hs(o,i),[s,o]}function Tne(e,t,n,i,o,s){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw s&&s(r),r},onCacheKey:r=>Xee(t,n,r)}}function Ene(e,t,n,i){const{modifiers:o,pluralRules:s,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:u,fallbackContext:c}=e,f={locale:t,modifiers:o,pluralRules:s,messages:(h,m)=>{let g=r(n,h);if(g==null&&(c||m)){const[y,,k]=dz(c||e,h,t,l,a,u);g=y??r(k,h)}if(dn(g)||lc(g)){let y=!1;const v=fz(e,h,t,g,h,()=>{y=!0});return y?ZM:v}else return Fa(g)?g:ZM}};return e.processor&&(f.processor=e.processor),i.list&&(f.list=i.list),i.named&&(f.named=i.named),ds(i.plural)&&(f.pluralIndex=i.plural),f}Ote();/*! + * vue-i18n v11.4.6 + * (c) 2026 kazuya kawaguchi + * Released under the MIT License. + */const Lne="11.4.6";function Nne(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(zh().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(zh().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(zh().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(zh().__INTLIFY_PROD_DEVTOOLS__=!1)}const Gr={UNEXPECTED_RETURN_TYPE:Yte,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Sl(e,...t){return S4(e,null,void 0)}const kC=Bf("__translateVNode"),bC=Bf("__datetimeParts"),wC=Bf("__numberParts"),hz=Bf("__setPluralRules"),pz=Bf("__injectWithOption"),F1=Bf("__dispose");function xv(e){if(!Ci(e)||lc(e))return e;for(const t in e)if(Oa(e,t))if(!t.includes("."))Ci(e[t])&&xv(e[t]);else{const n=t.split("."),i=n.length-1;let o=e,s=!1;for(let r=0;r{if("locale"in l&&"resource"in l){const{locale:a,resource:u}=l;a?(r[a]=r[a]||Ki(),A9(u,r[a])):A9(u,r)}else dn(l)&&A9(JSON.parse(l),r)}),o==null&&s)for(const l in r)Oa(r,l)&&xv(r[l]);return r}function mz(e){return e.type}function gz(e,t,n){let i=Ci(t.messages)?t.messages:Ki();"__i18nGlobal"in n&&(i=P7(e.locale.value,{messages:i,__i18n:n.__i18nGlobal}));const o=Object.keys(i);o.length&&o.forEach(s=>{e.mergeLocaleMessage(s,i[s])});{if(Ci(t.datetimeFormats)){const s=Object.keys(t.datetimeFormats);s.length&&s.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(Ci(t.numberFormats)){const s=Object.keys(t.numberFormats);s.length&&s.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function QM(e){return V(lf,null,e,0)}function Sv(){return gs()}const YM="__INTLIFY_META__",JM=()=>[],Fne=()=>!1;let XM=0;function eT(e){return((t,n,i,o)=>e(n,i,Sv()||void 0,o))}const Dne=()=>{const e=Sv();let t=null;return e&&(t=mz(e)[YM])?{[YM]:t}:null};function Rk(e={}){const{__root:t,__injectWithOption:n}=e,i=t===void 0,o=e.flatJson,s=Fk?q:_u;let r=wi(e.inheritLocale)?e.inheritLocale:!0;const l=s(t&&r?t.locale.value:dn(e.locale)?e.locale:Av),a=s(t&&r?t.fallbackLocale.value:dn(e.fallbackLocale)||Lo(e.fallbackLocale)||gi(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),u=s(P7(l.value,e)),c=s(gi(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=s(gi(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:wi(e.missingWarn)||wm(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:wi(e.fallbackWarn)||wm(e.fallbackWarn)?e.fallbackWarn:!0,m=t?t.fallbackRoot:wi(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,y=ho(e.missing)?e.missing:null,k=ho(e.missing)?eT(e.missing):null,v=ho(e.postTranslation)?e.postTranslation:null,C=t?t.warnHtmlMessage:wi(e.warnHtmlMessage)?e.warnHtmlMessage:!0,w=!!e.escapeParameter;const M=t?t.modifiers:gi(e.modifiers)?e.modifiers:{};let L=e.pluralRules||t&&t.pluralRules,E;E=(()=>{i&&HM(null);const ce={version:Lne,locale:l.value,fallbackLocale:a.value,messages:u.value,modifiers:M,pluralRules:L,missing:k===null?void 0:k,missingWarn:f,fallbackWarn:h,fallbackFormat:g,unresolving:!0,postTranslation:v===null?void 0:v,warnHtmlMessage:C,escapeParameter:w,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ce.datetimeFormats=c.value,ce.numberFormats=d.value,ce.__datetimeFormatters=gi(E)?E.__datetimeFormatters:void 0,ce.__numberFormatters=gi(E)?E.__numberFormatters:void 0;const Te=vne(ce);return i&&HM(Te),Te})(),Ng(E,l.value,a.value);function x(){return[l.value,a.value,u.value,c.value,d.value]}const A=D({get:()=>l.value,set:ce=>{E.locale=ce,l.value=ce}}),T=D({get:()=>a.value,set:ce=>{E.fallbackLocale=ce,a.value=ce,Ng(E,l.value,ce)}}),I=D(()=>u.value),O=D(()=>c.value),H=D(()=>d.value);function R(){return ho(v)?v:null}function F(ce){v=ce,E.postTranslation=ce}function P(){return y}function z(ce){ce!==null&&(k=eT(ce)),y=ce,E.missing=k}const W=(ce,Te,ke,Ae,Ne,Ze)=>{x();let rt;try{__INTLIFY_PROD_DEVTOOLS__,i||(E.fallbackContext=t?gne():void 0),rt=ce(E)}finally{__INTLIFY_PROD_DEVTOOLS__,i||(E.fallbackContext=void 0)}if(ke!=="translate exists"&&ds(rt)&&rt===_4||ke==="translate exists"&&!rt){const[pt,Rt]=Te();return t&&m?Ae(t):Ne(pt)}else{if(Ze(rt))return rt;throw Sl(Gr.UNEXPECTED_RETURN_TYPE)}};function $(...ce){return W(Te=>Reflect.apply(GM,null,[Te,...ce]),()=>yC(...ce),"translate",Te=>Reflect.apply(Te.t,Te,[...ce]),Te=>Te,Te=>dn(Te))}function K(...ce){const[Te,ke,Ae]=ce;if(Ae&&!Ci(Ae))throw Sl(Gr.INVALID_ARGUMENT);return $(Te,ke,hs({resolvedMessage:!0},Ae||{}))}function ne(...ce){return W(Te=>Reflect.apply(qM,null,[Te,...ce]),()=>gC(...ce),"datetime format",Te=>Reflect.apply(Te.d,Te,[...ce]),()=>Dk,Te=>dn(Te)||Lo(Te))}function G(...ce){return W(Te=>Reflect.apply(VM,null,[Te,...ce]),()=>vC(...ce),"number format",Te=>Reflect.apply(Te.n,Te,[...ce]),()=>Dk,Te=>dn(Te)||Lo(Te))}function te(ce){return ce.map(Te=>dn(Te)||ds(Te)||wi(Te)?QM(String(Te)):Te)}const ie={normalize:te,interpolate:ce=>ce,type:"vnode"};function _e(...ce){return W(Te=>{let ke;const Ae=Te;try{Ae.processor=ie,ke=Reflect.apply(GM,null,[Ae,...ce])}finally{Ae.processor=null}return ke},()=>yC(...ce),"translate",Te=>Te[kC](...ce),Te=>[QM(Te)],Te=>Lo(Te))}function Z(...ce){return W(Te=>Reflect.apply(VM,null,[Te,...ce]),()=>vC(...ce),"number format",Te=>Te[wC](...ce),JM,Te=>dn(Te)||Lo(Te))}function se(...ce){return W(Te=>Reflect.apply(qM,null,[Te,...ce]),()=>gC(...ce),"datetime format",Te=>Te[bC](...ce),JM,Te=>dn(Te)||Lo(Te))}function he(ce){L=ce,E.pluralRules=L}function Y(ce,Te){return W(()=>{if(!ce)return!1;const ke=dn(Te)?Te:l.value,Ae=dn(Te)?[ke]:mC(E,a.value,ke);for(let Ne=0;Ne[ce],"translate exists",ke=>Reflect.apply(ke.te,ke,[ce,Te]),Fne,ke=>wi(ke))}function J(ce){let Te=null;const ke=mC(E,a.value,l.value);for(let Ae=0;Ae{r&&(l.value=ce,E.locale=ce,Ng(E,l.value,a.value))}),ze(t.fallbackLocale,ce=>{r&&(a.value=ce,E.fallbackLocale=ce,Ng(E,l.value,a.value))}));const ve={id:XM,locale:A,fallbackLocale:T,get inheritLocale(){return r},set inheritLocale(ce){r=ce,ce&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Ng(E,l.value,a.value))},get availableLocales(){return Object.keys(u.value).sort()},messages:I,get modifiers(){return M},get pluralRules(){return L||{}},get isGlobal(){return i},get missingWarn(){return f},set missingWarn(ce){f=ce,E.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(ce){h=ce,E.fallbackWarn=h},get fallbackRoot(){return m},set fallbackRoot(ce){m=ce},get fallbackFormat(){return g},set fallbackFormat(ce){g=ce,E.fallbackFormat=g},get warnHtmlMessage(){return C},set warnHtmlMessage(ce){C=ce,E.warnHtmlMessage=ce},get escapeParameter(){return w},set escapeParameter(ce){w=ce,E.escapeParameter=ce},t:$,getLocaleMessage:Q,setLocaleMessage:ue,mergeLocaleMessage:me,getPostTranslationHandler:R,setPostTranslationHandler:F,getMissingHandler:P,setMissingHandler:z,[hz]:he};return ve.datetimeFormats=O,ve.numberFormats=H,ve.rt=K,ve.te=Y,ve.tm=U,ve.d=ne,ve.n=G,ve.getDateTimeFormat=pe,ve.setDateTimeFormat=ee,ve.mergeDateTimeFormat=re,ve.getNumberFormat=ge,ve.setNumberFormat=ae,ve.mergeNumberFormat=Ce,ve[pz]=n,ve[kC]=_e,ve[bC]=se,ve[wC]=Z,ve}function Rne(e){const t=dn(e.locale)?e.locale:Av,n=dn(e.fallbackLocale)||Lo(e.fallbackLocale)||gi(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,i=ho(e.missing)?e.missing:void 0,o=wi(e.silentTranslationWarn)||wm(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,s=wi(e.silentFallbackWarn)||wm(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=wi(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=gi(e.modifiers)?e.modifiers:{},u=e.pluralizationRules,c=ho(e.postTranslation)?e.postTranslation:void 0,d=dn(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=wi(e.sync)?e.sync:!0;let m=e.messages;if(gi(e.sharedMessages)){const M=e.sharedMessages;m=Object.keys(M).reduce((E,S)=>{const x=E[S]||(E[S]={});return hs(x,M[S]),E},m||{})}const{__i18n:g,__root:y,__injectWithOption:k}=e,v=e.datetimeFormats,C=e.numberFormats,w=e.flatJson;return{locale:t,fallbackLocale:n,messages:m,flatJson:w,datetimeFormats:v,numberFormats:C,missing:i,missingWarn:o,fallbackWarn:s,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:u,postTranslation:c,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:h,__i18n:g,__root:y,__injectWithOption:k}}function CC(e={}){const t=Rk(Rne(e)),{__extender:n}=e,i={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(o){t.setMissingHandler(o)},get silentTranslationWarn(){return wi(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=wi(o)?!o:o},get silentFallbackWarn(){return wi(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=wi(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){return Reflect.apply(t.t,t,[...o])},rt(...o){return Reflect.apply(t.rt,t,[...o])},te(o,s){return t.te(o,s)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,s){t.setLocaleMessage(o,s)},mergeLocaleMessage(o,s){t.mergeLocaleMessage(o,s)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,s){t.setDateTimeFormat(o,s)},mergeDateTimeFormat(o,s){t.mergeDateTimeFormat(o,s)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,s){t.setNumberFormat(o,s)},mergeNumberFormat(o,s){t.mergeNumberFormat(o,s)}};return i.__extender=n,i}function One(e,t,n){return{beforeCreate(){const i=Sv();if(!i)throw Sl(Gr.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const s=o.i18n;if(o.__i18n&&(s.__i18n=o.__i18n),s.__root=t,this===this.$root)this.$i18n=tT(e,s);else{s.__injectWithOption=!0,s.__extender=n.__vueI18nExtend,this.$i18n=CC(s);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=tT(e,o);else{this.$i18n=CC({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&gz(t,o,o),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$te=(s,r)=>this.$i18n.te(s,r),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),n.__setInstance(i,this.$i18n)},mounted(){},unmounted(){const i=Sv();if(!i)throw Sl(Gr.UNEXPECTED_ERROR);const o=this.$i18n;o&&(delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o?.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(i),delete this.$i18n)}}}function tT(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[hz](t.pluralizationRules||e.pluralizationRules);const n=P7(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(i=>e.mergeLocaleMessage(i,n[i])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(i=>e.mergeDateTimeFormat(i,t.datetimeFormats[i])),t.numberFormats&&Object.keys(t.numberFormats).forEach(i=>e.mergeNumberFormat(i,t.numberFormats[i])),e}const B7={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function Pne({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((i,o)=>[...i,...o.type===Le?o.children:[o]],[]):t.reduce((n,i)=>{const o=e[i];return o&&(n[i]=o()),n},Ki())}function vz(){return Le}const Bne=ot({name:"i18n-t",props:hs({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>ds(e)||!isNaN(e)}},B7),setup(e,t){const{slots:n,attrs:i}=t,o=e.i18n||qt({useScope:e.scope,__useComponent:!0});return()=>{const s=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),u=Ki();e.locale&&(u.locale=e.locale),e.plural!==void 0&&(u.plural=dn(e.plural)?+e.plural:e.plural);const c=Pne(t,a);return o[kC](e.keypath,c,u)},r=hs(Ki(),i),l=dn(e.tag)||Ci(e.tag)?e.tag:vz();return Ci(l)?Fn(l,r,{default:s}):Fn(l,r,s())}}}),nT=Bne;function $ne(e){return Lo(e)&&!dn(e[0])}function yz(e,t,n,i){const{slots:o,attrs:s}=t;return()=>{const r=()=>{const u={part:!0};let c=Ki();e.locale&&(u.locale=e.locale),dn(e.format)?u.key=e.format:Ci(e.format)&&(dn(e.format.key)&&(u.key=e.format.key),c=Object.keys(e.format).reduce((h,m)=>n.includes(m)?hs(Ki(),h,{[m]:e.format[m]}):h,Ki()));const d=i(e.value,u,c);let f=[u.key];return Lo(d)?f=d.map((h,m)=>{const g=o[h.type],y=g?g({[h.type]:h.value,index:m,parts:d}):[h.value];return $ne(y)&&(y[0].key=`${h.type}-${m}`),y}):dn(d)&&(f=[d]),f},l=hs(Ki(),s),a=dn(e.tag)||Ci(e.tag)?e.tag:vz();return Ci(a)?Fn(a,l,{default:r}):Fn(a,l,r())}}const zne=ot({name:"i18n-n",props:hs({value:{type:Number,required:!0},format:{type:[String,Object]}},B7),setup(e,t){const n=e.i18n||qt({useScope:e.scope,__useComponent:!0});return yz(e,t,cz,(...i)=>n[wC](...i))}}),iT=zne;function jne(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const i=n.__getInstance(t);return i!=null?i.__composer:e.global.__composer}}function Hne(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Sl(Gr.UNEXPECTED_ERROR);const u=jne(e,l.$),c=oT(a);return[Reflect.apply(u.t,u,[...sT(c)]),u]};return{created:(r,l)=>{const[a,u]=t(l);Fk&&(r.__i18nWatcher=ze(u.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=u,r.textContent=a},unmounted:r=>{Fk&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:l})=>{if(r.__composer){const a=r.__composer,u=oT(l);r.textContent=Reflect.apply(a.t,a,[...sT(u)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function oT(e){if(dn(e))return{path:e};if(gi(e)){if(!("path"in e))throw Sl(Gr.REQUIRED_VALUE,"path");return e}else throw Sl(Gr.INVALID_VALUE)}function sT(e){const{path:t,locale:n,args:i,choice:o,plural:s}=e,r={},l=i||{};return dn(n)&&(r.locale=n),ds(o)&&(r.plural=o),ds(s)&&(r.plural=s),[t,l,r]}function Wne(e,t,...n){const i=gi(n[0])?n[0]:{};(wi(i.globalInstall)?i.globalInstall:!0)&&([nT.name,"I18nT"].forEach(s=>e.component(s,nT)),[iT.name,"I18nN"].forEach(s=>e.component(s,iT)),[aT.name,"I18nD"].forEach(s=>e.component(s,aT))),e.directive("t",Hne(t))}const qne=Bf("global-vue-i18n");function Une(e={}){const t=__VUE_I18N_LEGACY_API__&&wi(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=wi(e.globalInjection)?e.globalInjection:!0,i=new Map,[o,s]=Vne(e,t),r=Bf("");function l(d){return i.get(d)||null}function a(d,f){i.set(d,f)}function u(d){i.delete(d)}const c={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,c),gi(f[0])){const g=f[0];c.__composerExtend=g.__composerExtend,c.__vueI18nExtend=g.__vueI18nExtend}let h=null;!t&&n&&(h=Xne(d,c.global)),__VUE_I18N_FULL_INSTALL__&&Wne(d,c,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(One(s,s.__composer,c));const m=d.unmount;d.unmount=()=>{h&&h(),c.dispose(),m()}},get global(){return s},dispose(){o.stop()},__instances:i,__getInstance:l,__setInstance:a,__deleteInstance:u};return c}function qt(e={}){const t=Sv();if(t==null)throw Sl(Gr.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Sl(Gr.NOT_INSTALLED);const n=Kne(t),i=Gne(n),o=mz(t),s=Zne(e,o);if(s==="global")return gz(i,e,o),i;if(s==="parent"){let a=rT(n,t,e.__useComponent);return a==null&&(a=i),a}if(s==="isolated"){if(n.mode!=="composition")throw Sl(Gr.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,u=hs({},e),c=rT(n,t);u.__root=c||i;const d=Rk(u);return a.__composerExtend&&(d[F1]=a.__composerExtend(d)),jm()&&cd(()=>{const h=d[F1];h&&(h(),delete d[F1])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=hs({},e);"__i18n"in o&&(a.__i18n=o.__i18n),i&&(a.__root=i),l=Rk(a),r.__composerExtend&&(l[F1]=r.__composerExtend(l)),Yne(r,t,l),r.__setInstance(t,l)}return l}function Vne(e,t){const n=p4(),i=__VUE_I18N_LEGACY_API__&&t?n.run(()=>CC(e)):n.run(()=>Rk(e));if(i==null)throw Sl(Gr.UNEXPECTED_ERROR);return[n,i]}function Kne(e){const t=en(e.isCE?qne:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Sl(e.isCE?Gr.NOT_INSTALLED_WITH_PROVIDE:Gr.UNEXPECTED_ERROR);return t}function Zne(e,t){return x4(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function Gne(e){return e.mode==="composition"?e.global:e.global.__composer}function rT(e,t,n=!1){let i=null;const o=t.root;let s=Qne(t,n);for(;s!=null;){const r=e;if(e.mode==="composition")i=r.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(s);l!=null&&(i=l.__composer,n&&i&&!i[pz]&&(i=null))}if(i!=null||o===s)break;s=s.parent}return i}function Qne(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function Yne(e,t,n){gn(()=>{},t),Tn(()=>{const i=n;e.__deleteInstance(t);const o=i[F1];o&&(o(),delete i[F1])},t)}const Jne=["locale","fallbackLocale","availableLocales"],lT=["t","rt","d","n","tm","te"];function Xne(e,t){const n=Object.create(null);return Jne.forEach(o=>{const s=Object.getOwnPropertyDescriptor(t,o);if(!s)throw Sl(Gr.UNEXPECTED_ERROR);const r=Gi(s.value)?{get(){return s.value.value},set(l){s.value.value=l}}:{get(){return s.get&&s.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,lT.forEach(o=>{const s=Object.getOwnPropertyDescriptor(t,o);if(!s||!s.value)throw Sl(Gr.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,s)}),()=>{delete e.config.globalProperties.$i18n,lT.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const eie=ot({name:"i18n-d",props:hs({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},B7),setup(e,t){const n=e.i18n||qt({useScope:e.scope,__useComponent:!0});return yz(e,t,uz,(...i)=>n[bC](...i))}}),aT=eie;Nne();dne(Vte);fne(ane);hne(mC);if(__INTLIFY_PROD_DEVTOOLS__){const e=zh();e.__INTLIFY__=!0,Kte(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const tie={confirm:"Confirm",cancel:"Cancel",close:"Close",dismiss:"Dismiss",loading:"Loading",copy:"Copy",errorBoundaryTitle:"Something went wrong",errorBoundaryRetry:"Try again",asyncLoadFailed:"Failed to load. Close this view and try again."},nie={connecting:"Connecting…",connectingStageAuth:"Checking sign-in…",connectingStageServer:"Connecting to server…",connectingStageConfig:"Loading configuration…",connectingStageSessions:"Loading sessions…",connectingStageSession:"Opening session…",connectingRetrySuffix:" (retry {n})",connectingIssueNetworkTitle:"Cannot connect to the Kimi server",connectingIssueNetworkMessage:"Check your network connection and make sure the server is still running.",connectingIssueTimeoutTitle:"The Kimi server is taking too long to respond",connectingIssueTimeoutMessage:"Still retrying automatically — please wait.",connectingIssueApiTitle:"The Kimi server returned an error",connectingIssueUnknownTitle:"Connection problem",internalBuildBanner:"Internal testing only",menuFile:"File",menuEdit:"Edit",menuView:"View",menuHelp:"Help",applicationMenu:"Application menu"},iie={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"workspaces",viewSwitcher:"List options",viewGroup:"View",viewFlat:"Flat list",viewGrouped:"Group by workspace",sortGroup:"Sort order",sortManual:"Manual",sortRecent:"Recent activity",sessionAdmin:"Manage Sessions",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",newSession:"New Session",newChat:"New Session",newWorkspace:"New Workspace",dropToAddWorkspace:"Drop to add workspace",emptyState:"No sessions yet · click New Session to start",options:"Options",rename:"Rename",genTitle:"Gen Title",genTitleUnavailable:"Title generation unavailable — needs a managed Kimi Code login and at least one message",setEmoji:"Set Emoji…",sessionEmojiTitle:"Pick an emoji",removeEmoji:"Remove emoji",randomEmoji:"Random",searchEmoji:"Search emoji",recentEmojis:"Recently used",noEmojiResults:"No matching emoji",emojiGroupFaces:"Smileys & People",emojiGroupNature:"Animals & Nature",emojiGroupFood:"Food & Drink",emojiGroupActivity:"Activities & Travel",emojiGroupObjects:"Objects & Work",emojiGroupSymbols:"Symbols & Status",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",archiveToastUndo:"Undo",archiveToastMid:"or view archived chats in",archiveToastSettings:"Settings",archiveToastTail:"",tabOpen:"Open",tabDone:"Done",tabWorkspaces:"Workspaces",tagOpen:"Open",tagDone:"Done",complete:"Done",markDone:"Mark as done",reopen:"Mark as open",noDoneSessions:"No completed sessions yet",noOpenSessions:"No open sessions yet",completeToastLead:"Done",reopenToastLead:"Back to open",fork:"Fork session",export:"Export session",pin:"Pin",unpin:"Unpin",lastActive:"Last updated: {time}",pinned:"Pinned",collapsePinned:"Collapse pinned",expandPinned:"Expand pinned",resizePinnedAria:"Resize pinned section height",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",defaultUserName:"Kimi User",upgrade:"Upgrade",upgradeMembership:"Upgrade membership",logoutConfirmTitle:"Sign out",logoutConfirmMessage:"Are you sure you want to sign out?",language:"Language",backendTitle:"Backend {backend} · {endpoint} — click to switch",noSessions:"No conversations yet",allPinned:"{count} conversations pinned",showMore:"Show more",loadMore:"Load more",showLess:"Show less",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions and workspaces",search:"Search",searchHint:"↑↓ navigate · ↵ open · Esc close",searchHintSelect:"navigate",searchHintOpen:"open",searchHintClose:"close",searchClear:"Clear search",searchNoResults:"No matching sessions or workspaces",searchEmpty:"No sessions yet",update:"Upgrade",updateAvailable:"v{version} available",updateDownloadingButton:"Downloading… ({percent}%)",updateReady:"v{version} ready",updateDone:"Restart",updateFailed:"Download failed",updateRetry:"Retry",updateDownloadNow:"Download & Update",updateSkip:"Skip This Version",updateRestartNow:"Restart Now",updateRestartLater:"Later",updateReleaseDate:"Released {date}",updateCurrentVersion:"Current v{version}",updateWhatsNew:"What’s new",updateBackground:"Download in Background",updateAutoDownload:"Automatically download and install updates",rcSelectDevice:"Select device",rcCurrentDevice:"Current device: {name}",rcConnectable:"Connectable",rcUnavailable:"Unavailable",rcOnline:"Online",rcOffline:"Offline",rcDevicesLoadFailed:"Failed to load devices"},oie={title:"Session Management",subtitle:"Manage all sessions. Mark the finished ones as done. Filter by last updated to clean up old sessions in bulk.",back:"Back",filterWorkspace:"Workspace",filterStatus:"Status",filterTime:"Updated",allWorkspaces:"All workspaces",selectAll:"Select all",searchWorkspace:"Search workspaces",noWorkspaceMatch:"No matching workspaces",removeTag:"Remove {name}",statusAll:"All statuses",statusOpen:"Open",statusDone:"Done",timeAll:"Any time",timeDaysAgo:"{n} days ago",query:"Query",reset:"Reset",colStatus:"Status",colTitle:"Title",colWorkspace:"Workspace",colPrompt:"Last prompt",colUpdated:"Updated",colCompleted:"Completed",colActions:"Actions",empty:"No sessions match the current filters",loading:"Loading…",total:"{n} total",pageSize:"{n} / page",prevPage:"Previous page",nextPage:"Next page",selectPageAll:"Select all on this page",batchSelected:"{n} selected",selectAllMatching:"Select all {total} matching sessions",materializingAll:"Selecting…",allMatchingSelected:"All {n} selected",clearSelection:"Clear selection",markDone:"Mark as done",reopen:"Mark as open",markDoneCount:"Mark as done ({n})",reopenCount:"Mark as open ({n})",batchDoneToast:"{n} marked as done",batchReopenedToast:"{n} moved back to open",batchFailedSuffix:", {n} failed",batchDoneFailedNotice:"Could not mark {n} as done",batchReopenFailedNotice:"Could not move {n} back to open",undo:"Undo",open:"Open session",rename:"Rename…",fork:"Fork",export:"Export",moreActions:"More actions"},sie={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableTitle:"Enable swarm mode?",swarmEnableConfirm:"The agent will run multiple sub-agents in parallel.",goalStartTitle:"Start goal?",goalStartConfirm:'"{objective}" — the agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",pathLabel:"Path",pathPlaceholder:"/absolute/path/to/project",recentLabel:"Recent folders",add:"Add",cancel:"Cancel",addHint:"Paste an absolute folder path, or pick a recent one.",addFailed:"Couldn't open this folder. Check the path and try again.",requiredTitle:"Choose a workspace first",requiredMessage:"Pick a folder to use as your workspace before sending a message.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Failed",abortedTitle:"This session's latest turn ended on an error"},rie={jumpToLatestAria:"Jump to latest message",backToBottom:"Back to bottom",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",starting:"Starting conversation…",requesting:"Requesting…",working:"Working…",workingRetry:"Model request failed — retrying ({n}/{max})…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",recentSessions:"Recent sessions",viewMoreSessions:"View more",sessionAdminTooltip:"View and manage more sessions in Session Management",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",pickFolder:"Choose folder…",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",undo:"Undo",undoTooltip:"Undo edit",undoConfirm:"Undo back to this message?",escUndoHintPre:"Press",escUndoHintPost:"again to undo",undone:"Undone — the message is back in the composer",turnInterrupted:"Manually stopped",turnFailed:"Model request failed — this turn was interrupted",turnFailedMaxSteps:"Step limit reached — this turn was interrupted",turnFailedResume:"Continue",turnFailedResumeText:"Continue",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…",widenTable:"Widen table",restoreTableWidth:"Restore default width",wrapCode:"Enable word wrap",unwrapCode:"Disable word wrap",showLineNumbers:"Show line numbers",hideLineNumbers:"Hide line numbers",cron:{fired:"Scheduled reminder fired",missed:"Missed scheduled reminders",job:"job {id}",oneShot:"one-shot",coalesced:"{n} fires coalesced",missedCount:"{n} missed",finalDelivery:"final delivery",expand:"Show more",collapse:"Show less"},fold:{worked:"Worked {duration}",workedUnknown:"Work details"},turnFiles:{titleOne:"{number} file changed",titleOther:"{number} files changed",more:"{number} more files",moreOne:"1 more file",showLess:"Show less",diffUnavailable:"This file’s changes can’t be shown line by line",rebuilding:"Loading this turn’s changes…",openFile:"Open file"},goal:{continuation:"Goal continuation"},notification:{sentBy:{task:"From background (Bash)",subagent:"From background (Agent)"},bodyLine:"{status}: {description}",reason:"Reason: {reason}",userStopped:"Stopped by user",statusTitle:{completed:"Completed",failed:"Failed",timed_out:"Timed out",killed:"Stopped",lost:"Lost",info:"Notification"},status:{completed:"completed",failed:"failed",timed_out:"timed out",killed:"killed",lost:"lost",info:"info"},groupTitle:"{n} notifications",copyPath:"Copy path",copied:"Copied",rawPayload:"Raw payload",outputTruncated:"Output truncated — showing the tail",fields:{type:"Type",source:"Source",severity:"Severity"}},userMessage:{expand:"Show more",collapse:"Show less"},search:{placeholder:"Search chat…",searching:"Searching…",results:"{current}/{total} results",resultsCapped:"{current}/{total}+ results",noResults:"No results",previous:"Previous match",next:"Next match",close:"Close search"}},lie={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Always Ask",permissionAuto:"Never Ask",permissionYolo:"Ask When Needed",permissionManualDesc:"Auto-read only; everything else needs your approval first",permissionAutoDesc:"Never interrupts you; everything runs and is decided automatically",permissionYoloDesc:"Routine edits and commands run automatically; risky actions, questions, and plans still ask",planLabel:"Plan",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",workModeDismiss:"Exit mode",goalLabel:"Goal",timeUnitHour:"h",timeUnitMinute:"m",timeUnitSecond:"s",planEmptyArmed:"Plan mode is on — the plan the agent writes will show up here.",planEmptyIdle:"No plan yet — turn plan mode on and the agent’s plan will show up here.",swarmLabel:"Swarm",swarmDismiss:"Turn off Swarm",towerLabel:"Tower",towerDismiss:"Turn off Tower",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",planPlaceholder:"What should the agent plan for?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",goalCancelConfirm:"Cancel this goal? It cannot be resumed afterwards.",goalCancelConfirmYes:"Yes",goalCancelConfirmNo:"No",goalDoneWhen:"Done when",goalStatusActive:"Active",goalStatusPaused:"Paused",goalStatusBlocked:"Blocked",goalStatusComplete:"Complete",modeNotSupported:"Not supported",thinkingLabel:"Thinking",thinkingTooltip:"Toggle thinking mode",cacheNote:"Note: Switching models or thinking effort invalidates the existing prompt cache. Start a new chat to avoid extra token costs.",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",statusTowerMode:"Tower mode",swarmOn:"on",swarmOff:"off",towerOn:"on",towerOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},aie={inputLabel:"Message input",placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",placeholderRunningMobile:"Press Enter to queue",starting:"Sending…",queuePending:"{n} waiting to send",queueSteer:"Send into the running turn",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedAttachments:"attachment ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",attachmentImage:"Image",attachmentVideo:"Video",attachmentOpenUnsupported:"Can’t open {name} — this file type isn’t supported",dropToAttach:"Drop files to attach",remove:"Remove",uploading:"Uploading",uploadFailed:"Upload failed",attachFile:"Attach file",addMenu:"Add",addFiles:"Files",addFilesDesc:"Upload files",addGoalDesc:"Set a goal to keep pursuing",addPlanDesc:"Turn plan mode on",addSwarmDesc:"Turn swarm mode on",addTowerDesc:"Turn tower mode on",noCommands:"No commands",slashSheetTitle:"Commands",slashSearchPlaceholder:"Search commands…",mentionSheetTitle:"Files",mentionSearchPlaceholder:"Search files…",addSlash:"Commands",addSlashDesc:"Built-in commands or skills",addMention:"Mention",addMentionDesc:"Mention files in the project",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",upgradeBanner:"Upgrade your Kimi account to use Kimi Code",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · {level}",noArgCommand:"{cmd} takes no arguments"},uie={title:"Sign in to Kimi Code",close:"Close (Esc)",regionCnTitle:"Kimi Code",regionCnHint:"Sign in with your kimi.com account",regionOverseasTitle:"Kimi Code",regionOverseasHint:"Sign in with your kimi.ai account",oauthTitle:"Sign in with Kimi",oauthHint:"Finish authorizing in your browser to sign in",starting:"Starting sign-in flow…",openedHint:"Finish authorizing in your browser ({time}).",blockedTitle:"Could not open the login page",blockedHint:"The browser blocked the automatic opening — use the button below to continue authorizing.",notOpened:"Didn't open in your browser?",authorizeInBrowser:"Sign in via browser",orDivider:"or",fallbackPrefix:"On another device? Open ",fallbackSuffix:" and enter the device code:",copy:"Copy",copied:"Copied",copyLink:"Copy link",success:"Signed in",successHint:"Loading, will close automatically…",expiredTitle:"Device code expired",expiredHint:"Please restart the sign-in flow",deniedTitle:"Sign-in cancelled",retry:"Retry",closeBtn:"Close",failedTitle:"Login failed",errorHint:"Please upgrade kimi-code and try again",pollErrorTitle:"Lost connection",pollErrorHint:"Sign-in polling failed repeatedly. Check the kimi-code process and try again.",action:"Sign in",requiredTitle:"Sign in required",requiredMessage:"Sign in to your Kimi account and set up a model to start chatting.",goToLogin:"Sign in",upgradeRequiredTitle:"Upgrade required",upgradeRequiredMessage:"Your account is on the free plan. Upgrade to a membership to start chatting with Kimi models.",pickModelTitle:"Choose a model",pickModelMessage:"Models are available. Pick a default model to start chatting.",pickModelAction:"Choose",configureModelsTitle:"Set up a model",configureModelsMessage:"You're signed in, but no model is available yet. Set up a model to start chatting.",configureModelsGenericMessage:"No model is available yet. Set up a model to start chatting.",configureModelsAction:"Set up",rcSubtitle:"Remote Control session",rcChecking:"Checking sign-in status…",rcLead:"This Remote Control session requires authorization. Sign in with your Kimi account to continue.",rcSuccessHint:"Redirecting…",rcExpiredTitle:"Authorization expired or declined",rcDeniedTitle:"Authorization cancelled",rcStartErrorTitle:"Could not start sign-in",rcSessionErrorTitle:"Could not create your session",rcConnectionErrorHint:"Check your connection and try again.",rcSuccessNoRedirect:"You can close this page now."},cie={title:"Provider management",loading:"Loading providers…",unavailable:"Provider management is not available yet",empty:"No providers yet",status:{connected:"Connected",error:"Error",unconfigured:"Not configured"},keySet:"key set",keyNotSet:"key not set",managedBadge:"OAuth",modelCount:"{count} models",confirmDelete:"Confirm delete?",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginKimi:"Sign in to Kimi",loginAnthropic:"Sign in to Anthropic",addProvider:"Add provider",added:"Provider added",enterApiKey:"Enter API Key",optional:"Optional",apiKeyRequired:"API Key cannot be empty",fieldId:"Name",fieldType:"API Protocol",types:{kimi:"Kimi",openai:"OpenAI",openai_responses:"OpenAI Responses",anthropic:"Anthropic","google-genai":"Google GenAI",vertexai:"Vertex AI"},fieldApiKey:"API Key",apiKeyManaged:"Signed in with OAuth",apiKeySet:"Set — enter a new key to replace",showApiKey:"Show API key",hideApiKey:"Hide API key",fieldBaseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",fieldModels:"Models",colModelId:"Model ID",colContext:"Context",colDisplayName:"Display name",modelIdPlaceholder:"kimi-k3",modelContextPlaceholder:"1048576",modelNamePlaceholder:"Optional",noModels:"No models",addModel:"Add model",removeModel:"Remove model",fieldDefaultModel:"Default model",save:"Save",saved:"Provider saved",deleteProvider:"Delete provider",deleteConfirm:"Delete {id} and its {count} models?",deleteConfirmYes:"Delete",managedHint:"Managed providers sign in and out on the Account tab",unsavedGuard:"You have unsaved changes.",guardStay:"Keep editing",guardDiscard:"Discard",add:"Add",catalog:{sourceCatalog:"From directory",sourceManual:"Manual",sourceRegistry:"Registry",registryHint:"Import providers and models from an api.json registry; re-importing the same URL refreshes it",registryUrlLabel:"Registry URL",registryImported:"{count} providers imported",searchPlaceholder:"Search providers",loading:"Loading directory…",loadError:"Failed to load the directory. Check your network and retry.",retry:"Retry",empty:"No matching providers",rejected:"Not importable",rejectReason:{"unknown-explicit-type":"Unsupported protocol","proprietary-sdk":"Proprietary SDK — cannot be imported","empty-base-url":"Blank base URL","placeholder-base-url":"Endpoint contains an env placeholder"},backToList:"Back to directory",willImport:"{count} models will be imported from the directory",overwriteWarning:"A provider with this name already exists; importing overwrites its config and models",importAction:"Import"},error:{idRequired:"Name cannot be empty",idInvalid:'Name must start with a letter or digit and may only contain letters, digits, "-", "_" and spaces',apiKeyRequired:"API Key cannot be empty",baseUrlRequired:"Base URL cannot be empty",registryUrlRequired:"Registry URL cannot be empty",modelRequired:"Model ID cannot be empty",contextSizeRequired:"Max context size cannot be empty",contextSizeInvalid:"Max context size must be a positive integer"},hintClose:"Close"},die={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",clearSearch:"Clear search",loading:"Loading models…",unavailable:"Model list is unavailable",contextSuffix:"{size} ctx",capabilityImageInput:"Image input",capabilityVideoInput:"Video input",capabilityToolUse:"Tool use",capabilityThinking:"Thinking",capabilityAlwaysThinking:"Always thinking",emptyNoModels:"No models available",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",hintNavigate:"Navigate",hintSelect:"Select",hintClose:"Close"},fie={justNow:"just now"},hie={title:{shell:"Run command?",diff:"Apply changes?",file:"Write file?",fileop:"File operation?",url:"Fetch URL?",search:"Search?",invocation:"Invoke?",todo:"Update todo?",plan_review:"Ready to build with this plan?",generic:"Approve action?"},subagentBadge:"sub agent · {name}",danger:"Danger: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"Explain why you are rejecting… (Enter to submit, Shift+Enter for a new line, Esc to cancel)",feedbackHint:"Enter to submit · Shift+Enter for a new line · Esc to cancel",approve:"Approve",approveSession:"Approve for session",reject:"Reject",feedback:"Feedback",feedbackSubmit:"Reject with feedback",feedbackCancel:"Cancel",approvePlan:"Approve plan",revise:"Revise",rejectAndExit:"Reject and Exit",expandPlan:"Expand",collapsePlan:"Collapse"},pie={back:"‹ Previous question",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand",hint:"↑↓ to choose · Enter to confirm"},mie={tag:"tasks",summary:"{run} running · {done} done",copy:"Copy",calling:"Calling {label}",fieldTask:"Task",fieldOutput:"Output",fieldProgress:"Progress",fieldResult:"Result",moreLines:"… ({count} more)",copied:"Copied",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Background Agent",dockTodos:"Todos",todoProgressTitle:"Progress",stateDone:"Done",stateFail:"Failed",stateCancelled:"Cancelled",filterRecent:"Recent",filterRunning:"Running",filterDone:"Done",filterAll:"All",running:"running",closePanel:"Close panel",openPanel:"Open in the side panel",timingRunning:"Running · {time}",timingDone:"Done · {time}",emptyTasks:"No background tasks running",emptyRecent:"No recent tasks",emptyRunning:"No running tasks",emptyDone:"No completed tasks",emptyBash:"No bash tasks running",emptySubagent:"No background agent tasks running",emptyTodo:"No todos yet",openTab:"Open the tasks tab",openDetail:"Open",toBackground:"To background",collapse:"Collapse",expand:"Expand",transcriptLoadError:"Failed to load this sub agent’s conversation.",copyCommand:"Copy command",copyOutput:"Copy output",copyAll:"Copy all"},gie={panelTitle:"Thinking",streaming:"Thinking…"},vie={aheadTitle:"ahead of remote",behindTitle:"behind remote",fileCountOne:"{number} file",fileCountOther:"{number} files",empty:"No git changes",clean:"Working tree clean, no changes",back:"Back",loading:"Loading diff…",noDiff:"No line changes for this file",emptyFile:"Empty file",list:"List",tree:"Tree"},yie={},kie={empty:"Select a file on the left to preview",loading:"Loading…",lineCount:"{count} lines",copy:"Copy",copied:"Copied",copyPath:"Copy path",openInEditor:"Open",reveal:"Reveal",download:"Download",close:"Close",moreActions:"More actions",refresh:"Refresh",htmlMode:"HTML preview mode",markdownMode:"Markdown preview mode",preview:"Preview",source:"Source",imageFit:"Image sizing",fit:"Fit",actual:"Actual",pdfNoPreview:"This PDF cannot be embedded here. Download it to view.",imageNoPreview:"Image file · {mime} · {size} · preview unavailable",binaryNoPreview:"Can't preview this file ({mime} · {size}). Open with another app",unknownType:"unknown type",copyCode:"Copy code",enlargeImage:"Enlarge image",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",notFound:"File no longer exists or was moved",tooLarge:"File is too large to preview",loadFailed:"Unable to read this file"}},bie={searching:"Searching…",noMatch:"No matches",files:"Files",skills:"Skills",openSkill:"Open skill file",copyPath:"Copy path",attachmentUploadFailed:"Upload failed — remove the attachment, or drop the file in again to retry",attachmentUploadInterrupted:"Upload interrupted — remove the attachment, or drop the file in again to retry",viewFullscreen:"View fullscreen",mediaPreviewLoading:"Loading preview…",mediaPreviewUploading:"Uploading — preview when ready",mediaPreviewUnavailable:"Preview unavailable",stateUploading:"Uploading",stateUploaded:"Uploaded",stateUploadFailed:"Upload failed"},wie={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",agentWarningFallback:"agent warning",unhandledEvent:"Unhandled event: {type}",agentError:{title:"Model request failed",connection:"Cannot connect to the model service",auth:"Model authentication failed",rateLimit:"Model rate limit reached",overloaded:"Model overloaded",filtered:"Response filtered by the provider",api:"Model API error",contextOverflow:"Context size exceeded"},details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Kimi server returned an error",daemonNetworkMessage:"Web did not receive a response from the Kimi server. Check that it is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi server",daemonTimeoutMessage:"The Kimi server did not respond within the wait limit. The operation may still complete in the background — refresh later to check, or try again.",daemonTimeoutTitle:"Kimi server response timed out",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sendFailedTitle:"Send failed",sendFailedNoDefaultModelMessage:"No default model is configured. Choose a model again in Settings",sessionSnapshotMessage:"Web could not load the current conversation. Check that the Kimi server is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},Cie={new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},login:{desc:"Sign in to Kimi in the browser"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm runs a task in swarm"},tower:{desc:"Toggle tower mode; /tower turns it on with a base branch"},goal:{desc:"Create/control a goal: /goal , /goal pause{'|'}resume{'|'}cancel"},btw:{desc:"Side chat: /btw asks a forked side session"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},export:{desc:"Download this session and troubleshooting logs as a ZIP",noSession:"Open a session before exporting it.",started:"Exporting session…",done:"Session exported.",tooLarge:"Session data exceeds the export size limit. Export it from a terminal instead: kimi export {sessionId} -o session.zip"},status:{desc:"View session status"},undo:{desc:"Undo the last message"}},Aie={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task",swarm:"Swarm",ask_user:"Question",plan:"Plan",goal_create:"Start Goal",goal_get:"Read Goal",goal_budget:"Set Goal Budget",goal_update:"Update Goal",waitfor:"Wait"},waitfor:{waitingAny:"Waiting for any background task",waitingTask:"Waiting for {id}",noTasks:"No background tasks running",timedOut:"Timed out",stillRunning:"{count} still running",moreFinished:"+{count} finished during wait",moreRunning:"+{count} more"},swarm:{progress:"{done} / {total}",runningSub:"{count} in progress",doneSub:"{completed} completed · {failed} failed",doneSubWithCancelled:"{completed} completed · {failed} failed · {cancelled} cancelled",phaseQueued:"Queued",phaseWorking:"Working",phaseSuspended:"Suspended",phaseCompleted:"Completed",phaseFailed:"Failed",phaseCancelled:"Cancelled",waiting:"Waiting for subagents…"},chip:{lines:"{count} lines",results:"{count} results",files:"{count} files",edited:"edited",created:"created",todos:"{count} items"},disclosure:{expand:"Expand details",collapse:"Collapse details"},agent:{foreground:"Foreground",background:"Background",status:{running:"Running",ok:"Completed",error:"Failed",cancelled:"Cancelled"}},output:{waiting:"Waiting for output…",empty:"No output",saved:"Saved result"},plan:{review:{pending:"Pending review",approved:"Approved",rejected:"Rejected",cancelled:"Cancelled"},selectedOption:"Selected",pathOnlyHint:"No inline content — open it in the side panel:",feedback:"Feedback"},summary:{inScope:"{value} in {scope}"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"Status: {status}",budget:"{value} {unit}",turns:"{value} turns",tokens:"{value} tokens",milliseconds:"{value} ms",seconds:"{value} sec",minutes:"{value} min",hours:"{value} hr"},group:{countOther:"{count} tool call | {count} tool calls",typed:{read:{done:"Read {count} file | Read {count} files"},bash:{done:"Ran {count} command | Ran {count} commands"},grep:{done:"Searched {count} pattern | Searched {count} patterns"},search:{done:"Ran {count} web search | Ran {count} web searches"},glob:{done:"Matched {count} file pattern | Matched {count} file patterns"},ls:{done:"Listed {count} directory | Listed {count} directories"},web_fetch:{done:"Fetched {count} page | Fetched {count} pages"},edit:{done:"Made {count} edit | Made {count} edits"},write:{done:"Wrote {count} file | Wrote {count} files"}}},activity:{failedClause:" ({count} failed)",liveDonePrefix:"",busy:"Working…",doing:{read:"Reading {subject}",bash:"Running {subject}",grep:"Searching {subject}",search:"Searching {subject}",glob:"Matching {subject}",ls:"Listing {subject}",web_fetch:"Fetching {subject}",edit:"Editing {subject}",write:"Writing {subject}"}},ask:{dismissed:"Dismissed",answer:"{count} answer",answers:"{count} answers",answered:"Answered",more:"(+{count} more)",collected:"Collected your answers",question:"{count} question",questions:"{count} questions",freeInput:"(free text)",unanswered:"No answer"}},xie={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},Sie={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Settings",groupSession:"Current session",groupApp:"App preferences",groupAccount:"Account",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"Auto-read only; everything else needs your approval first",permAutoSub:"Never interrupts you; everything runs and is decided automatically",permYoloSub:"Routine edits and commands run automatically; risky actions, questions, and plans still ask",planModeSub:"Plan mode",goalModeSub:"Goal mode",swarmModeSub:"Swarm mode",towerModeSub:"Tower mode",archivedSessions:"Archived sessions",archivedSessionsSub:"Browse and restore archived sessions",archivedBack:"Back",viewFlat:"Flat",viewGrouped:"By workspace"},_ie={colorSchemeLabel:"Appearance",light:"Moon bright",dark:"Moon dark",system:"System"},Iie={continue:"Continue",back:"Back",skip:"Skip",welcome:{title:"Welcome to Kimi Code",subtitle:"The AI coding workbench for professional developers",languageLabel:"Language",themeLabel:"Appearance"},login:{title:"Configure Model",subtitle:"Choose the model service that powers Kimi Code. You can change it later in Settings",kimiTitle:"Sign in with Kimi",kimiHint:"Ready out of the box with Kimi membership benefits",kimiCnTitle:"Kimi Code",kimiCnHint:"Sign in with your kimi.com account",kimiOverseasTitle:"Kimi Code",kimiOverseasHint:"Sign in with your kimi.ai account",customProviderTitle:"Add a custom provider",customProviderHint:"Bring your own API key for OpenAI-compatible and other services",loggedInTitle:"Logged in with Kimi",loggedInHint:"Your model service is ready to use",finish:"Finish",skip:"Skip for now"}},Mie={title:"Settings",internalTest:"Internal Test",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",providers:"Providers",advanced:"Advanced",archived:"Archived",shortcuts:"Hotkeys",plugins:"Plugins",lab:"Lab"},lab:{sidebarTabs:"Multi-tab sidebar",sidebarTabsHint:"The sidebar shows Open / Done / Workspaces tabs"},plugins:{retry:"Retry",builtIn:"Built-in",official:"Official",thirdParty:"Third-party",installed:"Installed",install:"Install",update:"Update",remove:"Remove",enabled:"Enabled",homepage:"Homepage",empty:"No plugins found",hasErrors:"Error",customInstall:"Install custom plugin",customInstallPlaceholder:"https://… or /path/to/plugin",customInstallHint:"Accepts an https zip URL, a GitHub repo URL, or a local directory path.",extensionHintTitle:"One step left: install the browser extension",extensionGuide:"Manual install",dismissHint:"Dismiss",catalogUnavailable:"The marketplace catalog is currently unreachable; installed plugins remain manageable below.",source:{"local-path":"Local","zip-url":"ZIP",github:"GitHub"},counts:{skill:"1 skill | {n} skills",mcp:"1 MCP server | {n} MCP servers",mcpEnabled:"{n} on",hook:"1 hook | {n} hooks",command:"1 command | {n} commands"}},appearance:"Appearance",notifications:"Notifications",notifyEnabled:"System notifications",notifyEnabledHint:"Send a system notification when a turn completes, needs an answer, or needs approval",notifySound:"Notification sound",notifySoundHint:"Play the system sound with notifications",notifyDenied:"Blocked in browser settings",notifyTitle:"Kimi Code · Turn finished",notifyQuestionTitle:"Kimi Code · Needs answer",notifyApprovalTitle:"Kimi Code · Approval required",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",notifyApprovalFallback:"A tool needs your approval",account:"Account",signedIn:"Signed in",signedOutHint:"Sign in to view your account and model access",planUsage:{title:"Plan Usage",retry:"Retry",loadFailed:"Failed to load",empty:"No usage data yet",weekLimit:"Weekly limit",genericLimit:"Limit",hourLimit:"{n}h limit",dayLimit:"{n}d limit",minuteLimit:"{n}m limit",resetsIn:"resets in {duration}",resetDone:"reset",durationDay:"{n}d",durationHour:"{n}h",durationMinute:"{n}m",durationSecond:"{n}s",usedPct:"{pct}% used",boosterTitle:"Booster",boosterBalance:"Balance",monthlyUsed:"Used this month",monthlyLimit:"Monthly limit",unlimited:"Unlimited",freeTitle:"Free account",freeHint:"Upgrade to a membership to use Kimi models and see plan usage"},colorSchemeHint:"Choose the app’s light or dark appearance",appIcon:"Dock icon",appIconHint:"Choose the icon shown in the Dock",appIconDefault:"Default",appIconBlack:"Black",uiFontSize:"Font size",uiFontSizeHint:"Adjust interface and message text size",vibrancy:"Frosted sidebar",vibrancyHint:"Use the native macOS frosted-glass material behind the sidebar — turn it off if the translucency is hard to read",languageHint:"Choose the interface language",defaultOpenInApp:"Default open-in app",defaultOpenInAppHint:"App used when opening files and folders from the header menu",openWith:"Open with",agentDefaults:"Agent defaults",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",secondaryModelSection:"Subagents",secondaryModel:"Subagent model",secondaryModelHint:"Model and thinking effort that subagents use by default",secondaryModelEffort:"Thinking effort",noSecondaryModel:"Not set (inherit primary)",secondaryModelEffortAuto:"Model default",telemetry:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",versionAndUpdates:"Version & updates",appVersion:"App version",appVersionHint:"The running app’s version and build time",checkUpdate:"Check for updates",checkUpdateHint:"Manually check whether a new version is available",checkUpdateBtn:"Check now",updateChecking:"Checking…",updateCheckLatest:"You’re on the latest version",updateCheckAvailable:"Version {version} is available — download it from the update entry in the sidebar",updateCheckUnsupported:"This build does not support update checks",updateCheckFailed:"Check failed. Please try again later.",updateCheckAvailableAuto:"Version {version} found — downloading in the background",updateCheckDownloaded:"Version {version} is ready — restart from the update entry in the sidebar",autoDownloadUpdate:"Auto-download updates",autoDownloadUpdateHint:"Download new versions in the background and install them on the next restart",canaryUpdate:"Update Canary",canaryGhMissing:"GitHub CLI not found — install it first (brew install gh) and sign in",canaryGhUnauthenticated:"GitHub CLI is not signed in — run gh auth login in a terminal first",canaryTrigger:"Repackage Canary",canaryTriggerHint:"Trigger the macOS arm64 build pipeline to produce a new canary build",canaryTriggerBtn:"Repackage Canary",canaryTriggerConfirm:"Click again to confirm",canaryTriggerDone:"Triggered — the build takes about 20–30 minutes",canaryTriggerFailed:"Failed to trigger: {error}",canaryViewWorkflow:"View workflow",canaryImportStable:"Import UI Settings from Stable…",canaryImportStableTitle:"Import UI Settings from Stable",canaryImportStableHint:"Copies the stable app’s UI settings (pinned sessions, appearance, and other localStorage preferences) into Canary, replacing the current ones (the existing copy is backed up as leveldb.bak). Canary restarts to finish the import; the stable app must stay quit.",canaryImportStableBtn:"Import & Restart",canaryImportStableRunning:"The stable app (Kimi Code) is running — quit it first, then import again.",canaryImportStableNoData:"No UI settings data from the stable app was found.",canaryImportStableFailed:"Import failed: {error}",privacy:"Data & privacy",diagnostics:"Diagnostics",messageFolding:"Message folding",turnFolding:"Auto-fold messages",turnFoldingHint:"When a turn ends, the work folds away automatically, leaving only the summary",activityRunFolding:"Tool call summary",activityRunFoldingHint:"During the answer, consecutive tool calls are summarized into one row",build:"Build",serverVersion:"Server version",serverAddress:"Server address",serverAddressHint:"The address of the connected server",serverVersionHint:"The version of the connected service",copyServerVersion:"Copy server version",copyServerAddress:"Copy server address",copied:"Copied",exportLog:"Troubleshooting log",exportLogHint:"Export the troubleshooting log collected by the app",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",archivedTitle:"Archived sessions",archivedDesc:"Browse archived sessions, see their workspace path, name, and archive time, and restore them to the session list.",archivedSearch:"Search archived sessions",archivedAllWorkspaces:"All workspaces",archivedSortLabel:"Sort by",archivedSortArchived:"Archive time",archivedSortCreated:"Created time",archivedSortName:"Name",archivedRestore:"Restore",archivedEmpty:"No archived sessions yet",archivedNoMatch:"No matching archived sessions",archivedSessionsCount:"{count} sessions",archivedAt:"Archived {time}",archivedLoadMore:"Load more",archivedLoading:"Loading…",archivedLoadingAll:"Loading all archived sessions…"},Tie={openInEditor:"Open in editor",openInEditorShort:"Open",openInApp:"Open in {app}",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",lastUsed:"Last used",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",prStatusOpen:"open",prStatusClosed:"closed",prStatusMerged:"merged",prStatusDraft:"draft",prStatusUnknown:"unknown",options:"Options",copySessionId:"Copy session ID",pinSession:"Pin",unpinSession:"Unpin",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",markSessionDone:"Mark as done",reopenSession:"Mark as open",exportSession:"Export session",devBadge:"Running in development mode"},Eie={title:"Side chat",empty:"Ask a quick question on the side — it shares this session’s context.",placeholder:"Ask the side chat…",send:"Send"},Lie={comment:"Comment",addToChat:"Add to chat",commentPlaceholder:"Write a comment…",confirm:"Add",copyQuote:"Copy quote",copyComment:"Copy comment",quoteLabel:"Quote"},Nie={actions:{summonApp:{label:"Show App Window",desc:"Bring the app window to the foreground from anywhere"},newSession:{label:"New Session",desc:"Start a new session in the current workspace"},searchSessions:{label:"Search Chats",desc:"Open the session search dialog"},archiveSession:{label:"Complete Chat",desc:"Mark the current chat as done right away (find it under Done)"},toggleSideChat:{label:"Toggle Side Chat",desc:"Open or close the /btw side chat"},toggleSidebar:{label:"Toggle Sidebar",desc:"Collapse or expand the session sidebar"},openFolder:{label:"Open Folder",desc:"Add a workspace folder with the native picker"},openInDefaultApp:{label:"Open in App",desc:"Open the workspace in your default editor/terminal"},openSettings:{label:"Open Settings",desc:"Show or hide the settings dialog"},toggleTerminal:{label:"Toggle Terminal",desc:"Show or hide the bottom terminal panel"},openDiffTab:{label:"Open Changes",desc:"Open or activate the workspace changes tab"},sidebarTabOpen:{label:"Open Tab",desc:"Switch to the Open list in the sidebar"},sidebarTabDone:{label:"Done Tab",desc:"Switch to the Done list in the sidebar"},sidebarTabWorkspaces:{label:"Workspaces Tab",desc:"Switch to the workspace directory in the sidebar"},selectPrevSibling:{label:"Previous Item",desc:"Select the previous chat / workspace in the current tab"},selectNextSibling:{label:"Next Item",desc:"Select the next chat / workspace in the current tab"},send:{label:"Send Message",desc:"Send the composer input"},newline:{label:"Newline",desc:"Insert a newline in the composer"}},searchPlaceholder:"Search shortcuts",unassigned:"Unassigned",unassign:"Unassign shortcut",edit:"Edit shortcut",reset:"Reset to default",resetAll:"Reset all to defaults",recording:"Press the new shortcut…",invalid:"This key combination can’t be used as a shortcut",notGlobal:"This key combination can’t be registered as a system-wide shortcut",globalTaken:"This shortcut is already taken by the system or another app",reserved:"Reserved by the system menu",reservedSteer:"Reserved for steer (Ctrl/Cmd+S)",reservedFind:"Reserved for transcript find (Ctrl/Cmd+F)",conflict:"Already used by “{action}”",customBadge:"Custom"},Fie={panelAria:"Terminal",toolbarAria:"Terminal tabs",resizeAria:"Resize terminal panel height",toggle:"Toggle terminal",open:"Open terminal",close:"Close terminal",newTab:"New terminal",closeTab:"Close terminal",restartTab:"Restart terminal",collapse:"Collapse terminal panel",empty:"No terminal yet — click to start one",processExited:"[process exited]",processExitedWithCode:"[process exited with code {code}]"},Die={tabs:{diff:"Changes",file:"File",turnDiff:"Turn diff",compaction:"Compaction summary",agent:"Subagent",term:"Terminal"},newTab:"New tab",closeTab:"Close tab",expand:"Expand panel",collapse:"Restore panel",hide:"Close right panel",openPanel:"Open right panel",launcherAria:"Quick open"},Rie={title:"PR Preview",intro:"Build a pull request or branch of this repo in an isolated worktree and open its UI in a separate window. The first build can take a few minutes.",prLabel:"Preview target",customRefPlaceholder:"PR number, branch, tag, or commit SHA",invalidRef:"Enter a valid branch name, tag, or commit SHA",start:"Start preview",cleanup:"Clean up preview cache",cleanupConfirm:"Delete all cached previews except the one currently being previewed? They will be rebuilt on demand next time.",cleanupDone:"Removed {count} cached preview(s)",fetching:"Fetching {pr}…",installing:"Installing dependencies…",building:"Building renderer…",activeText:"Previewing {pr}",stop:"Exit preview",rebuild:"Fetch & rebuild",errorTitle:"Preview failed",retry:"Retry",stageFetch:"fetch the code",stageInstall:"install dependencies",stageBuild:"build the renderer",stageFailed:"Failed to {stage}",stageHung:"Building the preview hung while trying to {stage} (no output for 5 minutes, killed — check the network/proxy)"},Oie={title:"Server token required",hint:"This server is protected. Enter the bearer token printed when the server started (or the password set via {env}).",tokenPlaceholder:"Token",connect:"Connect",connecting:"Connecting…"},Pie={common:tie,app:nie,sidebar:iie,admin:oie,workspace:sie,conversation:rie,status:lie,composer:aie,login:uie,providers:cie,model:die,sessions:fie,approval:hie,question:pie,tasks:mie,thinking:gie,diff:vie,fileTree:yie,filePreview:kie,mention:bie,warnings:wie,commands:Cie,tools:Aie,layout:xie,mobile:Sie,theme:_ie,onboarding:Iie,settings:Mie,header:Tie,sideChat:Eie,selection:Lie,shortcuts:Nie,terminal:Fie,panel:Die,prPreview:Rie,serverAuth:Oie},Bie={confirm:"确认",cancel:"取消",close:"关闭",dismiss:"关闭",loading:"加载中",copy:"复制",errorBoundaryTitle:"出错了",errorBoundaryRetry:"重试",asyncLoadFailed:"加载失败,请关闭后重试"},$ie={connecting:"连接中…",connectingStageAuth:"正在检查登录状态…",connectingStageServer:"正在连接服务器…",connectingStageConfig:"正在加载配置…",connectingStageSessions:"正在加载会话列表…",connectingStageSession:"正在打开会话…",connectingRetrySuffix:"(第 {n} 次重试)",connectingIssueNetworkTitle:"无法连接到 Kimi 服务器",connectingIssueNetworkMessage:"请检查网络连接,确认服务器仍在运行",connectingIssueTimeoutTitle:"Kimi 服务器响应超时",connectingIssueTimeoutMessage:"仍在自动重试,请稍候",connectingIssueApiTitle:"Kimi 服务器返回错误",connectingIssueUnknownTitle:"连接出现问题",internalBuildBanner:"仅供内部测试",menuFile:"文件",menuEdit:"编辑",menuView:"视图",menuHelp:"帮助",applicationMenu:"应用菜单"},zie={workspaceMeta:"工作空间 · {branch}",sessionsHeader:"会话",workspaces:"工作区",viewSwitcher:"列表管理",viewGroup:"视图",viewFlat:"平铺列表",viewGrouped:"按工作区分组",sortGroup:"排序",sortManual:"手动排序",sortRecent:"按最近活动",sessionAdmin:"会话管理",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",newSession:"新建会话",newChat:"新建会话",newWorkspace:"新建工作空间",dropToAddWorkspace:"松开鼠标添加工作区",emptyState:"还没有会话 · 点击 新建会话 开始",options:"选项",rename:"重命名",genTitle:"生成标题",genTitleUnavailable:"无法生成标题:需要登录 Kimi Code 托管账号,且会话中已有消息",setEmoji:"设置 Emoji…",sessionEmojiTitle:"选择 Emoji",removeEmoji:"移除 Emoji",randomEmoji:"随机",searchEmoji:"搜索 Emoji",recentEmojis:"最近使用",noEmojiResults:"没有匹配的 Emoji",emojiGroupFaces:"笑脸与人物",emojiGroupNature:"动物与自然",emojiGroupFood:"美食饮品",emojiGroupActivity:"活动与出行",emojiGroupObjects:"物品与工作",emojiGroupSymbols:"符号与状态",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",archiveToastUndo:"撤销",archiveToastMid:"或到",archiveToastSettings:"设置",archiveToastTail:"查看已归档的会话",tabOpen:"进行中",tabDone:"已完成",tabWorkspaces:"工作空间",tagOpen:"进行中",tagDone:"已完成",complete:"完成",markDone:"标记为完成",reopen:"恢复进行中",noDoneSessions:"还没有已完成的会话",noOpenSessions:"还没有进行中的会话",completeToastLead:"已完成",reopenToastLead:"已恢复进行中",fork:"分叉会话",export:"导出会话",pin:"置顶",unpin:"取消置顶",lastActive:"最后更新:{time}",pinned:"置顶",collapsePinned:"折叠置顶区",expandPinned:"展开置顶区",resizePinnedAria:"调整置顶区高度",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",defaultUserName:"Kimi 用户",upgrade:"升级",upgradeMembership:"会员升级",logoutConfirmTitle:"退出登录",logoutConfirmMessage:"确定要退出当前账号吗?",language:"语言",backendTitle:"后端 {backend} · {endpoint} — 点击切换",noSessions:"暂无对话",allPinned:"有 {count} 条对话被置顶",showMore:"展开更多",loadMore:"加载更多",showLess:"收起",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话或工作区",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchHintSelect:"选择",searchHintOpen:"打开",searchHintClose:"关闭",searchClear:"清除搜索",searchNoResults:"没有匹配的会话或工作区",searchEmpty:"暂无会话",update:"更新",updateAvailable:"发现新版本 v{version}",updateDownloadingButton:"下载中({percent}%)",updateReady:"v{version} 已就绪",updateDone:"重启并更新",updateFailed:"下载失败",updateRetry:"重试",updateDownloadNow:"下载并更新",updateSkip:"本次跳过",updateRestartNow:"立即重启",updateRestartLater:"下次启动",updateReleaseDate:"发布于 {date}",updateCurrentVersion:"当前版本 v{version}",updateWhatsNew:"更新内容",updateBackground:"后台下载",updateAutoDownload:"以后自动下载并安装更新",rcSelectDevice:"选择设备",rcCurrentDevice:"当前设备:{name}",rcConnectable:"可连接",rcUnavailable:"不可用",rcOnline:"在线",rcOffline:"离线",rcDevicesLoadFailed:"设备列表加载失败"},jie={title:"会话管理",subtitle:"管理所有会话,把任务完成的会话标记完成。旧会话按更新时间筛选,即可批量清理。",back:"返回",filterWorkspace:"工作空间",filterStatus:"状态",filterTime:"更新时间",allWorkspaces:"全部工作空间",selectAll:"全选",searchWorkspace:"搜索工作空间",noWorkspaceMatch:"没有匹配的工作空间",removeTag:"移除 {name}",statusAll:"全部状态",statusOpen:"进行中",statusDone:"已完成",timeAll:"全部时间",timeDaysAgo:"{n} 天以前",query:"查询",reset:"重置",colStatus:"状态",colTitle:"会话名",colWorkspace:"工作空间",colPrompt:"最后一条 prompt",colUpdated:"最后更新",colCompleted:"完成时间",colActions:"操作",empty:"没有符合当前筛选条件的会话",loading:"加载中…",total:"共 {n} 条",pageSize:"{n} 条/页",prevPage:"上一页",nextPage:"下一页",selectPageAll:"全选本页",batchSelected:"已选 {n} 项",selectAllMatching:"选中当前条件下的全部 {total} 项",materializingAll:"正在选中…",allMatchingSelected:"已选中全部 {n} 项",clearSelection:"清除选择",markDone:"标记完成",reopen:"恢复进行中",markDoneCount:"标记完成({n})",reopenCount:"恢复进行中({n})",batchDoneToast:"已标记完成 {n} 个会话",batchReopenedToast:"已将 {n} 个会话恢复为进行中",batchFailedSuffix:",{n} 个失败",batchDoneFailedNotice:"{n} 个会话未能标记完成",batchReopenFailedNotice:"{n} 个会话未能恢复为进行中",undo:"撤销",open:"打开会话",rename:"重命名…",fork:"分叉会话",export:"导出",moreActions:"更多操作"},Hie={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableTitle:"启用 swarm 模式?",swarmEnableConfirm:"Agent 将并行运行多个子 agent。",goalStartTitle:"启动 goal?",goalStartConfirm:"「{objective}」——Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",addFailed:"无法打开此文件夹,请检查路径后重试。",requiredTitle:"请先选择工作空间",requiredMessage:"发送消息前,需要先选择一个文件夹作为工作区。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"失败",abortedTitle:"此会话的上一轮对话因错误中断"},Wie={jumpToLatestAria:"跳到最新消息",backToBottom:"回到底部",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",starting:"正在创建对话…",requesting:"请求中…",working:"工作中…",workingRetry:"模型请求失败,正在重试(第 {n}/{max} 次)…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",recentSessions:"最近会话",viewMoreSessions:"查看更多",sessionAdminTooltip:"在会话管理页面查看并管理更多会话",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",pickFolder:"选择文件夹…",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",undo:"撤销",undoTooltip:"撤回编辑",undoConfirm:"撤回到这条消息?",escUndoHintPre:"再按",escUndoHintPost:"撤销本条",undone:"已撤销,原文已放回输入框",turnInterrupted:"已手动终止",turnFailed:"模型请求失败,本轮对话已中断",turnFailedMaxSteps:"达到本轮步数上限,对话已中断",turnFailedResume:"继续",turnFailedResumeText:"继续",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…",widenTable:"加宽表格",restoreTableWidth:"恢复默认宽度",wrapCode:"开启自动换行",unwrapCode:"关闭自动换行",showLineNumbers:"显示行号",hideLineNumbers:"隐藏行号",cron:{fired:"定时任务已触发",missed:"错过的定时提醒",job:"任务 {id}",oneShot:"单次",coalesced:"已合并 {n} 次触发",missedCount:"错过 {n} 次",finalDelivery:"最后一次投递",expand:"展开",collapse:"收起"},fold:{worked:"已工作 {duration}",workedUnknown:"工作过程"},turnFiles:{titleOne:"{number} 个文件已修改",titleOther:"{number} 个文件已修改",more:"还有 {number} 个文件",moreOne:"还有 1 个文件",showLess:"收起",diffUnavailable:"此文件的改动无法逐项展示",rebuilding:"正在加载本轮改动…",openFile:"打开文件"},goal:{continuation:"目标续跑"},notification:{sentBy:{task:"由后台发送(Bash)",subagent:"由后台发送(Agent)"},bodyLine:"{status}:{description}",reason:"原因:{reason}",userStopped:"已被用户终止",statusTitle:{completed:"已完成",failed:"失败",timed_out:"超时",killed:"已终止",lost:"丢失",info:"通知"},status:{completed:"完成",failed:"失败",timed_out:"超时",killed:"已终止",lost:"丢失",info:"信息"},groupTitle:"{n} 条通知",copyPath:"复制路径",copied:"已复制",rawPayload:"原始 payload",outputTruncated:"输出已截断,仅显示末尾",fields:{type:"类型",source:"来源",severity:"严重度"}},userMessage:{expand:"展开",collapse:"收起"},search:{placeholder:"搜索对话…",searching:"搜索中…",results:"{current}/{total} 条结果",resultsCapped:"{current}/{total}+ 条结果",noResults:"无结果",previous:"上一个匹配",next:"下一个匹配",close:"关闭搜索"}},qie={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"始终询问",permissionAuto:"完全自动",permissionYolo:"必要时询问",permissionManualDesc:"仅自动读取,其余操作逐一向你确认",permissionAutoDesc:"完全不打断,所有操作和判断自动完成",permissionYoloDesc:"自动完成常规修改和命令;高危操作、提问和计划仍会问你",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",workModeDismiss:"退出模式",goalLabel:"目标",timeUnitHour:"小时",timeUnitMinute:"分",timeUnitSecond:"秒",planEmptyArmed:"计划模式已开启,智能体写出计划后会显示在这里",planEmptyIdle:"还没有计划——开启计划模式后,智能体写出的计划会显示在这里",swarmLabel:"Swarm",swarmDismiss:"关闭 Swarm",towerLabel:"Tower",towerDismiss:"关闭 Tower",modeOff:"未启用",goalPlaceholder:"让智能体完成什么目标?",planPlaceholder:"让智能体先规划什么?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",goalCancelConfirm:"是否需要取消当前目标?取消后将无法恢复。",goalCancelConfirmYes:"是",goalCancelConfirmNo:"否",goalDoneWhen:"完成条件",goalStatusActive:"进行中",goalStatusPaused:"已暂停",goalStatusBlocked:"已阻塞",goalStatusComplete:"已完成",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",cacheNote:"提示:切换模型或思考程度会使已有的提示词缓存失效。建议新建会话,避免额外的 token 消耗。",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",statusTowerMode:"Tower 模式",swarmOn:"开",swarmOff:"关",towerOn:"开",towerOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},Uie={inputLabel:"消息输入框",placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",placeholderRunningMobile:"输入会加入队列",starting:"正在发送…",queuePending:"{n} 个任务等待发送",queueSteer:"立即发送到当前回合",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedAttachments:"附件 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",attachmentImage:"图片",attachmentVideo:"视频",attachmentOpenUnsupported:"无法打开 {name}:暂不支持此文件类型",dropToAttach:"松开鼠标添加附件",remove:"移除",uploading:"上传中",uploadFailed:"上传失败",attachFile:"添加附件",addMenu:"添加",addFiles:"文件",addFilesDesc:"上传文件",addGoalDesc:"设定目标并持续推进",addPlanDesc:"启用计划模式",addSwarmDesc:"启用 swarm 模式",addTowerDesc:"启用 tower 模式",noCommands:"无匹配命令",slashSheetTitle:"命令",slashSearchPlaceholder:"搜索命令…",mentionSheetTitle:"文件",mentionSearchPlaceholder:"搜索文件…",addSlash:"命令",addSlashDesc:"内置命令或技能",addMention:"提及",addMentionDesc:"提及项目中的文件",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",upgradeBanner:"升级你的 Kimi 账户来使用 Kimi Code",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · 思考",thinkingSuffixEffort:" · {level}",noArgCommand:"{cmd} 不接受任何参数"},Vie={title:"登录 Kimi Code",close:"关闭 (Esc)",regionCnTitle:"Kimi Code",regionCnHint:"使用 kimi.com 账号登录",regionOverseasTitle:"Kimi Code",regionOverseasHint:"使用 kimi.ai 账号登录",oauthTitle:"登录 Kimi 账号",oauthHint:"在浏览器中完成授权即可登录",starting:"正在启动登录流程…",openedHint:"请在浏览器中完成授权({time})",blockedTitle:"未能自动打开登录页",blockedHint:"浏览器拦截了自动打开,请点击下方按钮继续完成授权。",notOpened:"没有自动打开浏览器?",authorizeInBrowser:"在浏览器中登录",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",copyLink:"复制链接",success:"已登录",successHint:"正在加载,稍后自动关闭…",expiredTitle:"设备码已过期",expiredHint:"请重新开始登录流程",deniedTitle:"登录已取消",retry:"重试",closeBtn:"关闭",failedTitle:"登录失败",errorHint:"请升级 kimi-code 后重试",pollErrorTitle:"连接已断开",pollErrorHint:"登录轮询连续失败,请检查 kimi-code 进程后重试",action:"登录",requiredTitle:"请先登录",requiredMessage:"登录 Kimi 账号并配置模型后,才能开始对话。",goToLogin:"去登录",upgradeRequiredTitle:"请升级会员",upgradeRequiredMessage:"当前为免费账户,升级会员后即可使用 Kimi 模型开始对话。",pickModelTitle:"请选择模型",pickModelMessage:"已有可用模型,选择一个默认模型后即可开始对话。",pickModelAction:"选择模型",configureModelsTitle:"请配置模型",configureModelsMessage:"账号已登录,但还没有可用模型。配置模型后即可开始对话。",configureModelsGenericMessage:"还没有可用模型。配置模型后即可开始对话。",configureModelsAction:"去配置",rcSubtitle:"远程控制会话",rcChecking:"正在检查登录状态…",rcLead:"远程控制功能需要登录后使用。使用 Kimi 账号登录即可继续。",rcSuccessHint:"正在跳转…",rcExpiredTitle:"授权已过期或被取消",rcDeniedTitle:"已取消授权",rcStartErrorTitle:"无法开始登录",rcSessionErrorTitle:"无法创建登录会话",rcConnectionErrorHint:"请检查网络连接后重试。",rcSuccessNoRedirect:"现在可以关闭本页了。"},Kie={title:"供应商管理",loading:"加载提供商中…",unavailable:"暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",managedBadge:"OAuth",modelCount:"{count} 个模型",confirmDelete:"确认删除?",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginKimi:"登录 Kimi",loginAnthropic:"登录 Anthropic",addProvider:"添加供应商",added:"已添加",enterApiKey:"填写 API Key",optional:"可选",apiKeyRequired:"API Key 不能为空",fieldId:"名称",fieldType:"API 协议",types:{kimi:"Kimi",openai:"OpenAI",openai_responses:"OpenAI Responses",anthropic:"Anthropic","google-genai":"Google GenAI",vertexai:"Vertex AI"},fieldApiKey:"API Key",apiKeyManaged:"OAuth 托管登录",apiKeySet:"已设置,输入以更换",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",fieldBaseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",fieldModels:"模型",colModelId:"模型 ID",colContext:"上下文",colDisplayName:"显示名",modelIdPlaceholder:"kimi-k3",modelContextPlaceholder:"1048576",modelNamePlaceholder:"可选",noModels:"暂无模型",addModel:"添加模型",removeModel:"移除模型",fieldDefaultModel:"默认模型",save:"保存",saved:"已保存",deleteProvider:"删除供应商",deleteConfirm:"确认删除 {id} 及其 {count} 个模型?",deleteConfirmYes:"确认删除",managedHint:"托管供应商在账户页登录 / 登出",unsavedGuard:"有未保存的修改。",guardStay:"继续编辑",guardDiscard:"丢弃",add:"添加",catalog:{sourceCatalog:"从目录添加",sourceManual:"手动添加",sourceRegistry:"注册表",registryHint:"从 api.json 注册表导入供应商与模型;同一 URL 重复导入即为刷新",registryUrlLabel:"注册表 URL",registryImported:"已导入 {count} 个供应商",searchPlaceholder:"搜索供应商",loading:"加载目录中…",loadError:"目录加载失败,请检查网络后重试",retry:"重试",empty:"没有匹配的供应商",rejected:"不可导入",rejectReason:{"unknown-explicit-type":"协议不受支持","proprietary-sdk":"私有协议,无法导入","empty-base-url":"Base URL 为空","placeholder-base-url":"端点包含环境变量占位符"},backToList:"返回目录列表",willImport:"将从目录导入 {count} 个模型",overwriteWarning:"已存在同名供应商,导入将覆盖其配置与模型",importAction:"导入"},error:{idRequired:"名称不能为空",idInvalid:'名称需以字母或数字开头,只能包含字母、数字、"-"、"_" 和空格',apiKeyRequired:"API Key 不能为空",baseUrlRequired:"Base URL 不能为空",registryUrlRequired:"注册表 URL 不能为空",modelRequired:"模型 ID 不能为空",contextSizeRequired:"上下文长度不能为空",contextSizeInvalid:"上下文长度需为正整数"},hintClose:"关闭"},Zie={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",clearSearch:"清除搜索",loading:"加载模型中…",unavailable:"暂无可用模型列表",contextSuffix:"{size} ctx",capabilityImageInput:"图片输入",capabilityVideoInput:"视频输入",capabilityToolUse:"工具调用",capabilityThinking:"思考",capabilityAlwaysThinking:"始终思考",emptyNoModels:"暂无可用模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",hintNavigate:"导航",hintSelect:"选择",hintClose:"关闭"},Gie={justNow:"刚刚"},Qie={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",plan_review:"按这份 plan 开始实现?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",danger:"危险: {detail}",searchQueryLabel:"查询",searchScope:"范围:{scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Shift+Enter 换行, Esc 取消)",feedbackHint:"Enter 提交 · Shift+Enter 换行 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"反馈",feedbackSubmit:"提交并拒绝",feedbackCancel:"取消",approvePlan:"批准 plan",revise:"修改",rejectAndExit:"拒绝并退出",expandPlan:"放大",collapsePlan:"还原"},Yie={back:"‹ 上一题",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开",hint:"↑↓ 选择 · Enter 确认"},Jie={tag:"任务",summary:"{run} 运行中 · {done} 完成",copy:"复制",calling:"调用 {label}",fieldTask:"任务",fieldOutput:"输出",fieldProgress:"进度",fieldResult:"结果",moreLines:"…(还有 {count} 行)",copied:"已复制",stop:"停止",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"后台 Agent",dockTodos:"待办",todoProgressTitle:"当前进度",stateDone:"完成",stateFail:"失败",stateCancelled:"已取消",filterRecent:"最近",filterRunning:"进行中",filterDone:"已完成",filterAll:"全部",running:"运行中",closePanel:"关闭面板",openPanel:"在侧边栏打开",timingRunning:"运行中 · {time}",timingDone:"完成 · {time}",emptyTasks:"暂无后台任务",emptyRecent:"暂无最近任务",emptyRunning:"暂无运行中的任务",emptyDone:"暂无已完成的任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无后台 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",openDetail:"查看",toBackground:"转后台",collapse:"折叠",expand:"展开",transcriptLoadError:"无法加载这个子 Agent 的对话。",copyCommand:"复制命令",copyOutput:"复制输出",copyAll:"复制全部"},Xie={panelTitle:"思考过程",streaming:"思考中…"},eoe={aheadTitle:"领先远程",behindTitle:"落后远程",fileCountOne:"{number} 个文件",fileCountOther:"{number} 个文件",empty:"无 git 改动",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",emptyFile:"空文件",list:"列表",tree:"树形"},toe={},noe={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",moreActions:"更多操作",refresh:"刷新",htmlMode:"HTML 预览模式",markdownMode:"Markdown 预览模式",preview:"预览",source:"源码",imageFit:"图片缩放",fit:"适应",actual:"原始",pdfNoPreview:"无法内嵌预览此 PDF,可以下载后查看",imageNoPreview:"图片文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"无法预览此文件({mime} · {size}),可用其他应用打开",unknownType:"未知类型",copyCode:"复制代码",enlargeImage:"放大图片",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",notFound:"文件不存在或已被移动",tooLarge:"文件过大,暂不支持预览",loadFailed:"无法读取这个文件"}},ioe={searching:"搜索中…",noMatch:"无匹配",files:"文件",skills:"技能",openSkill:"打开技能文件",copyPath:"复制路径",attachmentUploadFailed:"上传失败——删除该附件,或重新拖入文件重试",attachmentUploadInterrupted:"上传中断——删除该附件,或重新拖入文件重试",viewFullscreen:"全屏查看",mediaPreviewLoading:"预览加载中…",mediaPreviewUploading:"上传中,完成后可预览",mediaPreviewUnavailable:"预览不可用",stateUploading:"上传中",stateUploaded:"已上传",stateUploadFailed:"上传失败"},ooe={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",agentWarningFallback:"agent 警告",unhandledEvent:"未处理的事件:{type}",agentError:{title:"模型请求失败",connection:"无法连接模型服务",auth:"模型认证失败",rateLimit:"模型请求被限流",overloaded:"模型服务过载",filtered:"响应被提供方过滤",api:"模型接口返回错误",contextOverflow:"上下文超出模型限制"},details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Kimi 服务器返回错误",daemonNetworkMessage:"Web 没有拿到 Kimi 服务器的响应。请确认它仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi 服务器",daemonTimeoutMessage:"Kimi 服务器在等待时限内没有响应。操作可能仍在后台执行,请稍后刷新确认结果,或重试。",daemonTimeoutTitle:"Kimi 服务器响应超时",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sendFailedTitle:"发送失败",sendFailedNoDefaultModelMessage:"默认模型未配置,请到设置中重新选择模型",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi 服务器仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},soe={new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},login:{desc:"在浏览器中登录 Kimi"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},tower:{desc:"切换 tower 模式;/tower 以指定 base 分支开启"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause{'|'}resume{'|'}cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},export:{desc:"将当前会话和排障日志下载为 ZIP 压缩包",noSession:"请先打开一个会话再导出。",started:"正在导出会话…",done:"会话导出完成。",tooLarge:"会话数据超过导出大小限制,可在终端用 CLI 导出:kimi export {sessionId} -o session.zip"},status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},roe={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务",swarm:"Swarm",ask_user:"提问",plan:"计划",goal_create:"启动目标",goal_get:"读取目标",goal_budget:"设置目标预算",goal_update:"更新目标",waitfor:"等待"},waitfor:{waitingAny:"等待任一后台任务",waitingTask:"等待 {id}",noTasks:"没有后台任务在运行",timedOut:"等待超时",stillRunning:"{count} 个仍在运行",moreFinished:"另有 {count} 个在等待期间完成",moreRunning:"还有 {count} 个"},swarm:{progress:"{done} / {total}",runningSub:"{count} 个进行中",doneSub:"完成 {completed} · 失败 {failed}",doneSubWithCancelled:"完成 {completed} · 失败 {failed} · 已取消 {cancelled}",phaseQueued:"排队",phaseWorking:"运行中",phaseSuspended:"暂停",phaseCompleted:"完成",phaseFailed:"失败",phaseCancelled:"已取消",waiting:"等待子任务加入…"},chip:{lines:"{count} 行",results:"{count} 结果",files:"{count} 个文件",edited:"已编辑",created:"已创建",todos:"{count} 项"},disclosure:{expand:"展开详情",collapse:"收起详情"},agent:{foreground:"前台",background:"后台",status:{running:"运行中",ok:"已完成",error:"失败",cancelled:"已取消"}},output:{waiting:"等待输出…",empty:"(无输出)",saved:"已保存的结果"},plan:{review:{pending:"待确认",approved:"已通过",rejected:"已拒绝",cancelled:"已取消"},selectedOption:"已选择",pathOnlyHint:"该计划未保存内联内容,可在侧边栏打开:",feedback:"反馈"},summary:{inScope:"{value} 在 {scope} 中"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"状态:{status}",budget:"{value} {unit}",turns:"{value} 轮",tokens:"{value} token",milliseconds:"{value} 毫秒",seconds:"{value} 秒",minutes:"{value} 分钟",hours:"{value} 小时"},group:{countOther:"执行了 {count} 次工具调用",typed:{read:{done:"读取了 {count} 个文件"},bash:{done:"运行了 {count} 条命令"},grep:{done:"搜索了 {count} 个模式"},search:{done:"网络搜索了 {count} 次"},glob:{done:"找了 {count} 次文件"},ls:{done:"列出了 {count} 个目录"},web_fetch:{done:"抓取了 {count} 个页面"},edit:{done:"编辑了 {count} 处"},write:{done:"写入了 {count} 个文件"}}},activity:{failedClause:"({count} 失败)",liveDonePrefix:"已",busy:"正在执行…",doing:{read:"正在读取 {subject}",bash:"正在运行 {subject}",grep:"正在搜索 {subject}",search:"正在搜索 {subject}",glob:"正在匹配 {subject}",ls:"正在列出 {subject}",web_fetch:"正在抓取 {subject}",edit:"正在编辑 {subject}",write:"正在写入 {subject}"}},ask:{dismissed:"已忽略",answer:"{count} 个回答",answers:"{count} 个回答",answered:"已回答",more:"(还有 {count} 个)",collected:"已收集回答",question:"{count} 个问题",questions:"{count} 个问题",freeInput:"(自由输入)",unanswered:"未作答"}},loe={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},aoe={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"设置",groupSession:"当前会话",groupApp:"应用偏好",groupAccount:"账号",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"仅自动读取,其余操作逐一向你确认",permAutoSub:"完全不打断,所有操作和判断自动完成",permYoloSub:"自动完成常规修改和命令;高危操作、提问和计划仍会问你",planModeSub:"计划模式",goalModeSub:"目标模式",swarmModeSub:"Swarm 模式",towerModeSub:"Tower 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回",viewFlat:"平铺",viewGrouped:"按工作区"},uoe={colorSchemeLabel:"外观",light:"月之亮面",dark:"月之暗面",system:"跟随系统"},coe={continue:"继续",back:"上一步",skip:"跳过",welcome:{title:"欢迎使用 Kimi Code",subtitle:"为专业开发者打造的 AI 编程工作台",languageLabel:"语言",themeLabel:"外观"},login:{title:"选择配置模型",subtitle:"选择驱动 Kimi Code 的模型服务,之后可在「设置」中更改。",kimiTitle:"登录 Kimi 账号",kimiHint:"使用 Kimi 会员权益,开箱即用",kimiCnTitle:"Kimi Code",kimiCnHint:"使用 kimi.com 账号登录",kimiOverseasTitle:"Kimi Code",kimiOverseasHint:"使用 kimi.ai 账号登录",customProviderTitle:"添加自定义供应商",customProviderHint:"使用自己的 API Key,接入 OpenAI 兼容等模型服务",loggedInTitle:"已登录 Kimi 账号",loggedInHint:"模型服务已就绪,可以开始使用",finish:"完成",skip:"跳过,稍后再说"}},doe={title:"设置",internalTest:"内部测试",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",providers:"供应商",advanced:"高级",archived:"已归档",shortcuts:"快捷键",plugins:"插件",lab:"实验室"},lab:{sidebarTabs:"多标签页侧边栏",sidebarTabsHint:"侧边栏显示「进行中 / 已完成 / 工作空间」三个标签页"},plugins:{retry:"重试",builtIn:"内置",official:"官方",thirdParty:"第三方",installed:"已安装",install:"安装",update:"更新",remove:"移除",enabled:"启用",homepage:"主页",empty:"没有找到插件",hasErrors:"错误",customInstall:"安装自定义插件",customInstallPlaceholder:"https://… 或 /本地/目录",customInstallHint:"支持 https zip 链接、GitHub 仓库地址或本地目录路径。",extensionHintTitle:"还差一步:安装浏览器扩展",extensionGuide:"手动安装",dismissHint:"知道了",catalogUnavailable:"插件市场目录暂时不可达;已安装的插件仍可正常管理。",source:{"local-path":"本地","zip-url":"ZIP",github:"GitHub"},counts:{skill:"{n} 个技能",mcp:"{n} 个 MCP 服务",mcpEnabled:"启用 {n} 个",hook:"{n} 个钩子",command:"{n} 个命令"}},appearance:"外观",notifications:"通知",notifyEnabled:"系统通知",notifyEnabledHint:"回合完成、待回答或待审批时发送系统通知",notifySound:"通知提示音",notifySoundHint:"系统通知随附提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Kimi Code · 回合完成",notifyQuestionTitle:"Kimi Code · 待回答",notifyApprovalTitle:"Kimi Code · 等待审批",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",notifyApprovalFallback:"有工具等待你审批",account:"账户",signedIn:"已登录",signedOutHint:"登录后可查看账户和模型权益",planUsage:{title:"套餐用量",retry:"重试",loadFailed:"加载失败",empty:"暂无用量数据",weekLimit:"每周限额",genericLimit:"限额",hourLimit:"{n} 小时限额",dayLimit:"{n} 天限额",minuteLimit:"{n} 分钟限额",resetsIn:"{duration}后重置",resetDone:"已重置",durationDay:"{n} 天",durationHour:"{n} 小时",durationMinute:"{n} 分钟",durationSecond:"{n} 秒",usedPct:"已使用 {pct}%",boosterTitle:"加油包",boosterBalance:"余额",monthlyUsed:"本月已用",monthlyLimit:"每月上限",unlimited:"不限",freeTitle:"免费账户",freeHint:"升级会员后即可使用 Kimi 模型并查看套餐用量"},colorSchemeHint:"选择应用的明暗外观",appIcon:"程序坞图标",appIconHint:"选择程序坞中显示的图标",appIconDefault:"默认",appIconBlack:"黑色",uiFontSize:"字体大小",uiFontSizeHint:"调整界面和消息文字大小",vibrancy:"毛玻璃侧栏",vibrancyHint:"在侧栏使用 macOS 原生毛玻璃材质——如果半透明影响阅读可以关闭",languageHint:"选择界面显示语言",defaultOpenInApp:"默认打开应用",defaultOpenInAppHint:"从顶栏菜单打开文件和文件夹时默认使用的应用",openWith:"打开方式",agentDefaults:"Agent 默认值",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启思考",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入计划模式",secondaryModelSection:"子智能体",secondaryModel:"子智能体模型",secondaryModelHint:"子智能体默认使用的模型与思考强度",secondaryModelEffort:"思考强度",noSecondaryModel:"未设置(跟随主模型)",secondaryModelEffortAuto:"模型默认",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",versionAndUpdates:"版本与更新",appVersion:"应用版本",appVersionHint:"当前应用的版本号和构建时间",checkUpdate:"检查更新",checkUpdateHint:"手动检查是否有新版本",checkUpdateBtn:"立即检查",updateChecking:"检查中…",updateCheckLatest:"已是最新版本",updateCheckAvailable:"发现新版本 {version},可从侧边栏的更新入口下载",updateCheckUnsupported:"当前构建不支持检查更新",updateCheckFailed:"检查失败,请稍后重试",updateCheckAvailableAuto:"发现新版本 {version},正在后台下载",updateCheckDownloaded:"新版本 {version} 已就绪,可从侧边栏的更新入口重启安装",autoDownloadUpdate:"自动下载更新",autoDownloadUpdateHint:"发现新版本时在后台自动下载,重启后完成安装",canaryUpdate:"更新 Canary",canaryGhMissing:"未检测到 GitHub CLI,请先安装(brew install gh)并登录",canaryGhUnauthenticated:"GitHub CLI 未登录,请先在终端运行 gh auth login",canaryTrigger:"重新打包 Canary",canaryTriggerHint:"触发 macOS arm64 构建流水线,产出新的 Canary 内测版",canaryTriggerBtn:"重新打包 Canary",canaryTriggerConfirm:"再点一次确认触发",canaryTriggerDone:"已触发,构建约需 20–30 分钟",canaryTriggerFailed:"触发失败:{error}",canaryViewWorkflow:"查看流水线",canaryImportStable:"从正式版导入界面设置…",canaryImportStableTitle:"从正式版导入界面设置",canaryImportStableHint:"把正式版的界面设置(置顶、外观等 localStorage 偏好)复制到 Canary 并覆盖当前设置(原设置自动备份为 leveldb.bak)。确认后 Canary 会重启完成导入;正式版需保持退出状态。",canaryImportStableBtn:"导入并重启",canaryImportStableRunning:"正式版(Kimi Code)正在运行——请先退出它,再重新导入。",canaryImportStableNoData:"没有找到正式版的界面设置数据。",canaryImportStableFailed:"导入失败:{error}",privacy:"数据与隐私",diagnostics:"诊断",messageFolding:"消息折叠",turnFolding:"消息自动折叠",turnFoldingHint:"回合结束时自动折叠工作过程,仅展示总结",activityRunFolding:"工具调用汇总",activityRunFoldingHint:"回答过程中,连续的工具调用自动汇总为一行摘要",build:"构建",serverVersion:"服务端版本",serverAddress:"服务器地址",serverAddressHint:"当前连接的服务器地址",serverVersionHint:"当前连接服务的版本",copyServerVersion:"复制服务端版本",copyServerAddress:"复制服务器地址",copied:"已复制",exportLog:"故障排查日志",exportLogHint:"导出已采集的故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",archivedTitle:"已归档会话",archivedDesc:"查看已归档会话,确认其所属工作区路径、会话名称和归档时间,并可恢复到会话列表。",archivedSearch:"搜索已归档会话",archivedAllWorkspaces:"所有工作区",archivedSortLabel:"排序方式",archivedSortArchived:"归档时间",archivedSortCreated:"创建时间",archivedSortName:"按字母顺序",archivedRestore:"恢复",archivedEmpty:"还没有归档的会话",archivedNoMatch:"没有匹配的已归档会话",archivedSessionsCount:"{count} 个会话",archivedAt:"归档于 {time}",archivedLoadMore:"加载更多",archivedLoading:"加载中…",archivedLoadingAll:"正在加载全部归档会话…"},foe={openInEditor:"在编辑器中打开",openInEditorShort:"打开",openInApp:"用 {app} 打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",lastUsed:"上次使用",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",prStatusOpen:"已打开",prStatusClosed:"已关闭",prStatusMerged:"已合并",prStatusDraft:"草稿",prStatusUnknown:"未知",options:"选项",copySessionId:"复制 Session ID",pinSession:"置顶",unpinSession:"取消置顶",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",markSessionDone:"标记为完成",reopenSession:"恢复进行中",exportSession:"导出会话",devBadge:"开发环境运行中"},hoe={title:"侧边聊天",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},poe={comment:"评论",addToChat:"添加到对话",commentPlaceholder:"写一句评论…",confirm:"确定",copyQuote:"复制引用",copyComment:"复制评论",quoteLabel:"引用"},moe={actions:{summonApp:{label:"显示应用窗口",desc:"从任意位置将应用窗口唤起到前台"},newSession:{label:"新建会话",desc:"在当前工作区开始一个新会话"},searchSessions:{label:"搜索会话",desc:"打开会话搜索弹窗"},archiveSession:{label:"完成任务",desc:"立即完成当前会话(可在已完成列表找回)"},toggleSideChat:{label:"侧边聊天",desc:"打开或关闭 /btw 侧边聊天"},toggleSidebar:{label:"展开/收起侧边栏",desc:"收起或展开会话侧边栏"},openFolder:{label:"打开文件夹",desc:"通过系统原生选择器添加工作目录"},openInDefaultApp:{label:"在默认应用中打开",desc:"在默认编辑器或终端中打开当前工作目录"},openSettings:{label:"打开设置",desc:"显示或隐藏设置窗口"},toggleTerminal:{label:"切换终端",desc:"显示或隐藏底部终端面板"},openDiffTab:{label:"打开改动",desc:"打开或激活工作区改动标签页"},sidebarTabOpen:{label:"进行中标签页",desc:"切换到侧栏的进行中列表"},sidebarTabDone:{label:"已完成标签页",desc:"切换到侧栏的已完成列表"},sidebarTabWorkspaces:{label:"工作空间标签页",desc:"切换到侧栏的工作空间目录"},selectPrevSibling:{label:"上一条",desc:"在当前标签页中选中上一条会话 / 上一个工作空间"},selectNextSibling:{label:"下一条",desc:"在当前标签页中选中下一条会话 / 下一个工作空间"},send:{label:"发送消息",desc:"发送输入框中的内容"},newline:{label:"换行",desc:"在输入框中插入换行"}},searchPlaceholder:"搜索快捷键",unassigned:"未分配",unassign:"取消分配",edit:"编辑快捷键",reset:"恢复默认",resetAll:"全部恢复默认",recording:"按下新的快捷键…",invalid:"该按键组合不能用作快捷键",notGlobal:"该按键组合无法注册为系统级快捷键",globalTaken:"该快捷键已被系统或其他应用占用",reserved:"系统菜单已占用该快捷键",reservedSteer:"steer 固定快捷键(Ctrl/Cmd+S),不可占用",reservedFind:"对话搜索固定快捷键(Ctrl/Cmd+F),不可占用",conflict:"已被「{action}」占用",customBadge:"自定义"},goe={panelAria:"终端",toolbarAria:"终端标签页",resizeAria:"调整终端面板高度",toggle:"切换终端",open:"打开终端",close:"关闭终端",newTab:"新建终端",closeTab:"关闭终端",restartTab:"重启终端",collapse:"收起终端面板",empty:"还没有终端,点击新建一个",processExited:"[进程已退出]",processExitedWithCode:"[进程已退出,退出码 {code}]"},voe={tabs:{diff:"改动",file:"文件",turnDiff:"本轮改动",compaction:"压缩摘要",agent:"子 Agent",term:"终端"},newTab:"新建标签页",closeTab:"关闭标签页",expand:"展开面板",collapse:"恢复面板",hide:"关闭右侧面板",openPanel:"打开右侧面板",launcherAria:"快速打开"},yoe={title:"PR 预览",intro:"在隔离 worktree 中构建本仓库某个 PR 或分支的代码,构建完成后在独立窗口中打开它的界面。首次构建可能需要几分钟。",prLabel:"预览目标",customRefPlaceholder:"PR 编号、分支名、tag 或 commit sha",invalidRef:"请输入有效的分支名、tag 或 commit sha",start:"开始预览",cleanup:"清理预览缓存",cleanupConfirm:"删除除当前预览外的全部预览缓存?下次预览时会按需重新构建。",cleanupDone:"已清理 {count} 个预览缓存",fetching:"正在拉取 {pr} 的代码…",installing:"正在安装依赖…",building:"正在构建渲染产物…",activeText:"正在预览 {pr}",stop:"退出预览",rebuild:"重新拉取构建",errorTitle:"预览失败",retry:"重试",stageFetch:"拉取代码",stageInstall:"安装依赖",stageBuild:"构建渲染产物",stageFailed:"{stage}失败",stageHung:"{stage}时卡住超过 5 分钟,已终止(请检查网络/代理)"},koe={title:"需要服务器 token",hint:"此服务器已开启访问保护。输入服务器启动时打印的 bearer token(或通过 {env} 设置的密码)。",tokenPlaceholder:"Token",connect:"连接",connecting:"连接中…"},boe={common:Bie,app:$ie,sidebar:zie,admin:jie,workspace:Hie,conversation:Wie,status:qie,composer:Uie,login:Vie,providers:Kie,model:Zie,sessions:Gie,approval:Qie,question:Yie,tasks:Jie,thinking:Xie,diff:eoe,fileTree:toe,filePreview:noe,mention:ioe,warnings:ooe,commands:soe,tools:roe,layout:loe,mobile:aoe,theme:uoe,onboarding:coe,settings:doe,header:foe,sideChat:hoe,selection:poe,shortcuts:moe,terminal:goe,panel:voe,prPreview:yoe,serverAuth:koe},woe={en:Pie,zh:boe},Coe="kimi-locale";function kz(){let e=null;try{e=globalThis.localStorage?.getItem(Coe)??null}catch{e=null}return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}function Aoe(e){const t=e.locale??kz();return Une({legacy:!1,locale:t,fallbackLocale:"en",messages:woe})}const bz=Symbol("KimiI18n"),xoe={t:e=>e};function Vm(){const e=en(bz,null);if(e)return e;try{const t=qt();return{t:(n,i)=>t.t(n,i),locale:t.locale.value}}catch{return xoe}}const AC=q(0),Ok=D(()=>AC.value>0),xC=new Set;function wz(e){xC.add(e),AC.value+=1;let t=!1;return()=>{t||(t=!0,xC.delete(e)&&(AC.value-=1))}}function uT(e){if(!e)return!1;for(const t of xC)if(t===e||t.contains(e))return!0;return!1}function Soe(e){return typeof e=="object"&&e!==null&&typeof e.contains=="function"}function nm(e,t){let n;ze([e,t],([i,o])=>{n?.(),n=void 0,i&&Soe(o)&&(n=wz(o))},{flush:"post",immediate:!0}),cd(()=>{n?.(),n=void 0})}let SC=-1,_C=-1,my=-1,w3=-1,Cz=!1,cT=!1;function _oe(e){const t=my>=0;SC=my,_C=w3,my=e.clientX,w3=e.clientY,t&&(my!==SC||w3!==_C)&&(Cz=!0)}function Az(){cT||typeof document>"u"||(cT=!0,document.addEventListener("pointermove",_oe,{capture:!0,passive:!0}))}function IC(e){return Cz?e.clientX===SC&&e.clientY===_C:!0}const Id=6,Md=8,Ioe=150,Moe=ot({__name:"TooltipBubble",props:{target:{default:null},delegate:{default:null},text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=q(),i=q(!1),o=q(!1),s=q({maxWidth:`${t.maxWidth}px`});let r,l=null,a,u=!1;function c(){if(t.target)return t.target;const A=t.delegate;return A?A.firstElementChild??A:null}function d(A){const T=n.value;if(!T)return;const I=A.getBoundingClientRect(),O=T.offsetWidth,H=T.offsetHeight,R=window.innerWidth,F=window.innerHeight;let P=t.placement;P==="top"&&I.top-Id-HF-Md?P="top":P==="left"&&I.left-Id-OR-Md&&(P="left");let z=0,W=0;P==="top"?(z=I.top-Id-H,W=I.left+I.width/2-O/2):P==="bottom"?(z=I.bottom+Id,W=I.left+I.width/2-O/2):P==="left"?(z=I.top+I.height/2-H/2,W=I.left-Id-O):(z=I.top+I.height/2-H/2,W=I.right+Id),W=Math.min(Math.max(W,Md),R-Md-O),z=Math.min(Math.max(z,Md),F-Md-H),s.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(z)}px`,left:`${Math.round(W)}px`}}function f(){return Ok.value&&!uT(c())}function h(){if(!t.text||f())return;const A=c();A&&(window.clearTimeout(r),r=window.setTimeout(()=>{i.value=!0,o.value=!1,ft(()=>{d(A),o.value=!0})},Ioe))}function m(){window.clearTimeout(r),u=!1,i.value=!1,o.value=!1}function g(A){u||IC(A)||(u=!0,h())}function y(){h()}function k(){m()}function v(A){return A instanceof Element?A.closest(".ui-tip"):null}function C(A){const T=t.delegate;if(T){if(v(A.target)!==T){m();return}u||IC(A)||(u=!0,h())}}function w(A){const T=t.delegate;if(!T)return;const I=A.relatedTarget;I instanceof Element&&T.contains(I)||m()}function M(A){v(A.target)===t.delegate&&h()}function L(){m()}function E(){l&&(t.delegate?(l.removeEventListener("pointermove",C),l.removeEventListener("mouseout",w),l.removeEventListener("focusin",M),l.removeEventListener("focusout",L)):(l.removeEventListener("pointermove",g),l.removeEventListener("mouseleave",k),l.removeEventListener("focusin",y),l.removeEventListener("focusout",k)),l=null)}function S(){E(),a?.disconnect(),a=void 0;const A=t.target??t.delegate;A&&(l=A,t.delegate?(A.addEventListener("pointermove",C,{passive:!0}),A.addEventListener("mouseout",w),A.addEventListener("focusin",M),A.addEventListener("focusout",L),a=new MutationObserver(()=>{i.value&&m()}),a.observe(A,{childList:!0})):(A.addEventListener("pointermove",g,{passive:!0}),A.addEventListener("mouseleave",k),A.addEventListener("focusin",y),A.addEventListener("focusout",k)))}ze(()=>[t.target,t.delegate],()=>{m(),S()}),ze(Ok,A=>{A&&!uT(c())&&m()});function x(){i.value&&m()}return gn(()=>{Az(),S(),window.addEventListener("scroll",x,!0),window.addEventListener("resize",x)}),ii(()=>{window.clearTimeout(r),a?.disconnect(),E(),window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}),(A,T)=>i.value?(b(),fe(Rs,{key:0,to:"body"},[_("div",{ref_key:"bubble",ref:n,class:De(["ui-tip__bubble",{positioned:o.value}]),style:on([s.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},B(e.text),7)])):X("",!0)}}),xz=St(Moe,[["__scopeId","data-v-da3fc01a"]]),Toe=["type","disabled","aria-label"],Eoe=ot({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},tooltip:{},type:{default:"button"}},setup(e,{expose:t}){const n=q();return t({el:n}),(i,o)=>(b(),N("button",{ref_key:"el",ref:n,class:De(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[Hn(i.$slots,"default",{},void 0,!0),e.tooltip?(b(),fe(xz,{key:0,target:n.value??null,text:e.tooltip},null,8,["target","text"])):X("",!0)],10,Toe))}}),tn=St(Eoe,[["__scopeId","data-v-279bf6ac"]]),Loe={class:"ui-action-toast-host"},Noe={class:"ui-action-toast__body"},Foe=ot({__name:"ActionToast",props:{duration:{default:8e3},dismissLabel:{},dismissToken:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Vm();let s=null,r=0,l=0;function a(d){s=setTimeout(()=>i("dismiss",n.dismissToken),d),r=Date.now()+d}function u(){s!==null&&(clearTimeout(s),s=null,l=Math.max(0,r-Date.now()))}function c(){s===null&&a(l)}return a(n.duration),Tn(()=>{s!==null&&clearTimeout(s)}),(d,f)=>(b(),N("div",Loe,[_("div",{class:"ui-action-toast",role:"status",onPointerenter:u,onPointerleave:c},[_("span",Noe,[Hn(d.$slots,"default")]),V(tn,{class:"ui-action-toast__close",size:"sm",label:e.dismissLabel??p(o)("common.dismiss"),tooltip:e.dismissLabel??p(o)("common.dismiss"),onClick:f[0]||(f[0]=h=>i("dismiss",e.dismissToken))},{default:de(()=>[V(xe,{name:"close",size:"sm"})]),_:1},8,["label","tooltip"])],32)]))}}),Doe=St(Foe,[["__scopeId","data-v-5464eaec"]]),Roe={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},Ooe={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},Poe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},ef=ot({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(b(),N("svg",Roe,[...n[0]||(n[0]=[_("circle",{cx:"18",cy:"18",r:"15"},null,-1),_("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(b(),N("svg",Ooe,[...n[1]||(n[1]=[_("circle",{cx:"14",cy:"14",r:"12"},null,-1),_("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),_("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(b(),N("svg",Poe,[...n[2]||(n[2]=[_("path",{d:"M14 3 L26 24 H2 Z"},null,-1),_("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),_("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),Boe={key:0,class:"ui-badge__dot","aria-hidden":"true"},$oe=ot({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(b(),N("span",{class:De(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(b(),N("span",Boe)):X("",!0),Hn(t.$slots,"default",{},void 0,!0)],2))}}),_l=St($oe,[["__scopeId","data-v-7b8349ab"]]),zoe={class:"ui-banner__icon","aria-hidden":"true"},joe={class:"ui-banner__text"},Hoe=ot({__name:"Banner",props:{variant:{default:"info"}},setup(e){return(t,n)=>(b(),N("div",{class:De(["ui-banner",`ui-banner--${e.variant}`]),role:"status"},[_("span",zoe,[Hn(t.$slots,"icon",{},()=>[e.variant==="info"?(b(),fe(xe,{key:0,name:"info",size:"md"})):(b(),fe(xe,{key:1,name:"alert-triangle",size:"md"}))],!0)]),_("span",joe,[Hn(t.$slots,"default",{},void 0,!0)])],2))}}),Eh=St(Hoe,[["__scopeId","data-v-8fb5232f"]]),Woe=["aria-label"],qoe=ot({__name:"Spinner",props:{size:{default:"md"},label:{}},setup(e){const{t}=Vm(),n=q(null);let i,o;function s(){const r=n.value;if(r){if(o?.matches){i?.cancel(),i=void 0;return}i||(i=r.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:850,iterations:1/0}),i.startTime=0)}}return gn(()=>{const r=n.value;!r||typeof r.animate!="function"||(o=window.matchMedia("(prefers-reduced-motion: reduce)"),o.addEventListener("change",s),s())}),ii(()=>{o?.removeEventListener("change",s),o=void 0,i?.cancel(),i=void 0}),(r,l)=>(b(),N("span",{ref_key:"boxRef",ref:n,class:De(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label??p(t)("common.loading")},[...l[0]||(l[0]=[_("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[_("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),_("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,Woe))}}),zi=St(qoe,[["__scopeId","data-v-bf7852f3"]]),Uoe=["type","disabled"],Voe={class:"ui-button__content"},Koe=ot({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(b(),N("button",{class:De(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(b(),fe(zi,{key:0,size:"sm",class:"ui-button__spinner"})):X("",!0),_("span",Voe,[Hn(t.$slots,"default",{},void 0,!0)])],10,Uoe))}}),Jt=St(Koe,[["__scopeId","data-v-e04dd6a0"]]),Zoe={key:0,class:"ui-card__head"},Goe={class:"ui-card__body"},Qoe={key:1,class:"ui-card__foot"},Yoe=ot({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(b(),N("div",{class:De(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(b(),N("div",Zoe,[Hn(t.$slots,"head",{},void 0,!0)])):X("",!0),_("div",Goe,[Hn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(b(),N("div",Qoe,[Hn(t.$slots,"foot",{},void 0,!0)])):X("",!0)],2))}}),Joe=St(Yoe,[["__scopeId","data-v-d0de153b"]]),Xoe={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},ese=["stroke-dasharray","stroke-dashoffset"],C3=7,tse=ot({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*C3;return(i,o)=>(b(),N("svg",Xoe,[_("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:C3,fill:"none","stroke-width":"2.5"}),_("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:C3,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,ese)]))}}),nse=St(tse,[["__scopeId","data-v-5a6777b1"]]),lr=q(0),A1=q(0),ise=["aria-label"],ose={key:0,class:"ui-dialog__head"},sse={class:"ui-dialog__titles"},rse={key:0,class:"ui-dialog__title"},lse={key:1,class:"ui-dialog__desc"},ase={class:"ui-dialog__body"},use={key:1,class:"ui-dialog__foot"},cse='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',dse=ot({__name:"Dialog",props:{open:{type:Boolean},title:{},ariaLabel:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0},hideClose:{type:Boolean},level:{default:"raised"},initialFocus:{},focusOnOpen:{type:Boolean,default:!0}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Vm(),s=q(null);let r=null;function l(){i("update:open",!1),i("close")}function a(){return s.value?Array.from(s.value.querySelectorAll(cse)):[]}function u(){const{initialFocus:f}=n;return f?typeof f=="function"?f()??null:typeof f=="string"?s.value?.querySelector(f)??null:s.value?.contains(f)?f:null:null}function c(f){if(!n.open)return;if(f.key==="Escape"&&n.closeOnEsc){f.preventDefault(),l();return}if(f.key!=="Tab")return;const h=a(),m=h[0],g=h[h.length-1];if(!m||!g){f.preventDefault(),s.value?.focus();return}const y=document.activeElement;f.shiftKey&&y===m?(f.preventDefault(),g.focus()):!f.shiftKey&&y===g&&(f.preventDefault(),m.focus())}function d(f){n.closeOnOverlay&&f.target===f.currentTarget&&l()}return ze(()=>n.open,async f=>{if(f){if(lr.value+=1,r=document.activeElement,n.focusOnOpen){await ft();const h=u(),m=a();(h??m[0]??s.value)?.focus()}}else lr.value=Math.max(0,lr.value-1),r instanceof HTMLElement&&(r.focus(),r=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),ii(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(lr.value=Math.max(0,lr.value-1),r instanceof HTMLElement&&r.focus())}),(f,h)=>(b(),fe(Rs,{to:"body"},[e.open?(b(),N("div",{key:0,class:"ui-dialog__overlay",onMousedown:d},[_("div",{ref_key:"panel",ref:s,class:De(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed","ui-dialog--grouped":e.level==="grouped"}]]),role:"dialog","aria-modal":"true","aria-label":e.ariaLabel??e.title,tabindex:"-1"},[e.title||f.$slots.head?(b(),N("div",ose,[Hn(f.$slots,"head",{},()=>[_("div",sse,[e.title?(b(),N("div",rse,B(e.title),1)):X("",!0),e.description?(b(),N("div",lse,B(e.description),1)):X("",!0)])],!0),e.hideClose?X("",!0):(b(),fe(tn,{key:0,class:"ui-dialog__close",size:"sm",label:p(o)("common.close"),tooltip:p(o)("common.close"),onClick:l},{default:de(()=>[V(xe,{name:"close",size:"md"})]),_:1},8,["label","tooltip"]))])):X("",!0),_("div",ase,[Hn(f.$slots,"default",{},void 0,!0)]),f.$slots.foot?(b(),N("div",use,[Hn(f.$slots,"foot",{},void 0,!0)])):X("",!0)],10,ise)],32)):X("",!0)]))}}),jf=St(dse,[["__scopeId","data-v-87c1966f"]]),fse={class:"ui-empty"},hse={key:0,class:"ui-empty__icon","aria-hidden":"true"},pse={key:1,class:"ui-empty__title"},mse={key:2,class:"ui-empty__hint"},gse=ot({__name:"EmptyState",props:{title:{},hint:{}},setup(e){return(t,n)=>(b(),N("div",fse,[t.$slots.icon?(b(),N("span",hse,[Hn(t.$slots,"icon",{},void 0,!0)])):X("",!0),e.title?(b(),N("div",pse,B(e.title),1)):X("",!0),e.hint?(b(),N("div",mse,B(e.hint),1)):X("",!0),Hn(t.$slots,"default",{},void 0,!0)]))}}),Sz=St(gse,[["__scopeId","data-v-66c019cd"]]),vse={key:0,class:"ui-field__label"},yse={key:1,class:"ui-field__error"},kse={key:2,class:"ui-field__hint"},bse=ot({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(b(),N("div",{class:De(["ui-field",{"has-error":!!e.error}])},[e.label?(b(),N("label",vse,B(e.label),1)):X("",!0),Hn(t.$slots,"default",{},void 0,!0),e.error?(b(),N("span",yse,B(e.error),1)):e.hint?(b(),N("span",kse,B(e.hint),1)):X("",!0)],2))}}),wse=St(bse,[["__scopeId","data-v-a6fe84a4"]]),Cse=["type","value","placeholder","disabled","readonly"],Ase=ot({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const i=n,o=q();function s(a){i("update:modelValue",a.target.value)}function r(){o.value?.focus()}function l(){o.value?.select()}return t({focus:r,select:l,el:o}),(a,u)=>(b(),N("input",{ref_key:"el",ref:o,class:De(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:s,onFocus:u[0]||(u[0]=c=>a.$emit("focus",c)),onBlur:u[1]||(u[1]=c=>a.$emit("blur",c))},null,42,Cse))}}),Es=St(Ase,[["__scopeId","data-v-3093c190"]]),xse={class:"ui-kbd"},Sse=ot({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(b(),N("span",xse,[(b(!0),N(Le,null,Ct(e.keys,i=>(b(),N("kbd",{key:i,class:"ui-kbd__key"},B(i),1))),128))]))}}),Xc=St(Sse,[["__scopeId","data-v-f33c235d"]]),_se=["href","target","rel"],Ise=ot({__name:"Link",props:{href:{},variant:{default:"default"},external:{type:Boolean}},setup(e){return(t,n)=>e.href?(b(),N("a",{key:0,class:De(["ui-link",`ui-link--${e.variant}`]),href:e.href,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0},[Hn(t.$slots,"default",{},void 0,!0)],10,_se)):(b(),N("span",{key:1,class:De(["ui-link",`ui-link--${e.variant}`])},[Hn(t.$slots,"default",{},void 0,!0)],2))}}),Mse=St(Ise,[["__scopeId","data-v-2c379b58"]]),Tse=["role"],Ese=ot({__name:"Menu",props:{role:{default:"menu"}},setup(e,{expose:t}){const n=q();t({el:n});let i;return gn(()=>{n.value&&(i=wz(n.value))}),ii(()=>i?.()),(o,s)=>(b(),N("div",{ref_key:"el",ref:n,class:"ui-menu",role:e.role},[Hn(o.$slots,"default",{},void 0,!0)],8,Tse))}}),Uo=St(Ese,[["__scopeId","data-v-a8172c5d"]]),Lse={key:0,class:"ui-menu-sep",role:"separator"},Nse=["role","disabled"],Fse=ot({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"},role:{default:"menuitem"}},emits:["click"],setup(e){return(t,n)=>e.separator?(b(),N("div",Lse)):(b(),N("button",{key:1,class:De(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:e.role,disabled:e.disabled,onClick:n[0]||(n[0]=i=>t.$emit("click",i))},[Hn(t.$slots,"default",{},void 0,!0)],10,Nse))}}),Qt=St(Fse,[["__scopeId","data-v-6cbd2f47"]]),Dse=ot({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=q();return(n,i)=>(b(),N(Le,null,[_("span",{ref_key:"trigger",ref:t,class:"ui-tip"},[Hn(n.$slots,"default",{},void 0,!0)],512),V(xz,{delegate:t.value??null,text:e.text,placement:e.placement,"max-width":e.maxWidth,"max-lines":e.maxLines},null,8,["delegate","text","placement","max-width","max-lines"])],64))}}),Ln=St(Dse,[["__scopeId","data-v-4f57efde"]]),Rse={class:"ui-panel-header__title"},Ose={key:0,class:"ui-panel-header__sub"},Pse=ot({__name:"PanelHeader",props:{title:{},titleTooltip:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{},closeIcon:{default:"close"},wrap:{type:Boolean}},emits:["close"],setup(e){const{t}=Vm();return(n,i)=>(b(),N("div",{class:De(["ui-panel-header",{wrap:e.wrap}])},[Hn(n.$slots,"leading",{},void 0,!0),e.title?(b(),fe(Ln,{key:0,text:e.titleTooltip??e.title},{default:de(()=>[_("span",Rse,B(e.title),1)]),_:1},8,["text"])):X("",!0),V(Ln,{text:e.subtitle},{default:de(()=>[e.subtitle?(b(),N("span",Ose,B(e.subtitle),1)):X("",!0)]),_:1},8,["text"]),Hn(n.$slots,"default",{},void 0,!0),e.closable?(b(),fe(tn,{key:1,class:"ui-panel-header__close",size:"sm",label:e.closeLabel??p(t)("common.close"),tooltip:e.closeLabel??p(t)("common.close"),onClick:i[0]||(i[0]=o=>n.$emit("close"))},{default:de(()=>[V(xe,{name:e.closeIcon,size:"sm"},null,8,["name"])]),_:1},8,["label","tooltip"])):X("",!0)],2))}}),Pk=St(Pse,[["__scopeId","data-v-bb2b5e64"]]),Bse=["disabled","aria-pressed"],$se=ot({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(b(),N("button",{key:0,class:De(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=i=>t.$emit("click",i))},[Hn(t.$slots,"default",{},void 0,!0)],10,Bse)):(b(),N("span",{key:1,class:De(["ui-pill",{"is-active":e.active}])},[Hn(t.$slots,"default",{},void 0,!0)],2))}}),_z=St($se,[["__scopeId","data-v-9fe3e0c7"]]),zse=ot({__name:"ScrollArea",props:{orientation:{default:"vertical"},hideDelay:{default:600}},setup(e,{expose:t}){const n=e,i=q(null),o=q(null),s=q(!1),r=q({overflow:!1,size:0,offset:0}),l=q({overflow:!1,size:0,offset:0}),a=q(null);let u=null,c=null,d=null;const f=D(()=>({overflowX:n.orientation==="vertical"?"hidden":"auto",overflowY:n.orientation==="horizontal"?"hidden":"auto"})),h=D(()=>({height:`${r.value.size}px`,transform:`translateY(${r.value.offset}px)`})),m=D(()=>({width:`${l.value.size}px`,transform:`translateX(${l.value.offset}px)`}));function g(x,A,T){if(!(A>x+1)||x<=0)return{overflow:!1,size:0,offset:0};const O=Math.max(0,x-4),H=Math.min(O,Math.max(24,O*x/A)),R=Math.max(0,O-H),F=Math.max(1,A-x);return{overflow:!0,size:H,offset:R*T/F}}function y(){const x=o.value;if(!x)return;const A=g(x.clientHeight,x.scrollHeight,x.scrollTop),T=g(x.clientWidth,x.scrollWidth,x.scrollLeft);(A.overflow!==r.value.overflow||A.size!==r.value.size||A.offset!==r.value.offset)&&(r.value=A),(T.overflow!==l.value.overflow||T.size!==l.value.size||T.offset!==l.value.offset)&&(l.value=T)}function k(){u!==null&&clearTimeout(u),u=null}function v(){k(),s.value=!0}function C(){k(),!(a.value||i.value?.matches(":hover, :focus-within"))&&(u=setTimeout(()=>{s.value=!1,u=null},n.hideDelay))}function w(){y(),v(),C()}function M(x,A){const T=o.value;T&&(A.preventDefault(),v(),a.value={axis:x,pointerId:A.pointerId,startPointer:x==="vertical"?A.clientY:A.clientX,startScroll:x==="vertical"?T.scrollTop:T.scrollLeft},A.currentTarget.setPointerCapture(A.pointerId))}function L(x){const A=a.value,T=o.value;if(!A||A.pointerId!==x.pointerId||!T)return;const I=A.axis==="vertical"?x.clientY:x.clientX,O=A.axis==="vertical"?T.clientHeight:T.clientWidth,H=A.axis==="vertical"?T.scrollHeight:T.scrollWidth,R=A.axis==="vertical"?r.value.size:l.value.size,F=Math.max(1,O-4-R),P=(I-A.startPointer)*(H-O)/F;A.axis==="vertical"?T.scrollTop=A.startScroll+P:T.scrollLeft=A.startScroll+P}function E(x){!a.value||a.value.pointerId!==x.pointerId||(a.value=null,C())}function S(){const x=o.value;if(!(!x||!c))for(const A of x.children)c.observe(A)}return gn(async()=>{await ft();const x=o.value;x&&(c=new ResizeObserver(y),c.observe(x),S(),d=new MutationObserver(()=>{S(),y()}),d.observe(x,{childList:!0,subtree:!0,characterData:!0}),y())}),ii(()=>{k(),c?.disconnect(),d?.disconnect()}),t({viewport:o,updateMetrics:y}),(x,A)=>(b(),N("div",{ref_key:"root",ref:i,class:"ui-scroll-area",onPointerenter:v,onPointerleave:C,onFocusin:v,onFocusout:C},[_("div",{ref_key:"viewport",ref:o,class:"ui-scroll-area__viewport",style:on(f.value),tabindex:"0",onScroll:w},[Hn(x.$slots,"default",{},void 0,!0)],36),r.value.overflow&&n.orientation!=="horizontal"?(b(),N("div",{key:0,class:De(["ui-scroll-area__bar ui-scroll-area__bar--vertical",{"is-visible":s.value}]),"aria-hidden":"true"},[_("span",{class:"ui-scroll-area__thumb",style:on(h.value),onPointerdown:A[0]||(A[0]=T=>M("vertical",T)),onPointermove:L,onPointerup:E,onPointercancel:E},null,36)],2)):X("",!0),l.value.overflow&&n.orientation!=="vertical"?(b(),N("div",{key:1,class:De(["ui-scroll-area__bar ui-scroll-area__bar--horizontal",{"is-visible":s.value}]),"aria-hidden":"true"},[_("span",{class:"ui-scroll-area__thumb",style:on(m.value),onPointerdown:A[1]||(A[1]=T=>M("horizontal",T)),onPointermove:L,onPointerup:E,onPointercancel:E},null,36)],2)):X("",!0)],544))}}),dT=St(zse,[["__scopeId","data-v-797269ad"]]),jse=["data-icon","aria-selected","onClick"],Hse=ot({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=t,o=q(null),s=q([]),r=q(!1),l=q({});let a=null;function u(d,f){d instanceof HTMLElement&&(s.value[f]=d)}async function c(){await ft();const d=n.options.findIndex(h=>h.value===n.modelValue),f=s.value[d];f&&(l.value={width:`${f.offsetWidth}px`,height:`${f.offsetHeight}px`,transform:`translate(${f.offsetLeft}px, ${f.offsetTop}px)`},r.value=!0)}return ze(()=>[n.modelValue,n.options.length],c,{immediate:!0}),gn(()=>{a=new ResizeObserver(()=>c()),o.value&&a.observe(o.value);for(const d of s.value)a.observe(d);c()}),ii(()=>a?.disconnect()),(d,f)=>(b(),N("div",{ref_key:"root",ref:o,class:De(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[_("span",{class:De(["ui-seg__indicator",{"is-ready":r.value}]),style:on(l.value),"aria-hidden":"true"},null,6),(b(!0),N(Le,null,Ct(e.options,(h,m)=>(b(),N("button",{key:h.value,ref_for:!0,ref:g=>u(g,m),class:De(["ui-seg__item",{"is-on":h.value===e.modelValue}]),"data-icon":h.icon,type:"button",role:"tab","aria-selected":h.value===e.modelValue,onClick:g=>i("update:modelValue",h.value)},[h.icon?(b(),fe(xe,{key:0,class:"ui-seg__icon",name:h.icon,size:"sm"},null,8,["name"])):X("",!0),h.swatch?(b(),N("span",{key:1,class:"ui-seg__swatch",style:on({backgroundColor:h.swatch})},null,4)):X("",!0),Be(" "+B(h.label),1)],10,jse))),128))],2))}}),Ls=St(Hse,[["__scopeId","data-v-c5824392"]]);function Wse(e){const{anchor:t,menuHeight:n,viewportWidth:i,viewportHeight:o,gap:s,margin:r}=e,l=o-r-(t.bottom+s),a=t.top-s-r,u=ll,c=u?a:l,d=Math.min(t.width,Math.max(0,i-2*r)),f=Math.min(Math.max(t.left,r),Math.max(r,i-r-d)),h={left:`${Math.round(f)}px`,width:`${Math.round(d)}px`};return cn.options.findIndex(le=>String(le.value)===String(n.modelValue??""))),w=D(()=>n.options[C.value]),M=D(()=>w.value?.label??n.placeholder);function L(le,ie){a.value[ie]=le instanceof HTMLElement?le:null}function E(){const le=l.value,ie=a.value[c.value];!le||!ie||(le.scrollTop=ie.offsetTop-(le.clientHeight-ie.offsetHeight)/2)}function S(){const le=r.value,ie=l.value;if(!le||!ie)return;ie.style.maxHeight="";const _e=le.getBoundingClientRect();f.value=Wse({anchor:_e,menuHeight:ie.offsetHeight,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,gap:y,margin:k}).style}function x(){n.disabled||u.value||(u.value=!0,c.value=C.value>=0?C.value:n.options.findIndex(le=>!le.disabled),y=v("--space-1",fT),k=v("--space-2",hT),ne(),ft(()=>{S(),ft(E)}))}function A({restoreFocus:le=!1}={}){u.value&&(u.value=!1,te(),le&&ft(()=>r.value?.focus()))}function T(){u.value?A():x()}function I(le){le.disabled||(String(le.value)!==String(n.modelValue??"")&&i("update:modelValue",le.value),A({restoreFocus:!0}))}function O(le){if(u.value||x(),n.options.length===0)return;let ie=c.value;for(let _e=0;_e_e.disabled?-1:Z).filter(_e=>_e>=0);c.value=le.key==="Home"?ie[0]??-1:ie.at(-1)??-1,ft(E)}}function R(le){m=u.value;const ie=le.target;s.value?.contains(ie)||l.value?.contains(ie)||A()}function F(){const le=g;m=!1,g=!1,te(),le&&u.value&&r.value?.focus()}function P(){g=!0}function z(le){const ie=le.relatedTarget;ie instanceof Node&&(s.value?.contains(ie)||l.value?.contains(ie))||requestAnimationFrame(()=>{if(!u.value||g)return;const _e=document.activeElement;_e&&(s.value?.contains(_e)||l.value?.contains(_e))||A()})}function W(le){u.value&&(l.value?.contains(le.target)||S())}function $(){u.value&&S()}ze(()=>n.options.length,()=>{u.value&&ft(S)});function K(le){(le.type==="touchmove"?u.value||m:u.value)&&qse(le.target,l.value)&&le.preventDefault()}function ne(){h||(h=!0,document.addEventListener("wheel",K,{capture:!0,passive:!1}),document.addEventListener("touchmove",K,{capture:!0,passive:!1}))}function G(){h&&(h=!1,document.removeEventListener("wheel",K,{capture:!0}),document.removeEventListener("touchmove",K,{capture:!0}))}function te(){u.value||m||G()}return gn(()=>{document.addEventListener("pointerdown",R,{passive:!0}),document.addEventListener("pointerup",F,{passive:!0}),document.addEventListener("pointercancel",F,{passive:!0}),document.addEventListener("scroll",W,!0),window.addEventListener("resize",$)}),Tn(()=>{m=!1,G(),document.removeEventListener("pointerdown",R),document.removeEventListener("pointerup",F),document.removeEventListener("pointercancel",F),document.removeEventListener("scroll",W,!0),window.removeEventListener("resize",$)}),(le,ie)=>(b(),N("div",{ref_key:"rootRef",ref:s,class:De(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error,"is-open":u.value,"is-disabled":e.disabled}]])},[_("button",ci({ref_key:"triggerRef",ref:r},p(o),{class:"ui-select__trigger",type:"button",role:"combobox","aria-controls":d,"aria-expanded":u.value,"aria-haspopup":"listbox",disabled:e.disabled,onClick:T,onKeydown:H,onFocusout:z}),[_("span",{class:De(["ui-select__value",{"is-placeholder":!w.value}])},[w.value?.icon?(b(),N("img",{key:0,class:"ui-select__icon",src:w.value.icon,alt:""},null,8,Vse)):X("",!0),_("span",Kse,B(M.value),1)],2),V(xe,{class:"ui-select__chevron",name:"chevron-down",size:"sm"})],16,Use),(b(),fe(Rs,{to:"body"},[u.value?(b(),N("div",{key:0,id:d,ref_key:"listRef",ref:l,class:"ui-select__menu",style:on(f.value),role:"listbox",onPointerdown:P,onFocusout:z},[(b(!0),N(Le,null,Ct(e.options,(_e,Z)=>(b(),N(Le,{key:`${_e.group??""}:${_e.value}`},[_e.group&&_e.group!==e.options[Z-1]?.group?(b(),N("div",Zse,B(_e.group),1)):X("",!0),_("button",{ref_for:!0,ref:se=>L(se,Z),class:De(["ui-select__option",{"is-selected":Z===C.value,"is-active":Z===c.value}]),type:"button",role:"option","aria-selected":Z===C.value,disabled:_e.disabled,onMouseenter:se=>c.value=Z,onClick:se=>I(_e)},[V(xe,{class:"ui-select__check",name:"check",size:"sm"}),_e.icon?(b(),N("img",{key:0,class:"ui-select__icon ui-select__icon--option",src:_e.icon,alt:""},null,8,Qse)):X("",!0),_("span",null,B(_e.label),1)],42,Gse)],64))),128))],36)):X("",!0)]))],2))}}),MC=St(Yse,[["__scopeId","data-v-e7628e92"]]),Jse=ot({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(o){switch(o){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"fail":case"danger":return"error";case"running":case"run":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const i=D(()=>n(t.status));return(o,s)=>(b(),N("span",{class:De(["kw-dot",`kw-dot--${i.value}`]),"aria-hidden":"true"},null,2))}}),ha=St(Jse,[["__scopeId","data-v-ddf97fc4"]]),Xse=["aria-checked","aria-label","disabled"],ere=ot({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(i,o)=>(b(),N("button",{class:De(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:o[0]||(o[0]=s=>n("update:modelValue",!e.modelValue))},[...o[1]||(o[1]=[_("span",{class:"ui-switch__thumb"},null,-1)])],10,Xse))}}),su=St(ere,[["__scopeId","data-v-eb53165a"]]),tre=["value","rows","placeholder","disabled","readonly"],nre=ot({__name:"Textarea",props:{modelValue:{},rows:{default:3},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean},resize:{type:Boolean,default:!0}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const i=n;function o(r){i("update:modelValue",r.target.value)}const s=q(null);return t({el:s}),(r,l)=>(b(),N("textarea",{ref_key:"textareaRef",ref:s,class:De(["ui-textarea",{"has-error":e.error,"no-resize":!e.resize}]),value:e.modelValue,rows:e.rows,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:o,onFocus:l[0]||(l[0]=a=>r.$emit("focus",a)),onBlur:l[1]||(l[1]=a=>r.$emit("blur",a))},null,42,tre))}}),ire=St(nre,[["__scopeId","data-v-1da4a9a7"]]),ore={class:"ui-toast__icon","aria-hidden":"true"},sre={class:"ui-toast__body"},rre={class:"ui-toast__title"},lre={key:0,class:"ui-toast__msg"},are=ot({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{}},emits:["dismiss"],setup(e){const{t}=Vm();return(n,i)=>(b(),N("div",{class:De(["ui-toast",`ui-toast--${e.variant}`])},[_("span",ore,[Hn(n.$slots,"icon",{},()=>[e.variant==="success"?(b(),fe(xe,{key:0,name:"check"})):e.variant==="danger"?(b(),fe(xe,{key:1,name:"close"})):e.variant==="warning"?(b(),fe(xe,{key:2,name:"alert-triangle"})):(b(),fe(xe,{key:3,name:"info"}))],!0)]),_("div",sre,[_("div",rre,B(e.title),1),e.message?(b(),N("div",lre,B(e.message),1)):X("",!0),Hn(n.$slots,"default",{},void 0,!0)]),V(tn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel??p(t)("common.dismiss"),tooltip:e.dismissLabel??p(t)("common.dismiss"),onClick:i[0]||(i[0]=o=>n.$emit("dismiss"))},{default:de(()=>[V(xe,{name:"close",size:"sm"})]),_:1},8,["label","tooltip"])],2))}}),ure=St(are,[["__scopeId","data-v-09e5bc42"]]),cre=100;function Ol(){let e=!1,t=0;function n(){e=!0,t=0}function i(){e=!1,t=Date.now()}function o(){e=!1,t=0}function s(r){return e||r.isComposing||r.keyCode===229||Date.now()-t{typeof window<"u"&&(window.removeEventListener("focusin",o,!0),window.removeEventListener("focusout",o,!0))}),{handleCompositionStart:n,handleCompositionEnd:i,resetComposition:o,isComposingKeyEvent:s}}/*! + * pinia v4.0.3 + * (c) 2026 Eduardo San Martin Morote + * @license MIT + */let Iz;const I4=e=>Iz=e,Mz=Symbol();function pT(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}function dre(){const e=p4(!0),t=e.run(()=>q({}));let n=[],i=[];const o=Lt({install(s){I4(o),o._a=s,s.provide(Mz,o),s.config.globalProperties.$pinia=o,i.forEach(r=>n.push(r)),i=[]},use(s){return this._a?n.push(s):i.push(s),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return o}const TC=()=>{};function mT(e,t,n,i=TC){e.add(t);const o=()=>{e.delete(t)&&i()};return!n&&jm()&&cd(o),o}function i1(e,...t){e.forEach(n=>{n(...t)})}const fre=e=>e(),gT=Symbol(),A3=Symbol();function EC(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,i)=>e.set(i,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!Object.hasOwn(t,n))continue;const i=t[n],o=e[n];pT(o)&&pT(i)&&Object.hasOwn(e,n)&&!Gi(i)&&!yu(i)?e[n]=EC(o,i):e[n]=i}return e}const hre=Symbol();function pre(e){return!e||typeof e!="object"||!Object.hasOwn(e,hre)}const{assign:Od}=Object;function mre(e){return!!(Gi(e)&&e.effect)}function gre(e,t,n,i){const{state:o,actions:s,getters:r}=t,l=n.state.value[e];let a;function u(){l||(n.state.value[e]=o?o():{});const c=LJ(n.state.value[e]);return Od(c,s,Object.keys(r||{}).reduce((d,f)=>(d[f]=Lt(D(()=>{I4(n);const h=n._s.get(e);return r[f].call(h,h)})),d),{}))}return a=Tz(e,u,t,n,i,!0),a}function Tz(e,t,n={},i,o,s){let r;const l=Od({actions:{}},n),a={deep:!0};let u,c,d=new Set,f=new Set,h;const m=i.state.value[e];!s&&!m&&(i.state.value[e]={});let g;function y(E){let S;u=c=!1,typeof E=="function"?(E(i.state.value[e]),S={type:"patch function",storeId:e,events:h}):(EC(i.state.value[e],E),S={type:"patch object",payload:E,storeId:e,events:h});const x=g=Symbol();ft().then(()=>{g===x&&(u=!0)}),c=!0,i1(d,S,i.state.value[e])}const k=s?function(){const{state:S}=n,x=S?S():{};this.$patch(A=>{Od(A,x)})}:TC;function v(){r.stop(),d.clear(),f.clear(),i._s.delete(e)}const C=(E,S="")=>{if(gT in E)return E[A3]=S,E;const x=function(){I4(i);const A=Array.from(arguments),T=new Set,I=new Set;function O(F){T.add(F)}function H(F){I.add(F)}i1(f,{args:A,name:x[A3],store:M,after:O,onError:H});let R;try{R=E.apply(this&&this.$id===e?this:M,A)}catch(F){throw i1(I,F),F}return R instanceof Promise?R.then(F=>(i1(T,F),F)).catch(F=>(i1(I,F),Promise.reject(F))):(i1(T,R),R)};return x[gT]=!0,x[A3]=S,x},w={_p:i,$id:e,$onAction:mT.bind(null,f),$patch:y,$reset:k,$subscribe(E,S={}){if(d.has(E))return TC;const x=mT(d,E,S.detached,()=>A()),A=r.run(()=>ze(()=>i.state.value[e],T=>{(S.flush==="sync"?c:u)&&E({storeId:e,type:"direct",events:h},T)},Od({},a,S)));return x},$dispose:v},M=po(w);i._s.set(e,M);const L=(i._a&&i._a.runWithContext||fre)(()=>i._e.run(()=>(r=p4()).run(()=>t({action:C}))));for(const E in L){const S=L[E];Gi(S)&&!mre(S)||yu(S)?s||(m&&pre(S)&&(Gi(S)?S.value=m[E]:((S instanceof Set||S instanceof Map)&&S.clear(),EC(S,m[E]))),i.state.value[e][E]=S):typeof S=="function"&&(L[E]=C(S,E),l.actions[E]=S)}return Od(M,L),Od(hi(M),L),Object.defineProperty(M,"$state",{get:()=>i.state.value[e],set:E=>{y(S=>{Od(S,E)})}}),i._p.forEach(E=>{const S=r.run(()=>E({store:M,app:i._a,pinia:i,options:l}));Od(M,S)}),m&&s&&n.hydrate&&n.hydrate(M.$state,m),u=!0,c=!0,M}/*! #__NO_SIDE_EFFECTS__ */function Os(e,t,n){let i;const o=typeof t=="function";i=o?n:t;function s(r,l){const a=qJ();return r=r||(a?en(Mz,null):null),r&&I4(r),r=Iz,r._s.has(e)||(o?Tz(e,t,i,r):gre(e,i,r)),r._s.get(e)}return s.$id=e,s}function o1(e){const t=hi(e),n={};for(const i in t){const o=t[i];o?.effect?n[i]=D({get:()=>e[i],set(s){e[i]=s}}):(Gi(o)||yu(o))&&(n[i]=DJ(e,i))}return n}function fc(e,t){const n=t??{h:"h",m:"m",s:"s"},i=Math.max(0,Math.floor(e/1e3));if(i<60)return i===0?"":`${i}${n.s}`;const o=Math.floor(i/60);if(o<60){const l=i%60;return l===0?`${o}${n.m}`:`${o}${n.m}${l}${n.s}`}const s=Math.floor(o/60),r=o%60;return r===0?`${s}${n.h}`:`${s}${n.h}${r}${n.m}`}const vre={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search",create_goal:"creategoal",get_goal:"getgoal",set_goal_budget:"setgoalbudget",update_goal:"updategoal",wait_for:"waitfor"};function hr(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return vre[t]??t}const yre={read:"tools.label.read",bash:"tools.label.bash",edit:"tools.label.edit",multi_edit:"tools.label.edit",write:"tools.label.write",grep:"tools.label.grep",glob:"tools.label.glob",ls:"tools.label.ls",web_fetch:"tools.label.web_fetch",search:"tools.label.search",todo:"tools.label.todo",task:"tools.label.task",agentswarm:"tools.label.swarm",askuserquestion:"tools.label.ask_user",exitplanmode:"tools.label.plan",creategoal:"tools.label.goal_create",getgoal:"tools.label.goal_get",setgoalbudget:"tools.label.goal_budget",updategoal:"tools.label.goal_update",waitfor:"tools.label.waitfor"};function Ez(e,t){const n=yre[hr(t)];return n?e(n):t}const Lz=80;function kre(e,t=Lz){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function bre(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function wre(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 fi(e){return typeof e=="string"&&e.length>0?e:void 0}function Pd(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Cre(e){try{const t=new URL(e),n=t.pathname.split("/").filter(Boolean)[0];return n?`${t.host}/${n}`:t.host}catch{return e.replace(/^https?:\/\//,"")}}function x3(e){return fi(e.path)??fi(e.file_path)??fi(e.filePath)??fi(e.filename)}const Are={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function xre(e,t){const n=fi(t);if(!n)return;const i=Are[n];return i?e(i):n}function Sre(e,t){const n=Pd(t.value),i=fi(t.unit);if(!(n===void 0||!i))switch(i){case"turns":return e("tools.goal.turns",{value:n});case"tokens":return e("tools.goal.tokens",{value:n});case"milliseconds":return e("tools.goal.milliseconds",{value:n});case"seconds":return e("tools.goal.seconds",{value:n});case"minutes":return e("tools.goal.minutes",{value:n});case"hours":return e("tools.goal.hours",{value:n});default:return e("tools.goal.budget",{value:n,unit:i})}}function $7(e,t,n,i=!1){const o=(s,r=Lz)=>i?s.trim():kre(s,r);try{const s=wre(n);if(!i&&bre(n,s))return"";const r=()=>o(n.replace(/^·\s*/,""));if(!s)return r();switch(hr(t)){case"read":{const l=x3(s);if(!l)return r();const a=Pd(s.offset)??Pd(s.line_start)??Pd(s.start_line),u=Pd(s.limit)??Pd(s.length),c=Pd(s.line_end)??Pd(s.end_line)??(a!==void 0&&u!==void 0?a+u:void 0);return o(a!==void 0&&c!==void 0?`${l}:${a}-${c}`:a!==void 0?`${l}:${a}`:l)}case"write":{const l=x3(s);return l?o(`${l} ${e("tools.chip.created")}`):r()}case"edit":case"multi_edit":{const l=x3(s);return l?o(l):r()}case"bash":{const l=fi(s.command)??fi(s.cmd)??fi(s.script);return l?l.trim():r()}case"grep":case"search":{const l=fi(s.pattern)??fi(s.query)??fi(s.regex),a=fi(s.path)??fi(s.glob)??fi(s.include);return l&&a?o(e("tools.summary.inScope",{value:l,scope:a})):l?o(l):r()}case"glob":{const l=fi(s.pattern)??fi(s.glob)??fi(s.query),a=fi(s.path)??fi(s.cwd);return l&&a?o(e("tools.summary.inScope",{value:l,scope:a})):l?o(l):fi(s.path)?o(fi(s.path)):r()}case"ls":{const l=fi(s.path)??fi(s.dir)??fi(s.directory)??fi(s.cwd);return l?o(l):r()}case"web_fetch":{const l=fi(s.url)??fi(s.uri);return l?o(Cre(l)):r()}case"todo":case"task":{const l=fi(s.description)??fi(s.title)??fi(s.prompt)??fi(s.name)??fi(s.subagent_type);if(l)return o(l);const a=Array.isArray(s.todos)?s.todos:Array.isArray(s.items)?s.items:void 0;return a?o(e("tools.chip.todos",{count:a.length})):r()}case"creategoal":{if(i)return r();const l=fi(s.objective),a=fi(s.completionCriterion);return l&&a?o(e("tools.goal.objectiveWithCriterion",{objective:l,criterion:a})):l?o(l):r()}case"getgoal":return i?r():"";case"setgoalbudget":{if(i)return r();const l=Sre(e,s);return l?o(l):r()}case"updategoal":{if(i)return r();const l=xre(e,s.status);return l?o(e("tools.goal.status",{status:l})):r()}default:return r()}}catch{return n}}function _re(e,t){try{switch(hr(t.name)){case"bash":return t.timing?t.timing:"";case"read":{if(t.output&&t.output.length>0){const n=t.output.length;return e("tools.chip.lines",{count:n})}return""}case"edit":case"multi_edit":case"write":{if(t.output){for(const i of t.output){const o=i.match(/\+(\d+).*[-−](\d+)/);if(o)return`+${o[1]} −${o[2]}`}const n=t.output.find(i=>/\d+/.test(i));if(n){const i=n.match(/\+(\d+)/),o=n.match(/[-−](\d+)/);if(i||o)return`${i?`+${i[1]}`:""} ${o?`−${o[1]}`:""}`.trim()}if(t.status!=="error")return e("tools.chip.edited")}return""}case"grep":case"search":return t.output&&t.output.length>0?e("tools.chip.results",{count:t.output.length}):"";default:return""}}catch{return""}}const Nz=new Set(["read","bash","grep","search","glob","ls","web_fetch","edit","write"]);function Fz(e){const t=hr(e);return t==="multi_edit"?"edit":t}function Dz(e){const t=[],n=new Map;for(const i of e){if(i.kind==="thinking")continue;const o=Fz(i.tool.name);let s=n.get(o);s||(s={count:0,errors:0},n.set(o,s),t.push(o)),s.count++,i.tool.status==="error"&&s.errors++}return{order:t,byKind:n}}function Rz(e,t,n){return Nz.has(t)?e(`tools.group.typed.${t}.done`,{count:n}):e("tools.group.countOther",{count:n})}function Oz(e,t){return{text:e("tools.activity.failedClause",{count:t}),tone:"danger"}}function Pz(e){return e.map(t=>t.fragments.map(n=>n.text).join("")).join(" · ")}function Ire(e,t,n={}){const{order:i,byKind:o}=Dz(t),s=[];let r=!1;for(const l of i){const a=o.get(l);if(!a)continue;const u=[{text:Rz(e,l,a.count),tone:"normal"}];a.errors>0&&(r=!0,u.push(Oz(e,a.errors))),s.push({fragments:u})}if(n.durationMs!==void 0){const l=fc(n.durationMs);l&&s.push({fragments:[{text:l,tone:"faint"}]})}return{clauses:s,plain:Pz(s),hasError:r}}function Mre(e,t){if(t.kind==="thinking")return{fragments:[{text:e("thinking.streaming"),tone:"normal"}]};const n=Fz(t.tool.name);let i=$7(e,t.tool.name,t.tool.arg);if(n==="write"&&i){const s=e("tools.chip.created");i.endsWith(s)&&(i=i.slice(0,i.length-s.length).trimEnd())}return{fragments:[{text:i&&Nz.has(n)?e(`tools.activity.doing.${n}`,{subject:i}):e("tools.activity.busy"),tone:"normal"}]}}function Tre(e,t,n){const i=t.filter(c=>c!==n&&!(c.kind==="tool"&&c.tool.status==="running")),{order:o,byKind:s}=Dz(i),r=e("tools.activity.liveDonePrefix"),l=[];for(const c of o){const d=s.get(c);if(!d)continue;const f=[{text:`${r}${Rz(e,c,d.count)}`,tone:"faint"}];d.errors>0&&f.push(Oz(e,d.errors)),l.push({fragments:f})}const a=n===null?null:Mre(e,n),u=a?[a,...l]:l;return{current:a,done:l,plain:Pz(u)}}async function Vo(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return Ere(e)}function Ere(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}const Lre={ts:"ts",tsx:"tsx",js:"js",jsx:"jsx",mjs:"js",cjs:"js",vue:"vue",svelte:"svelte",py:"py",rb:"rb",go:"go",rs:"rs",java:"java",kt:"kt",kts:"kts",scala:"scala",swift:"swift",c:"c",h:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",cs:"cs",php:"php",sh:"sh",bash:"bash",zsh:"zsh",fish:"fish",ps1:"ps1",bat:"bat",cmd:"bat",sql:"sql",graphql:"graphql",prisma:"prisma",html:"html",htm:"html",xml:"xml",svg:"xml",css:"css",scss:"scss",sass:"sass",less:"less",json:"json",jsonc:"jsonc",json5:"json5",yaml:"yaml",yml:"yml",toml:"toml",ini:"ini",md:"md",markdown:"markdown",mdx:"mdx",lua:"lua",r:"r",dart:"dart",zig:"zig",mk:"makefile",cmake:"cmake",diff:"diff",proto:"proto"},Nre={dockerfile:"dockerfile",makefile:"makefile","cmakelists.txt":"cmake"};function Fre(e){const t=e?.split(/[\\/]/).pop()?.toLowerCase()??"";if(!t)return;const n=Nre[t];if(n)return n;const i=t.lastIndexOf(".");if(!(i<=0))return Lre[t.slice(i+1)]}class Zu 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 Xl 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 z7 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 li(e){return e instanceof Zu||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function r2(e){return e instanceof Xl||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}function Bz(e){return r2(e)&&typeof e.cause=="object"&&e.cause!==null&&e.cause.name==="TimeoutError"}function Dre(e){return e instanceof z7||typeof e=="object"&&e!==null&&e.name==="FileTooLargeError"&&typeof e.limit=="number"}const Rre=41301,Ore=40922;function vT(e){return li(e)&&e.code===Ore}function Pre(e){const t=(e instanceof Error?e.message:String(e)).slice(0,140);return Bz(e)?{kind:"timeout",message:t}:r2(e)?{kind:"network",message:t}:li(e)?{kind:"api",message:t}:{kind:"unknown",message:t}}const Bre="kimi_desktop",$re="platform",yT="kimi-desktop",kT="kimi-desktop-platform";function zre(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(Bre)?(sessionStorage.setItem(yT,"1"),e=!0):e=e||sessionStorage.getItem(yT)==="1";const i=n.get($re);i?(sessionStorage.setItem(kT,i),t=i):t=sessionStorage.getItem(kT)}catch{}return{isDesktop:e,platform:t}}const LC=zre(),Lp=LC.isDesktop,af=LC.isDesktop&&LC.platform==="darwin",jre=["faces","nature","food","activity","objects","symbols"],Hre=[["😀","faces","grinning smile happy 笑 开心"],["😄","faces","smile happy joy 笑 开心 高兴"],["😁","faces","grin beaming 咧嘴笑 开心"],["😂","faces","joy laugh tears 笑哭 爆笑"],["🤣","faces","rofl laugh rolling 笑翻 爆笑"],["😊","faces","blush shy happy 微笑 害羞"],["😉","faces","wink 眨眼"],["😍","faces","heart eyes love 爱心眼 喜欢 爱"],["🥰","faces","smiling hearts love 爱心 喜欢"],["😘","faces","kiss 飞吻 亲亲"],["😋","faces","yum tongue 好吃 馋"],["🤪","faces","zany crazy 鬼脸 疯"],["🤔","faces","thinking hmm consider 思考 想"],["🤨","faces","skeptical eyebrow 怀疑 挑眉"],["😐","faces","neutral meh 面无表情 无语"],["😑","faces","expressionless 面无表情 无语"],["🙄","faces","eye roll 翻白眼 无语"],["😶","faces","no mouth silent 无言 沉默"],["🫡","faces","salute 敬礼 收到"],["🤫","faces","shush quiet 嘘 安静"],["🤭","faces","oops giggle 捂嘴 偷笑"],["😴","faces","sleeping sleepy 睡觉 困"],["😪","faces","sleepy tired 困 疲惫"],["😷","faces","mask sick 口罩 生病"],["🤒","faces","sick fever 生病 发烧"],["🤕","faces","hurt bandage 受伤"],["🤢","faces","nauseated 恶心"],["🤯","faces","mind blown explode 震惊 爆炸"],["🥳","faces","party celebrate 庆祝 派对"],["🤩","faces","star struck 星星眼 激动"],["😎","faces","cool sunglasses 酷 墨镜"],["🥸","faces","disguise 伪装 假扮"],["🤓","faces","nerd geek 书呆子 学霸"],["😢","faces","cry sad 哭 难过"],["😭","faces","sob cry loudly 大哭 痛哭"],["😤","faces","triumph huff 哼 生气"],["😡","faces","angry rage mad 生气 愤怒"],["🤬","faces","swearing cursing 骂人 爆粗"],["😱","faces","scream fear 尖叫 害怕"],["😨","faces","fearful 害怕 恐惧"],["🥵","faces","hot heat 热 出汗"],["🥶","faces","cold freezing 冷 冻"],["🥴","faces","woozy drunk 晕 醉"],["😇","faces","angel innocent 天使 无辜"],["🙃","faces","upside down silly 倒脸 哭笑不得"],["💀","faces","skull dead 骷髅 笑死"],["👻","faces","ghost 鬼 幽灵"],["👍","faces","thumbs up like good 赞 好"],["👎","faces","thumbs down dislike 踩 差"],["👏","faces","clap applause 鼓掌 厉害"],["🙌","faces","raise hands celebrate 举手 庆祝"],["🙏","faces","pray thanks please 拜托 感谢 祈祷"],["💪","faces","muscle strong flex 加油 强壮 肌肉"],["👀","faces","eyes look watch 看 围观 眼睛"],["🤝","faces","handshake deal 握手 合作"],["✌️","faces","victory peace 胜利 耶"],["👋","faces","wave hello bye 挥手 你好 再见"],["🤞","faces","crossed fingers luck 祈祷 好运"],["👌","faces","ok okay 好的 可以"],["🫶","faces","heart hands love 比心 爱心"],["✍️","faces","writing hand 写字 记录"],["🧠","faces","brain smart 大脑 聪明"],["🦾","faces","mechanical arm 机械臂 力量"],["👤","faces","person user profile 个人 用户"],["👥","faces","people team group 团队 多人"],["🐶","nature","dog puppy 狗 小狗"],["🐱","nature","cat kitten 猫 小猫"],["🐭","nature","mouse rat 老鼠"],["🐹","nature","hamster 仓鼠"],["🐰","nature","rabbit bunny 兔子"],["🦊","nature","fox 狐狸"],["🐻","nature","bear 熊"],["🐼","nature","panda 熊猫"],["🐨","nature","koala 考拉"],["🐯","nature","tiger 老虎"],["🦁","nature","lion 狮子"],["🐮","nature","cow 牛"],["🐷","nature","pig 猪"],["🐸","nature","frog 青蛙"],["🐵","nature","monkey 猴子"],["🐔","nature","chicken 鸡"],["🐧","nature","penguin 企鹅"],["🐦","nature","bird 鸟"],["🐣","nature","chick hatching 小鸡 孵化"],["🦆","nature","duck 鸭子"],["🦉","nature","owl 猫头鹰"],["🐝","nature","bee 蜜蜂"],["🐛","nature","bug caterpillar 虫子 毛虫"],["🦋","nature","butterfly 蝴蝶"],["🐌","nature","snail slow 蜗牛 慢"],["🐢","nature","turtle slow 乌龟 慢"],["🐍","nature","snake 蛇"],["🐙","nature","octopus 章鱼"],["🦑","nature","squid 鱿鱼"],["🦐","nature","shrimp 虾"],["🦀","nature","crab 螃蟹"],["🐠","nature","tropical fish 鱼 热带鱼"],["🐳","nature","whale 鲸鱼"],["🦈","nature","shark 鲨鱼"],["🐊","nature","crocodile 鳄鱼"],["🦄","nature","unicorn 独角兽"],["🐴","nature","horse 马"],["🐑","nature","sheep 羊 绵羊"],["🐐","nature","goat 山羊"],["🦜","nature","parrot 鹦鹉"],["🌸","nature","blossom flower sakura 樱花 花"],["🌹","nature","rose flower 玫瑰 花"],["🌻","nature","sunflower 向日葵"],["🌷","nature","tulip 郁金香"],["🌱","nature","seedling sprout 发芽 幼苗"],["🌲","nature","tree evergreen 树 松树"],["🌳","nature","deciduous tree 树 大树"],["🌵","nature","cactus 仙人掌"],["🍀","nature","clover luck 四叶草 幸运"],["🍁","nature","maple leaf autumn 枫叶 秋天"],["🍄","nature","mushroom 蘑菇"],["🌈","nature","rainbow 彩虹"],["☀️","nature","sun sunny 太阳 晴"],["🌙","nature","moon crescent 月亮"],["⭐","nature","star 星星"],["🌟","nature","glowing star 星星 闪亮"],["☁️","nature","cloud 云"],["⛅","nature","partly cloudy 多云"],["🌧️","nature","rain rainy 下雨"],["❄️","nature","snowflake snow 雪 雪花"],["⛄","nature","snowman 雪人"],["⚡","nature","lightning bolt 闪电"],["🔥","nature","fire hot 火 燃"],["🌊","nature","wave ocean sea 海浪"],["🏔️","nature","mountain snow 雪山 山"],["☕","food","coffee 咖啡"],["🍵","food","tea 茶"],["🧋","food","bubble tea boba 奶茶"],["🥛","food","milk 牛奶"],["🍺","food","beer 啤酒"],["🍷","food","wine 红酒"],["🥂","food","champagne cheers 香槟 干杯"],["🥤","food","cup straw soda 饮料 可乐"],["🧃","food","juice box 果汁"],["🍎","food","apple 苹果"],["🍊","food","orange tangerine 橙子 橘子"],["🍋","food","lemon 柠檬"],["🍉","food","watermelon 西瓜"],["🍓","food","strawberry 草莓"],["🍑","food","peach 桃子"],["🥭","food","mango 芒果"],["🍍","food","pineapple 菠萝"],["🥝","food","kiwi 猕猴桃"],["🍇","food","grapes 葡萄"],["🍒","food","cherries 樱桃"],["🥑","food","avocado 牛油果"],["🥦","food","broccoli 西兰花"],["🌽","food","corn 玉米"],["🌶️","food","hot pepper spicy 辣椒 辣"],["🍔","food","burger hamburger 汉堡"],["🍟","food","fries 薯条"],["🍕","food","pizza 披萨"],["🌭","food","hot dog 热狗"],["🥪","food","sandwich 三明治"],["🌮","food","taco 墨西哥卷"],["🍜","food","ramen noodles 拉面 面条"],["🍝","food","spaghetti pasta 意面"],["🍣","food","sushi 寿司"],["🍱","food","bento 便当"],["🥟","food","dumpling 饺子"],["🍚","food","rice 米饭"],["🍞","food","bread 面包"],["🥐","food","croissant 可颂 牛角包"],["🧀","food","cheese 奶酪 芝士"],["🍳","food","cooking egg 煎蛋 做饭"],["🍦","food","ice cream 冰淇淋"],["🍰","food","cake 蛋糕"],["🎂","food","birthday cake 生日蛋糕"],["🍫","food","chocolate 巧克力"],["🍩","food","donut doughnut 甜甜圈"],["🍪","food","cookie 饼干"],["🍭","food","lollipop 棒棒糖"],["⚽","activity","soccer football 足球"],["🏀","activity","basketball 篮球"],["🏈","activity","american football 橄榄球"],["⚾","activity","baseball 棒球"],["🎾","activity","tennis 网球"],["🏐","activity","volleyball 排球"],["🏓","activity","ping pong 乒乓球"],["🏸","activity","badminton 羽毛球"],["🥊","activity","boxing 拳击"],["⛳","activity","golf 高尔夫"],["🎣","activity","fishing 钓鱼"],["🏊","activity","swim 游泳"],["🏄","activity","surf 冲浪"],["🚴","activity","cycling 骑行"],["🏋️","activity","weightlifting gym 举重 健身"],["🧘","activity","yoga meditation 瑜伽 冥想"],["🎮","activity","video game controller 游戏 游戏机"],["🎲","activity","dice 骰子"],["🎯","activity","target bullseye 目标 靶心"],["🎳","activity","bowling 保龄球"],["🎰","activity","slot machine 老虎机"],["♟️","activity","chess 国际象棋 棋"],["🎸","activity","guitar 吉他"],["🎹","activity","piano keyboard 钢琴"],["🥁","activity","drum 鼓"],["🎤","activity","microphone sing 麦克风 唱歌"],["🎧","activity","headphones 耳机"],["🎬","activity","clapper movie 电影 拍摄"],["🎨","activity","art palette paint 画画 艺术"],["🎭","activity","theater masks 戏剧 面具"],["🎪","activity","circus 马戏团"],["🎡","activity","ferris wheel 摩天轮"],["✈️","activity","airplane travel flight 飞机 旅行"],["🚗","activity","car drive 汽车 车"],["🚕","activity","taxi 出租车"],["🚌","activity","bus 公交车"],["🚑","activity","ambulance 救护车"],["🚒","activity","fire engine 消防车"],["🚀","activity","rocket launch ship 火箭 发射"],["🛸","activity","ufo flying saucer 飞碟"],["🚲","activity","bicycle bike 自行车"],["🛴","activity","scooter 滑板车"],["🚄","activity","bullet train 高铁 动车"],["🚢","activity","ship 船 轮船"],["⛵","activity","sailboat 帆船"],["🏠","activity","house home 房子 家"],["🏢","activity","office building 公司 办公楼"],["🏥","activity","hospital 医院"],["🏫","activity","school 学校"],["🏖️","activity","beach vacation 海滩 度假"],["⛺","activity","camping tent 露营 帐篷"],["🌋","activity","volcano 火山"],["🗺️","activity","map world 地图"],["🧭","activity","compass 指南针"],["💻","objects","laptop computer 电脑 笔记本"],["🖥️","objects","desktop computer 台式机 电脑"],["⌨️","objects","keyboard 键盘"],["🖱️","objects","computer mouse 鼠标"],["📱","objects","phone mobile 手机"],["🔋","objects","battery 电池"],["🔌","objects","plug electric 插头"],["💾","objects","floppy save 软盘 保存"],["📀","objects","cd disc 光盘"],["🎥","objects","movie camera 摄像机"],["📷","objects","camera 相机"],["🔭","objects","telescope 望远镜"],["📡","objects","satellite antenna 卫星 天线"],["🌐","objects","globe web internet 网络 全球 互联网"],["🕯️","objects","candle 蜡烛"],["💡","objects","bulb idea light 灯泡 点子"],["🔦","objects","flashlight 手电筒"],["📁","objects","folder 文件夹"],["📂","objects","open folder 文件夹 打开"],["🗂️","objects","card index archive 归档 索引"],["📅","objects","calendar date 日历 日期"],["📌","objects","pin pushpin 图钉 置顶"],["📍","objects","round pin location 定位 位置"],["📎","objects","paperclip attachment 回形针 附件"],["✂️","objects","scissors cut 剪刀 剪切"],["📏","objects","ruler 尺子"],["📝","objects","memo note write 备忘 记录"],["✏️","objects","pencil edit write 铅笔 编辑"],["📄","objects","document page 文档 文件"],["📃","objects","page curl 文档 文件"],["📑","objects","bookmark tabs 标签页 文档"],["📚","objects","books 书 书籍"],["📖","objects","open book 打开的书 阅读"],["🔖","objects","bookmark 书签"],["🏷️","objects","label tag 标签"],["📊","objects","bar chart stats 图表 统计"],["📈","objects","chart up growth 上涨 增长"],["📉","objects","chart down 下跌 下降"],["🔍","objects","search magnifier 搜索 查找"],["🔎","objects","search magnifier right 搜索 查找"],["🔒","objects","lock locked 锁 锁定"],["🔓","objects","unlock open 解锁"],["🔑","objects","key 钥匙 密钥"],["🔧","objects","wrench tool 扳手 工具"],["🔨","objects","hammer 锤子"],["🛠️","objects","tools hammer wrench 工具 修理"],["🧰","objects","toolbox 工具箱 工具"],["🪛","objects","screwdriver 螺丝刀 工具"],["🔩","objects","nut and bolt screw 螺母 螺栓"],["🏗️","objects","building construction crane 施工 建造"],["⚙️","objects","gear settings 齿轮 设置"],["🧲","objects","magnet 磁铁"],["⚗️","objects","alembic 蒸馏器 实验"],["🧪","objects","test tube experiment 实验 试管"],["🔬","objects","microscope science 显微镜 科学"],["🤖","objects","robot bot 机器人"],["👾","objects","alien monster game 外星人 游戏"],["💣","objects","bomb 炸弹"],["🧨","objects","firecracker 爆竹"],["🗑️","objects","trash delete 垃圾桶 删除"],["🧹","objects","broom clean 扫帚 清理"],["🧻","objects","toilet paper 纸巾"],["🧽","objects","sponge 海绵"],["📦","objects","package box 包裹 箱子"],["✉️","objects","envelope mail 邮件 信封"],["📮","objects","mailbox postbox 邮箱"],["📧","objects","email mail 邮件"],["📥","objects","inbox tray receive 收件箱 接收"],["📤","objects","outbox tray send 发件箱 发送"],["📞","objects","telephone receiver call phone 电话 通话"],["💬","objects","speech balloon chat message bubble 聊天 对话 气泡 消息"],["💭","objects","thought balloon thinking 思考 想法 气泡"],["📣","objects","megaphone announcement 喇叭 公告"],["📢","objects","loudspeaker broadcast 广播 喇叭 通知"],["🚨","objects","police light alert emergency 警报 告警 紧急"],["🗳️","objects","ballot box vote 投票箱 投票"],["🔗","objects","link chain 链接 连接"],["🧩","objects","puzzle piece plugin 拼图 插件"],["🪄","objects","magic wand 魔法 魔杖"],["🛡️","objects","shield security 盾牌 安全"],["⚔️","objects","crossed swords 交叉剑 战斗"],["💳","objects","credit card 信用卡"],["💰","objects","money bag 钱袋 钱"],["🧾","objects","receipt 收据 小票"],["📿","objects","prayer beads 念珠"],["💍","objects","ring 戒指"],["👑","objects","crown 皇冠"],["🎩","objects","top hat 礼帽"],["🎒","objects","backpack 背包 书包"],["👓","objects","glasses 眼镜"],["🌂","objects","umbrella 雨伞"],["🕰️","objects","mantel clock 座钟"],["⌚","objects","watch 手表"],["⏱️","objects","stopwatch 秒表"],["🧯","objects","fire extinguisher 灭火器"],["🩹","objects","bandage patch fix 创可贴 补丁 修复"],["🎓","objects","graduation cap study learn 毕业 学习"],["🎫","objects","ticket 票 门票 工单"],["✅","symbols","check done complete 完成 对勾"],["✔️","symbols","checkmark correct 对勾 正确"],["❌","symbols","cross x wrong 错误 叉"],["❓","symbols","question help 问题 问号"],["❔","symbols","white question 问题 问号"],["❗","symbols","exclamation important 感叹号 重要"],["❕","symbols","white exclamation 感叹号"],["⚠️","symbols","warning caution 警告 注意"],["🚧","symbols","construction wip 施工 进行中"],["🚫","symbols","prohibited no 禁止"],["💥","symbols","boom explosion 爆炸"],["✨","symbols","sparkles shiny 闪亮 星星"],["🎉","symbols","tada party celebrate 庆祝 撒花"],["🎊","symbols","confetti party 庆祝 彩带"],["🏆","symbols","trophy champion 奖杯 冠军"],["🥇","symbols","gold medal first 金牌 第一"],["🥈","symbols","silver medal second 银牌 第二"],["🥉","symbols","bronze medal third 铜牌 第三"],["🎖️","symbols","military medal 勋章"],["🚩","symbols","red flag mark 红旗 标记"],["🏁","symbols","checkered flag finish 终点 完成"],["⏳","symbols","hourglass time waiting 沙漏 时间"],["⌛","symbols","hourglass done 沙漏 时间"],["🕐","symbols","clock one time 时钟 一点"],["⏰","symbols","alarm clock 闹钟"],["🔔","symbols","bell notification 铃铛 通知"],["🔕","symbols","bell slash mute 静音 免打扰"],["🕹️","symbols","joystick game 摇杆 游戏"],["🔴","symbols","red circle record 红圆 录制"],["🟢","symbols","green circle online 绿圆 在线"],["🟡","symbols","yellow circle 黄圆"],["🟠","symbols","orange circle 橙圆"],["🔵","symbols","blue circle 蓝圆"],["🟣","symbols","purple circle 紫圆"],["⚫","symbols","black circle 黑圆"],["⚪","symbols","white circle 白圆"],["🟥","symbols","red square 红方"],["🟩","symbols","green square 绿方"],["🟦","symbols","blue square 蓝方"],["🔺","symbols","red triangle up 三角 上"],["🔻","symbols","triangle down 三角 下"],["🔸","symbols","diamond orange 菱形"],["🔹","symbols","diamond blue 菱形"],["💠","symbols","diamond dot 菱形 花"],["🔶","symbols","diamond orange big 菱形"],["🔷","symbols","diamond blue big 菱形"],["▶️","symbols","play 播放"],["⏸️","symbols","pause 暂停"],["⏹️","symbols","stop 停止"],["⏺️","symbols","record 录制"],["⏩","symbols","fast forward 快进"],["⏪","symbols","rewind 快退"],["🔀","symbols","shuffle 随机 打乱"],["🔁","symbols","repeat 重复 循环"],["🔂","symbols","repeat one 单曲循环"],["🔄","symbols","refresh sync 刷新 同步"],["🔃","symbols","reload 重载"],["➕","symbols","plus add 加 新增"],["➖","symbols","minus 减"],["➗","symbols","divide 除"],["✖️","symbols","multiply 乘"],["💲","symbols","dollar money 美元 钱"],["™️","symbols","trademark 商标"],["©️","symbols","copyright 版权"],["®️","symbols","registered 注册商标"],["↔️","symbols","left right arrow 左右箭头"],["⬆️","symbols","up arrow 上箭头"],["⬇️","symbols","down arrow 下箭头"],["➡️","symbols","right arrow 右箭头"],["⬅️","symbols","left arrow 左箭头"],["🔙","symbols","back 返回"],["🔜","symbols","soon 很快"],["🔝","symbols","top 置顶 顶部"],["💤","symbols","zzz sleep 睡觉"],["🆕","symbols","new 新 新品"],["🆒","symbols","cool 酷"],["🆓","symbols","free 免费"],["🆗","symbols","ok 可以"],["🆙","symbols","up 提升"],["🆚","symbols","vs versus 对比"],["♾️","symbols","infinity 无限"],["💯","symbols","hundred perfect 满分 一百"],["💢","symbols","anger 生气"],["♨️","symbols","hot springs 温泉"],["🚸","symbols","children crossing 注意儿童"],["🔞","symbols","no one under eighteen 十八禁"],["📵","symbols","no mobile phones 禁止手机"],["❤️","symbols","red heart love 红心 爱"],["🧡","symbols","orange heart 橙心"],["💛","symbols","yellow heart 黄心"],["💚","symbols","green heart 绿心"],["💙","symbols","blue heart 蓝心"],["💜","symbols","purple heart 紫心"],["🖤","symbols","black heart 黑心"],["🤍","symbols","white heart 白心"],["🤎","symbols","brown heart 棕心"],["💔","symbols","broken heart 心碎"],["💕","symbols","two hearts 双心 爱心"],["💖","symbols","sparkling heart 闪亮的心"],["💗","symbols","growing heart 心动"]],$z=Hre.map(([e,t,n])=>({emoji:e,group:t,keywords:n}));function Wre(e,t=24){const n=e.trim().toLowerCase();if(!n)return[];const i=[];for(const o of $z)if((o.keywords.includes(n)||o.emoji===n)&&(i.push(o.emoji),i.length>=t))break;return i}const qre=8;function Ure(e,t,n=qre){return[t,...e.filter(i=>i!==t)].slice(0,n)}function zz(e,t){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const i=new Date,o=c=>String(c).padStart(2,"0"),s=`${o(n.getHours())}:${o(n.getMinutes())}`,r=n.getFullYear()===i.getFullYear(),l=n.getMonth()===i.getMonth(),a=n.getDate()===i.getDate();if(r&&l&&a)return s;const u=new Date(i);return u.setDate(i.getDate()-1),n.getFullYear()===u.getFullYear()&&n.getMonth()===u.getMonth()&&n.getDate()===u.getDate()?`${t} ${s}`:r?`${o(n.getMonth()+1)}-${o(n.getDate())} ${s}`:`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())} ${s}`}catch{return e}}function ld(e){if(e>=1024*1024)return`${bT(e/(1024*1024))}M`;if(e>=1024){const t=e/1024;return`${t>=100?Math.round(t):bT(t)}k`}return String(e)}function bT(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function Vre(){return window.kimiDesktop}function jz(e,t,n){const i=n.length===0?void 0:n.length===1?n[0]:n;try{Vre()?.log?.(e,t,i)}catch{}}function pa(e,...t){console.warn(e,...t),jz("warn",e,t)}function Gu(e,...t){console.error(e,...t),jz("error",e,t)}function ed(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}const Kre=/^(?:[A-Za-z]:[\\/]|\\\\|\/\/)/;function ea(e){const t=e.replaceAll("\\","/"),n=Kre.test(t),i=t.replace(/\/+$/,"");return n?i.toLowerCase():i}function Zre(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:i,sessionsHasMoreByWorkspace:o}=e,s=new Set(i.map(ea)),r=new Map;for(const f of t){const h=ea(f.root);s.has(h)||r.has(h)||r.set(h,{...f})}for(const f of n){const h=f.cwd;if(!h)continue;const m=ea(h);s.has(m)||r.has(m)||r.set(m,{id:f.workspaceId??h,root:h,name:ed(h),sessionCount:0})}const l=new Map;for(const f of t){const h=ea(f.root);l.has(h)||l.set(h,f.id)}const a=new Map;for(const f of n){const h=l.get(ea(f.cwd))??f.workspaceId??f.cwd;a.set(h,(a.get(h)??0)+1)}const u=[];for(const f of t){const h=ea(f.root);!s.has(h)&&!u.includes(h)&&u.push(h)}const c=[...r.keys()].filter(f=>!u.includes(f));c.sort((f,h)=>r.get(f).root.localeCompare(r.get(h).root));const d=[];for(const f of[...u,...c]){const h=r.get(f),m=a.get(h.id)??a.get(h.root)??0,g=o[h.id]===!1?m:Math.max(h.sessionCount,m);d.push({...h,sessionCount:g})}return d}function Gre(e,t){if(e===void 0||e.length===0)return;const n=t?.find(i=>i.id===e)??t?.find(i=>i.model===e);return n?.displayName||n?.model||(e.includes("/")?e.split("/").pop():e)}function Qre(e){if(!(e===void 0||e.length===0||e==="off"||e==="on"))return e}function Km(e){if(e===void 0)return"toggle";const t=e.capabilities??[];return t.includes("always_thinking")?"always-on":t.includes("thinking")||e.adaptiveThinking===!0?"toggle":"unsupported"}function Hz(e){return e?.supportEfforts??[]}function Yre(e){return e[Math.floor(e.length/2)]}function np(e){if(Km(e)==="unsupported")return"off";const t=Hz(e);return t.length>0?e?.defaultEffort??Yre(t):"on"}function Zm(e){const t=Hz(e),n=Km(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function wf(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function Jre(e){return e!=="off"}function Bk(e,t){return Zm(e).includes(t)}function M4(e,t){return t==="off"?"off":t==="on"?np(e):t}function j7(e,t){return t??np(e)}function Xre(e){return e==="off"?{enabled:!1}:e==="on"?{enabled:!0}:{enabled:!0,effort:e}}function H7(e,t){if(!e||typeof e!="object")return;const{enabled:n,effort:i}=e;if(n===!1)return Bk(t,"off")?"off":void 0;if(typeof i=="string"&&Bk(t,i))return i}function wT(e,t,n,i){return!n||e===void 0?t:H7(i,e)??np(e)}let ele=0;function x9(e,t){const n=++ele;return e.pendingThinkingBySession[t]=n,n}function Pa(e,t,n){return n===void 0||e.pendingThinkingBySession[t]!==n?!1:(delete e.pendingThinkingBySession[t],!0)}function W7(e,t,n){e.pendingThinkingBySession[t]===void 0&&(e.thinkingBySession[t]=n)}function Wz(){if(!(typeof window>"u"))return window.kimiDesktop}function gy(){return typeof Wz()?.getPathForFile=="function"}function T4(e){const t=Wz()?.getPathForFile;if(typeof t!="function")return null;try{return t(e)}catch{return null}}function CT(e){return T4(e)}function S3(e){return Array.from(e.dataTransfer?.items??[]).some(t=>t.kind==="file"&&t.type==="")}function NC(e,t=T4){const n=Array.from(e.dataTransfer?.items??[]);if(n.length===0){const l=Array.from(e.dataTransfer?.files??[]);return{files:l,folderPaths:[],items:l.map(a=>({kind:"file",file:a}))}}const i=[],o=[],s=[],r=new Set;for(const l of n){if(l.kind!=="file")continue;const a=l.getAsFile();if(a)if(l.webkitGetAsEntry()?.isDirectory===!0){const u=t(a);if(!u||r.has(u))continue;r.add(u),o.push(u),s.push({kind:"folder",path:u})}else i.push(a),s.push({kind:"file",file:a})}return{files:i,folderPaths:o,items:s}}function tle(e,t=T4){return NC(e,t).folderPaths}function nle(e,t=T4){const n=c=>`${c.size}:${c.type}:${c.name}`,i=[],o=new Set,s=new Set,r=[],l=new Set,a=[];let u=!1;for(const c of Array.from(e.items??[])){if(c.kind!=="file")continue;const d=c.getAsFile();if(c.webkitGetAsEntry?.()?.isDirectory===!0){u=!0,d&&s.add(n(d));const h=d?t(d):null;if(!h||l.has(h))continue;l.add(h),r.push(h),a.push({kind:"folder",path:h});continue}if(!d)continue;const f=n(d);o.has(f)||(o.add(f),i.push(d),a.push({kind:"file",file:d}))}for(const c of Array.from(e.files??[])){const d=n(c);s.has(d)||o.has(d)||(o.add(d),i.push(c),a.push({kind:"file",file:c}))}return{files:i,folderPaths:r,hasFolders:u,items:a}}function qz(e,t,n){return e==="unsupported"?[{titleKey:n.titleKey,hintKey:n.hintKey,disabled:!1}]:t.map(i=>({...i,disabled:e==="pending"}))}function ile(e,t,n){return n?e.filter(i=>i.sessions.length>0||i.workspace.id===t):e}const ole=/

([\s\S]*?)<\/summary>/,sle=/([\s\S]*?)<\/resume_hint>/,_3=/]*)>|<\/subagent>/g,rle="",AT=/(completed|failed|aborted):\s*(\d+)/g,xT=/([a-z_]+)="([^"]*)"/g;function lle(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function ale(e){const t={};xT.lastIndex=0;let n;for(;(n=xT.exec(e))!==null;)t[n[1]]=lle(n[2]);return t}function ule(e){const t={completed:0,failed:0,aborted:0};AT.lastIndex=0;let n;for(;(n=AT.exec(e))!==null;){const i=n[1];t[i]=Number(n[2])}return t}function cle(e,t){const n=ale(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function dle(e){const t=[],n=[];_3.lastIndex=0;let i;for(;(i=_3.exec(e))!==null;)if(i[0]===rle){if(n.length===0)continue;const o=n.pop();o&&n.length===0&&t.push(cle(o.attrs,e.slice(o.bodyStart,i.index)))}else n.length===0?n.push({attrs:i[1]??"",bodyStart:_3.lastIndex}):n.push(null);return t}function fle(e){if(e==null)return null;const t=Array.isArray(e)?e.join(` +`):e;if(!t.includes(""))return null;const n=ole.exec(t)?.[1]?.trim()??"",{completed:i,failed:o,aborted:s}=ule(n),r=sle.exec(t)?.[1]?.trim(),l=dle(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 hle=3,ple="Use TaskOutput with one of the task_id values above to read the full output.";function Lh(e,t){return new RegExp(`^${t}: (.+)$`,"m").exec(e)?.[1]}function mle(e,t){const n=Number(Lh(e,t)??0);return Number.isFinite(n)?n:0}function Uz(e,t){return e.match(t)?.length??0}function ST(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 _T(e,t){return t>=2&&e[t-1]===` +`&&e[t-2]===` +`}function IT(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 gle(e){return e.endsWith(ple)}function vle(e){const t=Lh(e,"active_background_tasks");if(t===void 0)return!1;const n=Number(t);return Number.isFinite(n)?Uz(e,/^task_id: /gm)===n:!1}function yle(e,t){return[...e.matchAll(/^description: (.+)$/gm)].map(i=>i[1]??"").slice(0,Math.min(hle,t))}function kle(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=Lh(i,"wait_status");if(o!=="completed"&&o!=="timed_out"&&o!=="no_tasks")return null;const s=Number(Lh(i,"waited_ms")??0);let r,l=n?.index??t.length;o==="completed"&&n!==null&&t.slice(n.index).startsWith("[finished]")&&(r=IT(t,n.index,"finished"),l=n.index+10);let a=0,u=-1;for(const f of ST(t,"completed_during_wait",l)){if(!_T(t,f))continue;const h=IT(t,f,"completed_during_wait");gle(h)&&(a=Uz(h,/^task_id: /gm),u=f)}let c=0,d=[];for(const f of ST(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=MT(o)||MT(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 Xt={permission:"kimi-web.permission",permissionBySession:"kimi-web.permission-by-session",permissionExplicit:"kimi-web.permission-explicit",permissionStickyAt:"kimi-web.permission-sticky-at",permissionDaemonDefault:"kimi-web.permission-daemon-default",nonComposerPromptIds:"kimi-web.non-composer-prompt-ids",activeWorkspace:"kimi-active-workspace",planArmed:"kimi-web.plan-armed",swarmMode:"kimi-web.swarm-mode",towerMode:"kimi-web.tower-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",diffViewMode:"kimi-web.diff-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"},Cle="__new__";function Zd(e){return e&&e.length>0?e:Cle}function $k(e){return`kimi-web.draft.${Zd(e)}`}function TT(e){return`kimi-web.attachment-draft.${Zd(e)}`}function zk(e){return`kimi-web.draft-atts.${Zd(e)}`}function so(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function co(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function fr(e){try{globalThis.localStorage.removeItem(e)}catch{}}function vc(e){const t=so(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Ua(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function FC(){const e=so(Xt.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 ET(e){const n={...FC()};for(const[i,o]of Object.entries(e))o?n[i]=!0:delete n[i];co(Xt.unread,JSON.stringify(n))}function Ale(){const e=vc(Xt.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function I3(e){Ua(Xt.collapsedWorkspaces,Array.from(e))}function xle(){return vc(Xt.pinnedCollapsed)===!0}function DC(e){Ua(Xt.pinnedCollapsed,e)}function Sle(){return so(Xt.sidebarViewMode)==="flat"?"flat":"grouped"}function _le(e){co(Xt.sidebarViewMode,e)}function Ile(){return so(Xt.mobileSwitcherViewMode)==="grouped"?"grouped":"flat"}function Mle(e){co(Xt.mobileSwitcherViewMode,e)}function Tle(){return so(Xt.diffViewMode)==="tree"?"tree":"list"}function Ele(e){co(Xt.diffViewMode,e)}function Lle(){const e=vc(Xt.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function LT(e){Ua(Xt.workspaceOrder,Array.from(e))}function Nle(){return so(Xt.workspaceSort)==="recent"?"recent":"manual"}function Fle(e){co(Xt.workspaceSort,e)}function Dle(){const e=vc(Xt.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 NT(e){Ua(Xt.workspaceRecencyFloor,e)}function Rle(){try{return so(Xt.activeWorkspace)}catch{return null}}function FT(e){try{co(Xt.activeWorkspace,e)}catch{}}function Ole(){try{const e=so(Xt.hiddenWorkspaces);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function DT(e){try{co(Xt.hiddenWorkspaces,JSON.stringify(e))}catch{}}function Vz(){const e=vc(Xt.pinnedSessions);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function M3(e){Ua(Xt.pinnedSessions,Array.from(e))}function S9(){const e=vc(Xt.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 RT(e){Ua(Xt.workspaceNameOverrides,e)}function Cf(e){return e==="manual"||e==="auto"||e==="yolo"?e:void 0}function OT(){return Cf(so(Xt.permission))??"manual"}function Ple(e){co(Xt.permission,e)}function PT(){const e=so(Xt.permissionStickyAt),t=Number(e);return Number.isFinite(t)&&t>0?t:e===null&&so(Xt.permission)!==null?1:0}function s1(e){co(Xt.permissionStickyAt,String(e))}function Kz(e){const t=so(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const i={};for(const[o,s]of Object.entries(n)){const r=Cf(s);r!==void 0&&(i[o]=r)}return i}catch{return{}}}function Zz(e,t){co(e,JSON.stringify(t))}function BT(){return Kz(Xt.permissionBySession)}function T3(e){Zz(Xt.permissionBySession,e)}function $T(){return Kz(Xt.permissionExplicit)}function Ble(e){Zz(Xt.permissionExplicit,e)}const zT={manual:0,yolo:1,auto:2};function $le(e){let t="auto",n=!1;for(const i of e)i!==void 0&&(n=!0,zT[i]typeof n=="number"&&Number.isFinite(n)&&n>0).slice(0,2);return t.length===0?Gz:Math.round(t.reduce((n,i)=>n+i,0))}function Qz(e){return e==null||!Number.isFinite(e)||e<=0?Gz:Math.round(e)}const RC=96;function Wle(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 qle(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):RC:RC}function Ule(e){return e>jle}function jT(e){return Math.round(e*.4)}function Vle(e){return e==null||!Number.isFinite(e)||e<=0?RC:Math.round(e)}function Kle(e,t,n,i){const o=Qz(n),s=Vle(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 E3(e,t,n){return t==null||!Number.isFinite(t)?e:Math.max(Qz(n),Math.min(e,Math.round(t)))}function Zle(e,t,n,i){return Math.max(Math.round(i),Math.min(Math.round(e+t),Math.round(n)))}function Gle(e,t){return t===null||t===e}const U7="application/x-kimi-session-row";function Qle(e,t){return e.includes(t)?e:[...e,t]}function Yle(e,t){return e.includes(t)?e.filter(n=>n!==t):e}function Jle(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 Xle={"&":"&","<":"<",">":">",'"':""","'":"'"};function N0(e){return e.replace(/[&<>"']/g,t=>Xle[t]??t)}function eae(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tae(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 HT(i,n*2);const s=i.toLowerCase().indexOf(o.toLowerCase());if(s<0)return HT(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 Yz=/([\s\S]*?)<\/kbd>/g;function Jz(e){let t="",n=0;for(const i of e.matchAll(Yz))t+=N0(e.slice(n,i.index)),t+=`${N0(i[1]??"")}`,n=i.index+i[0].length;return t+N0(e.slice(n))}function nae(e){return e.replace(Yz,"$1")}let iae=0;function WT(e,t){const n=++iae;return e.pendingPlanBySession[t]=n,n}function V7(e,t,n){return n===void 0||e.pendingPlanBySession[t]!==n?!1:(delete e.pendingPlanBySession[t],!0)}function OC(e,t,n){e.pendingPlanBySession[t]===void 0&&(e.planModeBySession[t]=n)}function oae(e,t,n){return e.find(i=>i.window?.duration===t&&i.window?.unit===n)}const sae=30;function rae(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 PC(e,t){if(t<=0)return"ok";const n=e/t;return n>=.85?"danger":n>=.5?"warn":"ok"}function _9(e,t){return t<=0?0:Math.min(100,Math.round(e/t*100))}function lae(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 tj="kimiWeb.compaction",nj="managed:kimi-code",aae=["kimi","openai","openai_responses","anthropic","google-genai","vertexai"];function vy(){return{model:"",maxContextSize:"",displayName:"",capabilities:["tool_use","thinking"],supportEfforts:[],adaptiveThinking:!0}}function BC(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 ij=/^[\p{L}\p{N}][\p{L}\p{N}\-_ ]*$/u;function uae(e,t={}){const n=e.id.trim();if(n==="")return"idRequired";if(!ij.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 oj(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 cae(e){const t=e.apiKey.trim(),n=e.baseUrl.trim();return{id:e.id.trim(),type:e.type,models:oj(e.models),...t===""?{}:{apiKey:t},...n===""?{}:{baseUrl:n}}}function dae(e,t,n){const i=oj(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 sj(e){return e.id===nj&&e.type==="kimi"}function fae(e,t){return t.startsWith("image/")||t==="application/pdf"?!0:e.toLowerCase().endsWith(".pdf")}const jk="/devices/",rj="kimi-rc-device-id";function hae(e){return new URLSearchParams(e.search).get("rc")==="1"}function lj(e){const{pathname:t}=e;if(!t.startsWith(jk))return;const n=t.slice(jk.length).split("/")[0];if(n)try{const i=decodeURIComponent(n);return i.length>0?i:void 0}catch{return}}function pae(e){if(lj({pathname:e})===void 0)return e;const t=e.slice(jk.length),n=t.indexOf("/");return n<0?"/":t.slice(n)}function mae(e){return`${jk}${encodeURIComponent(e)}/`}function aj(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 gae(e){const t=lj(e);return t!==void 0?(yae(t),t):vae()}function vae(){try{return window.sessionStorage.getItem(rj)??void 0}catch{return}}function yae(e){try{window.sessionStorage.setItem(rj,e)}catch{}}const kae=/^(\d+)\t(.*)$/;function bae(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=kae.exec(o);if(!s)return null;i.push(Number(s[1])),n.push(s[2]??"")}return{contents:n,lineNumbers:i}}function qT(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 uj(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 wae(e,t){const n=uj(e,t);return n!==null&&typeof n.fire=="function"?(n.fire(),!0):!1}function UT(e,t,n){const i=uj(e,t);return i!==null&&typeof i.value==typeof n?(i.value=n,!0):!1}const L3={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 cj(e,t,n={}){const i=n.isPageHidden??L3.isPageHidden,o=n.onVisibilityChange??L3.onVisibilityChange,s=n.observeIntersection??L3.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 ir="kimi-web.server-credential",Cae="token",Aae=10080*60*1e3;let ec;const $C=new Set;function xae(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Cae);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 zC(e){return{version:1,credential:e,expiresAt:Date.now()+Aae}}function Sae(e){return JSON.stringify(e)}function K7(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 jC(e){globalThis.localStorage?.setItem(ir,Sae(e))}function _ae(){try{const e=globalThis.localStorage?.getItem(ir);if(e){const n=K7(e);if(n===void 0){const i=zC(e);let o=!1;try{jC(i),o=!0}catch{}if(!o)try{globalThis.localStorage?.getItem(ir)===e&&globalThis.localStorage?.removeItem(ir),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(ir)}catch{}return o?i:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(ir),globalThis.localStorage?.getItem(ir)===e&&globalThis.localStorage?.removeItem(ir);return}const t=globalThis.sessionStorage?.getItem(ir);if(t){const n=zC(t);let i=!1;try{jC(n),i=!0}catch{}try{globalThis.sessionStorage?.removeItem(ir),i=!0}catch{}return i?n:void 0}return}catch{return}}function Iae(){const e=xae();return e?(dj(e),!0):(ec=_ae(),ec!==void 0)}function Mae(){if(ec!==void 0){if(ec.expiresAt<=Date.now()){Tae(ec);return}return ec.credential}}function Tae(e){ec=void 0;try{globalThis.sessionStorage?.removeItem(ir);const t=globalThis.localStorage?.getItem(ir),n=t==null?void 0:K7(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(ir)}catch{}}function dj(e){const t=zC(e);ec=t;try{jC(t)}catch{}try{globalThis.sessionStorage?.removeItem(ir)}catch{}}function Eae(){const e=ec;ec=void 0;try{const t=globalThis.localStorage?.getItem(ir),i=(t==null?void 0:K7(t))?.credential??t;e!==void 0&&i===e.credential&&globalThis.localStorage?.removeItem(ir),globalThis.sessionStorage?.removeItem(ir)}catch{}}function Lae(e){return $C.add(e),()=>{$C.delete(e)}}function Nae(){Eae();for(const e of $C)try{e()}catch{}}function l2(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 VT(e){let t=null;for(const n of e){const i=l2(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 KT;function Fae(e){if(typeof Intl.Segmenter=="function")return KT??=new Intl.Segmenter("und",{granularity:"grapheme"}),KT.segment(e)}const Dae=/\p{Emoji_Presentation}/u,Rae=/\p{Regional_Indicator}/u,Oae=/\p{Extended_Pictographic}/u,Pae="️";function Bae(e){return Dae.test(e)||Rae.test(e)?!0:Oae.test(e)&&e.includes(Pae)}function fj(e){const t=Fae(e)?.[Symbol.iterator]().next().value;if(t===void 0||!Bae(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 $ae(e,t){const{rest:n}=fj(e),i=t?.trim()??"";return i?n?`${i} ${n}`:i:n}function hj(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 zae(e){return e===void 0||e.length===0?"/":`${HC}${encodeURIComponent(e)}`}function Z7(){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 vj(e,t=Z7()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyA"||e.key.toLowerCase()==="a")&&!e.defaultPrevented}function jae(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement&&(e.isContentEditable||e.closest("input, textarea")!==null)}function Hae(e,t){return typeof Element>"u"||!(e instanceof Element)?null:e.closest(t)}function ZT(e){e.ownerDocument.getSelection()?.selectAllChildren(e)}function Wae(e,t=Z7()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyK"||e.key.toLowerCase()==="k")&&!e.defaultPrevented}const qae=[{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 Uae(e){const t=e.replace(/"[^"]*"|'[^']*'/g," ");for(const{pattern:n,detail:i}of qae)if(n.test(t))return i}function Hf(e){return Array.isArray?Array.isArray(e):kj(e)==="[object Array]"}function Vae(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 WC(e){return e==null?"":Vae(e)}function Mr(e){return typeof e=="string"}function I9(e){return typeof e=="number"}function Kae(e){return e===!0||e===!1||Zae(e)&&kj(e)=="[object Boolean]"}function yj(e){return typeof e=="object"}function Zae(e){return yj(e)&&e!==null}function ta(e){return e!=null}function yy(e){return!e.trim().length}function kj(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Gae="Incorrect 'index' type",qC="Invalid doc index: must be a non-negative integer within the bounds of the docs array",Qae=e=>`Invalid value for key ${e}`,Yae=e=>`Pattern length exceeds max of ${e}.`,Jae=e=>`Missing ${e} property in key`,Xae=e=>`Property 'weight' in key '${e}' must be a positive integer`,eue="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.",GT=Object.prototype.hasOwnProperty;var tue=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const i=bj(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 bj(e){let t=null,n=null,i=null,o=1,s=null;if(Mr(e)||Hf(e))i=e,t=QT(e),n=M9(e);else{if(!GT.call(e,"name"))throw new Error(Jae("name"));const r=e.name;if(i=r,GT.call(e,"weight")&&e.weight!==void 0&&(o=e.weight,o<=0))throw new Error(Xae(M9(r)));t=QT(r),n=M9(r),s=e.getFn??null}return{path:t,id:n,weight:o,src:i,getFn:s}}function QT(e){return Hf(e)?e:e.split(".")}function M9(e){return Hf(e)?e.join("."):e}function nue(e,t){const n=[];let i=!1;const o=(s,r,l,a)=>{if(ta(s))if(!r[l])n.push(a!==void 0?{v:s,i:a}:s);else{const u=s[r[l]];if(!ta(u))return;if(l===r.length-1&&(Mr(u)||I9(u)||Kae(u)||typeof u=="bigint"))n.push(a!==void 0?{v:WC(u),i:a}:WC(u));else if(Hf(u)){i=!0;for(let c=0,d=u.length;ce.score===t.score?e.idx=9&&e<=13||e===32||e===160}function aue(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(Mr(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 wj(e,t,{getFn:n=$n.getFn,fieldNormWeight:i=$n.fieldNormWeight}={}){const o=new G7({getFn:n,fieldNormWeight:i});return o.setKeys(e.map(bj)),o.setSources(t),o.create(),o}function uue(e,{getFn:t=$n.getFn,fieldNormWeight:n=$n.fieldNormWeight}={}){const{keys:i,records:o}=e,s=new G7({getFn:t,fieldNormWeight:n});return s.setKeys(i),s.setIndexRecords(o),s}function cue(e=[],t=$n.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 due(e,t,n,{location:i=$n.location,distance:o=$n.distance,threshold:s=$n.threshold,findAllMatches:r=$n.findAllMatches,minMatchCharLength:l=$n.minMatchCharLength,includeMatches:a=$n.includeMatches,ignoreLocation:u=$n.ignoreLocation}={}){if(t.length>32)throw new Error(Yae(32));const c=t.length,d=e.length,f=Math.max(0,Math.min(i,d));let h=s,m=f;const g=(x,A)=>{const T=x/c;if(u)return T;const I=Math.abs(f-A);return o?T+I/o:I?1:T},y=l>1||a,k=y?Array(d):[];let v;for(;(v=e.indexOf(t,m))>-1;){const x=g(0,v);if(h=Math.min(x,h),m=v+c,y){let A=0;for(;A=I;R-=1){const F=R-1,P=n[e[F]];if(H[R]=(H[R+1]<<1|1)&P,x&&(H[R]|=(C[R+1]|C[R])<<1|1|C[R+1]),H[R]&E&&(w=g(x,F),w<=h)){if(h=w,m=F,M=x,m<=f)break;I=Math.max(1,2*f-m)}}if(g(x+1,f)>h)break;C=H}if(y&&m>=0){const x=Math.min(d-1,m+c-1+M);for(let A=m;A<=x;A+=1)n[e[A]]&&(k[A]=1)}const S={isMatch:m>=0,score:Math.max(.001,w)};if(y){const x=cue(k,l);x.length?a&&(S.indices=x):S.isMatch=!1}return S}function fue(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(hue,t=>Cj[t]):e=>e;var Y7=class{constructor(e,{location:t=$n.location,threshold:n=$n.threshold,distance:i=$n.distance,includeMatches:o=$n.includeMatches,findAllMatches:s=$n.findAllMatches,minMatchCharLength:r=$n.minMatchCharLength,isCaseSensitive:l=$n.isCaseSensitive,ignoreDiacritics:a=$n.ignoreDiacritics,ignoreLocation:u=$n.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?_v(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const c=(f,h)=>{this.chunks.push({pattern:f,alphabet:fue(f),startIndex:h})},d=this.pattern.length;if(d>32){let f=0;const h=d%32,m=d-h;for(;f{const{isMatch:k,score:v,indices:C}=due(e,m,g,{location:o+y,distance:s,threshold:r,findAllMatches:l,minMatchCharLength:a,includeMatches:i,ignoreLocation:u});k&&(f=!0),d+=v,k&&C&&c.push(...C)});const h={isMatch:f,score:f?d/this.chunks.length:1};return f&&i&&(h.indices=Q7(c)),h}};const pue=new Set(["fuzzy","include"]);function mue(e){return e.startsWith("inverse")}const UC=[{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 Y7(e,{location:t.location??$n.location,threshold:t.threshold??$n.threshold,distance:t.distance??$n.distance,includeMatches:t.includeMatches??$n.includeMatches,findAllMatches:t.findAllMatches??$n.findAllMatches,minMatchCharLength:t.minMatchCharLength??$n.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??$n.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??$n.ignoreDiacritics,ignoreLocation:t.ignoreLocation??$n.ignoreLocation});return{type:"fuzzy",search(i){return n.searchIn(i)}}}}],YT=UC.length,gue="\0",vue="|";function yue(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=yue(n.replace(/\u0000/g,"|").trim()).filter(s=>s&&!!s.trim()),o=[];for(let s=0,r=i.length;s!!(e[Wk.AND]||e[Wk.OR]),wue=e=>!!e[KC.PATH],Cue=e=>!Hf(e)&&yj(e)&&!ZC(e),XT=e=>({[Wk.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Aj(e,t,{auto:n=!0}={}){const i=o=>{if(Mr(o)){const a={keyId:null,pattern:o};return n&&(a.searcher=Hk(o,t)),a}const s=Object.keys(o),r=wue(o);if(!r&&s.length>1&&!ZC(o))return i(XT(o));if(Cue(o)){const a=r?o[KC.PATH]:s[0],u=r?o[KC.PATTERN]:o[a];if(!Mr(u))throw new Error(Qae(a));const c={keyId:M9(a),pattern:u};return n&&(c.searcher=Hk(u,t)),c}const l={children:[],operator:s[0]};return s.forEach(a=>{const u=o[a];Hf(u)&&u.forEach(c=>{l.children.push(i(c))})}),l};return ZC(e)||(e=XT(e)),i(e)}function GC(e,{ignoreFieldNorm:t=$n.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 Aue(e,{ignoreFieldNorm:t=$n.ignoreFieldNorm}){e.forEach(n=>{n.score=GC(n.matches,{ignoreFieldNorm:t})})}var xue=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 Sue(e){const t=[];return e.matches.forEach(n=>{if(!ta(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 _ue(e,t,{includeMatches:n=$n.includeMatches,includeScore:i=$n.includeScore}={}){return e.map(o=>{const{idx:s}=o,r={item:t[s],refIndex:s};return n&&(r.matches=Sue(o)),i&&(r.score=o.score),r})}const Iue=/[\p{L}\p{M}\p{N}_]+/gu,eE=new WeakSet;function Mue(e){eE.has(e)||(eE.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 Tue(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||Mue(e),t=>t.match(e)||[]):t=>t.match(Iue)||[]}function QC({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const i=Tue(n);return{tokenize(o){return e||(o=o.toLowerCase()),t&&(o=_v(o)),i(o)}}}var Eue=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=QC({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 Y7(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=Q7(t)),this.combineAll&&(this.useMask?a.matchedMask=s:a.matchedTerms=r,a.termCount=this.numTerms),a}};function N3(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 xj(e,t,n,i){const{i:o,v:s,$:r}=t;if(s!==void 0){N3(e,s,o,i);return}if(r)for(let l=0;ll-a);for(const l of n)Fue(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 Wf=class{constructor(e,t,n){this.options={...$n,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new tue(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=Hk(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 G7))throw new Error(Gae);if(this._myIndex=t||wj(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=QC({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Lue(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!ta(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=QC({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Nue(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(qC);this._invertedIndex&&tE(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(Mr(e)&&!e.trim()){let f=this._docs.map((h,m)=>({item:h,refIndex:m}));return I9(n)&&n>-1&&(f=f.slice(0,n)),f}const a=s&&I9(n)&&n>0&&Mr(e),u=r,c=(f,h)=>u(f,h)||f.idx-h.idx;let d;if(a){const f=new xue(n,c);Mr(this._docs[0])?this._searchStringList(e,{heap:f,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:f,ignoreFieldNorm:l}),d=f.extractSorted()}else d=Mr(e)?Mr(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Aue(d,{ignoreFieldNorm:l}),s&&d.sort(Mr(e)?c:u),I9(n)&&n>-1&&(d=d.slice(0,n));return _ue(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(!ta(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=GC(h.matches,{ignoreFieldNorm:n}),t.insert(h)):r.push(h)}}}),r}_searchLogical(e){const t=Aj(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((y,k)=>{g.push(...this._findMatches({key:y,value:a[k],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(ta(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(!ta(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=GC(h.matches,{ignoreFieldNorm:n}),t.insert(h)):l.push(h)}}),l}_findMatches({key:e,value:t,searcher:n}){if(!ta(t))return[];const i=[];if(Hf(t))t.forEach(({v:o,i:s,n:r})=>{if(!ta(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;oJ7(t))};var Due=Wf;const Rue=/^[\uD800-\uDBFF]$/,Oue=/^[\uDC00-\uDFFF]$/,Pue=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;var nE;(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"})(nE||(nE={}));const ma={Normal:1,Surname:10,Custom:100};function du(e){var t;return e.length-(((t=e.match(Pue))===null||t===void 0?void 0:t.length)||0)}function YC(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 Bue=["zh","ch","sh","z","c","s","b","p","m","f","d","t","n","l","g","k","h","j","q","x","r","y","w",""],$ue=["j","q","x"],zue=["uān","uán","uǎn","uàn","uan","uē","ué","uě","uè","ue","ūn","ún","ǔn","ùn","un","ū","ú","ǔ","ù","u"],jue={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:"ü"},Hue=["ia","ian","iang","iao","ie","iu","iong","ua","uai","uan","uang","ue","ui","uo","üan","üe","van","ve"],iE={一:"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ī"},oE={重:"chóng",行:"háng",斗:"dǒu",更:"gēng"};function Wue(){const e={零一:"líng yī","〇一":"líng yī",十一:"shí yī",一十:"yī shí",第一:"dì yī",一十一:"yī shí yī"};for(let t in iE)for(let n in oE){const i=`${t}${n}`,o=`${iE[t]} ${oE[n]}`;e[i]=o}return e}const sE=Wue(),que=Object.keys(sE).map(e=>({zh:e,pinyin:sE[e],probability:1e-12,length:du(e),priority:ma.Normal,dict:Symbol("rule")})),_j={不:{bú:[4]},一:{yí:[4],yì:[1,2,3]}},Uue={不:["的","而","之","后","也","还","地"],一:["的","而","之","后","也","还","是"]},Vue=Object.keys(_j),JC={南宫:"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"},Kue=Object.keys(JC).map(e=>({zh:e,pinyin:JC[e],probability:1+du(e),length:du(e),priority:ma.Surname,dict:Symbol("surname")})),rE={"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":["滧"]},Af=new Sj;Object.keys(rE).forEach(e=>{const t=rE[e];for(let n of t)Af.set(n,e)});const lE={这个:"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"},Zue=Object.keys(lE).map(e=>({zh:e,pinyin:lE[e],probability:2e-8,length:2,priority:ma.Normal,dict:Symbol("dict2")})),aE={为什么:"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"},Gue=Object.keys(aE).map(e=>({zh:e,pinyin:aE[e],probability:2e-8,length:3,priority:ma.Normal,dict:Symbol("dict3")})),uE={成吉思汗:"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"},Que=Object.keys(uE).map(e=>({zh:e,pinyin:uE[e],probability:2e-8,length:4,priority:ma.Normal,dict:Symbol("dict4")})),cE={巴尔干半岛:"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"},Yue=Object.keys(cE).map(e=>({zh:e,pinyin:cE[e],probability:2e-8,length:5,priority:ma.Normal,dict:Symbol("dict5")}));function dE(e,t){return e&&(e.decimalt.probability)?e:t}function fE(e){e.probability<1e-300&&(e.probability*=1e300,e.decimal+=1)}function Jue(e){return e.priority===ma.Custom?-(e.length*e.length*100):e.priority===ma.Surname?-(e.length*e.length*10):0}function Xue(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+Jue(o),patterns:r.patterns,concatPattern:o};fE(u),n[a]=dE(n[a],u),o=e[--i]}const l={probability:1e-13*r.probability,decimal:0,patterns:r.patterns};fE(l),n[s]=dE(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 hE(e,t){return e&&e.count<=t.count?e:t}function ece(e){return e.priority===ma.Custom?-(e.length*e.length*1e5):e.priority===ma.Surname?-(e.length*e.length*100):1}function tce(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:ece(o)+r.count,patterns:r.patterns,concatPattern:o};n[a]=hE(n[a],u),o=e[--i]}const l={count:1+r.count,patterns:r.patterns};n[s]=hE(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 nce(e,t){return!(t.index+t.length<=e.index||t.priority>e.priority||t.priority===e.priority&&t.length>e.length)}function ice(e){const t=[];for(let n=e.length-1;n>=0;){const{index:i}=e[n];let o=n-1;for(;o>=0&&nce(e[n],e[o]);)o--;(o<0||e[o].index+e[o].length<=i)&&t.push(e[n]),n=o}return t.reverse()}var pE;(function(e){e[e.ReverseMaxMatch=1]="ReverseMaxMatch",e[e.MaxProbability=2]="MaxProbability",e[e.MinTokenization=3]="MinTokenization"})(pE||(pE={}));class mE{constructor(t,n="",i=""){this.children=new Map,this.fail=null,this.patterns=[],this.parent=t,this.prefix=n,this.key=i}}class oce{constructor(){this.dictMap=new Map,this.queues=[],this.root=new mE(null)}build(t){this.buildTrie(t),this.buildFailPointer()}buildTrie(t){for(let n of t){const i=YC(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[du(t.prefix)]||(this.queues[du(t.prefix)]=[]),this.queues[du(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=YC(t);for(let r=0;rn==="off"?c.priority!==ma.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!==ma.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?ice(o):i===3?tce(o,du(t)):Xue(o,du(t))}}const sce=[...Yue,...Que,...Gue,...Zue,...que,...Kue],Ij=new oce;Ij.build(sce);const rce=new Sj,lce=()=>rce,ace=[];function uce(){return ace}const o0=e=>{const t=Af.get(e);return t?t.split(" ")[0]:e},cce=e=>{const t=[],n=uce();for(let i=0;i{const s=o?cce(e):e,r=Ij.search(s,n,i);let l=0;const a=YC(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,"ê"),Mj=(e,t="off")=>{const n=lce();let i=Af.get(e)?Af.get(e).split(" "):[];if(n.get(e))i=n.get(e).split(" ");else if(t!=="off"){const o=JC[e];o&&(i=[o].concat(i.filter(s=>s!==o)))}return i},fce=(e,t="off")=>{let n=Mj(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}]},qk=(e,t)=>{const n=e.split(" "),i=[],o=[];for(let s of n)for(let r of Bue)if(s.startsWith(r)){let l=s.slice(r.length);$ue.indexOf(r)!==-1&&zue.indexOf(l)!==-1&&(l=jue[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(" ")}},T9=e=>{const{final:t}=qk(e);let n="",i="",o="";return Hue.indexOf(E4(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}},L4=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(" ")},hce=(e,t)=>{const n=E4(e).split(" "),i=L4(t).split(" "),o=[];return n.forEach((s,r)=>{o.push(`${s}${i[r]}`)}),o.join(" ")},Tj=(e,t)=>{const n=[];return e.split(" ").forEach(o=>{n.push(t?o[0]:o)}),n.join(" ")};function pce(e,t,n){if(Vue.indexOf(e)===-1)return o0(e);if(t===n&&t&&o0(t)!==t)return E4(o0(e));if(n&&!Uue[e].includes(n)){const i=o0(n);if(i!==n){const o=L4(i),s=_j[e];for(let r in s)if(s[r].indexOf(Number(o))!==-1)return r}}}function mce(e,t){if(e==="了"&&(!t||!Af.get(t)))return"liǎo"}function gce(e,t){if(e==="々")return!t||!Af.get(t)?"tóng":Af.get(t).split(" ")[0]}function gE(e,t,n){return gce(e,t)||mce(e,t)||pce(e,t,n)||o0(e)}const vce=e=>typeof e!="string"?(console.error("The first param of pinyin is error: "+e+' is not assignable to type "string".'),!1):!0;function F3(e,t){return t instanceof RegExp?t.test(e):!0}const yce=(e,t)=>{let n=t.nonZh;if(n==="removed")return e.filter(i=>i.isZh||!F3(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&&F3(o.origin,t.nonZhScope)&&F3(s.origin,t.nonZhScope)&&(o.origin+=s.origin,o.result+=s.result,s.delete=!0)}return e.filter(i=>!i.delete)}else return e},vE=(e,t)=>du(e)===1&&t.multiple?fce(e,t.surname):!1,kce=(e,t)=>{switch(t.pattern){case"pinyin":break;case"num":e.forEach(n=>{n.result=n.isZh?L4(n.result):""});break;case"initial":e.forEach(n=>{n.result=n.isZh?qk(n.result,t.initialPattern).initial:""});break;case"final":e.forEach(n=>{n.result=n.isZh?qk(n.result,t.initialPattern).final:""});break;case"first":e.forEach(n=>{n.result=Tj(n.result,n.isZh)});break;case"finalHead":e.forEach(n=>{n.result=n.isZh?T9(n.result).head:""});break;case"finalBody":e.forEach(n=>{n.result=n.isZh?T9(n.result).body:""});break;case"finalTail":e.forEach(n=>{n.result=n.isZh?T9(n.result).tail:""});break}},bce=(e,t)=>{switch(t.toneType){case"symbol":break;case"none":e.forEach(n=>{n.isZh&&(n.result=E4(n.result))});break;case"num":{e.forEach(n=>{n.isZh&&(n.result=hce(n.result,n.originPinyin))});break}}},wce=(e,t)=>{t.v&&e.forEach(n=>{n.isZh&&(n.result=n.result.replace(/ü/g,typeof t.v=="string"?t.v:"v"))})},Cce=(e,t,n)=>{if(t.multiple&&du(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}=qk(o,t.initialPattern),{head:l,body:a,tail:u}=T9(o);let c=[];return o!==""&&(c=[o].concat(Mj(i.origin,t.surname).filter(d=>d!==o))),{origin:i.origin,pinyin:o,initial:s,final:r,first:Tj(i.result,i.isZh),finalHead:l,finalBody:a,finalTail:u,num:Number(L4(i.originPinyin)),isZh:i.isZh,polyphonic:c,inZhRange:!!Af.get(i.origin),result:i.result}}):e.map(i=>i.result).join(t.separator)},Ace=(e,t)=>(t===!1&&e.forEach(n=>{n.origin==="一"?n.result=n.originPinyin="yī":n.origin==="不"&&(n.result=n.originPinyin="bù")}),e),xce={pattern:"pinyin",toneType:"symbol",type:"string",multiple:!1,mode:"normal",removeNonZh:!1,nonZh:"spaced",v:!1,separator:" ",toneSandhi:!0,segmentit:2};function Uk(e,t){if(t=Object.assign(Object.assign({},xce),t||{}),!vce(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(du(e)),{list:o}=dce(e,i,t.surname,t.segmentit,t.traditional);return o=Ace(o,t.toneSandhi),o=yce(o,t),vE(e,t)&&(o=vE(e,t)),kce(o,t),bce(o,t),wce(o,t),Cce(o,t,e)}var XC;(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"})(XC||(XC={}));XC.AllSegment;const eA=[{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:"/tower",desc:"commands.tower.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 tA(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 ac="skill:";function Sce(e,t){const n=e.find(r=>r.name===t);if(n!==void 0)return n;const i=`/${ac}${t.slice(1)}`,o=e.find(r=>r.name===i);if(o!==void 0)return o;if(!t.startsWith(`/${ac}`))return;const s=t.slice(1+ac.length);if(!(s.length===0||s.includes(" ")))return e.find(r=>r.isSkill===!0&&N4(r.name)===s)}function N4(e){const t=e.startsWith("/")?e.slice(1):e;return t.startsWith(ac)?t.slice(ac.length):t}function _ce(e,t,n){for(const i of[`/${ac}${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 Ej(e=[],t){const n=t?.towerEnabled===!0?eA:eA.filter(o=>o.name!=="/tower"),i=e.map(o=>({name:o.source==="builtin"?`/${o.name}`:`/${ac}${o.name}`,desc:o.description,isSkill:!0,acceptsInput:!0}));return[...n,...i]}const yE=new Map;function Lj(e){let t=yE.get(e);if(!t){const n=Uk(e,{toneType:"none",type:"array"}),i=Uk(e,{pattern:"first",toneType:"none",type:"array"});t=Ice(e,n,i),yE.set(e,t)}return t}const kE={full:[],first:[],offsets:[],literal:[]};function Ice(e,t,n){if(t.length!==n.length)return kE;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?kE:{full:t,first:n,offsets:i,literal:o}}function nA(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 nA(i,"first",o,o+t.length);const s=i.full.join("").indexOf(t);if(!(s<0))return nA(i,"full",s,s+t.length)}function Nce(e,t,n){const i=e.trim().replace(/^\//,"").toLowerCase();if(i==="")return{};const o=Ece(t,i),s=Lce(n,i);return{name:o?[o]:void 0,desc:s?[s]:void 0}}const Fce={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 Dce(e,t){const n=e.toLowerCase(),i=t.toLowerCase();return n===i?0:n.startsWith(i)?1:2}function wE(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 Rce(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=nA(Lj(e.desc),o.key==="pinyinFirst"?"first":"full",s,r+1);l&&i.push(l)}return{name:n.length>0?wE(n):void 0,desc:i.length>0?wE(i):void 0}}function Oce(e,t=eA,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=Mce(l);return{index:r,item:s,name:s.name.replace(/^\//,""),desc:l,pinyinFull:a.full,pinyinFirst:a.first}});return new Due(o,Fce).search(i).map(({item:s,score:r,matches:l})=>({doc:s,score:r??1,rank:Dce(s.name,i),ranges:Rce(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}))}function Pce(e){const t=e.trim();if(t.length<2)return t;const n=t[0];return(n==='"'||n==="'")&&t[t.length-1]===n?t.slice(1,-1).trim():t}function Bce(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 $ce=0;function CE(e,t){const n=++$ce;return e.pendingSwarmBySession[t]=n,n}function X7(e,t,n){return n===void 0||e.pendingSwarmBySession[t]!==n?!1:(delete e.pendingSwarmBySession[t],!0)}function iA(e,t,n){e.pendingSwarmBySession[t]===void 0&&(e.swarmModeBySession[t]=n)}function AE(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]}const zce="Report the current tower status: call TowerStatus and give a compact summary.",jce="Tear down the tower: call TowerTeardown and report what it did. It refuses to destroy dirty worktrees unless forced.";let Hce=0;function oA(e,t){const n=++Hce;return e.pendingTowerBySession[t]=n,n}function ex(e,t,n){return n===void 0||e.pendingTowerBySession[t]!==n?!1:(delete e.pendingTowerBySession[t],!0)}function sA(e,t,n){e.pendingTowerBySession[t]===void 0&&(e.towerModeBySession[t]=n)}function Wce(){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 qce(e,t=Wce()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyF"||e.key.toLowerCase()==="f")&&!e.defaultPrevented}const Uce=new Map([["ς","σ"],["ß","ss"],["ſ","s"],["ff","ff"],["fi","fi"],["fl","fl"],["ffi","ffi"],["ffl","ffl"],["ſt","st"],["st","st"],["ʼn","ʼn"],["µ","μ"],["K","k"],["Å","å"],["Ω","ω"]]);function Vce(e){return e==="pre"||e==="pre-wrap"||e==="break-spaces"?"preserve":e==="pre-line"?"pre-line":"collapse"}function Kce(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;rxE(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=Qce(xE(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]],y=n[m].map[f-s[m]],k={startSeg:h,startOffset:g.start,endSeg:m,endOffset:y.start+y.length};u!==void 0&&u.startSeg===k.startSeg&&u.startOffset===k.startOffset&&u.endSeg===k.endSeg&&u.endOffset===k.endOffset||(u=k,yield k)}}const Gce=/[.*+?^${}()|[\]\\]/g;function Qce(e){const t=[];let n=0;for(;n=tde)return{ranges:a,truncated:!0};a.push(f)}}return{ranges:a,truncated:!1}}const Fj="kimi-transcript-search",rA="kimi-transcript-search-current";function Dj(){return globalThis.CSS?.highlights??null}function D3(e,t){const n=Dj(),i=globalThis.Highlight;if(!n||!i)return;if(e.length===0){lA();return}const o=new i;for(const r of e)o.add(r);n.set(Fj,o);const s=e[t];if(s!==void 0){const r=new i;r.add(s),n.set(rA,r)}else n.delete(rA)}function lA(){const e=Dj();e?.delete(Fj),e?.delete(rA)}let Rj=null;function ide(e){e!==null&&(Rj=e)}let _E=0,ky=null;async function Vk(e){const t=++_E,n=(async()=>{const o=await e();t===_E&&ide(o)})(),i=(async()=>{await n,ky!==null&&ky.seq>t&&await ky.promise})();return ky={seq:t,promise:i},i}let Oj=null;function ode(e){Oj=e}const sde=5e3;function rde(e){return Promise.race([e(),new Promise(t=>{setTimeout(()=>t(null),sde)})])}function by(){return`${Rj==="global"?"https://www.kimi.ai":"https://www.kimi.com"}/code?from=${Lp?"kimi_code_desktop":"kimi_code_web"}`}function a2(){const e=Oj;if(e===null){window.open(by(),"_blank","noopener");return}const t=()=>rde(e);if(Lp){Vk(t).then(()=>{window.open(by(),"_blank","noopener")});return}const n=window.open("","_blank");if(n===null){window.open(by(),"_blank","noopener");return}try{n.opener=null}catch{}Vk(t).then(()=>{try{n.location.href=by()}catch{}})}function lde(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 ade(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 ude(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 dde(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 fde(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 hde(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 pde(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 mde=5;function gde(e,t,n,i=mde){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 vde={class:"error-boundary-title"},yde=ot({__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=q(!1);GB(()=>{o.value=!0});function s(){o.value=!1}return(r,l)=>o.value?(b(),N("div",{key:1,class:De(["error-boundary",{fullscreen:e.fullscreen}]),role:"alert"},[e.closable?(b(),fe(p(tn),{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:de(()=>[V(p(xe),{name:"close",size:"sm"})]),_:1},8,["label","tooltip"])):X("",!0),V(p(xe),{class:"error-boundary-icon",name:"alert-triangle",size:"lg"}),_("p",vde,B(p(i)("common.errorBoundaryTitle")),1),V(p(Jt),{size:"sm",onClick:s},{default:de(()=>[Be(B(p(i)("common.errorBoundaryRetry")),1)]),_:1})],2)):Hn(r.$slots,"default",{key:0},void 0,!0)}}),Pj=St(yde,[["__scopeId","data-v-3fe116a9"]]);var kde=Object.create,tx=Object.defineProperty,bde=Object.getOwnPropertyDescriptor,Bj=Object.getOwnPropertyNames,wde=Object.getPrototypeOf,Cde=Object.prototype.hasOwnProperty,$j=(e,t)=>function(){return t||(0,e[Bj(e)[0]])((t={exports:{}}).exports,t),t.exports},Ade=e=>{let t={};for(var n in e)tx(t,n,{get:e[n],enumerable:!0});return t},xde=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Bj(t),s=0,r=o.length,l;st[a]).bind(null,l),enumerable:!(i=bde(t,l))||i.enumerable});return e},zj=(e,t,n)=>(n=e!=null?kde(wde(e)):{},xde(tx(n,"default",{value:e,enumerable:!0}),e));function Sde(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 _de(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function Ide(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 Mde(e,t,n){return(n.xhtmlOut?`
+`:`
+`)+`
+
    +`}function Tde(){return`
+
+`}function Ede(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 Lde(){return`
  • +`}function Nde(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 Fde(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=Ide,e.renderer.rules.footnote_block_open=Mde,e.renderer.rules.footnote_block_close=Tde,e.renderer.rules.footnote_open=Ede,e.renderer.rules.footnote_close=Lde,e.renderer.rules.footnote_anchor=Nde,e.renderer.rules.footnote_caption=_de,e.renderer.rules.footnote_anchor_name=Sde;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 y=l.bMarks[a],k=l.tShift[a],v=l.sCount[a],C=l.parentType,w=h,M=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let L=M;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 Pde(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,y){y=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},y),g.core.ruler.after("inline","github-task-lists",function(k){for(var v=k.tokens,C=0,w=2;w=0;v--)if(g[v].level===k)return v;return-1}function o(g,y){return d(g[y])&&f(g[y-1])&&h(g[y-2])&&m(g[y])}function s(g,y,k,v){var C=k.idPrefix+y;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(C,v)),g.children.push(a(v)),g.children.unshift(r(g,C,k,v)),k.divWrap&&(g.children.unshift(u(k,v)),g.children.push(c(v)))}function r(g,y,k,v){var C=new v("checkbox_input","input",0);return C.attrs=[["type","checkbox"],["id",y]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&C.attrs.push(["checked","true"]),k.disabled===!0&&C.attrs.push(["disabled","true"]),C}function l(g,y){var k=new y("label_open","label",1);return k.attrs=[["for",g]],k}function a(g){return new g("label_close","label",-1)}function u(g,y){var k=new y("checkbox_open","div",0);return k.attrs=[["class",g.divClass]],k}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 zde=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 jde(e){return e>=55296&&e<=57343||e>1114111?65533:zde.get(e)??e}function Hde(e){const t=atob(e),n=t.length&-2,i=new Uint16Array(n/2);for(let o=0,s=0;o=ko.ZERO&&e<=ko.NINE}function qde(e){return e>=ko.UPPER_A&&e<=ko.UPPER_F||e>=ko.LOWER_A&&e<=ko.LOWER_F}function Ude(e){return e>=ko.UPPER_A&&e<=ko.UPPER_Z||e>=ko.LOWER_A&&e<=ko.LOWER_Z||aA(e)}function Vde(e){return e===ko.EQUALS||Ude(e)}var Ks;(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"})(Ks||(Ks={}));var Gd;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Gd||(Gd={}));var Kde=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=Ks.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=Gd.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=Ks.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case Ks.EntityStart:return e.charCodeAt(t)===ko.NUM?(this.state=Ks.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Ks.NamedEntity,this.stateNamedEntity(e,t));case Ks.NumericStart:return this.stateNumericStart(e,t);case Ks.NumericDecimal:return this.stateNumericDecimal(e,t);case Ks.NumericHex:return this.stateNumericHex(e,t);case Ks.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|IE)===ko.LOWER_X?(this.state=Ks.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Ks.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t>14;for(;t>7;if(this.runConsumed===0){const l=i&qr.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&qr.VALUE_LENGTH)>>14}if(t>=e.length)break;const s=e.charCodeAt(t);if(s===ko.SEMI&&o!==0&&(i&qr.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);if(this.treeIndex=Gde(n,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===Gd.Attribute&&(o===0||Vde(s))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],o=(i&qr.VALUE_LENGTH)>>14,o!==0){if(s===ko.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Gd.Strict&&(i&qr.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]&qr.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]&~(qr.VALUE_LENGTH|qr.FLAG13):i[e+1],n),t===3&&this.emitCodePoint(i[e+2],n),n}end(){switch(this.state){case Ks.NamedEntity:return this.result!==0&&(this.decodeMode!==Gd.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ks.NumericDecimal:return this.emitNumericEntity(0,2);case Ks.NumericHex:return this.emitNumericEntity(0,3);case Ks.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ks.EntityStart:return 0}}};function Zde(e){let t="";const n=new Kde(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 Gde(e,t,n,i){const o=(t&qr.BRANCH_LENGTH)>>7,s=t&qr.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 Qde=Zde(Wde);function nx(e,t=Gd.Legacy){return Qde(e,t)}var Yde=zj($de());const ME={};function Jde(e){let t=ME[e];if(t)return t;t=ME[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})}F4.defaultChars=";/?:@&=+$,#";F4.componentChars="";var uA=F4;const TE={};function Xde(e){let t=TE[e];if(t)return t;t=TE[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=Xde(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}D4.defaultChars=";/?:@&=+$,-_.!~*'()#";D4.componentChars="-_.!~*'()";var jj=D4;function ix(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 Kk(){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 efe=/^([a-z0-9.+-]+:)/i,tfe=/:[0-9]*$/,nfe=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ife=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` +`," "]),ofe=["'"].concat(ife),EE=["%","/","?",";","#"].concat(ofe),LE=["/","?","#"],sfe=255,NE=/^[+a-z0-9A-Z_-]{0,63}$/,rfe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,FE={javascript:!0,"javascript:":!0},DE={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function lfe(e,t){if(e&&e instanceof Kk)return e;const n=new Kk;return n.parse(e,t),n}Kk.prototype.parse=function(e,t){let n,i,o,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const u=nfe.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let r=efe.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&&FE[r])&&(s=s.substr(2),this.slashes=!0)),!FE[r]&&(o||r&&!DE[r])){let u=-1;for(let m=0;m127?v+="x":v+=k[C];if(!v.match(NE)){const C=m.slice(0,g),w=m.slice(g+1),M=k.match(rfe);M&&(C.push(M[1]),w.unshift(M[2])),w.length&&(s=w.join(".")+s),this.hostname=C.join(".");break}}}}this.hostname.length>sfe&&(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),DE[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Kk.prototype.parseHost=function(e){let t=tfe.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 ox=lfe,Hj=Ade({decode:()=>uA,encode:()=>jj,format:()=>ix,parse:()=>ox}),afe=Object.defineProperty,Wj=e=>{let t={};for(var n in e)afe(t,n,{get:e[n],enumerable:!0});return t},Ns=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}`}},ufe=Wj({arrayReplaceAt:()=>gfe,assign:()=>pfe,countLines:()=>Mo,escapeHtml:()=>Sfe,escapeRE:()=>Ife,fromCodePoint:()=>Mv,has:()=>hfe,isMdAsciiPunct:()=>Qk,isPunctChar:()=>Gk,isPunctCode:()=>cA,isSpace:()=>mfe,isString:()=>dfe,isValidEntityCode:()=>O4,isWhiteSpace:()=>Iv,lib:()=>Mfe,mdurl:()=>Hj,normalizeReference:()=>R4,ucmicro:()=>Zk,unescapeAll:()=>Tv,unescapeMd:()=>bfe});const Zk={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 cfe(e){return Object.prototype.toString.call(e)}function dfe(e){return cfe(e)==="[object String]"}const ffe=Object.prototype.hasOwnProperty;function hfe(e,t){return ffe.call(e,t)}function pfe(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 mfe(e){return e===9||e===32}function Iv(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 Gk(e){return Zk.P.test(e)||Zk.S.test(e)}const RE=new Map;function cA(e){if(Qk(e))return!0;if(e>=0&&e<128)return!1;const t=RE.get(e);if(t!==void 0)return t;const n=Gk(String.fromCharCode(e));return RE.set(e,n),n}function Qk(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 R4(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function gfe(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function O4(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 Mv(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 qj=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,vfe=new RegExp(`${qj.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),yfe=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function kfe(e,t){if(t.charCodeAt(0)===35&&yfe.test(t)){const i=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return O4(i)?Mv(i):e}const n=nx(e);return n!==e?n:e}function bfe(e){return e.includes("\\")?e.replace(qj,"$1"):e}function Tv(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(vfe,(t,n,i)=>n||kfe(t,i))}const wfe=/[&<>"]/,Cfe=/[&<>"]/g,Afe={"&":"&","<":"<",">":">",'"':"""};function xfe(e){return Afe[e]}function Sfe(e){return wfe.test(e)?e.replace(Cfe,xfe):e}const _fe=/[.?*+^$[\]\\(){}|-]/g;function Ife(e){return e.replace(_fe,"\\$&")}const Mfe={mdurl:Hj,ucmicro:Zk};function Mo(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(` +`,n+1))!==-1;)t++;return t}const Tfe=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Efe=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Lfe=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,sx=["references","footnotes","abbreviations","abbr","abbrs"],rx=Symbol.for("markdown-it-ts.global-state"),lx=Object.prototype.hasOwnProperty;function OE(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function pu(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function uf(e){if(Array.isArray(e))return e.map(t=>uf(t));if(pu(e)){const t={};for(const n of Object.keys(e))t[n]=uf(e[n]);return t}return e}function Yk(e){return Array.isArray(e)?e.map((t,n)=>String(n)):pu(e)?Object.keys(e):[]}function dA(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)?!dA(o[r],Uj(i.value,r)):!0)}}function ad(e){const t=ax(e);if(t){for(const n of sx){const i=t.snapshot[n];if(!i){delete e[n];continue}if(i.ownedKeys){Ffe(e,n,i);continue}i.existed?e[n]=Nfe(e[n],i.value):delete e[n]}delete e[rx]}}function R3(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 fA=Symbol.for("markdown-it-ts.diagnostics");function c2(e,t){if(e)try{const n=e[fA];if(n&&typeof n=="object")return n;if(!t)return;const i={};return e[fA]=i,i}catch{return}}function Bc(e){return c2(e,!1)}function Rfe(e){if(e)try{const t=e[fA];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function Ur(e){Rfe(e)}function Dg(e,t){const n=c2(e,!0);n&&(n.stockFast=t)}function ts(e,t){const n=c2(e,!0);n&&(n.strategy=t)}function O3(e,t){const n=c2(e,!0);n&&(n.chunk=t)}function Vj(e,t){const n=c2(e,!0);n&&(n.unbounded=t)}const Ofe=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Pfe=/[\0-\x1F\x7F-\x9F]/,Bfe=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,$fe=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var zfe=class{src_Any=Ofe.source;src_Cc=Pfe.source;src_Z=$fe.source;src_P=Bfe.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")}},P3={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)},jfe={"http:":P3,"https:":P3,"ftp:":P3,"//":{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)}},Hfe="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",Wfe="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function qfe(){const e=Wfe.split("|");return Hfe.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 Ufe={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:qfe(),urlAuth:!1,maxLength:1e4},PE=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}},Kj=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...Ufe,...n},this.__schemas__={...jfe},this.re=t||new zfe,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 v=a;a=void 0;const C=this.testSchemaAt(e,v.schema,v.lastIndex);if(C){g={schema:v.schema,index:v.index,lastIndex:v.lastIndex+C};break}}let y=g;if((!y||l&&(l.indexy.lastIndex))&&(y=l),(!y||r&&(r.indexy.lastIndex))&&(y=r),!y)break;y===l?l=void 0:y===r&&(r=void 0);const k=new PE(e,y.schema,y.index,y.lastIndex);k.schema?this.__schemas__[k.schema].normalize(k,this):this.normalize(k),t.push(k),f=y.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 PE(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}`)}},Vfe=$j({"../../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,y=Math.floor,k=String.fromCharCode;function v(R){throw new RangeError(m[R])}function C(R,F){const P=[];let z=R.length;for(;z--;)P[z]=F(R[z]);return P}function w(R,F){const P=R.split("@");let z="";P.length>1&&(z=P[0]+"@",R=P[1]),R=R.replace(h,".");const W=C(R.split("."),F).join(".");return z+W}function M(R){const F=[];let P=0;const z=R.length;for(;P=55296&&W<=56319&&PString.fromCodePoint(...R),E=function(R){return R>=48&&R<58?26+(R-48):R>=65&&R<91?R-65:R>=97&&R<123?R-97:36},S=function(R,F){return R+22+75*(R<26)-((F!=0)<<5)},x=function(R,F,P){let z=0;for(R=P?y(R/700):R>>1,R+=y(R/F);R>g*26>>1;z+=36)R=y(R/g);return y(z+(g+1)*R/(R+38))},A=function(R){const F=[],P=R.length;let z=0,W=128,$=72,K=R.lastIndexOf("-");K<0&&(K=0);for(let ne=0;ne=128&&v("not-basic"),F.push(R.charCodeAt(ne));for(let ne=K>0?K+1:0;ne=P&&v("invalid-input");const _e=E(R.charCodeAt(ne++));_e>=36&&v("invalid-input"),_e>y((2147483647-z)/le)&&v("overflow"),z+=_e*le;const Z=ie<=$?1:ie>=$+26?26:ie-$;if(_ey(2147483647/se)&&v("overflow"),le*=se}const te=F.length+1;$=x(z-G,te,G==0),y(z/te)>2147483647-W&&v("overflow"),W+=y(z/te),z%=te,F.splice(z++,0,W)}return String.fromCodePoint(...F)},T=function(R){const F=[];R=M(R);const P=R.length;let z=128,W=0,$=72;for(const G of R)G<128&&F.push(k(G));const K=F.length;let ne=K;for(K&&F.push("-");ne=z&&ley((2147483647-W)/te)&&v("overflow"),W+=(G-z)*te,z=G;for(const le of R)if(le2147483647&&v("overflow"),le===z){let ie=W;for(let _e=36;;_e+=36){const Z=_e<=$?1:_e>=$+26?26:_e-$;if(ie32))return s;if(i===41){if(r===0)break;r--}o++}return t===o||r!==0||(s.str=Tv(e.slice(t,o)),s.pos=o,s.ok=!0),s}var Gj=dx;const E9=-2;function Kfe(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=Kfe(l,t,a,n);if(f!==E9)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 Qfe(e,t,n){const i=P4(e,t);i<0?px(e,[t,n]):e.attrs[i][1]=`${e.attrs[i][1]} ${n}`}var Yfe=Wj({attrGet:()=>Gfe,attrIndex:()=>P4,attrJoin:()=>Qfe,attrPush:()=>px,attrSet:()=>Zfe,parseLinkDestination:()=>dx,parseLinkLabel:()=>fx,parseLinkTitle:()=>hx});function Jfe(e){return e.includes("\r")||e.includes("\0")}function Yj(e){return typeof e=="string"?e:e.toString()}function Xfe(e){if(e.inlineMode){const t=new Ns("inline","",0);t.content=Yj(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 ehe=/^([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])?)*)$/,the=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function nhe(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(the.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(ehe.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 Jj=nhe;function ihe(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 Xj=ihe;function BE(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 ohe(e){const t=e.tokens_meta,n=e.tokens_meta.length;BE(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?eH:tH,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 lhe(e){const t=e.tokens_meta,n=e.tokens_meta.length;$E(e,e.delimiters);for(let i=0;i=48&&e<=57}function ahe(e){const t=e|32;return mx(e)||t>=97&&t<=102}function iH(e){const t=e|32;return t>=97&&t<=122}function uhe(e){return iH(e)||mx(e)}function che(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 dhe(e,t,n){let i=t+1;if(i>=n||!iH(e.charCodeAt(i)))return null;for(i++;i=n||e.charCodeAt(i)!==59)return null;const o=e.slice(t,i+1);return nH(o)!==o?o:null}function fhe(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=che(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=O4(s)?Mv(s):Mv(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=dhe(e.src,n,i);if(o){const s=nH(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 oH=fhe;const sH=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),pA=new Array(128),rH=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);pA[e]=`\\${t}`,rH[e]=sH[e]?t:pA[e]}function zE(e,t,n){e.pending&&e.pushPending();const i=new Ns("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 hhe(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 zE(e,s<256&&sH[s]?r:l,l),e.pos=n+1,!0}var lH=hhe;function phe(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*\\/?>`,uH="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",ghe=new RegExp(`^(?:${aH}|${uH}||<\\?[\\s\\S]*?\\?>|]*>|)`),vhe=new RegExp(`^(?:${aH}|${uH})`);function cH(e){return e===32||e===9||e===10||e===12||e===13}function yhe(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||cH(t)}function khe(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 whe(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&&!bhe(s))return!1;const r=o.slice(i).match(ghe);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,yhe(l)&&e.linkLevel++,khe(l)&&e.linkLevel--}return e.pos+=l.length,!0}var dH=whe;function Che(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=Jk(e,e.pos+1,!1);if(m<0)return!1;if(s=m+1,s=f)return!1;if(l=Gj(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[R4(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 y=e.push("image","img",0);y.attrs=[["src",c],["alt",""]],y.children=g,y.content=i,a&&y.attrs.push(["title",a])}return e.pos=s,e.posMax=f,!0}var fH=Che;function B3(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[R4(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 hH=Ahe;function pH(e){const t=e|32;return t>=97&&t<=122}function xhe(e){return e>=48&&e<=57}function She(e){return pH(e)||xhe(e)||e===43||e===45||e===46}function _he(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&She(e.charCodeAt(t));)t--;return t++,t>=e.length||!pH(e.charCodeAt(t))?null:e.slice(t)}function Ihe(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=_he(e.pending);if(!o)return!1;const s=Ihe(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 Mhe(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||HE(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 Fhe(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 yH(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:gx(),records:Object.create(null)};return t.__mdtsRuleProfile=i,i}function om(e,t,n,i,o,s){const r=yH(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=Fhe(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=gx()}function Dhe(e){const t=yH(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}},kH=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 Ns("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 Ns(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 Ns(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 qE(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return gH(e,t);case 33:return fH(e,t);case 38:return oH(e,t);case 42:case 95:return hA.tokenize(e,t);case 58:return e.md.options.linkify&&mH(e,t);case 60:return Jj(e,t)||dH(e,t);case 91:return hH(e,t);case 92:return lH(e,t);case 96:return Xj(e,t);case 126:return mA.tokenize(e,t);default:return vH(e,t)}}function bH(e){return!Rhe.test(e)}var Ohe=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new WE,this.ruler2=new WE,this.ruler.push("text",vH),this.ruler.push("linkify",mH),this.ruler.push("newline",gH),this.ruler.push("escape",lH),this.ruler.push("backticks",Xj),this.ruler.push("strikethrough",mA.tokenize),this.ruler.push("emphasis",hA.tokenize),this.ruler.push("link",hH),this.ruler.push("image",fH),this.ruler.push("autolink",Jj),this.ruler.push("html_inline",dH),this.ruler.push("entity",oH),this.ruler2.push("balance_pairs",she),this.ruler2.push("strikethrough",mA.postProcess),this.ruler2.push("emphasis",hA.postProcess),this.ruler2.push("fragments_join",mhe),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=qE(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()&&bH(e)){const a=new Ns("text","",0);a.content=e,i.push(a);return}const o=new kH(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&&bH(s.content)){const r=new Ns("text","",0);r.content=s.content,s.children.push(r);continue}e.md.inline.parse(s.content,e.md,e.env,s.children)}}}const Bhe=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,$he=/[0-9a-z]/i;function zhe(e){return/^\s]/i.test(e)}function jhe(e){return/^<\/a\s*>/i.test(e)}function Hhe(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"&&(zhe(l.content)&&s>0&&s--,jhe(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=>Hhe(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 M=new Ns("text","",0);M.content=a.slice(f,k),M.level=d,c.push(M)}const v=new Ns("link_open","a",1);v.attrs=[["href",g]],v.level=d++,v.markup="linkify",v.info="auto",c.push(v);const C=new Ns("text","",0);C.content=y,C.level=d,c.push(C);const w=new Ns("link_close","a",-1);w.level=--d,w.markup="linkify",w.info="auto",c.push(w),f=m.lastIndex}if(f!==0){if(f=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(Zhe,Qhe)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function Jhe(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&wH.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 Xhe(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(""):"");Khe.test(i)&&Yhe(n.children||[]),wH.test(i)&&Jhe(n.children||[])}}var epe=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 tpe=/['"]/,UE=/['"]/g,VE="’";function wy(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function npe(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 y=32;if(u=48&&g<=57&&(h=f=!1),f&&h&&(f=k,h=v),!f&&!h){m&&(r.content=wy(r.content,d.index,VE));continue}if(h)for(n=i.length-1;n>=0;n--){let M=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("");!tpe.test(i)||!n.children||npe(n.children,e)}}function ope(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=[],y=[],k=e.md.block.ruler.getRulesForState(e,"blockquote"),v=e.parentType;e.parentType="blockquote";let C=!1,w;for(w=t;w=d)break;if(o.charCodeAt(c++)===62&&!x){let T=a[w]+1,I,O;o.charCodeAt(c)===32?(c++,T++,O=!1,I=!0):o.charCodeAt(c)===9?(I=!0,(u[w]+T)%4===3?(c++,T++,O=!1):O=!0):I=!1;let H=T;for(h.push(s[w]),s[w]=c;c=d,m.push(u[w]),u[w]=a[w]+1+(I?1:0),g.push(a[w]),a[w]=H-T,y.push(l[w]),l[w]=c-s[w];continue}if(C)break;let A=!1;for(let T=0,I=k.length;T";const E=[t,0];L.map=E,e.md.block.tokenize(e,t,w);const S=e.push("blockquote_close","blockquote",-1);S.markup=">",e.lineMax=f,e.parentType=v,E[1]=e.line;for(let x=0;x=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 cpe(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&&GE(o.charCodeAt(f-1))&&(u=f),e.line=t+1;const h=e.push("heading_open",KE[d],1);h.markup=ZE[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",KE[d],-1);return g.markup=ZE[d],!0}function fpe(e){switch(e){case 9:case 32:return!0}return!1}function hpe(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(`${vhe.source}\\s*$`),/^$/,!1]];function ppe(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 _H=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,y=this.bsCount,k=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("")}};_H.prototype.Token=Ns;function gpe(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:gpe(n,i,o)}const YE=["","h1","h2"];function vpe(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=IH(e);if(a[t]-u>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,m=t+1;for(;m=M)break;if(a[m]-u>3)continue;if(a[m]>=u&&(h=o.charCodeAt(w),h===45||h===61)){let E=w+1,S=E;for(;E=M){f=h===61?1:2;break}if(S-w>1)continue}if(a[m]<0||c&&!MH(e,m,o,w,M))continue;let L=!1;for(let E=0,S=i.length;Ew;){const L=o.charCodeAt(M-1);if(L!==9&&L!==32)break;M--}g=o.slice(w,M)}else g=e.getLines(t,m,u,!1).trim();e.line=m+1;const y=h===61?"=":"-",k=e.push("heading_open",YE[f],1);k.markup=y,k.map=[t,e.line];const v=e.push("inline","",0);v.content=g,v.map=[t,e.line-1],v.children=[];const C=e.push("heading_close",YE[f],-1);return C.markup=y,e.parentType=d,!0}function TH(e){switch(e){case 9:case 32:return!0}return!1}function JE(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,y=e.eMarks,k=e.sCount,v=e.bsCount,C=m[l]+g[l];if(C>=y[l])return!1;const w=h.charCodeAt(C);if(w>=48&&w<=57){if(f=XE(e,l),f<0||(c=!0,r=C,d=ype(e,l,f),u&&d!==1))return!1}else if(w===42||w===45||w===43){if(f=JE(e,l),f<0)return!1;c=!1}else return!1;if(u&&e.skipSpaces(f)>=y[l])return!1;if(i)return!0;const M=h.charCodeAt(f-1),L=String.fromCharCode(M);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 E=[l,0];e.tokens[e.tokens.length-1].map=E,e.tokens[e.tokens.length-1].markup=L;let S=!1;const x=e.tokens.length-1,A=e.md.block.ruler.getRulesForState(e,"list"),T=e.parentType;for(e.parentType="list";l=o?R=1:R=O-I,R>4&&(R=1);const F=I+R,P=e.push("list_item_open","li",1);P.markup=L;const z=[l,0];P.map=z,c&&(P.info=f-r-1===1?kpe[h.charCodeAt(r)-48]:h.slice(r,f-1));const W=e.tight,$=e.tShift[l],K=e.sCount[l],ne=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=F,e.tight=!0,e.tShift[l]=H-m[l],e.sCount[l]=O,H>=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=ne,e.tShift[l]=$,e.sCount[l]=K,e.tight=W,e.push("list_item_close","li",-1).markup=L,l=e.line,z[1]=l,l>=n||e.sCount[l]=4)break;let G=!1;for(let te=0,le=A.length;te3||u[f]<0)continue;if(o==="list"&&u[f]>=c){const C=r[f]+l[f],w=a[f];if(C=w||eL(s.charCodeAt(C+1)))break}else if(M>=48&&M<=57&&C+1=w){L=-1;break}const E=s.charCodeAt(L++);if(E>=48&&E<=57){if(L-C>=10){L=-1;break}continue}if((E===41||E===46)&&(L>=w||eL(s.charCodeAt(L))))break;L=-1;break}if(L>=0)break}}}const y=r[f]+l[f],k=a[f];if(d&&!MH(e,f,s,y,k))continue;let v=!1;for(let C=0,w=i.length;C=4||e.src.charCodeAt(o)!==91)return!1;function a(C){const w=e.lineMax;if(C>=w||e.isEmpty(C))return null;let M=!1;if(e.sCount[C]-e.blkIndent>3&&(M=!0),e.sCount[C]<0&&(M=!0),!M){const S=e.parentType;e.parentType="reference";let x=!1;for(let A=0,T=l.length;A"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:k,href:f}),e.line=r),!0):!1}function $3(e){switch(e){case 9:case 32:return!0}return!1}const xpe=65536;function z3(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function Spe(e,t){if(e.lineFlags)return(e.lineFlags[t]&F0.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&&!$3(l)||r===45&&$3(l)||!Spe(e,t))return!1;for(;s=4)return!1;u=tL(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 y=e.push("thead_open","thead",1);y.map=[t,t+1];const k=e.push("tr_open","tr",1);k.map=[t,t+1];for(let w=0;w=4||(u=tL(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),C+=d-u.length,C>xpe))break;if(o===t+2){const L=e.push("tbody_open","tbody",1);L.map=v=[t+2,0]}const M=e.push("tr_open","tr",1);M.map=[o,o+1];for(let L=0;Lr.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 om(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 Ay=[["table",_pe,["paragraph","reference"]],["code",upe],["fence",cpe,["paragraph","reference","blockquote","list"]],["blockquote",ape,["paragraph","reference","blockquote","list"]],["hr",hpe,["paragraph","reference","blockquote","list"]],["list",wpe,["paragraph","reference","blockquote"]],["reference",Ape],["html_block",ppe,["paragraph","reference","blockquote"]],["heading",dpe,["paragraph","reference","blockquote"]],["lheading",vpe],["paragraph",Cpe]];var Mpe=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Ipe;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 _H(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}},EH=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}};EH.prototype.Token=Ns;const nL=[["normalize",Vhe],["block",Xfe],["inline",Phe],["linkify",Whe],["replacements",Xhe],["smartquotes",ipe],["text_join",ope]],Tpe={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},Epe={parseLinkLabel:fx,parseLinkDestination:dx,parseLinkTitle:hx};function Lpe(){return{...Tpe}}function Npe(){return{...Epe}}var Fpe=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new Mpe,this.inline=new Ohe,this.ruler=new epe;for(let e=0;e@[\]\\^_`{}~]/;function Xk(e){return!Dpe.test(e)}function s0(e,t){const n=e.indexOf(` +`,t);return n===-1?e.length:n}function L9(e,t,n){for(let i=t;i3)return Xk(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(!Xk(c))return!1;const d=Ope[s],f=Ppe[s],h=Ba("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(vx(c,o,1));const m=Ba("heading_close",d,-1,0);return m.markup=f,e.push(m),!0}function $pe(e,t,n){const i=Ba("paragraph_open","p",1,0);i.map=[n,n+1],e.push(i),e.push(vx(t,n,1)),e.push(Ba("paragraph_close","p",-1,0))}function zpe(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?oL:W3,o="",s=!1,r=!1,l=0,a=0;for(;l"]/,sL=/[&<>"]/g,Kpe=/&/g,Zpe=/[<>"]/g,Gpe={"&":"&","<":"<",">":">",'"':"""};function U3(e){return Gpe[e]||e}function Pi(e){if(e.length===0)return"";if(e.length<32)return Vpe.test(e)?e.replace(sL,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(Kpe,"&"):t?e.replace(sL,U3):e.replace(Zpe,U3)}const Qpe=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Ype=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function LH(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Qpe,(t,n,i)=>{if(n)return n;if(Ype.test(i)){const s=i[1].toLowerCase()==="x"?Number.parseInt(i.slice(2),16):Number.parseInt(i.slice(1),10);return O4(s)?Mv(s):"�"}const o=nx(t);return o!==t?o:t})}const Jpe=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,Xpe=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,e1e=/"/g;function D1(e,t){const n=e.indexOf(` +`,t);return n===-1?e.length:n}function eb(e,t,n){for(let i=t;i=e.length||e.charCodeAt(t)===10?!1:!eb(e,t,D1(e,t))}function rL(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=yx(e.slice(s,r));return a===null?null:`${a} +`}function lL(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 s1e(e,t,n){const i=t+2;if(n===i+1)return o1e(e,i);const o=yx(e.slice(t+2,n));return o===null?null:`
  • ${o}
  • +`}function r1e(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}${Pi(c)}
    +`,nextPos:u=25e4,s=[],r={lang:null,open:""};let l="",a="",u="",c="";for(;n +`;w +`,l=k,a=v}let C=xy(e,y);for(;C${y}

    +`,u=h,c=m}const g=de.core.parse(t,n,e).tokens);let r=N9(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=f1e(r,o.maxChunks)),F9(t,r))return O3(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),im(n,s,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return O3(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:s||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!s}),im(n,s,()=>{for(let u=0;u=3&&(c?c.marker===C&&M>=c.length&&(c=null):c={marker:C,length:M})}}const y=m-f;o+=y,s+=1,l+=1,g?(a=0,u=0):(a+=1,u+=y);const k=g;if((o>=t.maxChunkChars||s>=t.maxChunkLines)&&!c)if(k)d(m);else{const v=Math.max(10,Math.floor(t.maxChunkLines*.5)),C=Math.max(t.maxChunkChars,8e3);(a>=v||u>=C)&&d(m)}f=m}return n&&d(e.length),i}function F9(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 d1e(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 Td(e){return e.length===0?0:Mo(e)+(e.charCodeAt(e.length-1)===10?0:1)}function k1e(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 w1e(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 k1e(e,n+1,e.length-1)?!b1e(e,t):!1}function C1e(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??g1e:e.options.fullChunkSizeChars??p1e),l=i.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??v1e:e.options.fullChunkSizeLines??m1e);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 d2=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=Td(this.pending);if(this.pending.length=i||n>=o}function PH(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??FH))return"yes";const i=e.options.autoUnboundedThresholdLines??DH;return n!==void 0?n>=i?"yes":"no":t+1e.core.parse(t,n,e).tokens);const s=[],r=new d2(e,{mode:"full",...i,retainTokens:!1,onChunkTokens(l){RH(s,l)}});if(o&&ux(n,o),r.feed(t),r.flushForce(n),o&&(cx(n),i.fallbackOnGlobalState===!1)){const l=Bc(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return s}const sm=(e,t,n)=>en?n:e;function BH(e){return e.experimental?{...e,...e.experimental}:e}const cL=[{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"}],dL=[{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 $H(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function I1e(e,t=Math.max(0,e/40|0),n={}){const i=BH(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:sm(Math.ceil(e/s),8e3,64e3),maxChunkLines:sm(Math.ceil(t/s),150,700),maxChunks:sm(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 fL(e,t=Math.max(0,e/40|0),n={}){const i=BH(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:sm(Math.ceil(e/s),8e3,64e3),maxChunkLines:sm(Math.ceil(t/s),150,700),maxChunks:sm(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 M1e={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"]}}},T1e={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},E1e={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 B4(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function D9(e,t){if(B4(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const hL=e=>B4(e)?e:Promise.resolve(e);function R0(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 Pi(e)}}function xf(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${R0(t[0])}="${Pi(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 Ev(e){return!e.attrs||e.attrs.length===0?`${Pi(e.content)}`:`${Pi(e.content)}`}function gA(e){const t=Pi(e.content);return e.attrs?`${t} +`:`
    ${t}
    +`}function L1e(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 pL(e){const t=e.attrs;return!t||t.length===0?"":t.length===1?``:t.length===2?``:``}function N1e(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 mL(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 nb(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 F1e={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Sy=Object.prototype.hasOwnProperty,yi={code_inline(e,t){return Ev(e[t])},code_block(e,t){return gA(e[t])},fence(e,t,n,i,o){const s=e[t],r=s.info?LH(s.info).trim():"",{langName:l,langAttrs:a}=zH(r),u=n.highlight,c=Pi(s.content);if(!u)return O0(s,c,r,l,n);const d=u(s.content,l,a);return B4(d)?d.then(f=>O0(s,f||c,r,l,n)):O0(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]],nb(s,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`
    +`:`
    +`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`
    +`:`
    +`:` +`},text(e,t){return Pi(e[t].content)},text_special(e,t){return Pi(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function gL(e,t,n){const i=e.info?LH(e.info).trim():"",{langName:o,langAttrs:s}=zH(i),r=t.highlight,l=Pi(e.content);if(!r)return O0(e,l,i,o,t);const a=r(e.content,o,s);if(B4(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return O0(e,a||l,i,o,t)}function V3(e,t,n,i){switch(e.type){case"text":return t.text===yi.text?e.content.length===0?"":Pi(e.content):null;case"text_special":return t.text_special===yi.text_special?e.content.length===0?"":Pi(e.content):null;case"softbreak":return t.softbreak===yi.softbreak?i:null;case"hardbreak":return t.hardbreak===yi.hardbreak?n:null;case"html_inline":return t.html_inline===yi.html_inline?e.content:null;case"code_inline":return t.code_inline===yi.code_inline?Ev(e):null;default:return null}}function D1e(e,t,n,i,o){const s=e[0];switch(s.type){case"text":if(o.text===yi.text)return s.content.length===0?"":Pi(s.content);break;case"text_special":if(o.text_special===yi.text_special)return s.content.length===0?"":Pi(s.content);break;case"softbreak":if(o.softbreak===yi.softbreak)return t.breaks?t.xhtmlOut?`
    +`:`
    +`:` +`;break;case"hardbreak":if(o.hardbreak===yi.hardbreak)return t.xhtmlOut?`
    +`:`
    +`;break;case"html_inline":if(o.html_inline===yi.html_inline)return s.content;break;case"code_inline":if(o.code_inline===yi.code_inline)return Ev(s);break}const r=o[s.type];if(!r)return nb(s,t.xhtmlOut===!0);const l=r(e,0,t,n,i);return typeof l=="string"?l:D9(l,s.type)}var R1e=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...yi}}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,y="";for(let k=0;k0&&e[k-1].hidden?` +`:"";if(C==="list_item_open"&&(!v.attrs||v.attrs.length===0)&&k+3${this.renderInlineTokens(S.children||[],i,o)}`,k+=3;continue}}if(k+2 +`,k+=2;continue}}}if(C==="inline"){const E=v.children||[];if(E.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=E[0];switch(S.type){case"text":if(l===yi.text){y+=Pi(S.content);continue}break;case"text_special":if(a===yi.text_special){y+=Pi(S.content);continue}break;case"softbreak":if(u===yi.softbreak){y+=m;continue}break;case"hardbreak":if(c===yi.hardbreak){y+=h;continue}break;case"html_inline":if(d===yi.html_inline){y+=S.content;continue}break;case"code_inline":if(f===yi.code_inline){y+=Ev(S);continue}break}}y+=this.renderInlineTokens(E,i,o);continue}const M=s[C];if(!M){const E=v.attrs;if(!v.hidden){if(!E||E.length===0)switch(C){case"hr":y+=r?`


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

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

    +`;continue;case"list_item_open":{const S=e[k+1];y+=w+(S&&(S.type==="inline"||S.hidden||S.nesting===-1&&S.tag==="li")?"
  • ":`
  • +`);continue}case"list_item_close":y+=`
  • +`;continue;case"bullet_list_open":y+=`${w}
      +`;continue;case"bullet_list_close":y+=`
    +`;continue;case"blockquote_open":y+=w+(e[k+1]&&e[k+1].nesting===-1&&e[k+1].tag==="blockquote"?"
    ":`
    +`);continue;case"blockquote_close":y+=`
    +`;continue;case"ordered_list_open":y+=`${w}
      +`;continue;case"ordered_list_close":y+=`
    +`;continue;case"table_open":y+=`${w} +`;continue;case"table_close":y+=`
    +`;continue;case"thead_open":y+=`${w} +`;continue;case"thead_close":y+=` +`;continue;case"tbody_open":y+=`${w} +`;continue;case"tbody_close":y+=` +`;continue;case"tr_open":y+=`${w} +`;continue;case"tr_close":y+=` +`;continue;case"td_open":y+=`${w}`;continue;case"td_close":y+=` +`;continue;case"th_open":y+=`${w}`;continue;case"th_close":y+=` +`;continue}else if(E.length===1){const S=E[0];if(C==="ordered_list_open"&&S[0]==="start"){y+=`${w}
      +`;continue}if(C==="td_open"&&S[0]==="style"){y+=`${w}`;continue}if(C==="th_open"&&S[0]==="style"){y+=`${w}`;continue}}}y+=this.renderToken(e,k,i);continue}if(C==="code_block"&&M===yi.code_block){y+=gA(v);continue}if(C==="fence"&&M===yi.fence){y+=gL(v,i);continue}if(C==="html_block"&&M===yi.html_block){y+=v.content;continue}const L=M(e,k,i,o,this);typeof L=="string"?y+=L:y+=D9(L,v.type)}return y}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(Sy.call(e,"highlight")&&e.highlight!==t.highlight&&(i().highlight=e.highlight),Sy.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(i().langPrefix=o)}if(Sy.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(i().xhtmlOut=o)}if(Sy.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(i().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...F1e,...this.baseOptions})}renderSingleToken(e,t,n,i){const o=this.rules,s=t.type;if(s==="code_block"&&o.code_block===yi.code_block)return gA(t);if(s==="html_block"&&o.html_block===yi.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):nb(t,r.xhtmlOut===!0);if(s==="fence"&&a===yi.fence)return gL(t,r);const u=a(e,0,r,l,this);return typeof u=="string"?u:D9(u,s)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const i=this.rules;if(e.length===1)return D1e(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,y=i.em_close,k=i.strong_open,v=i.strong_close;let C="";for(let w=0;w`;if(u===yi.softbreak&&w+3`,w+=1;continue}if(M.type==="em_open"&&!g&&!y&&w+2${x}`,w+=2;continue}}}if(M.type==="strong_open"&&!k&&!v&&w+2${x}`,w+=2;continue}}}switch(M.type){case"text":if(l===yi.text){const S=M.content.length===0?"":Pi(M.content);if(d===yi.html_inline&&w+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=Z,!Y&&se!==void 0&&(he=Mo(e),Y=he>=se)),Y){const U=this.parseFullDocument(e,O,n,he,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ts(O,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!Bc(O)?.unbounded}),U.tokens}else if(z){const U=(ge,ae,Ce)=>geCe?Ce:ge;he===void 0&&(he=Mo(e));const Q=le&&!te?fL(e.length,he,n.options):null,ue=Q?.maxChunkChars??(W?U(Math.ceil(e.length/$),8e3,64e3):K??1e4),me=Q?.maxChunkLines??(W?U(Math.ceil(he/$),150,700):ne??200),pe=Q?.maxChunks??(W?U(Math.ceil(e.length/64e3),$,32):G),ee=e.length>0&&e.charCodeAt(e.length-1)===10,re=P&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&Q?.strategy!=="plain";if((F||re)&&(e.length>=ue*2||he>=me*2)&&ee){const ge=tb(n,e,O,{maxChunkChars:ue,maxChunkLines:me,fenceAware:Q?.fenceAware??ie,maxChunks:pe});return this.cache={src:e,tokens:ge,env:O,lineCount:he,lastSegment:void 0,globalStateReason:kl(e)},this.updateCacheLineCount(this.cache,he),this.recordChunkedParseResult(O,F?"explicit-initial-large-doc":"default-initial-large-doc"),ge}}const J=this.parseFullDocument(e,O,n,he);return he=J.lineCount,this.cache={src:e,tokens:J.tokens,env:O,lineCount:he,lastSegment:void 0,globalStateReason:kl(e)},this.updateCacheLineCount(this.cache,he),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ts(O,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!Bc(O)?.unbounded}),J.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",ts(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=kl(o.src),o.globalStateReason=r);const l=r?null:s!==null?this.detectGlobalStateForAppend(o,s):kl(e),a=r||l;if(a){const O=i??o.env;ad(O);const H=kl(e),R=this.parseFullDocument(e,O,n),F=R.tokens,P=R.lineCount;return this.cache={src:e,tokens:F,env:O,lineCount:P,lastSegment:void 0,globalStateReason:H},this.updateCacheLineCount(this.cache,P),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ts(O,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!Bc(O)?.unbounded}),F}const u=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length5e3?H=8:c.length>1e3?H=6:c.length>200&&(H=4),H=Math.min(H,O);let R=null;const F=n.options?.streamContextParseStrategy??"chars",P=n.options?.streamContextParseMinChars??200,z=n.options?.streamContextParseMinLines??2;let W;const $=()=>(W===void 0&&(W=Mo(c)),W),K=this.canDirectlyParseAppend(o),ne=K&&this.shouldUseUnboundedAppend(e,o,c);let G=!1;if(!K)switch(F){case"lines":G=$()>=z;break;case"constructs":if(c.length>=P){G=!0;break}if(B1e(c)){G=!0;break}G=$()>=z;break;case"chars":default:G=c.length>=P}if(H>0&&G){const ie=this.getTailLines(o.src,H)+c;try{const _e=this.core.parse(ie,o.env,n).tokens,Z=_e.findIndex(se=>se.map&&typeof se.map[1]=="number"&&se.map[1]>H);if(Z!==-1){const se=_e.slice(Z),he=O-H;he!==0&&this.shiftTokenLines(se,he),R={tokens:se}}}catch{R=null}}else R=null;if(!R){const ie=O;if(ne)R={tokens:D0(n,c,o.env,{mode:"stream"})},ie>0&&this.shiftTokenLines(R.tokens,ie);else{const _e=this.core.parse(c,o.env,n);ie>0&&this.shiftTokenLines(_e.tokens,ie),R=_e}}let te=0;if(o.tokens.length>0&&R.tokens.length>0){const ie=o.tokens[o.tokens.length-1],_e=R.tokens[0];try{ie.type==="inline"&&_e.type==="inline"&&(_e.children&&_e.children.length>0&&(ie.children||(ie.children=[]),this.appendTokens(ie.children,_e.children)),ie.content=(ie.content||"")+(_e.content||""),te=1)}catch{te=0}}const le=o.tokens.length;if(R.tokens.length>te){const ie=o.tokens,_e=R.tokens,Z=Math.min(ie.length,_e.length-te);let se=0;for(let he=Z;he>0;he--){let Y=!0;for(let J=0;J0&&(te+=se),_e.length>te&&this.appendTokens(o.tokens,_e,te)}if(o.src=e,o.globalStateReason=null,o.lineCount=O+(W??$()),o.tokens.length>le){const ie=this.getLastSegment(o.tokens,e,le,o.tokens.length,e.length-c.length,O);ie?o.lastSegment=ie:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ne&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",ts(o.env,{area:"stream",path:ne?"stream-unbounded-append":"stream-append",reason:ne?"large-delta":"safe-append",unbounded:ne}),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",ts(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,y=!h&&!c&&m,k=g||y,v=n.options?.streamChunkAdaptive!==!1,C=n.options?.streamChunkTargetChunks??8,w=n.options?.streamChunkSizeChars,M=n.options?.streamChunkSizeLines,L=n.options?.streamChunkMaxChunks,E=!!n.__explicitStreamChunkConfig,S=n.options?.autoTuneChunks!==!1,x=n.options?.streamChunkFenceAware??!0;let A=c&&o.lineCount!==void 0?o.lineCount+Mo(c):void 0;if(k){A===void 0&&(A=Mo(e));const O=($,K,ne)=>$ne?ne:$,H=S&&!E?fL(e.length,A,n.options):null,R=H?.maxChunkChars??(v?O(Math.ceil(e.length/C),8e3,64e3):w??1e4),F=H?.maxChunkLines??(v?O(Math.ceil(A/C),150,700):M??200),P=H?.maxChunks??(v?O(Math.ceil(e.length/64e3),C,32):L),z=e.length>0&&e.charCodeAt(e.length-1)===10,W=y&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&H?.strategy!=="plain";if((g||W)&&(e.length>=R*2||A>=F*2)&&z){const $=tb(n,e,d,{maxChunkChars:R,maxChunkLines:F,fenceAware:H?.fenceAware??x,maxChunks:P});return this.cache={src:e,tokens:$,env:d,lineCount:A,lastSegment:void 0,globalStateReason:kl(e)},this.updateCacheLineCount(this.cache,A),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),$}}const T=this.parseFullDocument(e,d,n,A),I=T.tokens;return A=T.lineCount,this.cache={src:e,tokens:I,env:d,lineCount:A,lastSegment:void 0,globalStateReason:kl(e)},this.updateCacheLineCount(this.cache,A),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ts(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!Bc(d)?.unbounded}),I}recordChunkedParseResult(e,t){const n=Bc(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",ts(e,{area:"stream",path:"stream-full",reason:`global-state:${i}`,unbounded:!!Bc(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",ts(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,i,o=!0){const s=kl(e);u2(t)&&ad(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?PH(n,e.length,i):"no";if(r==="yes"){const a=D0(n,e,t);return ts(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:i??(o?Mo(e):0)}}let l=i;if(r==="need-lines"&&(l=Mo(e),OH(n,e.length,l))){const a=D0(n,e,t);return ts(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?Mo(e):0),{tokens:im(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:Mo(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+Mo(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??P1e}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+Mo(s);t.lineCount=g;const y=this.getDocLineCount(e,g);return r.map&&(r.map[1]=y),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:y,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 y=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,k=t.lineCount??Mo(t.src);t.tokens.splice(y,0,...m),t.src=e,t.env=n,t.globalStateReason=null;const v=k+Mo(s);t.lineCount=v;const C=this.getDocLineCount(e,v);if(r.map&&(r.map[1]=C),h.tbodyOpenIndex>=0){const w=t.tokens[h.tbodyOpenIndex];w?.map&&(w.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=Mo(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 yL={default:T1e,zero:E1e,commonmark:M1e};function H1e(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function W1e(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 kL(e){return e.experimental?{...e,...e.experimental}:e}function Ea(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 bL(e,t,n){for(let i=0;i=4?n.quotes=[S[0],S[1],S[2],S[3]]:n.quotes=["“","”","‘","’"]}let r=bL(s?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=bL(s?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=wL(s?.options,o,"fullChunkedFallback"),u=wL(s?.options,o,"streamChunkedFallback"),c=!1,d=null,f=null;const h=new Fpe;let m=null;const g=()=>(m||(m=new O1e(n)),m);let y=null;const k=()=>(y||(y=new j1e(h)),y);let v=null;const C=()=>(v||(v=new Kj({fuzzyLink:!0})),v),w=S=>!c&&!!d&&!W1e(S,d),M=(S,x)=>i==="default"&&!c&&m===null&&f!==null&&S.parse===f&&w(S)&&!S.stream.enabled&&x<(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,L=(S,x)=>i==="default"&&!c&&w(S)&&!S.stream.enabled&&!S.options.fullChunkedFallback&&x<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.linkify===!1&&S.options.typographer===!1,E={core:h,block:h.block,inline:h.inline,get linkify(){const S=C();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 w(this)},set(S){const x=kL(S);return this.options={...this.options,...x},(Ea(S,"fullChunkSizeChars")||Ea(S,"fullChunkSizeLines")||Ea(S,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(Ea(S,"streamChunkSizeChars")||Ea(S,"streamChunkSizeLines")||Ea(S,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),Ea(S,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),Ea(S,"streamChunkedFallback")&&(u=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set(x),typeof x.stream=="boolean"&&(this.stream.enabled=x.stream,y&&(y.reset(),y.resetStats())),this},configure(S){const x=typeof S=="string"?yL[S]:S;if(!x)throw new Error("Wrong `markdown-it` preset, can't be empty");if(x.options&&this.set(x.options),x.components){const A=x.components;A.core?.rules&&this.core.ruler.enableOnly(A.core.rules),A.block?.rules&&this.block.ruler.enableOnly(A.block.rules),A.inline?.rules&&this.inline.ruler.enableOnly(A.inline.rules),A.inline2?.rules&&this.inline.ruler2.enableOnly(A.inline2.rules)}return this},enable(S,x){const A=Array.isArray(S)?S:[S],T=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],I=new Set;for(const O of T){if(!O)continue;const H=O.enable(A,!0);for(let R=0;R!I.has(H));if(O.length)throw new Error(`Rules manager: invalid rule name ${O.join(", ")}`)}return this},disable(S,x){const A=Array.isArray(S)?S:[S],T=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],I=new Set;for(const O of T){if(!O)continue;const H=O.disable(A,!0);for(let R=0;R!I.has(H));if(O.length)throw new Error(`Rules manager: invalid rule name ${O.join(", ")}`)}return this},use(S,...x){const A=typeof S=="function"?S:S&&typeof S.default=="function"?S.default:void 0;if(!A)throw new TypeError("MarkdownIt.use: plugin must be a function");const T=[this,...x],I=S;return c=!0,A.apply(I,T),this},render(S,x){let A;if(M(this,S.length)){x!==void 0&&(Ur(x),A=R3("render"));const O=A?l1():0,H=A?uL(S,A):aL(S);if(A&&(A.attemptMs=l1()-O,H===null&&(A.fallbackReason="unsupported-stock-subset"),Dg(x,A)),H!==null)return x!==void 0&&ts(x,{area:"render",path:"stock-fast",reason:"stock-subset"}),H}const T=x??{},I=this.parse(S,T);return A&&Dg(T,A),g().render(I,this.options,T)},async renderAsync(S,x){let A;if(M(this,S.length)){x!==void 0&&(Ur(x),A=R3("render"));const O=A?l1():0,H=A?uL(S,A):aL(S);if(A&&(A.attemptMs=l1()-O,H===null&&(A.fallbackReason="unsupported-stock-subset"),Dg(x,A)),H!==null)return x!==void 0&&ts(x,{area:"render",path:"stock-fast",reason:"stock-subset"}),H}const T=x??{},I=this.parse(S,T);return A&&Dg(T,A),g().renderAsync(I,this.options,T)},renderIterable(S,x={}){const A=this.parseIterable(S,x);return g().render(A,this.options,x)},async renderAsyncIterable(S,x={}){const A=await this.parseAsyncIterable(S,x);return g().renderAsync(A,this.options,x)},renderInline(S,x={}){const A=this.parseInline(S,x);return g().render(A,this.options,x)},validateLink:AH,normalizeLink:xH,normalizeLinkText:SH,utils:ufe,helpers:{...Yfe},parse(S,x){if(typeof S!="string")throw new TypeError("Input data should be a String");if(x!==void 0&&Ur(x),L(this,S.length)){const O=x===void 0?void 0:R3("parse"),H=O?l1():0,R=Upe(S,O);if(O&&(O.attemptMs=l1()-H,R===null&&(O.fallbackReason="unsupported-stock-subset"),Dg(x,O)),R!==null)return x!==void 0&&ts(x,{area:"parse",path:"stock-fast",reason:"stock-subset"}),R}const A=x??{};let T;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&w(this)){const O=PH(this,S.length);if(O==="yes"){const H=D0(this,S,A);return ts(x,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),H}O==="need-lines"&&(T=Mo(S))}if(!this.stream.enabled){const O=S.length,H=this.options.autoTuneChunks!==!1,R=r,F=!a&&w(this),P=!!this.options.fullChunkedFallback,z=F&&O>=2e5;let W;(P||z||T!==void 0)&&(W=T??Mo(S));const $=(P||z)&&H&&!R?I1e(O,W,this.options):null;if(P||z){const K=W??0;if(P?O>=(this.options.fullChunkThresholdChars??2e4)||K>=(this.options.fullChunkThresholdLines??400):z){if($&&$.strategy!=="plain"){const ne=tb(this,S,A,{maxChunkChars:$.maxChunkChars,maxChunkLines:$.maxChunkLines,fenceAware:$.fenceAware,maxChunks:$.maxChunks});return x&&CL(x,P?"explicit-full-chunk":"default-large-string"),ne}if(P){const ne=(Y,J,U)=>YU?U:Y,G=this.options.fullChunkAdaptive!==!1,te=this.options.fullChunkTargetChunks??8,le=ne(Math.ceil(O/te),8e3,64e3),ie=ne(Math.ceil(K/te),150,700),_e=G?le:this.options.fullChunkSizeChars??1e4,Z=G?ie:this.options.fullChunkSizeLines??200,se=G?ne(Math.ceil(O/64e3),te,32):this.options.fullChunkMaxChunks,he=tb(this,S,A,{maxChunkChars:_e,maxChunkLines:Z,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:se});return x&&CL(x,"explicit-full-chunk"),he}}}if(T!==void 0&&w(this)&&OH(this,O,W??T)){const K=D0(this,S,A);return ts(x,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),K}}const I=kl(S);return ts(x,{area:"parse",path:"plain",reason:"default-plain"}),im(A,I,()=>h.parse(S,A,this).tokens)},parseIterable(S,x={}){return Ur(x),A1e(this,S,x)},parseAsyncIterable(S,x={}){return Ur(x),x1e(this,S,x)},parseIterableToSink(S,x,A={}){return Ur(A),S1e(this,S,x,A)},parseAsyncIterableToSink(S,x,A={}){return Ur(A),_1e(this,S,x,A)},parseInline(S,x={}){if(typeof S!="string")throw new TypeError("Input data should be a String");Ur(x),u2(x)&&ad(x);const A=h.createState(S,x,this);return A.inlineMode=!0,h.process(A),A.tokens}};if(E.stream={enabled:!!n.stream,parse(S,x){return E.stream.enabled?k().parse(S,x,E):E.parse(S,x??{})},reset(){k().reset()},peek(){return y?y.peek():[]},stats(){return y?y.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){y&&y.resetStats()}},s?.components){const S=s.components;S.core?.rules&&E.core.ruler.enableOnly(S.core.rules),S.block?.rules&&E.block.ruler.enableOnly(S.block.rules),S.inline?.rules&&E.inline.ruler.enableOnly(S.inline.rules),S.inline2?.rules&&E.inline.ruler2.enableOnly(S.inline2.rules)}return d=H1e(E),f=E.parse,E}var U1e=q1e;const HH=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],V1e=["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"],WH=["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"],K1e=["svg","g","path"],Z1e=["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"],G1e=["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"],Q1e=["action","data","href","src","srcset","poster","xlink:href","formaction"],Y1e=["script"],J1e=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Sf=new Set(HH),qH=new Set(WH),Lv=new Set([...HH,...V1e,...WH,...K1e]),UH=new Set([...Lv,...Z1e]),X1e=new Set(G1e),eme=new Set(Q1e),f2=new Set(Y1e),VH=new Set(J1e);function KH(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 tme={amp:"&",bsol:"\\",colon:":",newline:` +`,sol:"/",tab:" "};function ZH(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 tme[String(o??"").toLowerCase()]??t})}const _y=new Set(["http","https","mailto","tel"]),nme=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),fh=new Set(["http","https"]);function GH(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const ime=/^https?:\/\//i;function ome(e){if(!ime.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 sme(e,t,n){if(!P0(t,n)||!e.startsWith("file:///"))return!1;const i=e.charAt(8);return i!=="/"&&i!=="\\"}function P0(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function rme(e,t){return t==="href"||t==="xlink:href"?P0(e,t)?_y:fh:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?fh:(P0(e,t),_y)}function ip(e,t={}){if(ome(e))return!1;const n=KH(ZH(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=GH(n);return s?s==="file"?!sme(n,i,o):P0(i,o)?nme.has(s):!rme(i,o).has(s):!1}function lme(e){const t=ZH(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=GH(KH(t).toLowerCase());return n==="http"||n==="https"}function ame(e,t={}){const n=String(e??"").trim();return n?ip(n,t)?"":n:""}function AL(e){return ame(e,{tagName:"img",attrName:"src"})}function ume(e,t,n){function i(f){return f.trim().split(" ",2)[0]===t}function o(f,h,m,g,y){return f[h].nesting===1&&f[h].attrJoin("class",t),y.renderToken(f,h,m,g,y)}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 y,k=!1,v=f.bMarks[h]+f.tShift[h],C=f.eMarks[h];if(l!==f.src.charCodeAt(v))return!1;for(y=v+1;y<=C&&r[(y-v)%a]===f.src[y];y++);const w=Math.floor((y-v)/a);if(w=m||(v=f.bMarks[E]+f.tShift[E],C=f.eMarks[E],v=4)){for(y=v+1;y<=C&&r[(y-v)%a]===f.src[y];y++);if(!(Math.floor((y-v)/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)&&QH(o.children,t,n)}}function dme(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(ume,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 L=0,E=-1;for(let S=0;S0&&(h=g.slice(0,E))}h||(f=d||void 0)}if(o)return!0;const y=!!s.env.__markstreamFinal;let k=n+1,v=!1;for(;k<=i;){const L=s.bMarks[k]+s.tShift[k],E=s.eMarks[k];if(s.src.slice(L,E).trim()===":::"){v=!0;break}k++}v||(k=i);const C=s.push("vmr_container_open","div",1);if(C.attrSet("class",`vmr-container vmr-container-${c}`),C.map=[n,v?k:i],C.meta={...C.meta??{},unclosed:!v&&!y},f&&C.attrSet("data-args",f),h)try{const L=JSON.parse(h);for(const[E,S]of Object.entries(L)){const x=S!=null&&typeof S=="object";C.attrSet(`data-${E}`,x?JSON.stringify(S):String(S))}}catch{const L=cme(h);if(L)for(const[E,S]of Object.entries(L)){const x=S!=null&&typeof S=="object";C.attrSet(`data-${E}`,x?JSON.stringify(S):String(S))}else C.attrSet("data-attrs",h)}const w=[];for(let L=n+1;LL.trim().length>0)){let L=w.join(` +`);L.endsWith(` +`)||(L+=` +`),L.endsWith(` + +`)||(L+=` +`);const E=s.tokens[s.tokens.length-1];E&&(E.raw=L);const S=[];s.md.block.parse(L,s.md,s.env,S),QH(S,n+1,n+1+w.length),s.tokens.push(...S)}const M=s.push("vmr_container_close","div",-1);return v||(M.hidden=!0,M.map=[i,i]),s.line=v?k+1:k,!0},{alt:["paragraph","reference","blockquote","list"]})}function Au(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function No(e){let t=!1,n=!1;for(let i=0;i")return i}return-1}function $4(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 fme=/^[a-z][a-z0-9_-]*$/;function xL(e){return fme.test(String(e??"").trim().toLowerCase())}function Va(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return xL(t)?t.toLowerCase():"";let n=1;for(;n]/.test(s)?"":xL(o)?o:""}function Np(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 hme(...e){const t=new Set,n=[];for(const i of e)for(const o of Np(i))t.has(o)||(t.add(o),n.push(o));return n}function pme(e){const t=Np(e);return{key:t.join(","),tags:t}}function YH(e){return Va(e)}function mme(e,t){const n=String(e??""),i=Va(t);if(!i)return!1;const o=Au(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 JH(e,t){const n=Va(t);return!!n&&!Lv.has(n)&&!mme(e,n)}function gme(e,t){const n=String(e??""),i=Va(t);if(!i)return n;const o=Au(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 XH=Sf,vme=Lv,eW=new Set(qH);eW.delete("details");const yme=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,kme=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,vA=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,bme=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function ib(e){return(e.match(vA)?.[1]??"").toLowerCase()}function kx(e){return/^\s*<\s*\//.test(e)}function bx(e,t){return XH.has(t)||/\/\s*>\s*$/.test(e)}function wme(e,t){let n=0;for(let i=0;i0&&n--;continue}bx(o,s)||n++}}return n}function SL(e,t,n=0){const i=new RegExp(String.raw`<\s*(\/?)\s*${Au(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 Ame(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Au(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 ob(e){const t=e;return String(t.raw??t.content??t.markup??"")}function xme(e){const t=e;return t.meta||(t.meta={}),t.meta}function Z3(e,t,n){const i=xme(e);i.markstreamCustomHtmlRaw=t,i.markstreamCustomHtmlInner=n}function Sme(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Au(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*${Au(m)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!c(h),f=(h,m,g)=>{const y=g??(h.type==="html_inline"?ib(m):"");if(!(y&&t.has(y))){r(m);return}const k=kx(m),v=!k&&bx(m,y);if(k){if(!i.length||i[i.length-1].tag!==y){r(m);return}u(m);return}if(r(m),v){Z3(h,m,"");return}i.push({tag:y,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,y=!0;for(const k of h.children){const v=ob(k),C=k.type==="html_inline"?ib(v):"",w=C&&t.has(C);let M=v;if(y&&m&&v&&(i.length||w)){const L=m.indexOf(v,g);if(L!==-1)a(m.slice(g,L)),M=m.slice(L,L+v.length),g=L+v.length;else{if(i.length&&!w)continue;y=!1}}f(k,M,C)}y&&m&&g0;continue}if(i.length&&typeof h.content=="string"){const m=ob(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 _me(e){return/^\s*<\s*[!?]/.test(e)}function Ime(e){const t=new Set(vme);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 _L(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function Mme(e,t){let n=null;for(const s of e.matchAll(yme)){const r=s.index??-1;if(r<0)continue;const l=(s[1]??"").toLowerCase();_L(l,t)&&No(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 w=Va(String(C??""));w&&m.add(w)}const y=Ime(Array.from(m)),k=new Set(Lme);for(const C of m)k.add(C);return{autoCloseInlineTagSet:k,commonHtmlTags:y,customTagSet:m,shouldMergeHtmlBlockTag:C=>m.has(C)||!y.has(C)||eW.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 y={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},y,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[y]},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 y of h){const k=y;if(k.type!=="inline"||!Array.isArray(k.children))continue;const v=String(k.content??""),C=k.children.length?k.children:v.includes("<")?[{type:"text",content:v,raw:v}]:null;if(C)try{const w=Eme(C,m);if(k.children=w.children,w.pendingBuffer){const M=v.lastIndexOf(w.pendingBuffer);if(M!==-1){const L=v.slice(0,M);k.content=L,typeof k.raw=="string"&&(k.raw=L)}}}catch(w){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",w)}}Sme(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:m,customTagSet:g,shouldMergeHtmlBlockTag:y}=i(f),k=[];for(let v=0;v0){const[M,L]=k[k.length-1];if(v!==L){if(C.type==="paragraph_open"||C.type==="paragraph_close"){h.splice(v,1),v--;continue}const E=String(C.content??C.raw??"");if(E){const S=h[L],x=`${String(S.content||"")} +${E}`,A=No(x),T=A===-1?null:SL(x,M,A+1);if(T){const I=x.slice(0,T.end),O=x.slice(T.end);S.content=I,S.loading=!1,h.splice(v,1),k.pop();const H=d(S,O)?[]:u(O,c(h,v,"paragraph"));H.length&&h.splice(v,0,...H),v--;continue}S.content=x,S.loading!==!1&&(S.loading=!0)}h.splice(v,1),v--;continue}}const w=o(C);if(w){if(_me(w))continue;const M=(w.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),L=/^\s*<\s*\//.test(w);if(!M||!y(M))continue;if(s(C,w),!L)M&&!new RegExp(`^\\s*<\\s*${M}\\b[^>]*\\/\\s*>`,"i").test(w)&&Ame(w,M)>0&&k.push([M,v]);else if(k.length>0&&M&&k[k.length-1][0]===M){const[,E]=k[k.length-1],S=h[E];S.content=`${String(S.content||"")} +${w}`,S.loading=!1,k.pop(),h.splice(v,1),v--}continue}else if(k.length>0){if(C.type==="paragraph_open"||C.type==="paragraph_close"){h.splice(v,1),v--;continue}const M=C.content||"",L=new RegExp(`<\\s*\\/\\s*${k[k.length-1][0]}\\s*>`,"i").test(M);if(M){const[,E]=k[k.length-1],S=h[E];S.content=`${S.content||""} +${M}`,S.loading!==!1&&(S.loading=!L)}L&&k.pop(),h.splice(v,1),v--}else continue}if(g.size>0){const v=new Map,C=new Map,w=E=>{let S=v.get(E);return S||(S=new RegExp(`<\\s*${E}\\b`,"i"),v.set(E,S)),S},M=E=>{let S=C.get(E);return S||(S=new RegExp(`<\\s*\\/\\s*${E}\\s*>`,"i"),C.set(E,S)),S},L=[];for(let E=0;E0){const T=L[L.length-1],I=h[T.index],O=S.type==="html_block"?M(T.tag).exec(x):null;if(O){const F=O.index+O[0].length,P=x.slice(0,F),z=x.slice(F);I.content=`${String(I.content??"")} +${P}`,Array.isArray(I.children)&&I.children.push({type:"html_inline",content:``,raw:``}),L.pop();const W=d(I,z)?[]:u(z,c(h,E,"paragraph"));W.length?h.splice(E,1,...W):(h.splice(E,1),E--);continue}if(S.type!=="inline")continue;const H=Array.isArray(S.children)?S.children:[],R=wme(H,T.tag);if(R!==-1){const F=H.slice(0,R+1),P=H.slice(R+1),z=F.map(W=>String(W?.content??W?.raw??"")).join("");if(I.content=`${String(I.content??"")} +${z}`,Array.isArray(I.children)&&I.children.push(...F),P.length){const W=P.map($=>String($.content??$.raw??"")).join("");if(W.trim()){const $=W.replace(/^\s+/,"");if(d(I,W))h.splice(E,1),E--;else if($.startsWith("<"))h.splice(E,1,{type:"html_block",content:$});else{const K=u(W,c(h,E,"paragraph"));h.splice(E,1,...K)}}else h.splice(E,1),E--}else h.splice(E,1),E--;L.pop();continue}I.content=`${String(I.content??"")} +${x}`,Array.isArray(I.children)&&I.children.push(...H),h.splice(E,1),E--;continue}if(S.type!=="inline")continue;const A=Array.isArray(S.children)?S.children:[];for(const T of g)if((A.length?Cme(A,T):w(T).test(x)&&!M(T).test(x)?1:0)>0){L.push({tag:T,index:E});break}}}{let v=0;for(let C=0;C0?v--:(h.splice(C,1),C--))}}for(let v=0;v/]+)/)?.[1]??"").toLowerCase();if(S.startsWith("!")||S.startsWith("?")){C.loading=!1;continue}if(g.has(S)){const R=String(C.content??""),F=No(R),P=F===-1?null:SL(R,S,F+1);C.loading=P?!1:C.loading!==void 0?C.loading:!0;const z=P?.start??-1,W=P?P.end-P.start:0;if(z!==-1){const $=R.slice(0,z+W);let K="";F!==-1&&F]+)))?/g;let A;for(;(A=x.exec(C.content||""))!==null;)A[1],A[2]||A[3]||A[4];const T=String(C.content??""),I=new RegExp(`<\\/\\s*${S}\\s*>`,"i").exec(T),O=I?I.index:-1,H=I?I[0].length:0;if(O!==-1){const R=T.slice(0,O+H),F=(T.slice(O+H)||"").replace(/^\s+/,"");C.children=[{type:"html_block",content:R,tag:S,loading:!1}],C.content=R,C.raw=R,F&&h.splice(v+1,0,F.startsWith("<")?{type:"html_block",content:F}:{type:"text",content:F,raw:F})}else C.children=[{type:"html_block",content:C.content,tag:S,loading:!0}];continue}if(!C||C.type!=="inline")continue;if(C.children.length===2&&C.children[0].type==="html_inline"){const S=(C.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),x=C.children[1],A=String(x?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(x?.type==="html_inline"&&A===S)continue;m.has(S)?(C.children[0].loading=!0,C.children[0].tag=S,C.children.push({type:"html_inline",tag:S,loading:!0,content:``})):C.children=[{type:"html_block",loading:!0,tag:S,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 S=(C.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(m.has(S))continue;C.children=[{type:"html_block",loading:!1,tag:S,content:C.children.map(x=>x.content).join("")}];continue}if(!C.content?.startsWith("<")||C.children?.length!==1)continue;const w=String(C.content),M=C,L=M.children[0];if(L?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(w)&&(M.children.length=0);continue}const E=String(L.content??w).match(bme)?.[1]?.toLowerCase()??"";if(E){if(/\/\s*>\s*$/.test(w)||XH.has(E)){M.children=[{type:"html_inline",content:w}];continue}M.children.length=0}}})}function Fme(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 Dme(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&&!Fme(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 tW=/\.([a-z0-9]{1,15})$/i,Rme=/[_()[\]{}<>]/u,Ome=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,Pme=/[?#@]/u,Bme=/[\\/]/u,$me=/^[\p{L}\p{N}./\\-]+$/u,zme=/^[A-Za-z0-9-]{1,63}$/u,jme=/^xn--[a-z0-9-]{2,59}$/i,Hme=/^(?:[A-Z]{1,6}|\d{1,8})$/u,Wme=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,qme=/文件名\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,Ume=/文件名\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,Vme=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,Kme=2e3,Zme=512,Gme={},Qme=new Set(["ai","md","py","rs","sh","zip"]),nW=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),Yme=new Set([...nW,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),Jme=new Set(["com","dev","io","page","site"]),Xme=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),ege=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"]),jh=new Map;function IL(e,t){if(!e||e.length>Zme)return t;for(jh.set(e,t);jh.size>Kme;){const n=jh.keys().next().value;if(!n)break;jh.delete(n)}return t}function Nv(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 Nv(n)?n:void 0}function ML(e,t){if(!Nv(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 TL(e){const t=h2(e);return Nv(t)?t:void 0}function tge(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function EL(e,t){if(!Nv(t))return;const n=String(e??"").trim().split(/\s+/u).map(tge).filter(Boolean);if(n.length===0)return;const i={};return t?.filename&&n.every(o=>sb(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(i.filename=!0),t?.explicitFilename&&i.filename&&(i.explicitFilename=!0),t?.marketTicker&&n.every(o=>sb(o,{marketTicker:!0}))&&(i.marketTicker=!0),Nv(i)?i:void 0}function qf(e,t=!1){let n;return{options(i){return t||i==null?ML(e,n):ML(e,G3(TL(i),EL(i,n)))},remember(i){const o=TL(i);n=t?G3(n,o):G3(o,EL(i,n))},reset(){n=void 0}}}function LL(e){return zme.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function nge(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return LL(n)||jme.test(n)?t.every(LL):!1}function iW(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function ige(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function oge(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function oW(e,t,n){const i=ige(t);return iW(e)&&oge(i)&&String(n??"").toLowerCase().includes(i.toLowerCase())}function sge(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 h2(e){const t=String(e??""),n=jh.get(t);return n?(jh.delete(t),jh.set(t,n),n):sge(t)?IL(t,{explicitFilename:qme.test(t),filename:Ume.test(t),marketTicker:Vme.test(t)}):IL(t,Gme)}function rge(e){return nge(e.split(/[\\/]/)[0]??"")}function lge(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function age(e){if(Rme.test(e)||!$me.test(e))return!0;if(Bme.test(e))return!rge(e);const t=e.replace(tW,"");return iW(t)?!0:t.split(".").filter(Boolean).some(lge)}function uge(e,t,n){if(!(n?Yme:nW).has(t))return!1;const i=e.slice(0,-(t.length+1));return i===""?e.startsWith("."):(n?Wme:Hme).test(i)}function sb(e,t={}){if(!e||Ome.test(e)||Pme.test(e))return!1;const n=e.match(tW);if(!n)return!1;const i=String(n[1]??"").toLowerCase();return uge(e,i,t.marketTicker===!0)?!0:ege.has(i)?!Qme.has(i)||t.filename?!0:age(e):!!(t.explicitFilename&&Jme.has(i)||t.filename&&Xme.has(i))}const sW=new WeakMap,rW=new WeakSet;function yA(e,t){return sW.set(e,t),e}function cge(e){return sW.get(e)}function dge(e){rW.add(e)}function fge(e){return e===void 0||rW.has(e)}const NL=["!"];function FL(e){return e==="linkify"||e==="autolink"?e:"recovery"}function gl(e){return{type:"text",content:e,raw:e}}function hh(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 ph(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 Ed(e,t,n,i="recovery"){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return yA({type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`},i)}function hge(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(gl(t))}}function DL(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 mge(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 RL(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?OL(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=h2(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=OL(u);m!==-1&&(d===-1||m=g.content.length){h-=g.content.length;continue}if(h<0)break;const y=g.content[h],k=g.content.slice(0,h);let v=g.content.slice(h);for(let M=m+1;M0&&(e.splice(m+1,C),a=m+1);let w=c;if(y==="!"&&f!==-1)w=c.slice(0,f);else if(v){const M=encodeURI(v);if(M&&c.endsWith(M))w=c.slice(0,c.length-M.length);else{const L=y?encodeURI(y):"",E=L?c.indexOf(L):-1;E!==-1&&(w=c.slice(0,E))}}w!==c&&mge(l,w),v&&e.splice(a+1,0,gl(v));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(Ed(u,c,f,"linkify"));const h=e[r+3].content?.replace(/^\)\**/,"");h&&a.push(gl(h)),e.splice(r-4,8,...a)}else a.push(yA({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(k=>k[0]==="href")?.[1]||"",d=u.find(k=>k[0]==="title")?.[1]||"";let f=3,h=2;const m=(e[r-3]?.content||"").match(/^(\*+)$/),g=[];if(m){h+=1;const k=m[1].length;hh(g,k)}if(l.markup!=="linkify"&&e[r+1].type==="text"&&e[r+1]?.content?.startsWith("](")){f+=1;for(let k=r+1;ky[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(Ed(d,f,m)),ph(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=[];hh(d,2),d.push(Ed(u,c,!1)),ph(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 y=c+1;for(;y=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let y=c+1;for(;y{const n=t;try{const i=Ege(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 PL(){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 BL(){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 $L(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 lW(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 lW(e)!==null}function aW(e){return/^:?-+:?$/.test(e.trim())}function Sge(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(aW)}function _ge(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function Ige(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(aW)&&_ge(n)}function Mge(e){return e==="|"||e==="|:"}function Tge(e){const t=lW(e);return t!==null&&t.every(n=>!n.includes(":"))}function Ege(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)&&Ige(u)||d)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>$L(m)),h=[...PL(),...f,...BL()];i.splice(o-1,3,...h)}else if(r.includes(` +`)&&c.length===0&&Q3(a)&&Sge(u)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>$L(m)),h=[...PL(),...f,...BL()];i.splice(o-1,3,...h)}else r.includes(` +`)&&c.length===0&&Tge(a)&&Mge(u)&&(s.content=r.slice(0,-2),s.children.splice(2,1))}return i}function Lge(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 Nge=Lge;const Fge=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],rb=Fge.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),Dge=/\\[a-z]+/i,uW="(?:\\\\|\\u0008)",Rge=new RegExp(String.raw`${uW}(?:${rb})\s*\{[^}]+\}`,"i"),Oge=new RegExp(String.raw`(?:${uW})?(?:${rb})\s*\{`,"i"),Pge=/\\(?:text|frac|left|right|times)/,Bge=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,$ge=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,zge=/[A-Z]+\s*\([^)]+\)/i,jge=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,Hge=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,Wge=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,qge={"\b":"\\b","\v":"\\v","\f":"\\f"};function Uge(e){let t="";for(const n of e)t+=qge[n]??n;return t}function Qd(e){if(!e)return!1;const t=Uge(e),n=t.trim();if(Wge.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const i=Dge.test(t),o=Rge.test(t),s=Oge.test(t),r=Pge.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=Bge.test(t)&&!$ge.test(t),u=zge.test(t),c=jge.test(n),d=Hge.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 cW="__markstreamMathPluginApplied",kA=80,dW=2e4,zL=dW+4096;function wx(e){return!!e[cW]}function Vge(e){e[cW]=!0}const fW=["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"],Kge=["cdot","mathbf{","partial","mu_{"],hW=fW.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),pW="[ \r\b\f\v]",Zge=new RegExp(`([^\\\\])(${Kge.map(e=>e).join("|")})+`,"g"),Gge=/span\{([^}]+)\}/,Qge=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,Yge=/(^|[^\\])\\\r?\n/g,Jge=/(^|[^\\])\\$/g,Xge=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,e0e=new RegExp(`(${pW})|(${hW})\\b`,"g"),jL=new Map,HL=new Map;function t0e(e){if(!e)return e0e;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),i=jL.get(n);if(i)return i;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,s=new RegExp(`(${pW})|(${o})\\b`,"g");return jL.set(n,s),s}function n0e(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const i=e?"__default__":n.join(""),o=HL.get(i);if(o)return o;const s=e?[rb,hW].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),rb].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${s})\\s*\\{`,"g");return HL.set(i,r),r}const WL={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function qL(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function i0e(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&Xge.test(n))return t;const i=n?t.slice(n.length):t;return`${n}${"\\!".repeat(i.length)}`})}function UL(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 Ld(e,t){const n=t?.commands??fW,i=t?.escapeExclamation??!0,o=t?.commands==null,s=t0e(o?void 0:n);let r=e.replace(s,(u,c,d,f,h)=>{if(c!==void 0&&WL[c]!==void 0)return`\\${WL[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=i0e(r));let l=r;const a=n0e(o,o?void 0:n);return l=l.replace(a,(u,c,d)=>`${c}\\${d}{`),l=l.replace(Gge,"span\\{$1\\}").replace(Qge,"\\operatorname{span}\\{$1\\}"),l=l.replace(Yge,`$1\\\\ +`),l=l.replace(Jge,"$1\\\\"),l=l.replace(Zge,"$1\\$2"),l}function VL(e){const t=e.trim();return!(!Qd(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 mW(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 bA(e,t){let n=t;for(;n0&&e[i-1]==="$"||i+1=l)break;const u=lb(o,a);if(u){r=Math.max(a+Math.max(1,t.length),u[1]);continue}p2(e,a)||s++,r=a+Math.max(1,t.length)}return s}function Cx(e,t,n){const i=Dv(String(e??""));if(!i.endsWith(t))return-1;const o=i.length-t.length;if(o<=0||!Dv(i.slice(0,o)).trim()||p2(i,o))return-1;const s=mW(i);if(lb(s,o))return-1;const r=KL(i,t,0,o,s);if(t==="$$"){if(r%2===1)return-1}else if(r>KL(i,n,0,o,s))return-1;return o}function Fv(e){return e===" "||e===" "}function Dv(e){let t=e.length;for(;t>0&&Fv(e[t-1]);)t--;return e.slice(0,t)}function ZL(e){let t=0;for(let n=0;n=48&&t<=57}function s0e(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 r0e(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 l0e(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(r0e)}function a0e(e){let t=0;if(!GL(e[t]))return!1;for(;GL(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Fv(e[t+1])}function gW(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&&Fv(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Fv(t[1])||a0e(t)||s0e(t)||l0e(t))}function QL(e,t){return e?t?`${e} +${t}`:e:t}function wA(e){const t=String(e??"").trim();return t?Qd(t):!1}function YL(e){let t=0;for(let n=0;nkA){h=!0;break}const g=o[m],y=x1(g,c);if(y!==-1){const k=QL(f,g.slice(0,y));if(!wA(k)){h=!0;break}const v=g.slice(y+c.length),C=v.trim()?`suffix:${YL(v)}`:"nosuffix";return["closed",u,i+l,d,i+m,y,YL(k),C].join(":")}if(gW(g)){h=!0;break}if(f=QL(f,g),f.length>dW){h=!0;break}}if(!h&&wA(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 c0e(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 d0e(e,t){Vge(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=(v,C)=>{let w=C;for(;w=3&&(!w||/\s/.test(w))){const M=a.push("text","",0);return M.content=a.src.slice(a.pos,v),a.pos=v,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),m=Math.max(0,a.pos-h.length);let g=m,y=m;const k=m;for(const[v,C]of f){const w=a.src,M=mW(w),L=o0e(w,c);let E=!1;v==="$$"&&g!==k&&(g=k);let S=-1,x=-1,A=0;const T=I=>{if((I==="undefined"||I==null)&&(I=""),I==="\\"){a.pos=a.pos+I.length,g=a.pos;return}if(I==="\\)"||I==="\\("){const R=a.push("text_special","",0);R.content=I==="\\)"?")":"(",R.markup=I,a.pos=a.pos+I.length,g=a.pos;return}if(!I)return;if(v==="$$"&&I.includes("$")){let R=0;for(;R0&&I[F-1]==="$"||F+10){const P=I.slice(0,O),z=a.push("text","",0);z.content=P,a.pos=a.pos+P.length,g=a.pos}const R=I.slice(O).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(R){const[,P,z]=R,W=z.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),$=W?W[1]:z,K=W&&W[2]?W[2]:null,ne=a.push("image","img",0);ne.attrs=[["src",$],["alt",P]],K&&ne.attrs.push(["title",K]),ne.content=P,ne.children=[{type:"text",content:P,tag:""}],a.pos=a.pos+R[0].length,g=a.pos;const G=I.slice(O+R[0].length);G&&T(G);return}const F=a.push("text","",0);F.content=I,a.pos=a.pos+I.length,g=a.pos;return}const H=a.push("text","",0);H.content=I,a.pos=a.pos+I.length,g=a.pos};for(;!(g>=w.length);){const I=w.indexOf(v,g);if(I===-1)break;if(p2(w,I)){g=I+Math.max(1,v.length);continue}const O=lb(M,I);if(O){g=O[1];continue}const H=lb(L,I);if(H){g=H[1];continue}if(I===S&&g===x){if(A++,A>2){g=I+Math.max(1,v.length);continue}}else A=0,S=I,x=g;if(v==="("&&I>0){let G=I-1;for(;G>=0&&w[G]===" ";)G--;if(G>=0&&w[G]==="]"){g=I+v.length;continue}}if(v==="$"&&I>0&&w[I-1]==="$"){g=I+1;continue}if(v==="$"&&I=w.length);){const O=bA(w,I);if(O===-1)break;if(O+10&&w[O-1]==="$"){I=O+1;continue}const H=Y3(w,O+1);if(H===-1)break;const R=w.slice(O+1,H),F=R.includes("`"),P=!R||!R.trim(),z=w[H+1],W=J3(R,z),$=X3(R);if(!F&&!P&&!W&&!$){const K=w.slice(g,O);K&&T(K);const ne=a.push("math_inline","math",0);ne.content=Ld(R,t),ne.markup="$",ne.raw=`$${R}$`,ne.loading=!1,g=H+1,I=H+1}else T("$"),I=O+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(),y=!1,k="",v="",C=!1,w="",M=!1;for(const[K,ne]of h)if(g.startsWith(K))if(K.includes("[")){const G=K==="\\["?g.slice(K.length):"";if(K==="\\["&&x1(G,ne)===-1&&!/^\s*!\[/.test(G)&&!G.includes("`")&&Qd(G)){y=!0,k=K,v=ne;break}if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1=0?"\\]":v,A=S>=0?S:x1(g,v,E);if(!C&&A>k.length){const K=g.slice(L+k.length,A),ne=c.push("math_block","math",0);ne.content=Ld(K),ne.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",ne.map=[l,l+1],ne.raw=`${k}${K}${x}`,ne.block=!0,ne.loading=!1,c.line=l+1;const G=g.slice(A+x.length);return G.trim()&&n(c,G,l),!0}let T=l,I="",O=!1,H="",R=l;const F=C?g:g===k?"":g.slice(k.length),P=!f&&k==="\\["?"]":"",z=x1(F,v);if(z!==-1){const K=z;I=F.slice(0,K),H=F.slice(K+v.length),R=C?l+1:l,O=!0,T=R}else for(F&&!C&&(I=F),T=l+1;T{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 f0e(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 h0e=/^\s]/i,p0e=/^<\/a\s*>/i;function m0e(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??"");h0e.test(r)&&i>0&&i--,p0e.test(r)&&i++}if(!(i>0)&&s?.type==="text"&&t.test(String(s.content??"")))return!0}return!1}function g0e(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=>m0e(l,s));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(i)),i,{tokens:r}))})}function v0e(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 y0e(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 U1e({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:i,...n}});if(!o){const r=l=>!ip(l,{tagName:"a",attrName:"href"});dge(r),s.set({validateLink:r})}return v0e(s),g0e(s),(e.enableMath??!0)&&d0e(s,{...e.mathOptions??{}}),(e.enableContainers??!0)&&dme(s),e.enableFixIndentedCodeBlock!==!1&&Dme(s),gge(s),bge(s),yge(s),xge(s),f0e(s),Nme(s,{customHtmlTags:e.customHtmlTags}),s}function op(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=>op(n))),t}function k0e(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function b0e(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 w0e(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Iy(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;sn.startsWith(t)||t.startsWith(n)):!1}function JL(e,t,n,i){n.length>0&&e.push(...n),i.length>0&&t.push(...i),n.length=0,i.length=0}function XL(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function S0e(e,t){const n=[],i=[],o=[],s=[],r=e.split(A0e),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),u=h=>{const m=h;if(!kW.some(g=>m.startsWith(g)))if(m.startsWith("-")){const g=m.slice(1);o.push(XL(g,a))}else if(m.startsWith("+")){const g=m.slice(1);s.push(XL(g,a))}else{JL(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)&&JL(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 Ax(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=C0e(u,c);d.test(a)&&(a=a.replace(d,""))}if(r){const{original:u,updated:c}=S0e(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 _0e(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function I0e(){return{type:"hardbreak",raw:`\\ +`}}function M0e(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s\s*$/.test(t)||Sf.has(e)}function T0e(e){if(!e||e.length===0)return eN();const t=t8.get(e);if(t)return t;const n=e.map(Va).filter(Boolean);if(!n.length){const o=eN();return t8.set(e,o),o}const i={customTagSet:new Set(n),allowedTagSet:W4({customHtmlTags:e})};return t8.set(e,i),i}function AW(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function E0e(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,i=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof i=="string"?{raw:n,inner:i}:null}function ab(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 L0e(e,t,n){const i=e.slice();return ab(i,"href")||i.push(["href",t]),n!=null&&!ab(i,"title")&&i.push(["title",n]),i}function CA(e){return e.map(AW).join("")}function R9(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:R9(i.children)});continue}t.push(i)}return t}function N0e(e,t,n){let i=0;for(let o=t;o`;g.toLowerCase().includes(M.toLowerCase())||(g+=M),k=!0,y=!0}const v=[],C=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let w;for(;(w=C.exec(l))!==null;){const M=w[1],L=w[2]||w[3]||w[4]||"";v.push([M,L])}if(u?.has(a)){const M=E0e(e);return[{type:a,tag:a,attrs:v,content:M?M.inner:h.innerTokens.length?CA(h.innerTokens):"",children:h.innerTokens.length?i(h.innerTokens,o,s,r):[],raw:M?.raw??g,loading:e.loading||y,autoClosed:k},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:v,content:g,children:m,raw:g,loading:y,autoClosed:k},h.nextIndex]}function xW(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=>xW(t)).join(""):String(e.content??"")}function D0e(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>xW(t)).join("")}function tN(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=D0e(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 R0e(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function O0e(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 B0e(e,t,n){const i=e.slice();return ub(i,"href")||i.push(["href",t]),n!=null&&!ub(i,"title")&&i.push(["title",n]),i}function My(e,t,n){const i=e[t],o=P0e(i.attrs),s=String(ub(o,"href")??""),r=ub(o,"title"),l=r==null?null:String(r),a=B0e(o,s,l);let u=t+1;const c=[];let d=!0;for(;uy.type==="strong_open")){const y=String(h.content??""),k=String(h.raw??y),v=op(h);v.content=y.slice(0,-2),v.raw=k.replace(/\*\*$/,""),f=c.slice(),f[f.length-1]=v}const m=bo(f,void 0,void 0,n),g=m.map(y=>{const k=y;return"content"in y?String(k.content??""):String(k.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?@[\\\]^_`{|}~]/,Y0e=/\p{P}/u,J0e=/^[\x22\x27《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,X0e=/^[\x22\x27》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,eve=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,tve=/:\/\//,AA=1,SW=2,nve=4,ive=8,_W=16,Bd=32,O9=64,r0=128,IW=256,ove=512,l0=1024,sve=1982;function Ty(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 _f(e){return!!e&&G0e.test(e)}function If(e){return!!e&&(Q0e.test(e)||Y0e.test(e))}function TW(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&J0e.test(e)}function EW(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&X0e.test(e)}function lve(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!i||_f(i)?!1:!(If(i)&&!TW(i,n)&&n&&!_f(n)&&!If(n))}function ave(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!n||_f(n)?!1:!(If(n)&&!EW(n,i)&&i&&!_f(i)&&!If(i))}function uve(e,t,n=0){let i=n,o=!1;for(;i0?e[t-1]:void 0,i=e[t+2];return!i||_f(i)?!1:!(If(i)&&!TW(i,n)&&n&&!_f(n)&&!If(n))}function dve(e,t){const n=t>0?e[t-1]:void 0,i=e[t+2];return!n||_f(n)?!1:!(If(n)&&!EW(n,i)&&i&&!_f(i)&&!If(i))}function fve(e,t=0){let n=t,i=!1;for(;n=0&&e[s]==="\\";s--)o++;return o%2===1}const gve=/[\p{L}\p{N}]/u,vve=/^[\p{L}\p{N}]+$/u;function xA(e){return e?gve.test(e):!1}function LW(e){return e?vve.test(e):!1}function B0(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 wve(e){return e?eve.test(e)||tve.test(e):!1}function Cve(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function bo(e,t,n,i){if(!e||e.length===0)return[];const o=i?.__linkifyDemotionContext,s=h2(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,J){const U=e.length===1?t:String(J.content??""),Q=[],ue=yve(Y);if(ue!==-1){M(Y.slice(0,ue),Y.slice(0,ue));const pe=Y.slice(ue);return pe&&(T({type:"text",content:pe,raw:pe}),c--),c++,!0}if(U0e.test(Y)){const pe=Y.indexOf("~~");pe!==-1&&Q.push({type:"strikethrough",index:pe})}if(V0e.test(Y)){const pe=Y.indexOf("**");pe!==-1&&Q.push({type:"strong",index:pe})}if(/[^*]*\*[^*]+/.test(Y)){const pe=U?MW(U,0):Y.indexOf("*");if(U&&pe===-1)return!1;pe!==-1&&Q.push({type:"emphasis",index:pe})}Q.sort((pe,ee)=>pe.index!==ee.index?pe.index-ee.index:pe.type===ee.type?0:pe.type==="strong"?-1:ee.type==="strong"?1:0);const me=Q[0];if(!me)return!1;if(me.type==="strikethrough"){const pe=me.index,ee=pe>-1?Y.slice(0,pe):"";if(ee&&M(ee,ee),pe===-1)return c++,!0;const re=Y.indexOf("~~",pe+2),ge=re===-1?Y.slice(pe+2):Y.slice(pe+2,re),ae=re===-1?"":Y.slice(re+2),{node:Ce}=iN([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ge,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,i);return m(),w(Ce),ae&&(T({type:"text",content:ae,raw:ae}),c--),c++,!0}if(me.type==="strong"){const pe=me.index,ee=pe>-1?Y.slice(0,pe):"";if(ee&&M(ee,ee),pe===-1)return c++,!0;if(t&&pe===0){let ce=!1,Te=0;for(;Te=2)return M(Y,Y),c++,!0}}if(t&&(Y.match(/\*/g)||[]).length>rve(t))return M(Y.slice(ee.length),Y.slice(ee.length)),c++,!0;const re=B0(Y,pe);if(re.len>=3){const ce=bve(Y,pe+re.len);if(ce!==-1){const Te=Y.slice(pe+re.len,ce);if(kve(Te)){const{node:ke}=Rg([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Te,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(),w(ke);const Ae=Y.slice(ce+3);return Ae&&(T({type:"text",content:Ae,raw:Ae}),c--),c++,!0}}}if(!cve(Y,pe)){const ce=Y.slice(pe,pe+re.len);M(ce,ce);const Te=Y.slice(pe+re.len);return Te&&(T({type:"text",content:Te,raw:Te}),c--),c++,!0}const ge=fve(Y,pe+2);let ae="",Ce="";if(ge.index!==-1){ae=Y.slice(pe+2,ge.index),Ce=Y.slice(ge.index+2);const ce=ge.index,Te=B0(Y,ce);if(re.intraword&&Te.intraword&&!LW(ae)||!ae&&re.len>=4&&re.intraword)return M(Y.slice(ee.length),Y.slice(ee.length)),c++,!0}else{if(d||ge.sawInvalidClose||re.intraword)return M(Y.slice(ee.length),Y.slice(ee.length)),c++,!0;ae=Y.slice(pe+2),Ce=""}if(!ae&&/^\*+$/.test(Ce))return M(Y,Y),c++,!0;const{node:ve}=Rg([{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(),w(ve),Ce&&(T({type:"text",content:Ce,raw:Ce}),c--),c++,!0}if(me.type==="emphasis"){let pe=me.index;pe===-1&&(pe=0);const ee=Y.slice(0,pe);if(ee&&M(ee,ee),!lve(Y,pe)){M(Y[pe],Y[pe]);const ce=Y.slice(pe+1);return ce&&(T({type:"text",content:ce,raw:ce}),c--),c++,!0}const re=B0(Y,pe),ge=uve(U,Y,pe+1),ae=ge.index,Ce=e[c+1];if(i?.final&&Ce?.type==="em_open"&&ae!==-1&&Y.slice(pe+1,ae).trim()!==Y.slice(pe+1,ae)||ae===-1&&(ge.sawInvalidClose||i?.final||re.intraword||!xA(Y[pe+1])))return M(Y.slice(pe),Y.slice(pe)),c++,!0;const{node:ve}=Iy([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ae>-1?Y.slice(pe+1,ae):Y.slice(pe+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,i);if(m(),w(ve),ae!==-1&&ae{for(let ve=0;ve=0&&Ce[Te]==="\\";Te--)ce++;if(ce%2===0)return ve}return-1})(Y);if(Q===-1)return!1;let ue=1;for(let Ce=Q+1;Ceme?.type==="math_inline")||!K0e.test(Y))return null;const U=J.parseInline(Y,{__markstreamFinal:!!i?.final});if(!Array.isArray(U)||U.length===0)return null;const Q=(U.find(me=>me?.type==="inline")?.children??[]).filter(me=>!(me?.type==="text"&&String(me.content??"")===""));if(!Q.length||!Q.some(me=>me?.type!=="text")||Q.length===1&&Q[0]?.type==="text"&&String(Q[0].content??"")===Y)return null;const ue=bo(Q,Y,n,i);return ue.length?ue:null}function v(Y){m(),a.push(Y)}function C(Y){m();const J=op(Y);a.push(J)}function w(Y){v(Y)}function M(Y,J){u?(u.content+=Y,u.raw+=J??Y):(u={type:"text",content:String(Y??""),raw:String(J??Y??"")},a.push(u))}function L(Y,J){if(!Y)return;const U=bo([{...J,type:"text",content:Y,raw:Y}],Y,n,i);if(U.length===1&&U[0]?.type==="text"){const Q=U[0];M(String(Q.content??""),String(Q.raw??Q.content??""));return}for(const Q of U)w(Q)}function E(Y,J){return String(Y.markup??"").startsWith(J)}function S(Y){if(!u||Y.loading!==!0||Y.markup!=="\\(\\)")return;const J=e[c-1];!J||J.type!=="text"||!E(J,"\\(")||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 x(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 A(Y,J,U=Ty(Y)){let Q=Y;const ue=String(J.content??"");return(U&AA)!==0&&Q.endsWith("\\")&&!E(J,"\\\\")&&!ue.endsWith("\\\\")&&(Q=Q.slice(0,-1)),(U&l0)!==0&&Q.endsWith("(")&&!E(J,"\\(")&&!ue.endsWith("\\(")&&(Q=Q.slice(0,-1)),(U&SW)!==0&&/\*+$/.test(Q)&&!E(J,"\\*")&&!ue.endsWith("\\*")&&(Q=Q.replace(/\*+$/,"")),Q}for(;c=0;ce--){const Te=a[ce];if(Te.type!=="text")break;re=ce,ge=String(Te.content??"")+ge}rere==="href")?.[1],ee=String(pe??"");if(t&&ee){const re=t.indexOf("](");if(re!==-1){const ge=t.indexOf(")",re+2);ge===-1?U.loading=!0:U.loading&&t.slice(re+2,ge).includes(ee)&&(U.loading=!1)}}/^file:\/\/\/[a-z]:\//i.test(U.href)&&$(U,J-1)||P(U)||v(U)}function R(Y){if(Y.markup!=="linkify")return!1;const{node:J,nextIndex:U}=My(e,c,i);return W(J,U)?(c=U,!0):!1}function F(Y){m(),w($0e(Y)),c++}function P(Y){if(Y.type!=="link")return!1;const J=a[a.length-1];if(!J||J.type!=="text")return!1;const U=String(J.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!U)return!1;const Q=Y,ue=String(Q.href??""),me=String(Q.text??""),pe=String(U[2]??""),ee=ue.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ue||!(me===ue||me===ee||wve(me)))return!1;const re=String(U[1]??"");return re?(J.content=re,J.raw=re):a.pop(),v({...Y,text:pe,children:[{type:"text",content:pe,raw:pe}],raw:`[${pe}](${ue}${Q.title?` "${Q.title}"`:""})`}),!0}function z(Y){if(Y.type!=="link")return!1;const J=Y,U=String(J.href??"");return U?W({href:U,title:J.title==null||J.title===""?null:String(J.title),loading:!!J.loading},c+1):!1}function W(Y,J){const U=a[a.length-1];if(U?.type!=="image"||U.src||!U.loading||!String(U.raw??"").endsWith("]("))return!1;const Q=e[J],ue=String(Q?.content??"");if(Q?.type!=="text"||!ue.startsWith(")"))return!1;a.pop(),u=null;const me=String(U.alt??"");v({type:"image",src:Y.href,alt:me,title:Y.title,raw:`![${me}](${Y.href}${Y.title?` "${Y.title}"`:""})`,loading:!!Y.loading});const pe=ue.slice(1),ee=op(Q);return ee.content=pe,ee.raw=pe,h()[J]=ee,!0}function $(Y,J=c-1){if(Y.type!=="link")return!1;const U=a[a.length-1],Q=e[J];if(!U||U.type!=="text"||Q?.type!=="text")return!1;const ue=String(U.content??""),me=String(Q.content??"");if(!ue.endsWith("!")||!me.endsWith("!")||E(Q,"\\!"))return!1;const pe=ue.slice(0,-1);pe?(U.content=pe,U.raw=pe,u=U):(a.pop(),u=null);const ee=Y,re=String(ee.text??ee.children?.map(Ce=>String(Ce?.content??Ce?.raw??"")).join("")??""),ge=String(ee.href??""),ae=ee.title==null||ee.title===""?null:String(ee.title);return v({type:"image",src:ge,alt:re,title:ae,raw:`![${re}](${ge}${ae?` "${ae}"`:""})`,loading:!!ee.loading}),!0}function K(Y,J="",U=null){const Q=String(Y.alt??Y.raw??"");return{type:"link",href:J,title:U,text:Q,children:[Y],raw:`[${Q}](${J}${U?` "${U}"`:""})`,loading:!0}}function ne(Y){const J=Y.startsWith("![")?Y:`![${Y}`,U=J.slice(2),Q=U.indexOf("](");return{type:"image",src:"",alt:Q===-1?U.replace(/\]$/,""):U.slice(0,Q),title:null,raw:J,loading:!0}}function G(Y){const J=Y.indexOf("[![");if(J===-1||typeof t=="string"&&e.length===1&&mve(t,J,"["))return!1;const U=Y.slice(0,J);return U&&M(U,U),v(K(ne(Y.slice(J+1)))),c++,!0}function te(Y){if(i?.final)return!1;const J=e[c-1];if(J?.type!=="text"||!String(J.content??"").endsWith("[")||E(J,"\\["))return!1;const U=a[a.length-1];if(U?.type==="text"&&U.content.endsWith("[")){const Q=U.content.slice(0,-1);Q?(U.content=Q,U.raw=Q,u=U):(a.pop(),u=null)}return v(K(tN(Y))),c++,!0}function le(Y){if(Y.type!=="link")return!1;const J=Y,U=String(J.raw??""),Q=String(J.text??"");if(!U.startsWith("[![")&&!Q.startsWith("!["))return!1;const ue=J.title==null||J.title===""?null:String(J.title);return v(K({type:"image",src:String(J.href??""),alt:Q.replace(/^!\[/,"").replace(/\]$/,""),title:ue,raw:U.startsWith("[![")?U.slice(1):U,loading:!0})),!0}function ie(Y){if(!Y.startsWith("]("))return!1;const J=e[c-2];if(J?.type==="text"&&String(J.content??"").endsWith("[")&&E(J,"\\["))return!1;const U=a[a.length-1];if(U?.type!=="image"&&U?.type!=="link")return!1;const Q=U,ue=U?.type==="link"&&Array.isArray(Q.children)&&Q.children.length===1&&Q.children[0]?.type==="image"?a.pop():null,me=ue?ue.children[0]:a.pop();if(!me||me.type!=="image")return!1;const pe=e[c+1];let ee=String(ue?.href??""),re=ue?.title==null?null:String(ue.title),ge=!0;if(pe?.type==="link_open"){const{node:Ce,nextIndex:ve}=My(e,c+1,i);ee=Ce.href,re=Ce.title,ge=!0,c=ve}else{if(ee=Y.slice(2),ee.includes('"')){const Ce=ee.split('"');ee=String(Ce[0]??"").trim(),re=Ce[1]==null?null:String(Ce[1]).trim()}c++}const ae=K(me,ee,re);return ae.loading=ge,v(ae),!0}function _e(){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("[")&&E(Y,"\\[")}function Z(Y,J){const U=Y.indexOf("[");if(U===-1)return!1;let Q=Y.slice(0,U);const ue=Y.indexOf("](",U);if(ue!==-1){const me=e[c+2];let pe=Y.slice(U+1,ue);if(pe.includes("[")){const ce=pe.indexOf("[");Q+=Y.slice(0,U+ce+1);const Te=U+ce+1;pe=Y.slice(Te+1,ue)}const ee=e[c+1];if(Y.endsWith("](")&&ee?.type==="link_open"&&me){const ce=e[c+4];let Te=4,ke=!0;if(ce?.type==="text"){const Ne=String(ce.content??"");if(Ne.startsWith(")")){ke=!1;const Ze=Ne.slice(1);if(Ze){const rt=op(ce);rt.content=Ze,rt.raw=Ze,h()[c+4]=rt}else Te++}else Ne==="."&&Te++}L(Q,J);const Ae=String(me.content??"");return i?.validateLink&&!i.validateLink(Ae)?M(pe,pe):v({type:"link",href:Ae,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:ke}),c+=Te,!0}const re=Y.indexOf(")",ue),ge=re!==-1?Y.slice(ue+2,re):"",ae=re===-1;let Ce=Q.match(/\*+$/);if(Ce&&(Q=Q.replace(/\*+$/,"")),L(Q,J),Ce||(Ce=pe.match(/^\*+/)),!d&&Ce){const ce=Ce[0].length;pe=pe.replace(/^\*+/,"").replace(/\*+$/,"");const Te=[];if(ce===1?Te.push({type:"em_open",tag:"em",nesting:1}):ce===2?Te.push({type:"strong_open",tag:"strong",nesting:1}):ce===3&&(Te.push({type:"strong_open",tag:"strong",nesting:1}),Te.push({type:"em_open",tag:"em",nesting:1})),Te.push({type:"link",href:ge,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:ae}),ce===1){Te.push({type:"em_close",tag:"em",nesting:-1});const{node:ke}=Iy(Te,0,i);w(ke)}else if(ce===2){Te.push({type:"strong_close",tag:"strong",nesting:-1});const{node:ke}=Rg(Te,0,void 0,i);w(ke)}else if(ce===3){Te.push({type:"em_close",tag:"em",nesting:-1}),Te.push({type:"strong_close",tag:"strong",nesting:-1});const{node:ke}=Rg(Te,0,void 0,i);w(ke)}else{const{node:ke}=Iy(Te,0,i);w(ke)}}else i?.validateLink&&!i.validateLink(ge)?M(pe,pe):v({type:"link",href:ge,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:ae});const ve=re!==-1?Y.slice(re+1):"";return ve&&(T({type:"text",content:ve,raw:ve}),c--),c++,!0}return!1}function se(Y){const J=Y.indexOf("![");if(J===-1)return!1;const U=Y.slice(0,J);return U&&!u?u={type:"text",content:U,raw:U}:U&&u&&(u.content+=U),u&&(a.push(u),u=null),v(ne(Y.slice(J))),c++,!0}function he(Y){if(!(Y?.startsWith("[")&&n?.type==="list_item_open"))return!1;const J=Y.slice(1).match(/[^\s\]]/);if(J===null)return c++,!0;if(J&&/x/i.test(J[0])){const U=J[0]==="x"||J[0]==="X";return v({type:"checkbox_input",checked:U,raw:U?"[x]":"[ ]"}),c++,!0}return!1}return a}function Sx(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 oN(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 Rv(e,t,n,i){const o=Ave(e,t,n);return Sx(o.startLine,o.endLine,i)}function xve(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:Sx(i,o,t)}function bi(e,t,n){if(!n?.includeSourceMap)return e;const i=xve(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 Sve(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=Sx(s,Math.max(r,l),i)),e}function _ve(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 Ive(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 Mve(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Gm(e,t,n){const i=e[t],o=[],s=qf(n,!0);let r=t+1;for(;rd.raw).join("")};n?.includeSourceMap&&bi(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&&bi(l,i,n),[l,r+1]}function Tve(e,t,n,i){const o=String(n[1]??"note"),s=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=qf(i,!0);let a=t+1;for(;au.raw).join(` +`)} +:::`},a+1]}const Eve=new Set(["warning","info","note","tip","danger","caution"]);function Lve(e){let t=0;for(;t=0;g--){const y=f[g];if(y.type==="text"&&/:+/.test(y.content)){h=g;break}}const m={type:"paragraph",children:bo((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&&bi(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]=Gm(e,u,a.options());n?.includeSourceMap&&bi(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else if(e[u].type==="blockquote_open"){const[d,f]=Qm(e,u,a.options());n?.includeSourceMap&&bi(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else{const d=z4(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 Fve=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function Dve(e,t,n){const i=e[t];if(i.type!=="container_open")return null;const o=Fve.exec(String(i.info??""));return o?Tve(e,t,o,n):null}const _x={parseContainer:(e,t,n)=>Nve(e,t,n),matchAdmonition:Dve};function Qm(e,t,n){const i=[],o=qf(n,!0);let s=t+1;for(;sl.raw).join(` +`)};return n?.includeSourceMap&&bi(r,e[t],n),[r,s+1]}function Rve(e){if(e.info?.startsWith("diff"))return Ax(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 Ove(e,t,n){const i=[];let o=t+1,s=[],r=[];const l=qf(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 Pve(e,t,n){const i=e[t].meta??{},o=String(i?.label??"0"),s=[],r=qf(n,!0);let l=t+1;for(;la.raw).join(` +`)}`},l+1]}function Bve(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:bo(a.children||[],u,void 0,n),raw:u}}function $ve(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 NW(e){const t=String(e.content??"");if(/^\s*");else if(a)a=!y.includes(">");else if(u)u=!y.includes("?>");else if(y.startsWith("");else if(y.startsWith("");else if(y.startsWith("");else{const k=o(y);if(k)if(k.closing){for(let v=r.length-1;v>=0;v--)if(r[v]===k.tag){r.length=v;break}}else k.selfClosing||s(k.after,k.tag)||r.push(k.tag)}}if(d===-1||d>=t)break;c=d+1}return l||a||u||r.length>0}function x2e(e,t,n){if(!n?.length)return!1;const i=new Set(Np(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 y=c.indexOf(">",d);if(y===-1)return null;let k=y-1;for(;k>=0&&s(c[k]);)k--;return{closing:f,tag:m,selfClosing:!f&&c[k]==="/",after:c.slice(y+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=Ym(h);if(m){const g=r(h.slice(m.index));if(g)if(g.closing){for(let y=a.length-1;y>=0;y--)if(a[y]===g.tag){a.length=y;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 S2e(e,t){const n=t2e.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!Ym(r.endsWith("\r")?r.slice(0,-1):r)||HW(e,o)||A2e(e,o)||x2e(e,o,t)?null:`${e.slice(0,n.index)}${i}`}function Fx(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)&&!Qu(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]==="`"&&!Qu(e,l)){const a=Fx(e,s,"`"),u=WW(e,s+a,a);if(u===-1)break;s=u+a;continue}if(e.startsWith("\\[",s)&&!Qu(e,l)){t.inMath=!0,t.mathOpenOffset=n+s,s+=2;continue}if(e.startsWith("$$",s)&&!Qu(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+s,s+=2;continue}s++}return r}function _2e(e,t){if(!wx(t))return e;const n=t,i=uN.get(n),o=i?.source===e?i.state:i&&e.startsWith(i.source)?qW(i.state,e.slice(i.source.length),i.source.length-i.state.lineBuffer.length).state:H4(e).state;uN.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 Qd(l)&&!c?e:e.slice(0,r)}function I2e(e,t,n,i,o){const s=Tx(e),r=Ex(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&Lx(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 hN(e,t,n,i,o)}else return hN(e,t,n,i,o);return!1}function H4(e,t=y2e(),n=null,i=!1,o=0){const s=z0(t);let r=z0(t),l="",a=!1,u=0;for(;uu&&e[c-1]==="\r"?c-1:d?c:e.length,h=e.slice(u,f);I2e(h,s,o+u,n,i)&&(a=!0),d?(r=z0(s),l=""):l=h,u=d?c+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:s,lineBuffer:l}}}function qW(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:z0(e.committedContext),context:z0(e.context),lineBuffer:e.lineBuffer+t}}:H4(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function M2e(e,t){if(!wx(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const i=e,o=j4.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?qW(o.explicitBracketMath,r,o.source.length-o.explicitBracketMath.lineBuffer.length):H4(t),a=l.state,u=s&&o?l.closedOpenMath:!1;if(o&&s&&o.key===null&&o.pendingCandidate===!1&&!u&&!C2e(o.source,r)&&!b2e(t)){o.source=t,o.explicitBracketMath=a;return}const c=u0e(t);(o&&(o&&!s||o.key!==c||u)||!o&&c)&&n.reset(),k2e(e,t,c,a)}function T2e(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function UW(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 E2e(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 vN(e){return{type:"paragraph",children:e,raw:e.map(D2e).join("")}}function yN(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function kN(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=h2e(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(vN(r)),a.push(l);const u=i.slice(s+1);return u.length&&a.push(vN(u)),a}function R2e(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 j0(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function O2e(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*${Au(t)}\s*>\s*$`,"i").test(n)}const u8=new Set(["iframe","script","style","textarea","title"]);function m2(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=No(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 y=g.slice(1).trimStart();const k=y.startsWith("/");k&&(y=y.slice(1).trimStart());const v=y.match(/^([A-Z][\w:-]*)/i);return v?.[1]?{closing:k,end:m,selfClosing:/\/\s*>$/.test(g),tag:v[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},s=(f,h)=>{const m=new RegExp(String.raw`<\s*\/\s*${Au(f)}(?=\s|>)`,"gi");m.lastIndex=h;const g=m.exec(e);if(!g||g.index==null)return null;const y=o(g.index);return y?{start:g.index,end:y.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 bN(e){return e.replace(/\r\n/g,` +`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function $2e(e,t,n){return n?e.includes(n,t)?!0:bN(e.slice(Math.max(0,t))).includes(bN(n)):!1}function z2e(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 KW(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const H2e=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),W2e=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function q2e(e){return/\n\s*\n/.test(e)||W2e.test(e)}function U2e(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(i=>H2e.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(!q2e(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function V2e(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=m2(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 K2e(e,t,n,i){const o=n.customHtmlTags?.join("\0")??"",s=t,r=aN.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]:rm(u,t,n));return aN.set(s,{blocks:e,children:a,customHtmlTags:o,final:i,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function Z2e(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"||VH.has(r)||Array.isArray(s.children))return o;const l=String(o.raw??s.content??"");if(!l)return o;const a=No(l);if(a===-1)return o;const u=m2(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=KW(n,i),m=d?null:V2e(f),g=m?K2e(m,t,h,i):rm(f,t,h);return U2e(f,g)?{...o,children:g}:o})}function G2e(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function rm(e,t,n){return e.trim()?GW(e,t,{...n,__disableStreamParse:!0,__disableStructuredReuse:!0}):[]}function Q2e(e,t,n){const i=rm(e,t,n),o=i[0];return i.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:i}function Y2e(e,t,n){const i=NW({content:e}),o=No(e),s=VW(e,"summary");if(o!==-1&&s!==-1&&s>=o+1){const r=Q2e(e.slice(o+1,s),t,n);r.length>0&&(i.children=r)}return i.raw=e,i}function J2e(e,t,n){const i=No(e);if(i===-1)return[];const o=e.slice(i+1);if(!o.trim())return[];const s=m2(o,"summary",0);if(!s)return rm(o,t,n);const r=o.slice(0,s.start),l=o.slice(s.end);return[...rm(r,t,n),Y2e(s.raw,t,n),...rm(l,t,n)]}function ZW(e,t,n,i,o,s=0){const r=[];let l=s;for(let a=0;a{const $=VW(f,"details");return $!==-1?f.slice(0,$):f})():f,[C]=ZW(k?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,i,o,h+f.length),w=J2e(v,n,KW(i,o)),M=g===-1?"":String(e[g].raw??j0(e[g])??""),L=k||g!==-1&&y?.closed===!0,E=M.replace(/[\t\r\n ]+$/,""),S=L?(()=>{const $=(y?.raw??"").lastIndexOf(E);return $===-1?t.length:h+$})():t.length,x=No(f),A=k&&x!==-1?h+x+1:h+f.length,T=t.slice(A,S===-1?t.length:S),I=n.parse(T,{__markstreamFinal:o}),O=n.renderer.render(I,n.options,{__markstreamFinal:o}),H=S+E.length,R=L?Math.max(S+M.length,z2e(t,H)):t.length,F=L?t.slice(S,R):M,P=L?t.slice(h,R):t.slice(h),z=k&&x!==-1?f.slice(0,x+1):f,W={...u,tag:"details",attrs:$4(f.slice(0,x+1)),raw:P,content:`${z}${O}${F}`,children:[...w,...C],loading:!o&&!L};if(i.includeSourceMap&&(W.sourceMap=Rv(t,h,L?R:t.length,i)),r.push(W),l=L?R:t.length,g===-1&&!k)break;g!==-1&&(a=g)}return[r,l]}function X2e(e,t,n,i){if(!n)return e;const o=e.slice();let s=0;for(let r=0;r=d.start&&x.end<=d.end){o.splice(L,1);continue}break}M=S+E.length,o.splice(L,1)}}return o}function eye(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 y=g.charCodeAt(0);return y>=65&&y<=90||y>=97&&y<=122},c=g=>{const y=g.charCodeAt(0);return y>=48&&y<=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"||y==='"'||y==="'"||y==="`")break;a++}if(a>=l.length)return!0}}}return!0},i=(l,a)=>HW(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 CN(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 y=0;y=4)return!0;continue}if(k===" ")return!0;break}return!1},r=m=>{let g=!1,y=!1;for(let k=0;k")return k}return-1},l=m=>{let g=0;for(;g{if(s(m))return-1;const y=m.replace(/^[ \t]+/,"");if(!y||y.startsWith(">")||y.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(y))return-1;let k=!1,v=0;for(;v=M.length){k=!0,v++;continue}const E=M[L];if(E==="!"||E==="?"){k=!0,v+=w+1;continue}if(E==="/"){k=!0,v+=w+1;continue}const S=L;for(;L"&&A!=="/"){k=!0,v++;continue}const T=new RegExp(String.raw`<\s*\/\s*${x}\s*>`,"i"),I=/\/\s*>$/.test(M),O=T.test(m.slice(v+w+1)),H=T.test(e.slice(g+v+w+1)),R=/[\r\n]/.test(e.slice(g+v+w+1));if(k&&n.has(x)&&!I&&!O&&(H||R))return v;k=!0,v+=w+1}return-1};let u=!1,c="",d=0,f="",h=0;for(;hh&&e[m-1]==="\r",k=g?y?m-1:m:e.length,v=e.slice(h,k),C=g?y?`\r +`:` +`:"",w=l(v);let M=v;if(!u&&!w){const L=a(v,h);if(L!==-1){const E=C||` +`;M=`${v.slice(0,L).replace(/[ \t]+$/,"")}${E}${E}${v.slice(L).replace(/^[ \t]+/,"")}`}}f+=M,f+=C,w&&(u?w.markerChar===c&&w.markerLen>=d&&/^\s*$/.test(w.rest)&&(u=!1,c="",d=0):(u=!0,c=w.markerChar,d=w.markerLen)),h=g?m+1:e.length}return f}function nye(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 y=g+1;for(;y=d.length||d[y]!=="/"){g=d.indexOf("<",g+1);continue}for(y++;yd.length){g=d.indexOf("<",g+1);continue}let k=!0;for(let C=0;C="A"&&w<="Z"?String.fromCharCode(w.charCodeAt(0)+32):w)!==m[C]){k=!1;break}}if(!k){g=d.indexOf("<",g+1);continue}let v=y+m.length;if(v")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 iye(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,y=e.slice(d,g),k=h?m?`\r +`:` +`:"",v=o(y),C=v?.prefix??"",w=v?.content??y,M=s(w);M&&(l?M.markerChar===a&&M.markerLen>=u&&/^\s*$/.test(M.rest)&&(l=!1,a="",u=0):(l=!0,a=M.markerChar,u=M.markerLen));let L=w;if(!l&&L.includes("{if(T.replace(/^[\t ]+/,"").startsWith("|"))return S;const I=T.slice(0,A).replace(/^[\t ]+/,"");if(I.length>0){const O=x.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",H=I.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!O||!H||O!==H)return S}return`${x} + +`});if(C){const E=C+L.split(` +`).join(` +${C}`);c+=E}else c+=L;c+=k,d=h?f+1:e.length}return c}function oye(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 O=0;for(let H=0;H=4)return!0;continue}if(R===" ")return!0;break}return!1},s=I=>{const O=I.charCodeAt(0);return O>=65&&O<=90||O>=97&&O<=122||O>=48&&O<=57||I==="_"||I==="-"||I===":"},r=I=>{let O=0;for(;O{let O=0,H=!1,R=0;for(;O=I.length||I[O]!==">")break;for(H=!0,O++;Or(I).startsWith("<"),u=I=>{for(let O=0;O{if(o(I))return"";const O=r(I);if(!O.startsWith("<"))return"";let H=1;for(;H=O.length||O[H]==="/"||O[H]==="!"||O[H]==="?")return"";const R=H;for(;H"&&P!=="/"?"":F},d=I=>{if(o(I))return null;const O=r(I);if(!O.startsWith("<"))return null;let H=1;for(;H=O.length)return null;const R=O[H]==="/";if(R)for(H++;H"&&W!=="/")return null;if(R)return{type:"close",name:z};if(/\/\s*>\s*$/.test(O))return{type:"open",name:z,complete:!0};const $=O.indexOf(">",H);if($!==-1){const K=O.slice($+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 O=r(I).replace(/[ \t]+$/,"");if(!O.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(O))return null;const H=O.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(H?.[1])return H[1].toLowerCase();const R=O.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!R?.[1]||!R[2])return null;const F=R[1].toLowerCase();return F===R[2].toLowerCase()?F:null};let h=!1,m="",g=0;const y=I=>{let O=0;for(;Oy(I),v=I=>{const O=r(I);return O?o(I)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(O):!1},C=(I,O,H)=>{let R=I,F=0;for(;RR&&e[P-1]==="\r",$=z?W?P-1:P:e.length,K=e.slice(R,$),ne=l(K),G=ne?.key??"";if(F>0&&O&&G!==O)break;const te=ne?.content??K,le=d(te);if(le?.name===H){if(le.type==="open")le.complete||F++;else if(F>0&&(F--,F===0))return!1}else if(F>0&&(u(te)||v(te)))return!0;if(z)R=P+1;else break}return!1};let w="",M=0,L=!0,E=!1,S=!1,x=` +`;const A=[];let T="";for(;MM&&e[I-1]==="\r",R=O?H?I-1:I:e.length,F=e.slice(M,R),P=O?H?`\r +`:` +`:"",z=l(F),W=z?.key??"",$=z?.content??F,K=k($);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 ne=A.length>0;if(!h&&!ne){const te=c($),le=!!te&&!L&&E&&S&&C(M,W,te);te&&!L&&(!E||le)&&(W&&T&&W===T?w+=`${W}${x}`:W||(w+=x))}if(w+=F,w+=P,P&&(x=P),!h){const te=d($);if(te){if(te.type==="open")te.complete||A.push(te.name);else for(let le=A.length-1;le>=0;le--)if(A[le]===te.name){A.length=le;break}}}const G=u($);L=G,E=!G&&a($),S=!G&&!!f($),T=W,M=O?I+1:e.length}return w}function sye(e){let t=!1,n="",i=0,o=!1,s=!1,r=!1,l=0;const a=(c,d)=>{const f=Nx(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=sye(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=S2e(o,i.customHtmlTags)??o),i.customHtmlTags?.length&&o.includes("<")){const r=Np(i.customHtmlTags);if(r.length&&(o=tye(o,r),o=nye(o,r),o=oye(o,r),o=iye(o,r),o.includes("[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");o=o.replace(a,"$1$2$2")}}return t||(o=eye(o)),o}function rye(e,t,n,i){const o=e,s=`${n?"final":"stream"}:${(i.customHtmlTags??[]).join(",")}`,r=_A.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-n2e-i2e),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=_2e(l,e)),_A.set(o,{source:t,safeMarkdown:l,mode:s}),l}function GW(e,t,n={}){const i=OW(n),o=i?au():0,s=!!n.final,r=(e??"").toString();g2e(t,n)&&(t.stream.reset(),v2e(t),_A.delete(t));const l=rye(t,r,s,n);i&&cf(i,"safeMarkdownMs",au()-o);const a=R2e(l);if(a){if(n.includeSourceMap){const M={...n,__sourceLineMapper:CN(r,l)};a[0].sourceMap=Rv(l,0,l.length,M)}const C=n.preTransformTokens,w=n.postTransformTokens;if(Mx(t,n)||typeof C=="function"||typeof w=="function"){const M=gN(t,l,{__markstreamFinal:s},n),L=typeof C=="function"&&C(M)||M;typeof w=="function"&&w(L)}return cN(a,n,i,o)}const u=i?au():0,c=gN(t,l,{__markstreamFinal:s},n);if(i&&cf(i,"tokenizeMs",au()-u),!c||!Array.isArray(c))return cN([],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,y=n.validateLink??g??m.options?.validateLink??(typeof m.validateLink=="function"?m.validateLink:void 0),k={...n,validateLink:y,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?CN(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let v=f2e(t,l,h,k,i);if(f&&typeof f=="function"){const C=f(h);if(Array.isArray(C)){const w=C[0],M=w?.type;w&&typeof M=="string"?v=S1(C,{...k,__customHtmlBlockCursor:0},i):v=C}}if(G2e(v)){const C=i?au():0;v=X2e(v,s,l,k),v=ZW(v,l,t,k,s)[0],v=Z2e(v,t,k,s),i&&cf(i,"htmlBlockPassesMs",au()-C)}if(s){const C=new WeakSet,w=M=>{if(!M||typeof M!="object"||C.has(M))return;if(C.add(M),Array.isArray(M)){for(const E of M)w(E);return}const L=M;L.type==="html_block"&&L.loading===!0&&(L.loading=!1);for(const E of Object.values(L))w(E)};w(v)}return v=BW(v,n),n.debug&&console.log("Parsed Markdown Tree Structure:",v),PW(v,i,o)}function AN(e,t){if(!e||!Array.isArray(e))return[];const n=[],i=qf(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)bi(d,a,t);for(const d of c)Bu(d,a,t);n.push(...c)}else{const d={type:"paragraph",raw:u,children:c};s&&bi(d,a,t);const f=kN(d,t);if(f){s&&yN(f,d);for(const h of f)Bu(h,a,t);n.push(...f)}else Bu(d,a,t),n.push(d)}i.remember(u)}r+=1;break;default:r+=1;break}}return n}const lye=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g,H0=/\d/u,aye=/[,.!?;:,。;、!?:]/u,uye=/\d\p{Script=Han}{1,3}$/u;function cye(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&&cye(u))return!1;u.pos=d+1;let f=!1;for(;u.pos]|$)/i,pye=new Set([...f2,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),mye=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 xN(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function gye(e){return typeof e=="string"?e:e==null?"":String(e)}function QW(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Yd(e){return gye(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function YW(e){return Yd(e).replace(/`/g,"`")}function q4(e){return String(e??"").trim().toLowerCase()}function Dx(e,t="safe"){const n=q4(e);return n?t==="escape"?!0:t==="trusted"?f2.has(n):!mye.has(n):!1}function JW(e,t="safe"){const n=q4(e);return n?t==="escape"?!0:t==="trusted"?f2.has(n):pye.has(n):!1}function SN(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,i])=>i===""?` ${n}`:` ${n}="${YW(i)}"`).join("")}function XW(e){const t=e.startsWith("/"),n=t?e.slice(1):e,i=n.match(hye);return i?{attrsStr:t?"":n.slice(i[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:i[1]}:null}function vye(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||ip(o,{tagName:t,attrName:"srcset"})})}function eq(e,t,n,i){return X1e.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?vye(t,i):!!(eme.has(e)&&t&&ip(t,{tagName:i,attrName:e}))}function Fh(e,t){const n=t.toLowerCase();return Object.keys(e).find(i=>i.toLowerCase()===n)}function tq(e,t,n,i=!1){if(t!=="safe"||q4(n)!=="a")return e;const o=Fh(e,"href");if(i&&(!o||!e[o])){const a=Fh(e,"target"),u=Fh(e,"rel");return a&&delete e[a],u&&delete e[u],e}const s=Fh(e,"target");if((s?String(e[s]).trim():"").toLowerCase()!=="_blank")return e;const r=Fh(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 _N(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!QW(r)||eq(l,s,t,n)||(i[r]=s)}return tq(i,t,n,!!Fh(e,"href"))}function nq(e,t){const n=e.toLowerCase();return UH.has(n)?!1:xN(t,n)||xN(t,e)}function Rx(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!QW(r)||eq(l,s,t,n)||(i[r]=s)}return tq(i,t,n,!!Fh(e,"href"))}function W0(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 P9(e,t="safe",n){const i=Rx(W0(e),t,n),o=Object.entries(i).map(([s,r])=>[s,r]);return o.length>0?o:void 0}function yye(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 kye(e){const t={};for(const[n,i]of Object.entries(e))t[n]=yye(i,n);return t}function d8(e){return e.trim().length>0}function iq(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=XW(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||Sf.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r})}n=o+1}return t}function bye(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=XW(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||Sf.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r}),n=o+1}return t}function wye(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${Yd(t)}>`;const n=Object.entries(e.attrs??{}).map(([i,o])=>o===""?` ${Yd(i)}`:` ${Yd(i)}="${YW(o)}"`).join("");return e.type==="self_closing"?`<${Yd(t)}${n} />`:`<${Yd(t)}${n}>`}function Cye(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of iq(e))if((n.type==="tag_open"||n.type==="self_closing")&&nq(n.tagName??"",t))return!0;return!1}function lm(e,t="safe"){if(!e)return"";if(t==="escape")return Yd(e);const n=bye(e),i=[],o=[],s=[];for(const r of n){if(r.type==="text"){s.length===0&&o.push(Yd(r.content??""));continue}const l=q4(r.tagName);if(!l)continue;if(JW(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"&&Dx(l,t)){o.push(wye(r));continue}if(r.type==="self_closing"){o.push(`<${l}${SN(_N(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${SN(_N(r.attrs??{},t,l))}>`),Sf.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 Aye=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],IN="http://www.w3.org/2000/svg",xye=new Set(["script","style","iframe","object","embed","link","meta"]),Sye=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"]),_ye=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),Iye=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),Mye=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function Tye(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Eye(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function Lye(e){const t=e.nodeName.toLowerCase();return t==="use"?Tye(e):t==="image"?Eye(e):t==="text"||t==="tspan"?!!e.textContent?.trim():Mye.has(t)}function Nye(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 Fye(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")?ip(s,{tagName:"a",attrName:"href"})?"":s:i==="image"&&(o==="href"||o==="xlink:href"||o==="src")?ip(s,{tagName:"img",attrName:"src"})?"":s:o==="href"||o==="xlink:href"?s.startsWith("#")?s:"":ip(s,{tagName:i,attrName:o})?"":s:""}function Dye(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 sq(e){const t=oq(e),n=t.toLowerCase();let i=0;for(;in.test(t))||sq(t)}function Rye(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 Ly(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function rq(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(!xye.has(i)){if(i==="br"){t.push(` +`);return}for(const o of Array.from(n.childNodes))rq(o,t)}}function Oye(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];rq(t,n);const i=n.join("").split(/\r?\n/).map(c=>c.trim()).filter(Boolean);if(!i.length){t.remove();continue}const o=Ly(t.getAttribute("width")),s=Ly(t.getAttribute("height")),r=Ly(t.getAttribute("x")),l=Ly(t.getAttribute("y")),a=e.ownerDocument.createElementNS(IN,"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(IN,"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 Pye(e){Oye(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const i=n.tagName.toLowerCase();if(!Sye.has(i)){n.remove();continue}if(i==="style"&&MN(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&&MN(s.value)){n.removeAttribute(s.name);continue}if(r==="srcdoc"){n.removeAttribute(s.name);continue}if(_ye.has(r)&&s.value){const l=Fye(i,r,s.value);if(!l){n.removeAttribute(s.name);continue}l!==s.value&&n.setAttribute(s.name,l);continue}if(Iye.has(r)&&s.value&&sq(s.value)){n.removeAttribute(s.name);continue}if(s.value){const l=Nye(s.value);l!==s.value&&n.setAttribute(s.name,l)}}Rye(n)}}function R8t(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 Pye(n),Bye(n)?null:n}catch{return null}}function Bye(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){Lye(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 Ny=[];function f8(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function $ye(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function zye(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function TN(e=`editor-${Date.now()}`,t={}){const n=y0e(t),i=n;i.__markstreamRegisteredPluginCount=Ny.length,i.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||Ny.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,...y]=m;typeof g=="function"&&n.use(g,...y)}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(Ny.length)for(const h of Ny)if(Array.isArray(h)){const[m,...g]=h;typeof m=="function"&&n.use(m,...g)}else typeof h=="function"&&n.use(h);n.use(fye),n.use(Bde),n.use(Rde);const r=Yde,l=r.default??r;n.use(l),n.use(Dde),n.use(Fde),n.core.ruler.after("block","mark_fence_closed",h=>{const m=h,g=m.src,y=!!m.env?.__markstreamFinal,k=g.split(/\r?\n/);for(const v of m.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const C=v.map[0],w=v.map[1],M=v.markup,L=M[0],E=M.length,S=k[Math.max(0,w-1)]??"";let x=0;for(;xC+1&&A>=E&&T===S.length,O=v;O.meta=O.meta??{},O.meta.unclosed=!I,O.meta.closed=!!I}}),n.renderer.rules.fence=(h,m)=>{const g=h[m],y=String(g.info??"").trim(),k=String(g.content??""),v=btoa(unescape(encodeURIComponent(k))),C=$ye(y),w=f8(C),M=zye(`editor-${e}-${m}-${C}`),L=f8(s("common.copy"));return`
      +
      + ${f8(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 y=a.exec(g.src.slice(g.pos));if(!y)return!1;const k=g.src.slice(Math.max(0,g.pos-120),g.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(k))return!1;const v=g.src.slice(g.pos+y[0].length);if(v.startsWith("](")||v.startsWith("(")||c(v))return!1;if(!m){const C=y[1],w=g.push("reference","span",0);w.content=C,w.markup=y[0],w.raw=y[0]}return g.pos+=y[0].length,!0};n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(h,m)=>{const y=String(h[m].content??"");return`${y}`};const f=n.use.bind(n);return n.use=((...h)=>(i.__markstreamHasCustomParserExtensions=!0,f(...h))),n}const jye="modulepreload",Hye=function(e){return"/"+e},EN={},qo=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=Hye(u),u in EN)return;EN[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":jye,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 Wye({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 lq({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}:Wye({nextContent:e,previousContent:t??s,typewriterEnabled:i}):{settledContent:e,streamedDelta:"",appended:!1}}const qye={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 Uye(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function aq(e){const t=Uye(e);return qye[t]??t}function Vye(e){if(!Array.isArray(e))return;const t=e.filter(i=>typeof i=="string").map(i=>aq(i)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function Kye(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 Zye(e){return Kye(e)?.join("\0")??""}function Gye(e,t){return`${Zye(e)}\0\0${Vye(t)?.join("\0")??""}`}function a1(e,t,n=1){const i=Number(e);return Number.isFinite(i)?Math.max(n,i):t}function LN(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var Qye=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=NN();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=NN();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,y=e9e(m/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(y-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const k=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),v=Xye(this.source.slice(this.visible.length),k,this.segmenter);v.text&&(this.visible+=v.text,this.charBudget=Math.max(0,this.charBudget-v.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=a1(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,a1(i,1e3,1)),this.normalizedTargetLatencyMs=a1(o,900,1),this.normalizedCatchUpLatencyMs=a1(s,350,1),this.normalizedCatchUpThreshold=LN(r,600),this.normalizedStartDelayMs=LN(a,80),this.maxCommitFps=Math.trunc(a1(l,30,1)),this.maxCharsPerCommit=Math.trunc(a1(u,80,1)),this.flushOnFinish=c,this.segmenter=Jye(),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 Yye(e={},t){const n=new Qye(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 Jye(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function Xye(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 NN(){return typeof performance<"u"?performance.now():Date.now()}function e9e(e,t,n){return Math.min(n,Math.max(t,e))}var t9e=(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 MA=Symbol.for("markstream-vue:node-lifecycle");function O8t(){}const Ox=new Map;let uq="material";const R1=new Map,FN=new Map;let TA=null;function n9e(e){Ox.set(e.id,e)}function i9e(e){const t=Ox.get(uq);if(!t)return;const n=t.core[e];if(n)return n;const i=R1.get(t.id);if(i){const o=i[e];if(o)return o}t.loadExtended&&!R1.has(t.id)&&s9e(t)}function o9e(){var e,t;return(t=(e=Ox.get(uq))==null?void 0:e.fallback)!=null?t:""}function s9e(e){return t9e(this,null,function*(){var t,n,i;if(R1.has(e.id))return(t=R1.get(e.id))!=null?t:null;let o=FN.get(e.id);return o||(o=((i=(n=e.loadExtended)==null?void 0:n.call(e))!=null?i:Promise.resolve(null)).then(s=>(R1.set(e.id,s),TA?.(),s)).catch(()=>(R1.set(e.id,null),null)),FN.set(e.id,o)),o})}const DN='',RN='',r9e={id:"material",core:{"":RN,plain:'',text:RN,javascript:'',typescript:'',jsx:'',tsx:'',html:'',css:'',scss:'',json:'',python:'',ruby:'',go:'',java:'',kotlin:'',c:'',cpp:'',cs:DN,csharp:DN,php:'',shell:'',powershell:'',sql:'',yaml:'',markdown:'',xml:'',rust:'',vue:'',mermaid:''},fallback:'',loadExtended:()=>qo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},l9e=_u(0);TA=()=>{l9e.value++},n9e(r9e);const a9e={"":"",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 U4(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=a9e[n])!=null?t:n}function P8t(e){const t=U4(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 B8t(e){return i9e(U4(e))||o9e()}const ON={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 V4=(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 Zr=null,Hh=!1,Wh=null,K4=Bx;function g2(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function Px(){try{const e=globalThis;return g2(e?.katex)}catch{return null}}function Bx(){return V4(null,null,function*(){const e=Px();if(e)return e;const t=yield qo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield qo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return g2(t)})}function cq(e){const t=Promise.resolve(e).then(n=>{var i;return Wh===t&&n?(Zr=(i=g2(n))!=null?i:n,Zr):null}).catch(()=>null).finally(()=>{Wh===t&&(Wh=null)});return Wh=t,Hh=!0,t}function u9e(e){K4=e,Zr=null,Hh=!1,Wh=null}function c9e(e){u9e(Bx)}function dq(){return typeof K4=="function"}function $8t(){var e;const t=K4;if(!t||t===Bx)return null;if(Zr)return Zr;const n=Px();if(n)return Zr=n,Zr;if(Hh)return null;try{const i=t();return i?typeof i?.then=="function"?(cq(i),null):(Zr=(e=g2(i))!=null?e:i,Zr):null}catch{return null}}function fq(){return V4(this,null,function*(){var e;const t=Px();if(t)return Zr=t,Zr;if(Zr)return Zr;if(Wh)return Wh;if(Hh)return null;const n=K4;if(!n)return Hh=!0,null;try{const i=n();if(typeof i?.then=="function")return cq(i);if(i)return Zr=(e=g2(i))!=null?e:i,Hh=!0,Zr}catch{}return Hh=!0,null})}function hq(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let B9=null,Ch=null;const Vr=new Map,Zc=new Map;let Ov=5;const sp=new Set;function q0(){if(Vr.size{const{id:n,html:i,error:o}=t.data,s=Vr.get(n);if(s)if(Vr.delete(n),clearTimeout(s.timeoutId),s.cleanup(),q0(),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(Zc.set(a,i),Zc.size>200){const u=Zc.keys().next().value;Zc.delete(u)}}s.aborted||s.resolve(i)}},B9.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,i]of Vr.entries())clearTimeout(i.timeoutId),i.cleanup(),i.aborted||i.reject(new Error(`Worker error: ${t.message}`));Vr.clear(),d9e()}}function h9e(e,t=!0,n=2e3,i){return V4(this,null,function*(){performance.now();const o=hq(e);if(!dq()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Ch)return Promise.reject(Ch);const s=`${t?"d":"i"}:${o}`,r=Zc.get(s);if(r)return q0(),Promise.resolve(r);const l=B9||(Ch=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Ch.name="WorkerInitError",Ch.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Ch);if(Vr.size>=Ov){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Vr.size,a.max=Ov,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=Vr.get(c);if(!g)return;Vr.delete(c),g.cleanup();const y=new Error("Worker render timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT",g.aborted||g.reject(y),q0()},n);d=()=>{const g=Vr.get(c);if(!g||g.aborted)return;g.aborted=!0,g.cleanup();const y=new Error("Aborted");y.name="AbortError",u(y)},i&&i.addEventListener("abort",d,{once:!0});const h=a,m=u;Vr.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 y=Vr.get(c);Vr.delete(c),clearTimeout(f),y?.cleanup(),y?.reject(g),q0()}})})}function z8t(e,t=!0,n){const i=`${t?"d":"i"}:${hq(e)}`;if(Zc.set(i,n),Zc.size>200){const o=Zc.keys().next().value;Zc.delete(o)}}const p9e="WORKER_BUSY";function m9e(e=2e3,t){return Vr.size{let o,s=!1,r=null,l=()=>{};const a=()=>{o&&globalThis.clearTimeout(o),sp.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{s||(s=!0,a(),n())},sp.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(()=>q0()),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 Og={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function j8t(e){return V4(this,arguments,function*(t,n=!0,i={}){var o,s,r,l;if(!dq()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(o=i.timeout)!=null?o:Og.timeout,u=(s=i.waitTimeout)!=null?s:Og.waitTimeout,c=(r=i.backoffMs)!=null?r:Og.backoffMs,d=(l=i.maxRetries)!=null?l:Og.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Og.maxRetries,h=i.signal;let m=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield h9e(t,n,a,h)}catch(g){if(g?.code!==p9e||m>=f)throw g;if(m++,yield m9e(u,h).catch(()=>{}),h?.aborted){const y=new Error("Aborted");throw y.name="AbortError",y}c>0&&(yield new Promise(y=>globalThis.setTimeout(y,c*m)))}}})}function O1(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function g9e(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 cb(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),i=g9e(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 db(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 pq(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function fb(e,t=360,n=500){return pq(e,t,n)}function hb(e,t=360,n=500){return pq(e,t,n)}var v9e=Object.defineProperty,y9e=Object.defineProperties,k9e=Object.getOwnPropertyDescriptors,PN=Object.getOwnPropertySymbols,b9e=Object.prototype.hasOwnProperty,w9e=Object.prototype.propertyIsEnumerable,BN=(e,t,n)=>t in e?v9e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mq=(e,t)=>{for(var n in t||(t={}))b9e.call(t,n)&&BN(e,n,t[n]);if(PN)for(var n of PN(t))w9e.call(t,n)&&BN(e,n,t[n]);return e},$N=(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 pb=()=>qo(()=>import("./mermaid.core-WW7RuneT.js").then(e=>e.bp),__vite__mapDeps([2,3]));let Fc=null,P1=pb,u0=null,EA=!1,LA=!1,c0=0;function C9e(e){P1=e,c0++,Fc=null,u0=null,EA=!1,LA=!1}function A9e(e){C9e(pb)}function zN(){return typeof P1=="function"}function jN(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=mq({},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},y9e(n,k9e(i))}var n,i;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function HN(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const i=mq({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 H8t(){return $N(this,null,function*(){if(Fc)return Fc;const e=(function(){try{const i=globalThis;return jN(i?.mermaid)}catch{return null}})();if(e)return Fc=e,HN(Fc),Fc;const t=P1,n=c0;return t?t===pb&&EA?null:u0||(u0=$N(null,null,function*(){let i;try{i=yield t()}catch(o){if(t===pb)return n===c0&&t===P1&&(EA=!0,(function(s){LA||(LA=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',s))})(o)),null;throw o}finally{n===c0&&t===P1&&(u0=null)}return n!==c0||t!==P1?null:i?(Fc=jN(i),HN(Fc),Fc):null}),u0):null})}let ju=null,Ah=null;const uu=new Map,xh=new Map;function h8(e){for(const t of uu.values())t.reject(e);uu.clear(),xh.clear()}let WN=5,qN=!1;const x9e="WORKER_BUSY",UN="MERMAID_DISABLED";function S9e(e){if(ju&&ju!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",h8(n)}ju=e,Ah=null;const t=e;ju.onmessage=n=>{if(ju!==t)return;const{id:i,ok:o,result:s,error:r}=n.data,l=uu.get(i);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(s))},ju.onerror=n=>{var i,o;if(ju===t)if(uu.size!==0){try{qN?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)},ju.onmessageerror=n=>{var i,o;if(ju===t)if(uu.size!==0){try{qN?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 gq(e,t,n,i){if(!zN()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=UN,Promise.reject(r)}const o=`${e}\0${t.theme}\0${n}\0${t.code}`;let s=xh.get(o);return s||(s=(function(r,l,a=1400){if(!zN()){const c=new Error("Mermaid rendering disabled");return c.name="MermaidDisabled",c.code=UN,Promise.reject(c)}if(Ah)return Promise.reject(Ah);const u=ju||(Ah=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Ah.name="WorkerInitError",Ah.code="WORKER_INIT_ERROR",null);if(!u)return Promise.reject(Ah);if(uu.size>=WN){const c=new Error("Worker busy");return c.name="WorkerBusy",c.code=x9e,c.inFlight=uu.size,c.max=WN,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),uu.delete(f))},y={resolve:k=>{g(),c(k)},reject:k=>{g(),d(k)}};uu.set(f,y);try{u.postMessage({id:f,action:r,payload:l})}catch(k){return uu.delete(f),void d(k)}h=globalThis.setTimeout(()=>{const k=new Error("Worker call timed out");k.name="WorkerTimeout",k.code="WORKER_TIMEOUT";const v=uu.get(f);v&&v.reject(k)},a)})})(e,t,n),xh.set(o,s),s.then(()=>{xh.get(o)===s&&xh.delete(o)},()=>{xh.get(o)===s&&xh.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 W8t(e,t,n=1400,i){return gq("canParse",{code:e,theme:t},n,i)}function q8t(e,t,n=1400,i){return gq("findPrefix",{code:e,theme:t},n,i)}var _9e=Object.defineProperty,I9e=Object.defineProperties,M9e=Object.getOwnPropertyDescriptors,VN=Object.getOwnPropertySymbols,T9e=Object.prototype.hasOwnProperty,E9e=Object.prototype.propertyIsEnumerable,KN=(e,t,n)=>t in e?_9e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bt=(e,t)=>{for(var n in t||(t={}))T9e.call(t,n)&&KN(e,n,t[n]);if(VN)for(var n of VN(t))E9e.call(t,n)&&KN(e,n,t[n]);return e},Dn=(e,t)=>I9e(e,M9e(t)),io=(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 L9e="__global__",p8="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",NA=(()=>{const e=globalThis;if(e[p8])return e[p8];const t={scopedCustomComponents:{},revision:_u(0)};return e[p8]=t,t})(),ZN=NA.revision,N9e=Symbol("markstreamCustomComponents"),F9e=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 v2(e){return F9e.has(String(e).trim().toLowerCase())}function D9e(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(D9e(n))]))!o||v2(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=i)}return t}function vs(e){const t=en(N9e,null);return D(()=>{var n;return ZN.value,(function(i,o={}){return ZN.value,Bt(Bt(Bt({},m8(NA.scopedCustomComponents[L9e]||{})),m8(o)),m8((function(s){return s&&NA.scopedCustomComponents[s]||{}})(i)))})(e?.(),(n=t?.value)!=null?n:{})})}const R9e=["aria-label"],O9e={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"},P9e={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"},Ei=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},ra=Ei(ot({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(b(),N("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(b(),N("svg",P9e,[...n[1]||(n[1]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),_("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(b(),N("svg",O9e,[...n[0]||(n[0]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,R9e))}),[["__scopeId","data-v-be21ab83"]]);ra.install=e=>{e.component(ra.__name,ra)};const B9e={class:"emoji-node"},Il=Ei(ot({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(b(),N("span",B9e,B(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Il.install=e=>{e.component(Il.__name,Il)};const $9e=["id"],z9e=["title"],la=Ei(ot({__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)=>(b(),N("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[_("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+B(e.node.id)+"]",9,z9e)],8,$9e))}}),[["__scopeId","data-v-c1463a29"]]);la.install=e=>{e.component(la.__name,la)};const vq=(()=>{try{return!1}catch{}return!1})();function g8(e){vq&&console.warn(e)}function GN(e,t="safe",n){return Rx(e,t,n)}function yq(e){return kye(e)}function v8(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function $x(e,t="safe"){const n=String(e.tag||e.type||"").trim(),i=P9((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=yq(W0(i));return Object.keys(s).length>0?s:void 0}function QN(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 Pg(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 nq(d,f)})(e,i);if(f2.has(e.toLowerCase())||!l&&JW(e,s))return null;if(!l&&Dx(e,s))return r?[QN(e,t,!0)]:[QN(e,t),...n,``];const a=Rx(t,s,e),u=a.key,c=u!=null&&u!==""?u:o;if(l){const d=i[e]||i[e.toLowerCase()],f=yq(a);return Fn(d,Dn(Bt({},f),{key:c}),n.length>0?n:void 0)}return Fn(e,Dn(Bt({},a),{innerHTML:void 0,key:c}),n.length>0?n:void 0)}function kq(e,t){return Cye(e,t)}function mb(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);Pg(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?Pg(u[u.length-1].children,g):Pg(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?Pg(u[u.length-1].children,f):Pg(c,f),g8(`Auto-closing unclosed tag: <${d.tagName}>`)}return c})(iq(e),t,n)}catch(o){return i=o,vq&&console.error("Failed to parse HTML to VNodes:",i),null}var i}const j9e=["innerHTML"],aa=Ei(ot({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=en("markstreamHtmlPolicy",void 0),i=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=vs(()=>t.customId),s=ot({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:lm(l,i.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const u=mb(l,o.value,i.value);if(u!==null)return{mode:"dynamic",nodes:u}}if(!kq(l,o.value))return{mode:"html",content:lm(l,i.value)};const a=mb(l,o.value,i.value);return a===null?{mode:"html",content:lm(l,i.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(b(),N("span",{key:0,class:De(["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"?(b(),N("span",{key:1,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},B(r.value.content),3)):(b(),N("span",{key:2,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,j9e))}}),[["__scopeId","data-v-d17f12b0"]]);aa.install=e=>{e.component(aa.__name,aa)};const H9e={class:"inline-code"},W9e={key:0},Er=Ei(ot({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=qm(),i=en("markstreamFade",void 0),o=en("markstreamTextStreamState",void 0),s=en("markstreamStreamVersion",void 0),r=D(()=>{const v=n.fade;return v===""||v===!0||v==="true"||v!==!1&&v!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var v;return String((v=t.node.code)!=null?v:"")}),u=D(()=>!l.value),c=D(()=>{var v;const C=(v=n["index-key"])!=null?v:n.indexKey;return C==null||C===""?"":String(C)}),d=q(t.node.code),f=q(""),h=q(0);let m;function g(){m?.(),m=void 0}function y(){g(),f.value&&(d.value=d.value+f.value,f.value="")}ze([()=>t.node.code,c,l],([v])=>{const C=String(v??""),w=c.value,M=lq({nextContent:C,persistedContent:w?o?.get(w):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=M.settledContent,f.value=M.streamedDelta,M.appended?(h.value+=1,(function(){if(!f.value||m||!s)return;const L=s.value;m=ze(()=>s.value,E=>{E!==L&&y()},{flush:"sync"})})()):f.value||g(),w&&o?.set(w,C)},{immediate:!0}),cd(g);const k=D(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(v,C)=>(b(),N("code",H9e,[u.value?(b(),N(Le,{key:0},[Be(B(a.value),1)],64)):(b(),N(Le,{key:1},[d.value?(b(),N("span",W9e,B(d.value),1)):X("",!0),f.value?(b(),N("span",{key:1,class:De(["inline-code-stream-delta",[k.value]]),onAnimationend:y},B(f.value),35)):X("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);Er.install=e=>{e.component(Er.__name,Er)};const FA=q(!1),YN=q(""),JN=q("top"),U0=q(null),V0=q(null),DA=q(null),RA=q(null),XN=q(null);let $9=null,z9=null,OA=0;function bq(){$9&&(clearTimeout($9),$9=null),z9&&(clearTimeout(z9),z9=null)}let Fy=!1,Dy=null,eF=!1;function q9e(e,t,n="top",i=!1,o,s){if(!e)return;const r=++OA;bq();const l=()=>io(null,null,function*(){var a,u;if(yield(function(){return io(this,null,function*(){if(!Fy&&!eF&&typeof document<"u"){Dy!=null||(Dy=io(null,null,function*(){const[{createApp:c,h:d},{default:f}]=yield Promise.all([qo(()=>import("./vue.runtime.esm-bundler-Dz1HMlA6.js"),[]),qo(()=>import("./Tooltip-Da35cfam.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),c({setup:()=>()=>{var m;return d(f,{visible:FA.value,"anchor-el":U0.value,content:YN.value,placement:JN.value,id:V0.value,originX:DA.value,originY:RA.value,isDark:(m=XN.value)!=null?m:void 0})}}).mount(h),Fy=!0}));try{yield Dy}catch(c){Fy=!1,Dy=null,eF=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",c)}}})})(),Fy&&r===OA){V0.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,U0.value=e,YN.value=t,JN.value=n,DA.value=(a=o?.x)!=null?a:null,RA.value=(u=o?.y)!=null?u:null,XN.value=typeof s=="boolean"?s:null,FA.value=!0;try{e.setAttribute("aria-describedby",V0.value)}catch{}}});i?l():$9=setTimeout(l,80)}function U9e(e=!1){OA+=1,bq();const t=()=>{if(U0.value&&V0.value)try{U0.value.removeAttribute("aria-describedby")}catch{}FA.value=!1,U0.value=null,V0.value=null,DA.value=null,RA.value=null};e?t():z9=setTimeout(t,120)}const V9e={"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..."},K9e=Symbol("markstreamI18nFallback");function wq(e,t){var n;return(n=t?.[e])!=null?n:V9e[e]}const PA=(e,t)=>{var n;return(n=wq(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 tF(e,t){return{t(n){const i=wq(n,t);if(e.te&&i!=null&&!e.te(n))return PA(n,t);const o=e.t(n);return o===n&&i!=null?PA(n,t):o}}}function Z9e(){const e=(function(){var n,i,o;try{const s=gs(),r=K9e,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=gs(),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 tF(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const i=n();if(i&&typeof i.t=="function")return tF({t:i.t.bind(i),te:typeof i.te=="function"?i.te.bind(i):void 0},e)}catch{}}catch{}return{t:n=>PA(n,e)}}const Cq=Symbol("ViewportPriority"),Aq=Symbol("ViewportPriorityOptions"),xq=Symbol("OffscreenHeavyNodeDeferral"),G9e=D(()=>!1),gp="400px";function zx(){return en(Aq,void 0)}function jx(){return en(xq,G9e)}function Q9e(e,t){var n,i;const o=typeof window<"u"&&typeof document<"u",s=typeof t=="boolean"?q(t):t,r=o?(n=window.requestIdleCallback)!=null?n:E=>window.setTimeout(()=>E({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(i=window.cancelIdleCallback)!=null?i:E=>window.clearTimeout(E):null,a=new WeakMap;let u=1;const c=new Map,d=new Map,f=new Set;let h=null,m=null;function g(E){if(!E)return"viewport";let S=a.get(E);return S||(S=u++,a.set(E,S)),String(S)}function y(){if(h!=null){try{l?.(h)}catch{}h=null}}function k(E){if(E){const S=c.get(E);if(S&&!S.targets.size){try{S.io.disconnect()}catch{}c.delete(E)}}d.size||f.size||y()}function v(E){const S=d.get(E);if(!S)return;const x=c.get(S.bucketKey);if(!S.visible.value){S.visible.value=!0;try{S.resolve()}catch{}}try{x?.io.unobserve(E)}catch{}x?.targets.delete(E),d.delete(E),f.delete(E),k(S.bucketKey)}function C(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const E=f.values().next().value;E&&(f.delete(E),v(E),f.size&&C())},{timeout:1200}))}function w(E,S){if(!o||typeof IntersectionObserver>"u")return null;const x=(function(R,F){var P,z,W;return{root:(P=e?.(R??null))!=null?P:null,rootMargin:(z=F?.rootMargin)!=null?z:gp,threshold:(W=F?.threshold)!=null?W:0}})(E,S),A=[g((T=x).root),T.rootMargin,T.threshold].join("\0");var T;const I=c.get(A);if(I)return{key:A,bucket:I};let O;try{O=new IntersectionObserver(R=>{for(const F of R)(F.isIntersecting||F.intersectionRatio>0)&&v(F.target)},{root:x.root,rootMargin:x.rootMargin,threshold:x.threshold})}catch{return null}const H={io:O,targets:new Map};return c.set(A,H),{key:A,bucket:H}}function M(){if(o&&s.value)for(const[E,S]of Array.from(d.entries())){const x=w(E,S.opts);if(!x){v(E);continue}if(x.key===S.bucketKey)continue;const A=S.bucketKey,T=c.get(A);try{T?.io.unobserve(E)}catch{}T?.targets.delete(E),S.bucketKey=x.key,x.bucket.targets.set(E,S),x.bucket.io.observe(E),k(A)}}ze(s,E=>{if(!E){for(const S of Array.from(d.keys()))v(S);y()}},{flush:"sync"});const L=(E,S)=>{const x=q(!1);let A,T=!1;const I=new Promise(F=>{A=()=>{T||(T=!0,F())}}),O=()=>{const F=d.get(E);if(!F)return f.delete(E),void k();const P=c.get(F.bucketKey);try{P?.io.unobserve(E)}catch{}P?.targets.delete(E),d.delete(E),f.delete(E),k(F.bucketKey)};if(!o||!s.value)return x.value=!0,A(),{isVisible:x,whenVisible:I,destroy:O};const H=w(E,S);if(!H)return x.value=!0,A(),{isVisible:x,whenVisible:I,destroy:O};const R={resolve:A,visible:x,bucketKey:H.key,opts:S};return d.set(E,R),H.bucket.targets.set(E,R),H.bucket.io.observe(E),o&&m==null&&(m=window.requestAnimationFrame(()=>{m=null,M()})),S?.allowIdle!==!1&&(f.add(E),C()),{isVisible:x,whenVisible:I,destroy:O}};return L.refresh=M,Gn(Cq,L),L}function Hx(){var e,t;const n=en(Cq,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=q(!1);let y,k=!1;const v=new Promise(M=>{y=()=>{k||(k=!0,M())}}),C=()=>{const M=i.get(h);if(!M)return s.delete(h),void(s.size||u());const L=o.get(M.bucketKey);try{L?.io.unobserve(h)}catch{}i.delete(h),L?.targets.delete(h),s.delete(h),c(M.bucketKey),s.size||u()},w=(M=>{var L,E;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const S=(O=>{var H,R;return[(H=O?.rootMargin)!=null?H:gp,(R=O?.threshold)!=null?R:0].join("\0")})(M),x=o.get(S);if(x)return{key:S,bucket:x};const A=(L=M?.rootMargin)!=null?L:gp;let T;try{T=new IntersectionObserver(O=>{for(const H of O)(H.isIntersecting||H.intersectionRatio>0)&&d(H.target)},{root:null,rootMargin:A,threshold:(E=M?.threshold)!=null?E:0})}catch{return null}const I={io:T,targets:new Set};return o.set(S,I),{key:S,bucket:I}})(m);return w?(i.set(h,{resolve:y,visible:g,bucketKey:w.key}),w.bucket.targets.add(h),w.bucket.io.observe(h),m?.allowIdle!==!1&&(s.add(h),f()),{isVisible:g,whenVisible:v,destroy:C}):(g.value=!0,y(),{isVisible:g,whenVisible:v,destroy:C})}}function Y9e(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 J9e=["data-markstream-viewport-pending"],X9e=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],eke={key:1,class:"image-placeholder"},tke={key:1,class:"image-node__raw-text"},nke={key:2,class:"image-shimmer-overlay"},ike={key:1,class:"image-node__raw-text"},oke={key:3,class:"image-error"},df=Ei(ot({__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=q(!1),a=q(!1),u=q(""),c=q("primary"),d=q(null),f=qm(),h=en(MA,null),m=Hx(),g=zx(),y=jx(),k=D(()=>AL(s.node.src)),v=D(()=>AL(s.fallbackSrc)),C=(o=(i=(n=gs())==null?void 0:n.vnode.el)==null?void 0:i.querySelector)==null?void 0:o.call(i,"img"),w=typeof window<"u"&&C?.getAttribute("src")===(k.value||v.value),M=q(typeof window>"u"||w||!y.value),L=_u(null);let E="",S=null;const x=D(()=>u.value),A=D(()=>!s.lazy),T=D(()=>typeof window<"u"&&y.value&&!w),I=D(()=>!T.value||M.value),O=D(()=>I.value?x.value:""),H=D(()=>{var Z,se;return(se=(Z=g?.value.heavyBlockMargin)!=null?Z:g?.value.rootMargin)!=null?se:gp}),R=D(()=>!s.node.loading&&c.value!=="failed"&&u.value.length>0),F=D(()=>c.value==="failed"),P=D(()=>(!A.value||T.value&&!M.value)&&!l.value&&!a.value&&c.value!=="failed"&&u.value.length>0),z=D(()=>Y9e(s,f));function W(Z=z.value){Z&&d.value&&h?.reportHeight(Z,d.value.offsetHeight)}function $(Z=z.value){Z&&ft(()=>{W(Z)})}function K(){S&&(clearTimeout(S),S=null)}function ne(){const Z=z.value;Z&&E!==Z&&(E&&h?.markSettled(E),K(),E=Z,h?.markPending(Z),typeof window<"u"&&(S=window.setTimeout(()=>{E===Z&&($(Z),G())},8e3)))}function G(){return io(this,null,function*(){const Z=E;Z&&(K(),E="",yield ft(),W(Z),h?.markSettled(Z))})}function te(){if(c.value==="primary"&&v.value&&v.value!==u.value)return c.value="fallback",u.value=v.value,l.value=!1,a.value=!1,void $();c.value="failed",a.value=!0,r("error",u.value),$()}function le(){l.value=!0,a.value=!1,r("load",x.value),$()}function ie(Z){Z.preventDefault(),l.value&&!a.value&&r("click",[Z,x.value])}const{t:_e}=Z9e();return ze([k,v,()=>s.node.loading],()=>(l.value=!1,a.value=!1,s.node.loading||k.value?(u.value=k.value,void(c.value="primary")):v.value?(u.value=v.value,void(c.value="fallback")):(u.value="",c.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&ze([d,T],([Z,se],he,Y)=>{var J;if((J=L.value)==null||J.destroy(),L.value=null,!se||M.value)return void(M.value=!0);if(!Z)return void(M.value=!1);let U=!0;const Q=m(Z,{rootMargin:H.value,allowIdle:!1});L.value=Q,M.value=Q.isVisible.value,Q.whenVisible.then(()=>{U&&L.value===Q&&(M.value=!0)}),Y(()=>{U=!1,Q.destroy(),L.value===Q&&(L.value=null)})},{immediate:!0}),ze([R,l,a,x,()=>s.lazy,I],([Z,se,he,Y,J,U])=>Z&&Y&&!he&&U?se?(G(),void $()):J?(ne(),void $()):void(se||he||ne()):(G(),void $()),{flush:"post",immediate:!0}),ii(()=>{var Z;(Z=L.value)==null||Z.destroy(),L.value=null,(function(){const se=E;se&&(K(),E="",h?.markSettled(se))})()}),(Z,se)=>{var he,Y,J,U,Q;return b(),N("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":T.value&&!M.value?"true":void 0},[R.value?(b(),N("img",{key:0,src:O.value||void 0,alt:String((Y=(he=s.node.alt)!=null?he:s.node.title)!=null?Y:""),title:String((U=(J=s.node.title)!=null?J:s.node.alt)!=null?U:""),class:De(["image-node__img",{"is-loading":!A.value&&!l.value,"is-loaded":A.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:s.lazy?"lazy":void 0,fetchpriority:A.value?"high":void 0,decoding:A.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(Q=s.node.alt)!=null?Q:p(_e)("image.preview"),onError:te,onLoad:le,onClick:ie},null,42,X9e)):X("",!0),e.node.loading&&!a.value?(b(),N("span",eke,[s.usePlaceholder?Hn(Z.$slots,"placeholder",{key:0,node:s.node,displaySrc:x.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[0]||(se[0]=_("span",{class:"image-shimmer"},null,-1))],!0):(b(),N("span",tke,B(e.node.raw),1))])):X("",!0),P.value&&!e.node.loading?(b(),N("span",nke,[s.usePlaceholder?Hn(Z.$slots,"placeholder",{key:0,node:s.node,displaySrc:x.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[1]||(se[1]=_("span",{class:"image-shimmer"},null,-1))],!0):(b(),N("span",ike,B(e.node.raw),1))])):X("",!0),F.value?(b(),N("span",oke,[Hn(Z.$slots,"error",{node:s.node,displaySrc:x.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[2]||(se[2]=_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[_("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)),_("span",null,B(p(_e)("image.loadError")),1)],!0)])):X("",!0)],8,J9e)}}}),[["__scopeId","data-v-046e82ac"]]);df.install=e=>{e.component(df.__name,df)};const ske={key:2},yc=ot({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=vs(()=>t.customId),i=en("markstreamHtmlPolicy",void 0),o=en("markstreamNestedRendererProps",void 0),s=D(()=>{var m;return(m=i?.value)!=null?m:"safe"}),r=D(()=>{var m,g;const y=(m=o?.value)!=null?m:{};return Dn(Bt({},y),{customId:(g=t.customId)!=null?g:y.customId,htmlPolicy:s.value})}),l=Xu({loader:()=>Promise.resolve().then(()=>Xx),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),u=D(()=>!!(a.value&&n.value[t.node.type]&&!v2(String(t.node.type)))),c=D(()=>u.value?$x(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?(b(),fe(To(a.value),ci({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:de(()=>[d.value?(b(),fe(p(l),ci({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?(b(),fe(p(l),ci({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"])):X("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(b(),fe(To(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(b(),N("span",ske,B(h.value),1)):X("",!0)}}),nF=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function rke(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return Dn(Bt(Bt({},nF),n),{enabled:(t=n.enabled)==null||t})}return Bt({},nF)}function Wx(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 Sq(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 iF(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function lke(e){var t;return e.diff===!0||iF(e.language)||iF(Sq(String((t=e.raw)!=null?t:"")))}function ake(e,t,n){const i=(function(o){const s=Sq(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 uke=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],cke={key:0,translate:"no",class:"markstream-pre__diff-code"},dke={class:"markstream-pre__diff-pane-content"},fke={class:"markstream-pre__diff-number","aria-hidden":"true"},hke={class:"markstream-pre__diff-content"},pke={class:"markstream-pre__diff-content-inner"},mke={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},gke=["textContent"],vke=["textContent"],bl=ot({__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(ie,_e){const Z=String(ie??"");return _e?Z:Z.replace(/\r\n$|\n$|\r$/,"")}const i=D(()=>{var ie,_e,Z;const se=String((_e=(ie=t.node)==null?void 0:ie.language)!=null?_e:"");return String((Z=String(se).split(/\s+/g)[0])!=null?Z:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=D(()=>`language-${i.value}`),s=D(()=>{var ie;return t.loading===!0||((ie=t.node)==null?void 0:ie.loading)===!0}),r=D(()=>{var ie;return n((ie=t.node)==null?void 0:ie.code,s.value)});let l="",a=1;const u=D(()=>(function(ie){let _e=0,Z=1;ie.startsWith(l)&&(_e=l.length,Z=a,_e>0&&ie[_e-1]==="\r"&&ie[_e]===` +`&&_e++);for(let se=_e;ser.value.split(/\r\n|\n|\r/));let d=0,f="";const h=D(()=>{const ie=u.value;ie{var ie;return t.showLineNumbers===!0&&((ie=t.node)==null?void 0:ie.diff)===!0}),g=D(()=>m.value&&t.diffInline===!0),y=D(()=>{const ie=Number(t.reservedHeightPx);if(!Number.isFinite(ie)||ie<=0)return;const _e=`${Math.ceil(ie)}px`;return s.value?{maxHeight:_e,overflow:"auto"}:{height:_e,minHeight:_e,maxHeight:_e,overflow:"auto"}}),k=["diff ","index ","--- ","+++ ","@@ "];function v(ie){return String(ie??"").trim().length===0}function C(ie,_e="context",Z={}){const se=v(ie);return{code:ie,kind:se&&_e!=="hunk"&&_e!=="spacer"&&!Z.preserveBlankKind?"context":_e,empty:se}}function w(ie){const _e=n(ie,s.value);return _e?_e.split(/\r\n|\n|\r/):[]}function M(ie,_e){return!v(ie[_e])||_ek.some(Z=>_e.startsWith(Z)))}function x(ie,_e){return _e||!ie.startsWith(" ")||ie.startsWith(" ")?ie:` ${ie}`}function A(ie,_e){const Z=ie.length,se=_e.length,he=[];let Y=0;for(;Y=Y&&Q>=Y&&ie[U]===_e[Q];)J.unshift({originalIndex:U,modifiedIndex:Q}),U--,Q--;const ue=U-Y+1,me=Q-Y+1;if(ue<=0||me<=0||s.value||(ue+1)*(me+1)>15e5)return he.concat(J);const pe=me+1,ee=new Uint32Array((ue+1)*(me+1));for(let Ce=ue-1;Ce>=0;Ce--)for(let ve=me-1;ve>=0;ve--){const ce=Ce*pe+ve;if(ie[Y+Ce]===_e[Y+ve])ee[ce]=ee[(Ce+1)*pe+ve+1]+1;else{const Te=ee[(Ce+1)*pe+ve],ke=ee[Ce*pe+ve+1];ee[ce]=Te>=ke?Te:ke}}const re=[];let ge=0,ae=0;for(;ge=ee[ge*pe+ae+1]?ge++:ae++;return he.concat(re,J)}function T(ie){var _e;const Z=(function(){var Q,ue;const me=t.diffHideUnchangedRegions;if(me==null||me===!1)return null;const pe=me===!0?{}:me;return pe.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((Q=pe.contextLineCount)!=null?Q:2)),minimumLineCount:Math.max(1,Math.floor((ue=pe.minimumLineCount)!=null?ue:4))}})();if(!Z||ie.length<1||ie.length>2||ie.length===2&&ie[0].lines.length!==ie[1].lines.length)return ie;const se=ie[0].lines,he=(_e=ie[1])==null?void 0:_e.lines,Y=Q=>se[Q].kind==="context"&&(he===void 0||he[Q].kind==="context"&&se[Q].code===he[Q].code),J=[];let U=0;for(;U=Z.minimumLineCount){const me=Q+(Q===0?0:Z.contextLineCount),pe=ue-(ue===se.length?0:Z.contextLineCount);pe-me>=Z.minimumLineCount&&J.push({start:me,end:pe})}U===Q&&U++}return J.length?ie.map((Q,ue)=>{const me=[];let pe=0;for(const ee of J)me.push(...Q.lines.slice(pe,ee.start)),me.push({code:ue===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${Q.key}-collapsed-${ee.start}-${ee.end}`,number:""}),pe=ee.end;return me.push(...Q.lines.slice(pe)),Dn(Bt({},Q),{lines:me})}):ie}const I=D(()=>{var ie,_e,Z,se;if(!m.value)return[];const he=(function(ue){const me=ue.some(ee=>L(ee)),pe=ue.some(ee=>E(ee));return me&&pe||(function(){var ee,re,ge,ae;if(i.value==="diff")return!0;const Ce=(ae=(ge=String((re=(ee=t.node)==null?void 0:ee.raw)!=null?re:"").split(/\r?\n/,1)[0])==null?void 0:ge.trim())!=null?ae:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Ce)})()&&(me||pe)})(c.value),Y=(function(){var ue,me;return((ue=t.node)==null?void 0:ue.originalCode)!=null||((me=t.node)==null?void 0:me.updatedCode)!=null})();if(g.value){const ue=Y?(function(me,pe){const ee=w(me),re=w(pe),ge=A(ee,re);if(ge.length>0){const ke=[];let Ae=0,Ne=0;for(const Ze of ge){for(;Ae=Ce&&ce>=Ce&&ee[ve]===re[ce];)Te.unshift(Dn(Bt({},C(re[ce])),{key:`inline-suffix-${ce}`,number:ce+1})),ve--,ce--;for(let ke=Ce;ke<=ve;ke++)ae.push(Dn(Bt({},C(ee[ke],"removed",{preserveBlankKind:M(ee,ke)})),{key:`inline-removed-source-${ke}`,number:ke+1}));for(let ke=Ce;ke<=ce;ke++)ae.push(Dn(Bt({},C(re[ke],"added",{preserveBlankKind:M(re,ke)})),{key:`inline-added-source-${ke}`,number:ke+1}));return ae.concat(Te)})((ie=t.node)==null?void 0:ie.originalCode,(_e=t.node)==null?void 0:_e.updatedCode):(function(me){const pe=[];let ee=1,re=1;const ge=S(me);for(const[ae,Ce]of me.entries())if(Ce.startsWith("@@")){const ve=Ce.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);ve&&(ee=Number(ve[1]),re=Number(ve[2])),pe.push(Dn(Bt({},C(Ce,"hunk")),{key:`inline-hunk-${ae}`,number:""}))}else if(L(Ce))pe.push(Dn(Bt({},C(x(Ce.slice(1),ge),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${ae}`,number:ee++}));else if(E(Ce))pe.push(Dn(Bt({},C(x(Ce.slice(1),ge),"added",{preserveBlankKind:!0})),{key:`inline-added-${ae}`,number:re++}));else{const ve=ge&&Ce.startsWith(" ")?Ce.slice(1):Ce;pe.push(Dn(Bt({},C(ve)),{key:`inline-context-${ae}`,number:re})),ee++,re++}return pe})(c.value);return T([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:ue}])}if(!he&&Y)return(function(ue,me){const pe=w(ue),ee=w(me),re=A(pe,ee),ge=[],ae=[];let Ce=0,ve=0,ce=0;const Te=(ke,Ae)=>{const Ne=Math.max(ke-Ce,Ae-ve);for(let Ze=0;ZeDn(Bt({},ue),{key:`original-${me}`,number:me+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:U.map((ue,me)=>Dn(Bt({},ue),{key:`modified-${me}`,number:me+1}))}])}),O=D(()=>{var ie,_e;if(t.showLineNumbers!==!0)return;let Z=m.value?1:u.value;if(m.value){Z=Math.max(Z,w((ie=t.node)==null?void 0:ie.originalCode).length,w((_e=t.node)==null?void 0:_e.updatedCode).length);for(const he of I.value)for(const Y of he.lines)typeof Y.number=="number"&&(Z=Math.max(Z,Y.number))}const se=`${Math.max(2,String(Z).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))"}}),H=D(()=>I.value.some(ie=>ie.lines.some(_e=>_e.kind==="collapsed"))),R=D(()=>{const ie=i.value;return ie?`Code block: ${ie}`:"Code block"}),F=q(null),P=q([]);let z=null,W=!1,$=null;function K(ie){const _e=Number.parseFloat(String(ie??""));return Number.isFinite(_e)&&_e>0?_e:0}function ne(ie,_e){var Z;if(!ie)return _e;if(ie.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const se=ie.querySelector(".markstream-pre__diff-content"),he=se?.getBoundingClientRect(),Y=(Z=he?.height)!=null?Z:0;return Math.max(_e,Math.ceil(Y))}function G(){W||typeof window>"u"||(z!=null&&window.cancelAnimationFrame(z),z=window.requestAnimationFrame(()=>{z=null,W||(function(){var ie,_e;z=null;const Z=F.value;if(!Z||!m.value||g.value||!Z.classList.contains("is-wrap"))return void(P.value.length&&(P.value=[]));const se=(function(me){const pe=window.getComputedStyle(me),ee=K(pe.getPropertyValue("--markstream-pre-diff-line-height"));if(ee>0)return ee;const re=K(pe.lineHeight);return re>0?re:18})(Z),he=Array.from(Z.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),Y=Array.from(Z.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),J=Math.max(he.length,Y.length),U=[];for(let me=0;me{const ee=ue[pe];return ee&&Math.abs(me.rowHeight-ee.rowHeight)<=.5&&Math.abs(me.originalHeight-ee.originalHeight)<=.5&&Math.abs(me.modifiedHeight-ee.modifiedHeight)<=.5})||(P.value=U)})()}))}function te(ie){$?.disconnect(),$=null,ie&&m.value&&!g.value&&typeof ResizeObserver<"u"&&($=new ResizeObserver(()=>{G()}),$.observe(ie))}function le(ie,_e){const Z=P.value[ie];if(!Z)return;const se=_e==="original"?Z.originalHeight:Z.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(Z.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(se)}px`}}return ze(F,ie=>{te(ie),ft(()=>G())},{flush:"post"}),ze([m,g,I],()=>{te(F.value),ft(()=>G())},{flush:"post",immediate:!0}),ii(()=>{W=!0,z!=null&&(window.cancelAnimationFrame(z),z=null),$?.disconnect(),$=null}),(ie,_e)=>(b(),N("pre",{ref_key:"preRef",ref:F,style:on([y.value,O.value]),class:De([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":m.value,"markstream-pre--diff-inline":g.value,"markstream-pre--diff-collapsed":H.value}]),"aria-busy":s.value,"aria-label":R.value,"data-language":i.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[m.value?(b(),N("code",cke,[(b(!0),N(Le,null,Ct(I.value,Z=>(b(),N("span",{key:Z.key,class:De(["markstream-pre__diff-pane",Z.className])},[_("span",dke,[(b(!0),N(Le,null,Ct(Z.lines,(se,he)=>(b(),N("span",{key:se.key,class:De(["markstream-pre__diff-line",[`markstream-pre__diff-line--${se.kind}`,{"markstream-pre__diff-line--empty":se.empty}]]),style:on(le(he,Z.key))},[_e[0]||(_e[0]=_("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),_("span",fke,B(se.number),1),_("span",hke,[_("span",pke,B(se.code),1)])],6))),128))])],2))),128))])):(b(),N(Le,{key:1},[t.showLineNumbers?(b(),N("span",mke,[_("span",{class:"markstream-pre__line-numbers-text",textContent:B(h.value)},null,8,gke)])):X("",!0),_("code",{translate:"no",class:"markstream-pre__code",textContent:B(r.value)},null,8,vke)],64))],14,uke))}});bl.install=e=>{e.component(bl.__name,bl)};const Fo=Ei(ot({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=qm(),i=en("markstreamFade",void 0),o=en("markstreamTextStreamState",void 0),s=en("markstreamStreamVersion",void 0),r=D(()=>{const M=n.fade;return M===""||M===!0||M==="true"||M!==!1&&M!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var M;const L=(M=n["index-key"])!=null?M:n.indexKey;return L==null||L===""?"":String(L)}),u=q(t.node.content),c=q(""),d=q(0),f=q(t.node.content);let h;const m=q(null),g=q(null);let y="",k=null;function v(){h?.(),h=void 0}function C(){v(),c.value&&(u.value=u.value+c.value,c.value="")}ze([u,m,g],function(){var M,L;const E=m.value;if(!E)return;const S=String((M=u.value)!=null?M:""),x=g.value;return k||(k=E.firstChild,y=(L=k?.data)!=null?L:""),S.startsWith(y)?!k&&S?(E.textContent=S,k=E.firstChild,void(y=S)):void(S.length>y.length&&x&&(x.appendChild(document.createTextNode(S.slice(y.length))),y=S)):(E.textContent=S,k=E.firstChild,x&&(x.textContent=""),void(y=S))},{immediate:!0}),ze([()=>t.node.content,a,l],([M])=>{const L=String(M??""),E=a.value,S=lq({nextContent:L,persistedContent:E?o?.get(E):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 x=s.value;h=ze(()=>s.value,A=>{A!==x&&C()},{flush:"sync"})})()):c.value||v(),E&&o?.set(E,L)},{immediate:!0}),cd(v);const w=D(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(M,L)=>(b(),N("span",{class:De([[e.node.center?"text-node-center":""],"text-node"])},[si(_("span",{ref_key:"settledTextEl",ref:m},B(f.value),513),[[Eo,u.value!==""]]),si(_("span",{ref_key:"settledAppendsEl",ref:g},null,512),[[Eo,u.value!==""]]),c.value?(b(),N("span",{key:0,class:De(["text-node-stream-delta",[w.value]]),onAnimationend:C},B(c.value),35)):X("",!0)],2))}}),[["__scopeId","data-v-fd79037c"]]);function d0(e,t,n){return ot({name:e,inheritAttrs:!1,setup(i,{attrs:o,slots:s}){var r,l;const a=Hx(),u=zx(),c=jx(),d=typeof window<"u"&&((l=(r=gs())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=q(typeof window>"u"||d||!c.value),h=_u(null);let m=null;function g(y){const k=y&&"$el"in y?y.$el:y;h.value=k instanceof HTMLElement?k:null}return typeof window<"u"&&ze([h,c],([y,k],v,C)=>{if(m?.destroy(),m=null,!k||f.value)return void(f.value=!0);if(!y)return;let w=!0;const M=a(y,{rootMargin:u?.value.heavyBlockMargin,allowIdle:!1});m=M,f.value=M.isVisible.value,M.whenVisible.then(()=>{w&&m===M&&(f.value=!0)}),C(()=>{w=!1,M.destroy(),m===M&&(m=null)})},{immediate:!0}),ii(()=>{m?.destroy(),m=null}),()=>Fn(f.value?t:n,Dn(Bt({},o),{ref:g}),s)}})}Fo.install=e=>{e.component(Fo.__name,Fo)};const gb=ot({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=U4(String((o=(i=n.node)==null?void 0:i.language)!=null?o:"")),d=ON[c]||(c?c.charAt(0).toUpperCase()+c.slice(1):ON[""]),f=lke(n.node),h=ake(String((r=(s=n.node)==null?void 0:s.raw)!=null?r:""),d,f),m=n.monacoOptions,g=f&&((l=n.estimatedDiffInline)!=null?l:Wx(m??{},typeof window>"u"?0:window.innerWidth)),y=m?.diffAppearance,k=y==="dark"||y!=="light"&&n.isDark===!0,v=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:v===12?18:Math.max(12,Math.round(1.5*v)),w=typeof m?.tabSize=="number"&&Number.isFinite(m.tabSize)&&m.tabSize>0?m.tabSize:4,M=f?0:8,L=typeof((a=m?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(m.padding.top)&&m.padding.top>=0?m.padding.top:M,E=typeof((u=m?.padding)==null?void 0:u.bottom)=="number"&&Number.isFinite(m.padding.bottom)&&m.padding.bottom>=0?m.padding.bottom:M,S=typeof m?.fontFamily=="string"?m.fontFamily.trim():"",x=Bt(Bt({fontSize:`${v}px`,lineHeight:`${C}px`,tabSize:w,paddingTop:`${L}px`,paddingBottom:`${E}px`,"--markstream-pre-line-number-top":`${L}px`},f?{"--markstream-pre-diff-line-height":`${C}px`}:{}),S?{"--markstream-code-font-family":S}:{}),A=()=>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"})]),T=n.isShowPreview!==!1&&(c==="html"||c==="svg"),I=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||T&&n.showPreviewButton!==!1,O=R=>{if(R!=null)return typeof R=="number"?`${R}px`:String(R)},H=Bt(Bt(Bt({"--markstream-code-layout-character-width":"1ch"},O(n.minWidth)?{minWidth:O(n.minWidth)}:{}),O(n.maxWidth)?{maxWidth:O(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",Dn(Bt({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":k,"is-diff":f,"is-plain-text":c===""||c==="plaintext"||c==="text"},t.class],style:[H,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:A(),n.showCollapseButton===!1?null:A(),I?Fn("div",{class:"relative"},[A()]):null])]),Fn("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[Fn(bl,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:g,diffHideUnchangedRegions:f?rke(m?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:x,"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"})])}}}),k8=d0("ViewportDeferredCodeBlockNode",Xu({loader:()=>io(null,null,function*(){try{return(yield qo(()=>import("./CodeBlockNode-Dh6YGbd1.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),bl}}),loadingComponent:gb,delay:0,suspensible:!1}),gb),Iu=Xu(()=>io(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(Fo,Dn(Bt({},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 fq(),(yield qo(()=>import("./index7-CreDRl0J.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(Fo,Dn(Bt({},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:""}$`}}))}})),_q=Xu(()=>io(null,null,function*(){try{return yield fq(),(yield qo(()=>import("./index6-BTRYPHWD.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(Fo,Dn(Bt({},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:""}$$`}}))}})),Qr=Ei(ot({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(b(),N("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"]]);Qr.install=e=>{e.component(Qr.__name,Qr)};const yke={class:"superscript-node"},Ml=Ei(ot({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,emphasis:el,footnote_reference:la,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,emoji:Il,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("sup",yke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{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 kke={class:"subscript-node"},Tl=Ei(ot({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,emphasis:el,footnote_reference:la,strikethrough:Jr,highlight:ua,insert:El,superscript:Ml,emoji:Il,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("sub",kke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{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"]]);Tl.install=e=>{e.component(Tl.__name,Tl)};const bke={class:"strong-node"},Yr=Ei(ot({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,emphasis:el,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,superscript:Ml,emoji:Il,footnote_reference:la,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("strong",bke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{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"]]);Yr.install=e=>{e.component(Yr.__name,Yr)};const wke={class:"strikethrough-node"},Jr=Ei(ot({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,emphasis:el,highlight:ua,insert:El,subscript:Tl,superscript:Ml,emoji:Il,footnote_reference:la,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("del",wke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{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"]]);Jr.install=e=>{e.component(Jr.__name,Jr)};const Cke=["href","title","aria-label","aria-hidden","target","rel"],Ake=["aria-hidden"],xke={class:"link-text-wrapper relative inline-flex"},Ske={class:"leading-[normal] link-text"},Xr=Ei(ot({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=en("markstreamShowTooltips",void 0),i=D(()=>{const k=n?.value;return typeof k=="boolean"?k:t.showTooltip}),o=D(()=>{var k,v,C,w,M;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",E=(k=t.animationOpacity)!=null?k:.35,S=Math.max(.12,Math.min(.5*E,E)),x={"--underline-height":`${(v=t.underlineHeight)!=null?v:2}px`,"--underline-bottom":L,"--underline-opacity":String(E),"--underline-rest-opacity":String(S),"--underline-duration":`${(C=t.animationDuration)!=null?C:1.6}s`,"--underline-timing":(w=t.animationTiming)!=null?w:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(M=t.animationIteration)!=null?M:"infinite"};return t.color&&(x["--link-color"]=t.color),x}),s=vs(()=>t.customId),r=D(()=>Bt({text:Fo,strong:Yr,strikethrough:Jr,emphasis:el,image:df,html_inline:aa,inline_code:Er},s.value)),l=qm(),a=D(()=>{var k,v;const C=(k=t.node)==null?void 0:k.attrs;if(!C||typeof C!="object")return{};const w={};if(Array.isArray(C))for(const M of C)Array.isArray(M)&&M[0]&&(w[String(M[0])]=String((v=M[1])!=null?v:""));else for(const[M,L]of Object.entries(C))M&&L!=null&&L!==!1&&(w[M]=L===!0?"":String(L));return GN(w,"safe","a")}),u=D(()=>Bt(Bt({},l),a.value)),c=D(()=>{var k,v;return GN({href:String((v=(k=t.node)==null?void 0:k.href)!=null?v:"")},"safe","a").href}),d=D(()=>{if(!c.value)return;const k=u.value.target;return(typeof k=="string"?k.trim():String(k??"").trim())||(lme(c.value)?"_blank":void 0)}),f=D(()=>{var k;return String((k=d.value)!=null?k:"").trim().toLowerCase()==="_blank"}),h=D(()=>{if(!c.value)return;const k=u.value.rel,v=new Set((typeof k=="string"?k:String(k??"")).split(/\s+/).filter(Boolean)),C=new Set(Array.from(v).filter(w=>w.toLowerCase()!=="opener"));return f.value&&(C.add("noopener"),C.add("noreferrer")),C.size>0?Array.from(C).join(" "):void 0}),m=D(()=>{const k=Bt({},u.value);return delete k.title,delete k.href,delete k.target,delete k.rel,k});function g(){i.value&&U9e()}const y=D(()=>{var k,v;const C=(k=t.node)==null?void 0:k.title;return typeof C=="string"&&C.trim().length>0?C:String((v=c.value)!=null?v:"")});return(k,v)=>{var C,w;return e.node.loading?(b(),N("span",ci({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},p(l),{style:o.value}),[_("span",xke,[_("span",Ske,[V(p(Fo),{class:"leading-[normal] link-text",node:{type:"text",content:String((C=e.node.text)!=null?C:""),raw:String((w=e.node.text)!=null?w:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),v[1]||(v[1]=_("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,Ake)):(b(),N("a",ci({key:0,class:"link-node",href:c.value,title:i.value?"":y.value,"aria-label":`Link: ${y.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},m.value,{style:o.value,onMouseenter:v[0]||(v[0]=M=>(function(L){var E,S,x,A;if(!i.value)return;const T=L,I=T?.clientX!=null&&T?.clientY!=null?{x:T.clientX,y:T.clientY}:void 0,O=((E=t.node)==null?void 0:E.title)||((S=c.value)!=null&&S.includes("xn--")&&((A=(x=t.node)==null?void 0:x.text)!=null&&A.includes("://"))?t.node.text:c.value)||"";q9e(L.currentTarget,O,"top",!1,I)})(M)),onMouseleave:g}),[(b(!0),N(Le,null,Ct(e.node.children,(M,L)=>(b(),fe(p(yc),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:M,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,Cke))}}}),[["__scopeId","data-v-367e6ca4"]]);Xr.install=e=>{e.component(Xr.__name,Xr)};const _ke={class:"insert-node"},El=Ei(ot({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,emphasis:el,strikethrough:Jr,highlight:ua,subscript:Tl,superscript:Ml,emoji:Il,footnote_reference:la,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("ins",_ke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{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"]]);El.install=e=>{e.component(El.__name,El)};const Ike={class:"highlight-node"},ua=Ei(ot({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,emphasis:el,strikethrough:Jr,insert:El,subscript:Tl,superscript:Ml,emoji:Il,footnote_reference:la,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("mark",Ike,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{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"]]);ua.install=e=>{e.component(ua.__name,ua)};const Mke={class:"emphasis-node"},el=Ei(ot({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,superscript:Ml,emoji:Il,footnote_reference:la,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("em",Mke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{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"]]);el.install=e=>{e.component(el.__name,el)};const Tke={class:"hard-break"},ff=Ei(ot({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(b(),N("br",Tke))}),[["__scopeId","data-v-50c58f70"]]);ff.install=e=>{e.component(ff.__name,ff)};const Pv=ot({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Lt({checkbox:ra,checkbox_input:ra,emoji:Il,emphasis:el,hardbreak:ff,highlight:ua,inline_code:Er,insert:El,link:Xr,reference:Qr,strikethrough:Jr,strong:Yr,subscript:Tl,superscript:Ml,text:Fo}),i=vs(()=>t.customId),o=D(()=>{const s=i.value;return Object.keys(s).length>0?Bt(Bt({},n),s):n});return(s,r)=>(b(!0),N(Le,null,Ct(e.nodes,(l,a)=>(b(),fe(p(yc),{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 BA(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(BA)}function vb(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(BA))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(BA)?o:null}function vp(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 Eke=["cite"],Lke={key:0,dir:"auto",class:"paragraph-node"},Nke=["custom-id"],j9=Ei(ot({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>!!n.value.paragraph),o=D(()=>!!n.value.text),s=D(()=>vb(t.node.children,!i.value)),r=D(()=>t.fade!==!1||o.value?null:vp(s.value));return Gn("markstreamShowTooltips",D(()=>t.showTooltips)),Gn("markstreamFade",D(()=>t.fade)),(l,a)=>(b(),N("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[s.value?(b(),N("p",Lke,[r.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(r.value),9,Nke)):(b(),fe(p(Pv),{key:1,nodes:s.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(b(),fe(p(Ll),{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,Eke))}}),[["__scopeId","data-v-abfecebc"]]);j9.install=e=>{e.component(j9.__name,j9)};const Fke={class:"definition-list"},Dke={class:"definition-term"},Rke={class:"definition-desc"},H9=Ei(ot({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(b(),N("dl",Fke,[(b(!0),N(Le,null,Ct(t.node.items,(o,s)=>(b(),N(Le,{key:s},[_("dt",Dke,[V(p(Ll),{"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"])]),_("dd",Rke,[V(p(Ll),{"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"]]);H9.install=e=>{e.component(H9.__name,H9)};const Oke=["href","title"],K0=Ei(ot({__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)=>(b(),N("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,Oke))}}),[["__scopeId","data-v-e1eb37b6"]]);K0.install=e=>{e.component(K0.__name,K0)};const Pke=["id"],Bke={class:"flex-1"},W9=ot({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(b(),N("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[_("div",Bke,[V(p(Ll),{"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,Pke))}});W9.install=e=>{e.component(W9.__name,W9)};const $ke=["custom-id"],$A=Ei(ot({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=en("markstreamFade",void 0),o=D(()=>i?.value!==!1||n.value.text?null:vp(t.node.children)),s=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,image:df,strong:Yr,emphasis:el,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,superscript:Ml,emoji:Il,checkbox:ra,checkbox_input:ra,footnote_reference:la,hardbreak:ff,math_inline:Iu,reference:Qr},n.value));return(r,l)=>(b(),fe(To(`h${e.node.level}`),ci({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:de(()=>[o.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(o.value),9,$ke)):(b(!0),N(Le,{key:1},Ct(e.node.children,(a,u)=>(b(),fe(p(yc),{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"]]),Z4=$A;Z4.install=e=>{e.component($A.__name,$A)};const zke={key:0,dir:"auto",class:"paragraph-node"},jke=["custom-id"],Hke={dir:"auto",class:"paragraph-node"},Wke=["custom-id"],am=Ei(ot({__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=vs(()=>t.customId),o=D(()=>!!i.value.paragraph),s=D(()=>!!i.value.text),r=D(()=>{var h;return vb((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 y=m.slice(1);if(!y.every(v=>v?.type==="list"))return null;const k=vb([g]);return k?{paragraphChildren:k,nestedLists:y}:null});function a(){return t.fade===!1&&!s.value}const u=D(()=>a()?vp(r.value):null),c=D(()=>{var h;return a()?vp((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 Gn("markstreamShowTooltips",D(()=>t.showTooltips)),Gn("markstreamFade",D(()=>t.fade)),(h,m)=>{var g,y;return b(),N("li",ci({class:"list-item",dir:"auto"},f.value),[r.value?(b(),N("p",zke,[u.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(u.value),9,jke)):(b(),fe(p(Pv),{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?(b(),N(Le,{key:1},[_("p",Hke,[c.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(c.value),9,Wke)):(b(),fe(p(Pv),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(b(!0),N(Le,null,Ct(l.value.nestedLists,(k,v)=>(b(),fe(p(Ll),{key:v,nodes:[k],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${v}`,"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)):(b(),fe(p(Ll),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(y=(g=n.value)==null?void 0:g.children)!=null?y:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:m[1]||(m[1]=k=>h.$emit("copy",k))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);am.install=e=>{e.component(am.__name,am)};const um=Ei(ot({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=vs(()=>e.customId),n=D(()=>t.value.list_item||am);return(i,o)=>(b(),fe(To(e.node.ordered?"ol":"ul"),{class:De(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:de(()=>[(b(!0),N(Le,null,Ct(e.node.items,(s,r)=>{var l;return b(),fe(To(n.value),ci({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"]]);um.install=e=>{e.component(um.__name,um)};const qke={key:2,class:"html-block-node__raw"},Uke=["innerHTML"],Vke={key:1,class:"html-block-node__placeholder"},Z0=Ei(ot({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=en("markstreamHtmlPolicy",void 0),i=en("markstreamNestedRendererProps",void 0),o=D(()=>{var I,O;return(O=(I=t.htmlPolicy)!=null?I:n?.value)!=null?O:"safe"}),s=D(()=>{var I,O;const H=(I=i?.value)!=null?I:{};return Dn(Bt({},H),{customId:(O=t.customId)!=null?O:H.customId,htmlPolicy:o.value})}),r=Xu({loader:()=>Promise.resolve().then(()=>Xx),suspensible:!1}),l=D(()=>{const I=P9(t.node.attrs,o.value);if(!I)return;const O=W0(I);return Object.keys(O).length>0?O:void 0}),a=D(()=>{const I=String(t.node.tag||"").trim(),O=P9(t.node.attrs,o.value,I);if(!O)return;const H=W0(O);return Object.keys(H).length>0?H:void 0}),u=vs(()=>t.customId),c=ot({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=q(null),f=q(typeof window>"u"),h=q(t.node.content),m=D(()=>Array.isArray(t.node.children)?t.node.children:[]),g=D(()=>String(t.node.tag||"div")),y=D(()=>{var I;if(g.value.trim().toLowerCase()!=="details"||(I=t.node.attrs)!=null&&I.some(([H])=>String(H).toLowerCase()==="open"))return null;const O=m.value[0];return O?.type==="html_block"&&String(O.tag||"").toLowerCase()==="summary"?O:null}),k=D(()=>{var I;return vp((I=y.value)==null?void 0:I.children)}),v=D(()=>{const I=y.value;if(!I)return;const O=P9(I.attrs,o.value,"summary");if(!O)return;const H=W0(O);return Object.keys(H).length>0?H:void 0}),C=D(()=>k.value==null?m.value:m.value.slice(1)),w=D(()=>{const I=g.value.trim().toLowerCase();return VH.has(I)||Dx(I,o.value)}),M=D(()=>m.value.length>0&&!!t.node.tag&&!w.value),L=D(()=>{var I,O,H;if(M.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(I=h.value)!=null?I:""};const R=(O=h.value)!=null?O:t.node.content;if(!R)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:lm(R,o.value)};if(t.node.loading){const P=mb(R,u.value,o.value);return P===null?{mode:"text",content:(H=t.node.raw)!=null?H:R}:{mode:"dynamic",nodes:P}}if(!kq(R,u.value))return{mode:"html",content:lm(R,o.value)};const F=mb(R,u.value,o.value);return F===null?{mode:"html",content:lm(R,o.value)}:{mode:"dynamic",nodes:F}}),E=Hx(),S=zx(),x=jx(),A=_u(null),T=!!t.node.loading;return typeof window<"u"?(ze([()=>d.value,()=>S?.value.heavyBlockMargin,()=>S?.value.rootMargin],([I],O,H)=>{var R,F,P,z;if((F=(R=A.value)==null?void 0:R.destroy)==null||F.call(R),A.value=null,!T)return f.value=!0,void(h.value=t.node.content);if(!I)return void(f.value=!1);let W=!0;const $=(z=(P=S?.value.heavyBlockMargin)!=null?P:S?.value.rootMargin)!=null?z:gp,K=E(I,{rootMargin:$,allowIdle:!x.value});A.value=K,f.value=f.value||K.isVisible.value,K.whenVisible.then(()=>{W&&A.value===K&&(f.value=!0)}),H(()=>{W=!1,K.destroy(),A.value===K&&(A.value=null)})},{immediate:!0}),ze(()=>t.node.content,I=>{T&&!f.value||(h.value=I)})):f.value=!0,ii(()=>{var I,O;(O=(I=A.value)==null?void 0:I.destroy)==null||O.call(I),A.value=null}),(I,O)=>(b(),fe(To(M.value?g.value:"div"),ci({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":p(x)&&!f.value?"true":void 0},M.value?a.value:void 0),{default:de(()=>[f.value?(b(),N(Le,{key:0},[L.value.mode==="structured"?(b(),N(Le,{key:0},[k.value!==null?(b(),N(Le,{key:0},[_("summary",iJ(C$(v.value)),B(k.value),17),C.value.length?(b(),fe(p(r),ci({key:0},s.value,{nodes:C.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):X("",!0)],64)):(b(),fe(p(r),ci({key:1},s.value,{nodes:m.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):L.value.mode==="dynamic"?(b(),fe(p(c),{key:1,nodes:L.value.nodes},null,8,["nodes"])):L.value.mode==="text"?(b(),N("pre",qke,B(L.value.content),1)):(b(),N("div",ci({key:3},l.value,{innerHTML:L.value.content}),null,16,Uke))],64)):(b(),N("div",Vke,[Hn(I.$slots,"placeholder",{node:e.node},()=>[O[0]||(O[0]=_("span",{class:"html-block-node__placeholder-bar"},null,-1)),O[1]||(O[1]=_("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),O[2]||(O[2]=_("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);Z0.install=e=>{e.component(Z0.__name,Z0)};const Kke={dir:"auto",class:"paragraph-node"},Zke=["custom-id"],rp=Ei(ot({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=vs(()=>t.customId),i=en("markstreamHtmlPolicy",void 0),o=en("markstreamFade",void 0),s=en("markstreamParseOptions",void 0),r=en("markstreamCustomMarkdownIt",void 0),l=en("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,x;return(x=t.customHtmlTags)!=null?x:(S=l?.value)==null?void 0:S.customHtmlTags}),f=D(()=>{var S,x;const A=(S=l?.value)!=null?S:{};return Dn(Bt({},A),{customId:(x=t.customId)!=null?x:A.customId,customHtmlTags:d.value,parseOptions:u.value,customMarkdownIt:c.value,htmlPolicy:a.value})}),h=Xu({loader:()=>Promise.resolve().then(()=>Xx),suspensible:!1});function m(S){var x;return S.type==="text"&&String((x=S.content)!=null?x:"").trim()===""}const g=D(()=>t.node.children.filter(S=>!m(S))),y=D(()=>g.value.length>0&&g.value.every(S=>S.type==="image"||(function(x){var A;const T=(function(I){return I.type==="link"&&Array.isArray(I.children)?I.children.filter(O=>!m(O)):[]})(x);return T.length===1&&((A=T[0])==null?void 0:A.type)==="image"})(S))),k=D(()=>new Set(Np(d.value))),v=D(()=>{if(!y.value||g.value.length<=1)return t.node.children;const S=[];for(let x=0;x0,I=t.node.children.slice(x+1).some(O=>!m(O));T&&I&&S.push(Dn(Bt({},A),{content:" ",raw:" "}))}return S}),C=D(()=>o?.value===!1&&!n.value.text),w=D(()=>C.value?vp(v.value):null);function M(S,x){return{node:S,"index-key":`${t.indexKey}-${x}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=D(()=>Bt({inline_code:Er,image:df,link:Xr,hardbreak:ff,emphasis:el,strong:Yr,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,superscript:Ml,html_inline:aa,html_block:Z0,emoji:Il,checkbox:ra,math_inline:Iu,checkbox_input:ra,reference:Qr,footnote_anchor:K0,footnote_reference:la,text:Fo},n.value)),E=D(()=>v.value.map((S,x)=>{var A;const T=(function(I){var O,H,R,F;if(I.type==="html_block"||I.type==="html_inline"){const P=String((O=I.tag)!=null?O:"").trim().toLowerCase()||YH(I.content);if(P&&!k.value.has(P)&&JH((H=I.content)!=null?H:I.raw,P)){const z=String((F=(R=I.content)!=null?R:I.raw)!=null?F:"");return{child:{type:"text",content:z,raw:z},component:Fo,isCustomComponent:!1}}}return{child:I,component:L.value[I.type],isCustomComponent:!!(n.value[I.type]&&!v2(String(I.type)))}})(S);return Dn(Bt({},T),{index:x,key:`${t.indexKey||"paragraph"}-${x}`,customAttrs:T.isCustomComponent?$x(T.child,a.value):void 0,hasSlotChildren:Array.isArray(T.child.children)&&T.child.children.length>0,slotContent:String((A=T.child.content)!=null?A:""),originalChild:S})}));return(S,x)=>(b(),N("p",Kke,[w.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(w.value),9,Zke)):(b(!0),N(Le,{key:1},Ct(E.value,A=>{return b(),N(Le,{key:A.key},[y.value&&m(A.originalChild)?(b(),N(Le,{key:0},[Be(B((T=A.originalChild,String((I=T.content)!=null?I:""))),1)],64)):A.isCustomComponent?(b(),fe(To(A.component),ci({key:1,ref_for:!0},A.customAttrs,{node:A.child,loading:A.child.loading,"index-key":A.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:de(()=>[A.hasSlotChildren?(b(),fe(p(h),ci({key:0,ref_for:!0},f.value,{nodes:A.child.children,"index-key":A.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):A.slotContent?(b(),fe(p(h),ci({key:1,ref_for:!0},f.value,{content:A.slotContent,final:!A.child.loading,"index-key":`${A.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):X("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(b(),fe(To(A.component),ci({key:2,ref_for:!0},M(A.child,A.index)),null,16))],64);var T,I}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);rp.install=e=>{e.component(rp.__name,rp)};const Gke={class:"table-node-wrapper"},Qke=["aria-busy"],Yke={key:0},Jke=["custom-id"],Xke=["aria-label","onPointerdown"],ebe=["custom-id"],tbe={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},G0=Ei(ot({__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 k;return(k=t.node.loading)!=null&&k}),i=D(()=>{var k;return(k=t.node.rows)!=null?k:[]}),o=q(null),s=q([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>s.value.some(k=>Number.isFinite(k)&&k>0)),u=D(()=>a.value?s.value.map(k=>k>0?{width:`${k}px`}:void 0):[]);Gn("markstreamShowTooltips",D(()=>t.showTooltips)),Gn("markstreamFade",D(()=>t.fade));const c=vs(()=>t.customId),d=D(()=>!!c.value.text),f=D(()=>!!c.value.paragraph),h=new WeakMap;function m(k){const v=t.fade===!1&&!d.value,C=!f.value,w=h.get(k);if(w?.children===k.children&&w.textFastPath===v&&w.paragraphFastPath===C)return w.info;const M=vb(k.children,C,!0),L={simpleChildren:M,plainText:M&&v?vp(M):null};return h.set(k,{children:k.children,textFastPath:v,paragraphFastPath:C,info:L}),L}function g(k){if(!r)return;k.preventDefault();const v=r.startWidth+r.nextStartWidth,C=Math.min(48,Math.floor(v/2)),w=Math.max(C,Math.min(v-C,Math.round(r.startWidth+k.clientX-r.startX))),M=[...r.widths];M[r.index]=w,M[r.index+1]=v-w,s.value=M}function y(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),r=null)}return ze(l,()=>{y(),s.value=[]}),ii(y),(k,v)=>(b(),N("div",Gke,[_("table",{ref_key:"tableRef",ref:o,class:De(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(b(),N("colgroup",Yke,[(b(!0),N(Le,null,Ct(e.node.header.cells,(C,w)=>(b(),N("col",{key:w,style:on(u.value[w])},null,4))),128))])):X("",!0),_("thead",null,[_("tr",null,[(b(!0),N(Le,null,Ct(e.node.header.cells,(C,w)=>(b(),N("th",{key:w,dir:"auto",class:De([C.align==="right"?"text-right":C.align==="center"?"text-center":"text-left"])},[m(C).plainText!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(m(C).plainText),9,Jke)):m(C).simpleChildren?(b(),fe(p(Pv),{key:1,nodes:m(C).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${w}`},null,8,["nodes","custom-id","index-key"])):(b(),fe(p(Ll),{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:v[0]||(v[0]=M=>k.$emit("copy",M))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),w(function(L,E){if(E.button!==0)return;const S=(function(){var T;const I=(T=o.value)==null?void 0:T.querySelectorAll("thead th");return Array.from(I??[],O=>Math.round(O.getBoundingClientRect().width))})(),x=S[L],A=S[L+1];x&&A&&(E.preventDefault(),r={index:L,startX:E.clientX,startWidth:x,nextStartWidth:A,widths:S},s.value=S,window.addEventListener("pointermove",g),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y))})(w,M)},null,40,Xke)):X("",!0)],2))),128))])]),_("tbody",null,[(b(!0),N(Le,null,Ct(i.value,(C,w)=>(b(),N("tr",{key:w},[(b(!0),N(Le,null,Ct(C.cells,(M,L)=>(b(),N("td",{key:L,class:De([M.align==="right"?"text-right":M.align==="center"?"text-center":"text-left"]),dir:"auto"},[m(M).plainText!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(m(M).plainText),9,ebe)):m(M).simpleChildren?(b(),fe(p(Pv),{key:1,nodes:m(M).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${w}-${L}`},null,8,["nodes","custom-id","index-key"])):(b(),fe(p(Ll),{key:2,nodes:M.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:v[1]||(v[1]=E=>k.$emit("copy",E))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,Qke),V(mo,{name:"table-node-fade"},{default:de(()=>[n.value?(b(),N("div",tbe,[Hn(k.$slots,"loading",{isLoading:n.value},()=>[v[2]||(v[2]=_("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),v[3]||(v[3]=_("span",{class:"sr-only"},"Loading",-1))],!0)])):X("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);G0.install=e=>{e.component(G0.__name,G0)};const nbe={class:"hr-node"},q9=Ei({},[["render",function(e,t){return b(),N("hr",nbe)}],["__scopeId","data-v-39b2349c"]]);q9.install=e=>{e.component(q9.__name,q9)};const ibe={class:"unknown-node"},zA=ot({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(b(),N("div",ibe,B(e.node.raw),1))}),U9=Ei(ot({__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=vs(()=>t.customId),o=D(()=>Bt({text:Fo,paragraph:rp,heading:Z4,inline_code:Er,link:Xr,image:df,strong:Yr,emphasis:el,strikethrough:Jr,insert:El,subscript:Tl,superscript:Ml,checkbox:ra,checkbox_input:ra,hardbreak:ff,math_inline:Iu,reference:Qr,list:um,math_block:_q,table:G0},i.value));return(s,r)=>(b(),N("div",ci({class:n.value},e.node.attrs),[(b(!0),N(Le,null,Ct(e.node.children,(l,a)=>{return b(),fe(To((u=l.type,o.value[u]||zA)),{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"]]);U9.install=e=>{e.component(U9.__name,U9)};const obe=["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"],oF=[[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 sbe(e){if(e<=255)return obe[e];let t=0,n=oF.length-1;for(;t<=n;){const i=t+n>>1,o=oF[i];if(eo[1]))return o[2];t=i+1}}return"L"}const rbe=/[ \t\n\r\f]+/g,lbe=/[\t\n\r\f]| {2,}|^ | $/;let b8=null;const abe=new RegExp("\\p{Script=Arabic}","u"),Mf=new RegExp("\\p{M}","u"),qx=new RegExp("\\p{Nd}","u");function sF(e){return abe.test(e)}function rF(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 tc(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&i<=57343){if(rF(i-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(rF(n))return!0}}return!1}const ube=new Set([" "," ","⁠","\uFEFF"]),cbe=new Set(["-","‐","–","—"]);function Iq(e,t){return!((function(n){const i=Q0(n);return i!==null&&ube.has(i)})(e)||t&&((function(n){const i=Q0(n);return i!==null&&(Ux.has(i)||yp.has(i))})(e)||(function(n){const i=Q0(n);return i!==null&&cbe.has(i)})(e)))}const Ux=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),G4=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),Vx=new Set(["'","’"]),yp=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),dbe=new Set([":",".","،","؛"]),fbe=new Set(["၏"]),hbe=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function pbe(e){if(Kx(e))return!0;let t=!1;for(const n of e)if(yp.has(n)||kb(n))t=!0;else if(!t||!Mf.test(n))return!1;return t}function mbe(e){for(const t of e)if(!Ux.has(t)&&!yp.has(t))return!1;return e.length>0}function gbe(e){if(Kx(e))return!0;for(const t of e)if(!(G4.has(t)||Vx.has(t)||Mf.test(t)||kb(t)))return!1;return e.length>0}function Kx(e){let t=!1;for(const n of e)if(n!=="\\"&&!Mf.test(n)){if(!(G4.has(n)||yp.has(n)||Vx.has(n)))return!1;t=!0}return t}function yb(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 Q0(e){if(e.length===0)return null;const t=yb(e,e.length);return e.slice(t)}const vbe=[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 kb(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,vbe)}function ybe(e){const t=(function(n){for(const i of n)if(!Mf.test(i))return i;return null})(e);return t!==null&&qx.test(t)}function kbe(e){const t=Array.from(e);let n=t.length;for(;n>0;){const i=t[n-1];if(Mf.test(i))n--;else{if(!G4.has(i)&&!Vx.has(i))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function bbe(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function lF(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 aF(e,t){return e&&t!==null&&dbe.has(t)}function wbe(e){const t=Q0(e);return t!==null&&fbe.has(t)}function Cbe(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 jA(e){let t=e.length;for(;t>0;){const n=yb(e,t),i=e.slice(n,t);if(hbe.has(i))return!0;if(!yp.has(i))return!1;t=n}return!1}function Abe(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 xbe=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function ru(e){return e.length===1?e[0]:e.join("")}function Sbe(e,t){const n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),ru(n)}function _be(e,t,n,i){if(!xbe.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=Abe(c,i),f=d==="text"&&t;s===null||d!==s||f!==a?(s!==null&&o.push({text:ru(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:ru(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 Ibe=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Mbe(e,t){const n=e.texts[t];return!!n.startsWith("www.")||Ibe.test(n)&&t+1=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!Fbe.has(e)&&!Nbe.test(e)&&Lbe.test(e)}function uF(e){let t=!1;for(const n of e)if(!Mf.test(n)){if(!Mq(n))return!1;t=!0}return t}function Dbe(e,t,n,i){const o=!t&&uF(e),s=!i&&uF(n),r=(function(a){const u=(function(c){for(let d=c.length;d>0;){const f=yb(c,d),h=c.slice(f,d);if(!Mf.test(h))return h;d=f}return null})(a);return u!==null&&kb(u)})(e),l=(t||r)&&(function(a){for(let u=a.length;u>0;){const c=yb(a,u),d=a.slice(c,u);if(!Mf.test(d))return Mq(d)||kb(d);u=c}return!1})(e);return!!(o||s||l)&&!tc(e)&&!tc(n)&&(t||o||r)&&(i||s)}function cF(e){for(const t of e)if(qx.test(t))return!0;return!1}function V9(e){if(e.length===0)return!1;for(const t of e)if(!qx.test(t)&&!Ebe.has(t))return!1;return!0}function Rbe(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 y=[],k=[],v=[],C=[],w=[],M=[],L=[],E=[],S=[],x=[],A=[],T=[];for(const F of m.segment(a))for(const P of _be(F.segment,(d=F.isWordLike)!=null&&d,F.index,c)){let z=function(){M[ie]!==null&&(k[ie]=[lF(y,M,L,ie)],M[ie]=null),k[ie].push(P.text),v[ie]=v[ie]||P.isWordLike,E[ie]=E[ie]||K,S[ie]=S[ie]||ne,x[ie]=te,A[ie]=le,T[ie]=aF(S[ie],G)};const W=P.kind==="text",$=bbe(P.text,P.isWordLike,P.kind),K=tc(P.text),ne=sF(P.text),G=Q0(P.text),te=jA(P.text),le=wbe(P.text),ie=g-1;u.carryCJKAfterClosingQuote&&W&&g>0&&C[ie]==="text"&&K&&E[ie]&&x[ie]||W&&g>0&&C[ie]==="text"&&mbe(P.text)&&E[ie]||W&&g>0&&C[ie]==="text"&&A[ie]?z():W&&g>0&&C[ie]==="text"&&P.isWordLike&&ne&&T[ie]?(z(),v[ie]=!0):$!==null&&g>0&&C[ie]==="text"&&M[ie]===$?L[ie]=((f=L[ie])!=null?f:1)+1:W&&!P.isWordLike&&g>0&&C[ie]==="text"&&!E[ie]&&(pbe(P.text)||P.text==="-"&&v[ie])?z():(y[g]=P.text,k[g]=[P.text],v[g]=P.isWordLike,C[g]=P.kind,w[g]=P.start,M[g]=$,L[g]=$===null?0:1,E[g]=K,S[g]=ne,x[g]=te,A[g]=le,T[g]=aF(ne,G),g++)}for(let F=0;Fnull);let O=-1;for(let F=g-1;F>=0;F--){const P=y[F];if(P.length!==0){if(C[F]==="text"&&!v[F]&&O>=0&&C[O]==="text"&&(gbe(P)||P==="-"&&ybe(y[O]))){const z=(h=I[O])!=null?h:[];z.push(P),I[O]=z,w[O]=w[F],y[F]="";continue}O=F}}for(let F=0;FK+1){P.push(ru(le)),z.push(_e),W.push("text"),$.push(F.starts[K]),K=ie;continue}}P.push(ne),z.push(te),W.push(G),$.push(F.starts[K]),K++}return{len:P.length,texts:P,isWordLike:z,kinds:W,starts:$}})((function(F){const P=[],z=[],W=[],$=[];for(let K=0;K1;for(let le=0;le=F.len||w8(F.kinds[G]))continue;const te=[],le=F.starts[G];let ie=G;for(;ie0&&(P.push(ru(te)),z.push(!0),W.push("text"),$.push(le),K=ie-1)}return{len:P.length,texts:P,isWordLike:z,kinds:W,starts:$}})((function(F){const P=F.texts.slice(),z=F.isWordLike.slice(),W=F.kinds.slice(),$=F.starts.slice();for(let ne=0;ne=0&&!Iq(u.texts[C-1],c)&&v(C),g<0&&(g=C),y=y||tc(w))}return v(u.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:m}})(s,r,t.breakKeepAllAfterPunctuation):r;return Bt({normalized:s,chunks:Rbe(l,o)},l)}let u1=null;const dF=new Map;let c1=null;const Pbe=new RegExp("\\p{Emoji_Presentation}","u"),Bbe=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let C8=null;const fF=new Map;function HA(){if(u1!==null)return u1;if(typeof OffscreenCanvas<"u")return u1=new OffscreenCanvas(1,1).getContext("2d"),u1;if(typeof document<"u")return u1=document.createElement("canvas").getContext("2d"),u1;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Nd(e,t){let n=t.get(e);return n===void 0&&(n={width:HA().measureText(e).width,containsCJK:tc(e)},t.set(e,n)),n}function bb(){if(c1!==null)return c1;if(typeof navigator>"u")return c1={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},c1;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 c1={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},c1}function Tq(){return C8===null&&(C8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),C8}function $be(e){return Pbe.test(e)||e.includes("️")}function mh(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=Tq();for(const a of l.segment(s))$be(a.segment)&&r++;return r})(i)),o.emojiCount})(e,t)*n}function zbe(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function hF(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function pF(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function Zx(e,t){return t===0?0:e+t}function Wbe(e,t,n,i,o){return Zx(i,t==="tab"?o+(function(s,r){return s.letterSpacing!==0&&s.spacingGraphemeCounts[r]>0?s.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function mF(e,t,n,i){return Zx(i,t==="tab"?0:e.lineEndFitAdvances[n])}function gF(e,t,n,i,o){return Zx(i,t==="tab"?o:e.lineEndPaintAdvances[n])}function qbe(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Ube(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Ry(e,t,n){let i=t;for(;iz){if(me!==null&&ee>U){ie(J,ee,re),ge=ee,pe=Ry(me,pe,ge+1),ee=-1,re=0;continue}ie(),Z(J,ge,ae)}else $+=ae,ne=J,G=ge+1;else Z(J,ge,ae);const Ce=ge+1;me!==null&&me[pe]===Ce&&(ee=Ce,re=$,pe++),ge++}K&&ne===J&&G===ue.length&&(ne=J+1,G=0)}let Y=0;for(;Y=H.length)));){const J=H[Y],U=hF(R[Y]);if(K)if($+J>z){if(U){se(Y,J),ie(Y+1,0,$-J),Y++;continue}if(te>=0){if(ne>te||ne===te&&G>0){ie();continue}ie(te,0,le);continue}if(J>z&&F[Y]!==null){ie(),he(Y,0),Y++;continue}ie()}else se(Y,J),U&&(te=Y+1,le=$-J),Y++;else J>z&&F[Y]!==null?he(Y,0):_e(Y,J),U&&(te=Y+1,le=$-J),Y++}return K&&ie(),W})(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=bb(),d=i+c.lineFitEpsilon;let f=0,h=0,m=!1,g=0,y=0,k=-1,v=0,C=null;function w(){k=-1,v=0,C=null}function M(I=g,O=y,H){f++,h=0,m=!1,w()}function L(I,O){m=!0,g=I+1,y=0,h=O}function E(I,O,H){m=!0,g=I,y=O+1,h=H}function S(I,O){m?(h+=O,g=I+1,y=0):L(I,O)}function x(I,O,H,R,F,P){if(!O)return;const z=mF(n,I,H,F);gF(n,I,H,F,R),k=H+1,v=h-P+z,C=I}function A(I,O){var H;const R=r[I],F=(H=l[I])!=null?H:null;let P=F===null?-1:Ry(F,0,O+1),z=-1,W=O;for(;Wd){if(F!==null&&z>O){M(I,z),W=z,P=Ry(F,P,W+1),z=-1;continue}M(),E(I,W,$)}else h=G,g=I,y=W+1}else E(I,W,$);const K=W+1;F!==null&&F[P]===K&&(z=K,P++),W++}m&&g===I&&y===R.length&&(g=I+1,y=0)}function T(I){f++,w()}for(let I=0;I=O.endSegmentIndex)));){const R=s[H],F=hF(R),P=Hbe(n,m,H),z=R==="tab"?jbe(h+P,n.tabStopAdvance):o[H],W=P+z,$=Wbe(n,R,H,P,z);if(R!=="soft-hyphen")if(m){if(h+$>d){const K=h+mF(n,R,H,P);if(gF(n,R,H,P,z),C==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&v<=d){M(k,0);continue}if(F&&K<=d){S(H,W),M(H+1,0),H++;continue}if(k>=0&&v<=d){if(g>k||g===k&&y>0){M();continue}const ne=k;M(ne,0),H=ne;continue}if($>d&&r[H]!==null){M(),A(H,0),H++;continue}M();continue}S(H,W),x(R,F,H,z,P,W),H++}else $>d&&r[H]!==null?A(H,0):L(H,z),x(R,F,H,z,P,W),H++;else m&&(g=H+1,y=0,k=H+1,v=h+a,C=R),H++}m&&(O.consumedEndSegmentIndex,M(O.consumedEndSegmentIndex,0))}return f})(e,t)}let A8=null;function Gx(){return A8===null&&(A8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),A8}function Kbe(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=jA(d),l=G4.has(d)}function c(d,f){i.push(d),s=s||f;const h=jA(d);r=d.length===1&&yp.has(d)&&r||h,l=!1}for(const d of Gx().segment(e)){const f=d.segment,h=tc(f);i.length!==0?l||Ux.has(f)||yp.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 Zbe(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&&!Iq(t[l-1].text,n)&&r(l),o<0&&(o=l),s=s||tc(a.text)}return r(t.length),i}function vF(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=Gx();for(const o of i.segment(e))n++;return n}function Gbe(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Qbe(e,t,n,i,o){const s=bb(),{cache:r,emojiCorrection:l}=(function(T,I){HA().font=T;const O=(function(F){let P=dF.get(F);return P||(P=new Map,dF.set(F,P)),P})(T),H=(function(F){const P=F.match(/(\d+(?:\.\d+)?)\s*px/);return P?parseFloat(P[1]):16})(T),R=I?(function(F,P){let z=fF.get(F);if(z!==void 0)return z;const W=HA();W.font=F;const $=W.measureText("😀").width;if(z=0,$>P+.5&&typeof document<"u"&&document.body!==null){const K=document.createElement("span");K.style.font=F,K.style.display="inline-block",K.style.visibility="hidden",K.style.position="absolute",K.textContent="😀",document.body.appendChild(K);const ne=K.getBoundingClientRect().width;document.body.removeChild(K),$-ne>.5&&(z=$-ne)}return fF.set(F,z),z})(T,H):0;return{cache:O,fontSize:H,emojiCorrection:R}})(t,(a=e.normalized,Bbe.test(a)));var a;const u=mh("-",Nd("-",r),l)+(o===0?0:2*o),c=8*mh(" ",Nd(" ",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 y=e.chunks.length<=1&&!d;const k=null,v=[],C=[],w=[],M=null,L=Array.from({length:e.len});function E(T,I,O,H,R,F,P,z,W){R!=="text"&&R!=="space"&&R!=="zero-width-break"&&(y=!1),f.push(I),h.push(O),m.push(H),g.push(R),v.push(P),C.push(z),d&&w.push(W)}function S(T,I,O,H,R){const F=Nd(T,r),P=d?vF(T,I):0,z=(function(ne,G,te){return G>1?ne+(G-1)*te:ne})(mh(T,F,l),P,o),W=I==="space"||I==="preserved-space"||I==="zero-width-break"?0:z,$=W===0?0:W+(P>0?o:0),K=I==="space"||I==="zero-width-break"?0:z;if(R&&H&&T.length>1){let ne="sum-graphemes";o!==0?ne="segment-prefixes":V9(T)?ne="pair-context":s.preferPrefixWidthsForBreakableRuns&&(ne="segment-prefixes");const G=(function(le,ie,_e,Z,se){if(ie.breakableFitAdvances!==void 0&&ie.breakableFitMode===se)return ie.breakableFitAdvances;ie.breakableFitMode=se;const he=Tq(),Y=[];for(const ue of he.segment(le))Y.push(ue.segment);if(Y.length<=1)return ie.breakableFitAdvances=null,ie.breakableFitAdvances;if(se==="sum-graphemes"){const ue=[];for(const me of Y){const pe=Nd(me,_e);ue.push(mh(me,pe,Z))}return ie.breakableFitAdvances=ue,ie.breakableFitAdvances}if(se==="pair-context"||Y.length>96){const ue=[];let me=null,pe=0;for(const ee of Y){const re=mh(ee,Nd(ee,_e),Z);if(me===null)ue.push(re);else{const ge=me+ee,ae=Nd(ge,_e);ue.push(mh(ge,ae,Z)-pe)}me=ee,pe=re}return ie.breakableFitAdvances=ue,ie.breakableFitAdvances}const J=[];let U="",Q=0;for(const ue of Y){U+=ue;const me=mh(U,Nd(U,_e),Z);J.push(me-Q),Q=me}return ie.breakableFitAdvances=J,ie.breakableFitAdvances})(T,F,r,l,ne),te=G===null||i==="keep-all"?null:(function(le){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(le))return null;const ie=[];let _e=0;for(const Z of Gx().segment(le))_e++,Gbe(Z.segment)&&ie.push(_e);return ie.length===0?null:ie})(T);return void E(T,z,$,K,I,O,G,te,P)}E(T,z,$,K,I,O,null,null,P)}for(let T=0;T=55296&&le<=56319&&te+1=56320&&se<=57343&&(ie=se-56320+(le-55296<<10)+65536,_e=2)}const Z=sbe(ie);Z!=="R"&&Z!=="AL"&&Z!=="AN"||(z=!0);for(let se=0;se<_e;se++)P[te+se]=Z;te+=_e}if(!z)return null;let W=0;for(let te=0;te=0&&P[le]==="ET";le--)P[le]="EN";for(le=te+1;le0?P[te-1]:ne)!=="L"?"R":"L";if(ie===((le{const e=globalThis;if(e[x8])return e[x8];const t={configs:{},controllers:{},revision:_u(0),preparedCache:new Map,blockEstimateCache:new Map};return e[x8]=t,t})();let Bg=null;const S8=_s.revision;function yF(e){var t;return e&&(t=_s.configs[e])!=null?t:null}function kF(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function Jbe(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(!Jbe(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 I8(e,t,n){var i,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var s;if(Bg!=null)return Bg;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return Bg=!!((s=r.getContext)!=null&&s.call(r,"2d")),Bg}catch{return Bg=!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=_s.blockEstimateCache.get(r);if(l)return _s.blockEstimateCache.delete(r),_s.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 y=`${g}\0${m}\0${h}`,k=_s.preparedCache.get(y);if(k)return _s.preparedCache.delete(y),_s.preparedCache.set(y,k),k.prepared;const v=(function(C,w,M){return(function(L,E,S,x){var A,T;const I=(A=x?.wordBreak)!=null?A:"normal",O=(T=x?.letterSpacing)!=null?T:0;return Qbe(Obe(L,bb(),x?.whiteSpace,I),E,!1,I,O)})(C,w,0,M)})(h,m,{whiteSpace:g});for(_s.preparedCache.set(y,{prepared:v});_s.preparedCache.size>240;){const C=_s.preparedCache.keys().next().value;if(!C)break;_s.preparedCache.delete(C)}return v})(e,n.font,a),c=(function(h,m,g){const y=Vbe(h,m);return{lineCount:y,height:y*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(_s.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});_s.blockEstimateCache.size>4e3;){const h=_s.blockEstimateCache.keys().next().value;if(!h)break;_s.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function Eq(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?I8(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?I8(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?I8(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=Eq(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 $g(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function gh(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function M8(e,t,n=0){return e.diff?Wx(t??{},n)?(function(i){const o=gh(i.raw);if(o){const s=o.split(/\r?\n/);return i.originalCode!=null||i.updatedCode!=null?Math.max(1,s.filter(r=>!Ybe.some(l=>r.startsWith(l))).length):Math.max(1,s.length)}return $g(gh(i.originalCode))+$g(gh(i.updatedCode))})(e):(function(i){const o=i.originalCode,s=i.updatedCode;if(o!=null||s!=null)return Math.max($g(gh(o)),$g(gh(s)));const r=gh(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):$g(gh(e.code,e.loading===!0))}function Xbe(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=kF(i.lineHeight,1.5*kF(i.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:Xbe(i),lineHeight:s,wrapperOverhead:Math.max(0,o-s),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const e4e=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function bF(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))e4e.has(r)||o.has(r)||l.enumerable&&"value"in l&&(i[r]=l.value);return i}function wF(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 CF(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 AF(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const Lq=Symbol("MarkstreamMathBlockMinHeightCache");function U8t(){return en(Lq,null)}const t4e=new Set(["text","inline_code","emoji","footnote_reference"]),n4e=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function zg(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function vh(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 Nq(e){var t;if(!e||typeof e!="object")return!1;const n=e,i=String((t=n.type)!=null?t:"");if(t4e.has(i))return!0;if(!n4e.has(i))return!1;const o=n.children;return!Array.isArray(o)||!o.length||o.every(Nq)}function WA(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(WA).filter(Boolean).join(" ");m&&d.push(m)}}return d.join(" ").replace(/\s+/g," ").trim()}function Fq(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(Fq)})}function i4e(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 o4e(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 y=e,k=String((n=y.type)!=null?n:""),v=Number.isFinite(t)&&t>0?t:640;switch(k){case"heading":return(function(C){var w;const M=Number((w=C.level)!=null?w:C.depth);return M>=4?20:M===3?30:M===2?32:44})(y);case"paragraph":return(function(C,w){const M=String(C??"");if(!M)return 28;const L=Math.max(18,Math.floor(Math.max(320,w)/8)),E=M.split(/\r?\n/).length,S=Math.ceil(M.length/L);return Math.max(1,E,S)<=1?28:vh(M,w,34)})(String((o=(i=y.raw)!=null?i:y.content)!=null?o:""),v);case"list":return(function(C,w){var M;const L=Array.isArray(C.items)?C.items:[];if(!L.length)return 48;const E=Math.max(48,30*L.length+12);let S=12;for(const T of L)S+=i4e(WA(T)||String((M=T.raw)!=null?M:""),w);const x=Math.max(0,S-E);if(L.length>20){const T=Math.round(2.4*L.length);return Math.round(E+Math.max(T,Math.min(x,3*L.length)))}if(x<=0)return E;const A=L.length>8?8*L.length:x;return Math.round(E+Math.min(x,A))})(y,v);case"list_item":return vh(String((r=(s=y.raw)!=null?s:y.content)!=null?r:""),v,34);case"blockquote":return vh(String((a=(l=y.raw)!=null?l:y.content)!=null?a:""),v,56);case"table":return(function(C,w){const M=[...C.header?[C.header]:[],...Array.isArray(C.rows)?C.rows:[]];if(!M.length){const L=Array.isArray(C.children)?C.children.length:3;return Math.max(120,38*L+48)}return Math.max(120,Math.round(4+M.reduce((L,E)=>L+(function(S,x){const A=Math.max(1,S.length),T=Math.max(80,(x-32)/A),I=Math.max(10,Math.floor(T/8)),O=Math.max(1,...S.map(H=>{var R;const F=WA(H)||String((R=H?.raw)!=null?R:"");return Math.ceil(F.length/I)||1}));return 54+34*Math.max(0,O-1)+(A<=3&&S.some(Fq)?14:0)})((function(S){var x;return Array.isArray(S?.cells)&&(x=S.cells)!=null?x:[]})(E),w),0)))})(y,v);case"code_block":{const C=String((u=y.language)!=null?u:"").trim().toLowerCase(),w=String((d=(c=y.code)!=null?c:y.raw)!=null?d:"");return C==="mermaid"?fb(cb(w)):C==="infographic"?hb(db(w)):vh(w,v,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(C,w){var M,L,E;const S=C.match(/^\s*]*)>/i);return S&&!/(?:^|\s)open(?:\s|=|$)/i.test((M=S[1])!=null?M:"")?vh(((E=(L=C.match(/]*>([\s\S]*?)<\/summary>/i))==null?void 0:L[1])==null?void 0:E.replace(/<[^>]*>/g,"").trim())||"Details",w,28,28):vh(C,w,96)})(String((h=(f=y.raw)!=null?f:y.content)!=null?h:""),v);case"thematic_break":return 24;default:return vh(String((g=(m=y.raw)!=null?m:y.content)!=null?g:""),v,40)}}function xF(e,t,n){return Math.min(Math.max(e,t),n)}const s4e=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],r4e=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","safeMarkdownMs","tokenizeMs","htmlBlockPassesMs","parseMarkdownToStructureTotalMs"],l4e=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),Dq=["raw","content","code","originalCode","updatedCode"],SF=new WeakMap,_F=new WeakMap;let a4e=1;function ou(){return typeof performance<"u"?performance.now():Date.now()}function IF(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function na(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=SF.get(t);return n||(n=a4e++,SF.set(t,n)),String(n)}function MF(e,t,n,i={}){var o,s;const r=i.includeFinal!==!1,l={md:na(t),customMarkdownIt:na(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(s=e.streamParse)!=null?s:"auto",validateLink:na(e.validateLink),preTransformTokens:na(e.preTransformTokens),postTransformTokens:na(e.postTransformTokens),postTransformNodes:na(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function TF(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 EF(e){const t=Rq(e);return t.length>=2&&t.every(n=>{const i=n.trim();return i.length>=1&&i.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function Rq(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function Oq(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function Qx(e){const t=String(e??"");return`${t.length}:${Oq(t)}`}function qA(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?Qx(r):`${r.length}:${Oq(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${na(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:${na(i)}`;const s=na(i);if(t.set(i,s),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>qA(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}:${qA(r[u],t,n+1)}`).join(";")}`}return typeof e}function wb(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function Pq(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(i=>wb(i)?Tf(i,t,n+1):Pq(i,t,n+1)).join(",")}`:wb(e)?Tf(e,t,n):qA(e,t,n)}function u4e(e,t,n){return Object.keys(e).sort().filter(i=>i!=="children"&&!Dq.includes(i)).map(i=>{const o=e[i];return typeof o=="string"?`${i}=s:${Qx(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${i}=${String(o)}`:typeof o=="function"?`${i}=fn:${na(o)}`:l4e.has(i)&&(Array.isArray(o)||typeof o=="object")?`${i}=${Pq(o,t,n+1)}`:o&&typeof o=="object"?`${i}=object:${na(o)}`:""}).filter(Boolean).join(";")}function c4e(e){return Dq.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${Qx(n)}`:""}).filter(Boolean).join(";")}function Tf(e,t=new WeakMap,n=0){const i=_F.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}:${na(o)}`;const r=na(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=>Tf(m,u,c+1)).join("|"):"";return[a.type,c4e(d),u4e(d,u,c),f.length,h].join(":")})(e,t,n);return _F.set(o,l),l}function Bq(e,t){return Tf(e)===Tf(t)}function Yx(e,t,n){const i=ou(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=ou()-i,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function LF(e,t,n){return Yx(t,n,()=>Tf(e))}function $q(e,t,n){return LF(e,n,"stabilizeSignatureMs")===LF(t,n,"stabilizeSignatureMs")}function Oy(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function NF(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function FF(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function d4e(e,t){return e.length===t.length&&e===t}function Jx(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=Jx(e,t)}),i??$q(e,t,n)}function p4e(e,t){const n={};for(const i of s4e){const o=e[i],s=t?.[i];typeof o=="number"&&(n[i]=o-(typeof s=="number"?s:0))}return n}function m4e(e,t){var n;const i=TN(t.instanceMsgId),o=new Map,s=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=q(t.renderContent.value);let l=[],a="",u="",c="",d=!1;const f=(function(){let H="",R=0,F=!1,P=!1,z=!1,W=!1;function $(){H="",R=0,F=!1,P=!1,z=!1,W=!1}function K(ne){let G=!1;for(let te=0;te{if(!ne||!G.startsWith(ne)||G.length<=ne.length)return $(),[!0,0];let te=0;H!==ne&&($(),K(ne),te=ne.length);const le=G.slice(ne.length),ie=K(le);return H=G,[ie,te+le.length]}})();let h,m=0,g=0,y=ou(),k=-1,v=0;function C(H){k=Number.isInteger(H)?H:0,v+=1}function w(){h&&(clearTimeout(h),h=void 0)}function M(){w();const H=t.renderContent.value;r.value!==H&&(r.value=H),y=ou()}ze([t.renderContent,t.effectiveFinal,s],([H,R,F])=>{r.value!==H&&(!F||R||(function(P,z){if(!P&&z||z.length<=80||z.length\s*|`{3,}|~{3,})/.test(W))||W.endsWith(` +`)&&!(function($){const K=TF($);if(EF(K))return!1;const ne=Rq(K);return ne.length>=2&&ne.some(G=>G.trim())})(z))})(r.value,H)?M():(function(){if(g+=1,h)return;const P=Math.max(0,(function(z){const W=z.parseCoalesceMs;return typeof W=="number"&&Number.isFinite(W)&&W>=0?W:80})(e)-(ou()-y));P<=0?M():h=setTimeout(M,P)})())},{flush:"sync",immediate:!0}),cd(w);const L=D(()=>{var H,R,F,P;return hme(e.customHtmlTags,(H=e.parseOptions)==null?void 0:H.customHtmlTags,(P=(F=(R=t.customComponentsMap)==null?void 0:R.value)!=null?F:{},Object.entries(P).map(([z,W])=>{const $=Va(z);return W==null||!$||v2($)||UH.has($)||f2.has($)?"":$}).filter(Boolean)))}),E=D(()=>{const{key:H,tags:R}=pme(L.value);if(!H)return i;const F=o.get(H);if(F)return F;const P=TN(t.instanceMsgId,{customHtmlTags:R});return o.set(H,P),P}),S=D(()=>{const H=E.value;if(!e.customMarkdownIt)return H;const R=e.customMarkdownIt(H);return H.__markstreamHasCustomParserExtensions=!0,R.__markstreamHasCustomParserExtensions=!0,R}),x=D(()=>{var H,R;const F=(H=e.parseOptions)!=null?H:{},P=t.effectiveFinal.value,z=L.value,W=P!=null,$=z.length>0;return W||$||F.streamParse==null?Bt(Bt(Dn(Bt({},F),{streamParse:(R=F.streamParse)==null||R}),W?{final:P}:{}),$?{customHtmlTags:z}:{}):F}),A=D(()=>{var H;return new Set(((H=x.value.customHtmlTags)!=null?H:[]).map(R=>String(R).trim().toLowerCase()).filter(Boolean))}),T=D(()=>MF(x.value,S.value,e.customMarkdownIt,{includeFinal:!0})),I=D(()=>MF(x.value,S.value,e.customMarkdownIt,{includeFinal:!1}));ze([T,I],([H,R],[F,P])=>{F&&(H===F&&R===P||(M(),R!==P&&(l=[],c="")))},{flush:"sync"});const O=D(()=>{var H,R,F,P,z,W,$,K,ne,G,te;if((H=e.nodes)!=null&&H.length)return l=[],c="",C(0),Lt(e.nodes.slice());const le=r.value;if(!le)return l=[],c="",C(-1),[];const ie=t.debugPerformanceEnabled.value,_e=ie?ou():0,Z=S.value,se=T.value,he=I.value;a&&se!==a&&(function(Ae){var Ne,Ze;(Ze=(Ne=Ae.stream)==null?void 0:Ne.reset)==null||Ze.call(Ne)})(Z),u&&he!==u&&(l=[],c="");const Y=Object.keys((F=(R=t.customComponentsMap)==null?void 0:R.value)!=null?F:{}).length>0||typeof x.value.postTransformNodes=="function";Y!==d&&(l=[],c="");const J=!Y&&l.length>0&&le.startsWith(c)&&he===u,U=ie?IF(Z):null,Q=ie?{}:void 0,ue=FF(Z),me=!ue&&!Y,pe=Bt(Bt(Dn(Bt({},x.value),{__reuseStableTopLevelNodes:me}),ue?{__disableStreamParse:!0}:{}),Q?{__timing:Q}:{}),ee=GW(le,Z,pe),re=ie?ou():0,ge=ie?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let ae,Ce=ie?Oy(ee.length):void 0,ve=0,ce=0,Te=0;if(J){const Ae=ie?ou():0,[Ne,Ze]=(function(pt){var Rt,Ot;const[Fe,Pe]=pt.scanGlobalReferenceAppend(pt.previousContent,pt.content),be=pt.parseOptions;return[pt.previousDirtyStartIndex>0&&be.final!==!0&&!pt.customMarkdownIt&&!FF(pt.md)&&!Fe&&typeof be.preTransformTokens!="function"&&typeof be.postTransformTokens!="function"&&typeof be.postTransformNodes!="function"&&((Ot=(Rt=be.customHtmlTags)==null?void 0:Rt.length)!=null?Ot:0)===0?pt.previousDirtyStartIndex:0,Pe]})({content:le,previousContent:c,previousDirtyStartIndex:k,parseOptions:x.value,customMarkdownIt:e.customMarkdownIt,md:Z,scanGlobalReferenceAppend:f});Te=Ze;const rt=Ne<=0;if(ge){const pt=(function(Rt,Ot,Fe,Pe={}){var be;if(!Ot.length)return{nodes:Rt,metrics:Oy(Rt.length)};const Oe=(be=Pe.scanStartIndex)!=null?be:0,Ke=Pe.reuseDirtyTail!==!1,Qe=(function(Se,We,ut,Tt=0){const tt=Math.min(Se.length,We.length);for(let Ve=Math.min(tt,Math.max(0,Tt));VeTf(Ae[rt]))})(ae,ge,ce):(function(Ae,Ne=0){for(let Ze=Math.max(0,Ne);Ze((z=U?.total)!=null?z:0);t.logPerf(Ne?"parse(stream)":"parse(sync)",Bt(Bt(Bt({rendererId:t.instanceMsgId,ms:Math.round(ou()-_e),nodes:ae.length,contentLength:le.length,parseCommitCount:m,parseCoalescedCount:g,nodeReuseMs:ke,referenceDefinitionScanChars:Te,signatureMs:(W=ge?.signatureMs)!=null?W:0,stabilizeSignatureMs:($=ge?.stabilizeSignatureMs)!=null?$:0,primeSignatureMs:(K=ge?.primeSignatureMs)!=null?K:0,signatureCallCount:(ne=ge?.signatureCallCount)!=null?ne:0,stabilizeSignatureCallCount:(G=ge?.stabilizeSignatureCallCount)!=null?G:0,primeSignatureCallCount:(te=ge?.primeSignatureCallCount)!=null?te:0,stabilizeMs:ve},Ce??{}),Q?Object.fromEntries(r4e.map(Ze=>{var rt;return[Ze,(rt=Q[Ze])!=null?rt:0]})):{}),Ae?{streamMode:Ae.lastMode,streamDelta:p4e(Ae,U),streamStats:Ae}:{}))}return Lt(ae)});return{effectiveCustomHtmlTags:L,effectiveCustomHtmlTagsSet:A,mdBase:E,mdInstance:S,mergedParseOptions:x,getParsedNodesDirtyStartIndex:()=>k,getParsedNodesRevision:()=>v,parsedNodes:O}}function g4e(e){const{isClient:t}=e,n=q(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 y=n.value,k=y.has(f);if(h){if(k)return;const C=new Set(y);return C.add(f),void(n.value=C)}if(!k)return;const v=new Set(y);v.delete(f),n.value=v})(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 jm()&&cd(()=>{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 y4e={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},DF=/auto|scroll|overlay/i;function k4e(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return DF.test(t)||DF.test(n)}function b4e(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 w4e={class:"m-0 p-0"},C4e=["data-probe"],A4e=Ei(ot(Dn(Bt({},{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)=>(b(),N("div",{class:"height-estimation-probes",style:on({width:`${e.width}px`}),"aria-hidden":"true"},[_("div",{ref:s=>e.setParagraphWrapper(s),class:De(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[V(p(rp),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),_("div",{ref:s=>e.setListItemWrapper(s),class:De(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[_("ul",w4e,[V(p(am),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),_("div",{ref:s=>e.setListWrapper(s),class:De(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[V(p(um),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(b(),N(Le,null,Ct(6,s=>_("div",{key:`probe-heading-${s}`,ref_for:!0,ref:r=>e.setHeadingWrapper(s,r),class:De(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${s}`},[V(p(Z4),{node:n(s),"index-key":`probe-heading-${s}`},null,8,["node","index-key"])],10,C4e)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),RF=ot({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 hb((i=O1(e.estimatedPreviewHeightPx))!=null?i:db(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"})])])])}}}),OF=ot({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 fb((i=O1(e.estimatedPreviewHeightPx))!=null?i:cb(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"}})])])}}}),x4e={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 Vs(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 S4e=["data-custom-id"],_4e=["data-node-index","data-node-type"],PF="typewriter-simple-cursor-target",zq=Ei(ot(Dn(Bt({},{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(j){if(!(typeof Event<"u"&&j instanceof Event))return typeof j=="string"&&o("copy-code",j),void o("copy",j)}const r=gs(),l=en("markstreamNestedRendererProps",void 0);function a(j){const oe=r?.vnode.props;return!!oe&&(Object.prototype.hasOwnProperty.call(oe,j)||Object.prototype.hasOwnProperty.call(oe,String(j).replace(/[A-Z]/g,ye=>`-${ye.toLowerCase()}`)))}function u(j){var oe,ye;const we=i[j];return a(j)?we:(ye=(oe=l?.value)==null?void 0:oe[j])!=null?ye:we}const c=D(()=>{return(j=u("mode"))==="chat"||j==="minimal"||j==="docs"?j:"docs";var j}),d=D(()=>AF(u("typewriter"))),f=D(()=>d.value!=="off"),h=D(()=>u("domMode")==="minimal"?"minimal":"full"),m=D(()=>{return(j={mode:c.value,codeRenderer:u("codeRenderer"),renderCodeBlocksAsPre:u("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":j.codeRenderer==="pre"||j.codeRenderer==="shiki"||j.codeRenderer==="monaco"?j.codeRenderer:j.renderCodeBlocksAsPre===!1||j.mode==="docs"?"monaco":"pre";var j}),g=D(()=>x4e[c.value]),y=D(()=>{var j;return(j=u("showTooltips"))!=null?j:g.value.showTooltips}),k=D(()=>{var j;return(j=u("fade"))!=null?j:g.value.fade}),v=D(()=>{var j;return(j=u("batchRendering"))!=null?j:g.value.batchRendering}),C=D(()=>{var j;return(j=u("initialRenderBatchSize"))!=null?j:g.value.initialRenderBatchSize}),w=D(()=>{var j;return(j=u("renderBatchSize"))!=null?j:g.value.renderBatchSize}),M=D(()=>{var j;return(j=u("renderBatchDelay"))!=null?j:g.value.renderBatchDelay}),L=D(()=>{var j;return(j=u("renderBatchBudgetMs"))!=null?j:g.value.renderBatchBudgetMs}),E=D(()=>{var j;return(j=u("renderBatchIdleTimeoutMs"))!=null?j:g.value.renderBatchIdleTimeoutMs}),S=D(()=>{var j;return(j=u("deferNodesUntilVisible"))!=null?j:g.value.deferNodesUntilVisible}),x=D(()=>{var j;return(j=u("maxLiveNodes"))!=null?j:g.value.maxLiveNodes}),A=D(()=>{var j;return(j=u("liveNodeBuffer"))!=null?j:g.value.liveNodeBuffer}),T=D(()=>{var j;return(j=u("nodeVirtual"))!=null?j: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 y.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 k.value},get batchRendering(){return v.value},get initialRenderBatchSize(){return C.value},get renderBatchSize(){return w.value},get renderBatchDelay(){return M.value},get renderBatchBudgetMs(){return L.value},get renderBatchIdleTimeoutMs(){return E.value},get deferNodesUntilVisible(){return S.value},get maxLiveNodes(){return x.value},get liveNodeBuffer(){return A.value},get nodeVirtual(){return T.value},get virtualScroll(){return i.virtualScroll},get renderAsFragment(){return i.renderAsFragment}};function O(j){o("height-change",j)}function H(j){o("virtual-state-change",j)}function R(j){o("anchor-change",j)}const F=q(),P=q(null),z=q(null),W=q(null),$=po({1:null,2:null,3:null,4:null,5:null,6:null}),K=q(!1),ne=new Map,G=q(0),te=q(0),le=q({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ie(j,oe){return typeof j!="string"?oe:j.trim()||oe}function _e(j){const oe=Number(j);return Number.isFinite(oe)&&oe>0?Math.max(1,Math.trunc(oe)):640}const Z=D(()=>{var j;const oe=(j=I.viewportPriorityOptions)!=null?j:{},ye=ie(oe.rootMargin,gp);return{rootMargin:ye,heavyBlockMargin:ie(oe.heavyBlockMargin,ye),maxTargets:_e(oe.maxTargets)}}),se=D(()=>{var j;return(j=Z.value.rootMargin)!=null?j:gp}),he=D(()=>{var j;return(j=Z.value.maxTargets)!=null?j:640});function Y(){var j,oe;if(((j=i.virtualScroll)==null?void 0:j.enabled)!==!0)return null;const ye=(oe=i.virtualScroll)==null?void 0:oe.scrollRoot;return J(typeof ye=="function"?ye():ye)}function J(j){return j?typeof HTMLElement<"u"&&j instanceof HTMLElement?j:typeof j=="object"&&"value"in j?J(j.value):typeof j=="object"&&"$el"in j?J(j.$el):null:null}Gn(Aq,Z);const{isClient:U,renderAsFragment:Q,debugPerformanceEnabled:ue,resolvedShowTooltips:me,resolvedHtmlPolicy:pe,inheritedSmoothStreaming:ee,ownsTypewriterCursor:re}=(function(j){const oe=typeof window<"u",ye=qm(),we=en("markstreamHtmlPolicy",void 0),Ee=en("markstreamTypewriterCursor",void 0),He=en("markstreamSmoothStreaming",void 0),Je=D(()=>j.renderAsFragment===!0),nt=D(()=>!!(j.debugPerformance&&oe&&typeof console<"u")),vt=D(()=>{var gt;if(typeof j.showTooltips=="boolean")return j.showTooltips;const Xe=(gt=ye.showTooltips)!=null?gt:ye["show-tooltips"];return Xe===""||Xe===!0||Xe==="true"||Xe!==!1&&Xe!=="false"&&void 0}),it=D(()=>{var gt,Xe;return(Xe=(gt=j.htmlPolicy)!=null?gt:we?.value)!=null?Xe:"safe"}),lt=D(()=>Ee?.value!==!0);return{isClient:oe,renderAsFragment:Je,debugPerformanceEnabled:nt,resolvedShowTooltips:vt,resolvedHtmlPolicy:it,inheritedSmoothStreaming:He,inheritedTypewriterCursor:Ee,ownsTypewriterCursor:lt}})(I),{resolveViewportRoot:ge,resolveScrollContainer:ae,isReverseFlexScrollRoot:Ce,getNormalizedScrollTop:ve,getOffsetTopWithinRoot:ce}=(function(j,oe){function ye(){var nt,vt;return(vt=(nt=oe.scrollRoot)==null?void 0:nt.call(oe))!=null?vt:null}function we(nt){if(typeof window>"u")return null;const vt=ye();if(vt)return vt;const it=nt??j.value;if(!it)return null;const lt=it.ownerDocument||document,gt=lt.scrollingElement||lt.documentElement;let Xe=it;for(;Xe&&Xe!==lt.body&&Xe!==gt;){if(k4e(window.getComputedStyle(Xe))&&b4e(Xe))return Xe;Xe=Xe.parentElement}return null}function Ee(nt){if(!oe.isClient)return!1;try{const vt=window.getComputedStyle(nt);return!!(vt.display||"").toLowerCase().includes("flex")&&(vt.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function He(nt,vt,it){var lt,gt;if(it)return Je(vt);const Xe=nt.scrollTop;if(!Ee(nt))return Xe;const at=Xe<0?-Xe:Xe;return Math.max(0,((lt=nt.scrollHeight)!=null?lt:0)-((gt=nt.clientHeight)!=null?gt:0))-at}function Je(nt){var vt,it,lt,gt,Xe;const at=Number((vt=nt.scrollingElement)==null?void 0:vt.scrollTop),It=Number((lt=(it=nt.documentElement)==null?void 0:it.scrollTop)!=null?lt:0),At=Number((Xe=(gt=nt.body)==null?void 0:gt.scrollTop)!=null?Xe:0);return Math.max(0,Number.isFinite(at)?at:0,Number.isFinite(It)?It:0,Number.isFinite(At)?At:0)}return{resolveViewportRoot:we,resolveScrollContainer:function(nt){var vt,it,lt,gt;const Xe=ye();if(Xe)return Xe;const at=we((vt=nt??j.value)!=null?vt:null);if(at)return at;const It=(gt=(lt=nt?.ownerDocument)!=null?lt:(it=j.value)==null?void 0:it.ownerDocument)!=null?gt:typeof document<"u"?document:null;return It?.scrollingElement||It?.documentElement||null},isReverseFlexScrollRoot:Ee,getNormalizedScrollTop:He,getOffsetTopWithinRoot:function(nt,vt){const it=vt.ownerDocument||nt.ownerDocument||document;if((function(at,It){return at===It.documentElement||at===It.body||at===It.scrollingElement})(vt,it))return nt.getBoundingClientRect().top+Je(it);const lt=vt.getBoundingClientRect(),gt=nt.getBoundingClientRect(),Xe=He(vt,it,!1);return gt.top-lt.top+Xe}}})(F,{isClient:U,scrollRoot:Y});Gn("markstreamShowTooltips",me),Gn("markstreamHtmlPolicy",pe),Gn("markstreamTypewriter",f),Gn("markstreamFade",D(()=>I.fade!==!1)),Gn("markstreamTypewriterCursor",D(()=>!0)),Gn("markstreamTextStreamState",ne),Gn("markstreamStreamVersion",G),Gn("markstreamParseOptions",D(()=>I.parseOptions)),Gn("markstreamCustomMarkdownIt",D(()=>I.customMarkdownIt));const{smoothStreamingEnabled:Te,renderContent:ke,requestedFinal:Ae,effectiveFinal:Ne}=(function(j,oe){const ye=v4e(Bt(Bt({},y4e),j.smoothStreamingOptions)),we=D(()=>{var Xe,at,It;return j.smoothStreaming!==!1&&!((Xe=j.nodes)!=null&&Xe.length)&&(j.smoothStreaming===!0||!((at=oe.inheritedSmoothStreaming)!=null&&at.value))&&(j.smoothStreaming===!0||AF(j.typewriter)!=="off"||((It=j.maxLiveNodes)!=null?It:0)<=0)}),Ee=q(!oe.isClient||j.smoothStreaming===!0);gn(()=>{Ee.value=!0});const He=D(()=>Ee.value&&we.value),Je=D(()=>{var Xe;return He.value?ye.visible.value:(Xe=j.content)!=null?Xe:""}),nt=D(()=>{var Xe,at;const It=(Xe=j.parseOptions)!=null?Xe:{};return(at=j.final)!=null?at:It.final}),vt=D(()=>{const Xe=nt.value;return He.value&&Xe!=null?!!Xe&&ye.caughtUp.value:Xe});let it=0,lt=!1;function gt(){it=0,lt=!1}return ze([()=>j.content,()=>j.nodes,He,nt],([Xe,at,It,At])=>{if(at?.length)return gt(),void ye.reset("");const Ut=Xe??"";if(!It)return gt(),ye.reset(Ut),void(At&&ye.finish({flush:!0}));const Dt=ye.source.value;if(Ut){if(Ut!==Dt)if(Ut.startsWith(Dt)){const rn=Ut.slice(Dt.length),cn=ye.pendingChars.value;rn.length<=8?(it++,lt||it>=2&&cn<=8?(lt=!0,ye.reset(Ut)):ye.enqueue(rn)):(gt(),ye.enqueue(rn))}else gt(),ye.reset(Ut)}else gt(),ye.reset("");At&&ye.finish()},{immediate:!0}),{smoothStream:ye,smoothStreamingEligible:we,smoothStreamingEnabled:He,renderContent:Je,requestedFinal:nt,effectiveFinal:vt}})(I,{isClient:U,inheritedSmoothStreaming:ee}),Ze=Ae.value===!0;Gn("markstreamSmoothStreaming",Te);const rt=q(!1),pt=q(!1),Rt=q(!1);let Ot="",Fe=!1,Pe=null;function be(){U&&Pe!=null&&(window.clearTimeout(Pe),Pe=null)}function Oe(){rt.value=!1,be()}function Ke(j,oe){if(!ue.value)return;const ye=(function(){if(!ue.value)return null;const we=We(Qe),Ee=We(mt),He=Math.max(Se,Ee);if(we<=0&&He<=0)return null;const Je={total:we,maxPerFrame:He,byLabel:(nt=Qe,Object.fromEntries(Array.from(nt.entries()).sort((vt,it)=>it[1]-vt[1]||vt[0].localeCompare(it[0]))))};var nt;return Qe.clear(),mt.clear(),Se=0,Je})();console.info(`[markstream-vue][perf] ${j}`,ye?Dn(Bt({},oe),{layoutReads:ye}):oe)}ze([()=>I.indexKey,()=>I.customId],()=>{var j,oe;Oe(),pt.value=!1,Rt.value=!((j=i.nodes)!=null&&j.length)&&Ae.value!==!0&&!!i.content,Ot=(oe=ke.value)!=null?oe:"",Fe=Ot.length>0},{flush:"sync"}),ze([()=>i.content,()=>i.nodes,Ae],([j,oe,ye])=>{!oe?.length&&ye!==!0&&j&&(Rt.value=!0)},{flush:"sync",immediate:!0}),ze([ke,()=>i.nodes,Ae],([j,oe,ye])=>{const we=j??"";return oe?.length||ye===!0?(Oe(),pt.value=!1,Ot=we,void(Fe=!0)):(we.length>0&&(Rt.value=!0),Fe?(Ot&&we.length>Ot.length&&we.startsWith(Ot)?(rt.value=!0,pt.value=!0,U&&(be(),Pe=window.setTimeout(()=>{var Ee;Pe=null,Ne.value===!0||(Ee=i.nodes)!=null&&Ee.length||(Gp(),rt.value=!1,_c())},1200))):(we.length"u")return null;const He=window;if(He.__markstreamLayoutReadPerformance)return He.__markstreamLayoutReadPerformance;const Je={total:0,maxPerFrame:0,byLabel:{}};return He.__markstreamLayoutReadPerformance=Je,Je})();Ee&&(Ee.total=Number(Ee.total||0)+1,Ee.byLabel[we]=Number(Ee.byLabel[we]||0)+1,Ee.currentFrameTotal=Number(Ee.currentFrameTotal||0)+1,Ee.frameScheduled||(Ee.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>Tt(Ee),0):queueMicrotask(()=>Tt(Ee)):window.requestAnimationFrame(()=>Tt(Ee))))})(j),dt||(dt=!0,U&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(ut):typeof queueMicrotask!="function"?setTimeout(ut,0):queueMicrotask(ut)))}function Ve(j,oe){return tt(j),oe()}const kt=I.customId?`renderer-${I.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Wt=(function(j){const oe=new Map;return{scope:j,cache:oe,clear:()=>oe.clear()}})(kt),Nn=kt;Gn(Lq,Wt);const Sn=vs(()=>I.customId),{effectiveCustomHtmlTagsSet:Yi,mergedParseOptions:Ji,parsedNodes:Zt,getParsedNodesDirtyStartIndex:Ro,getParsedNodesRevision:Js}=m4e(I,{instanceMsgId:kt,renderContent:ke,effectiveFinal:Ne,smoothStreamingEnabled:Te,debugPerformanceEnabled:ue,customComponentsMap:Sn,logPerf:Ke});ze(Zt,()=>{rt.value||Wt.clear(),G.value+=1},{immediate:!0});const ji=D(()=>({customId:I.customId,customHtmlTags:Ji.value.customHtmlTags,parseOptions:I.parseOptions,customMarkdownIt:I.customMarkdownIt,htmlPolicy:pe.value,viewportPriority:I.viewportPriority,viewportPriorityOptions:Z.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:me.value,themes:I.themes,langs:I.langs,isDark:I.isDark,typewriter:f.value,smoothStreamingOptions:I.smoothStreamingOptions,parseCoalesceMs:I.parseCoalesceMs,fade:I.fade}));Gn("markstreamNestedRendererProps",ji);const Fr=D(()=>Zt.value),Oo=D(()=>Zt.value.length),pr=q(null),Zo=q(null),Po=q(null),fo=q(null),Ps=i.indexKey!=null&&String(i.indexKey).startsWith("list-item-"),$l=!Ps&&I.customId?yF(I.customId):null,mr=D(()=>$l?(S8.value,yF(I.customId)):null),Ue=D(()=>{var j;return!!(!Q.value&&I.customId&&!Ps&&((j=mr.value)!=null&&j.enabled))}),Ge=D(()=>!!(U&&Ue.value)),Ye=D(()=>{var j;return!!(!Q.value&&((j=i.virtualScroll)!=null&&j.enabled))}),fn=D(()=>Ye.value),xt=q(!1);gn(()=>{xt.value=!0});const hn=D(()=>!!(U&&Ye.value));Gn("markstreamHostScrollManaged",hn);const So=D(()=>!!(xt.value&&hn.value)),ei=D(()=>Ge.value||hn.value),Li=D(()=>Ge.value||So.value),Mt=D(()=>{var j;return ei.value&&((j=mr.value)==null?void 0:j.textEstimation)!==!1});function ht(){const j=te.value||Ve("getMeasuredContainerWidth.clientWidth",()=>{var oe;return((oe=F.value)==null?void 0:oe.clientWidth)||0});return Number.isFinite(j)&&j>0?j:0}const $t=D(()=>{const j=ht();return j>0?Math.max(1,Math.round(j)):640}),Vt=D(()=>{var j,oe;return!(Ne.value!==!0||Ye.value||c.value!=="chat"&&c.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||(j=i.nodes)!=null&&j.length||Rt.value||!(((oe=I.maxLiveNodes)!=null?oe:0)<=0))}),Un=D(()=>{var j;return Vt.value?50:Math.max(1,(j=I.maxLiveNodes)!=null?j:320)}),Ri=D(()=>{var j;return Vt.value?16:Math.max(0,(j=I.liveNodeBuffer)!=null?j:60)}),An=D(()=>{var j;return!Q.value&&I.nodeVirtual!==!1&&!(((j=I.maxLiveNodes)!=null?j:0)<=0&&!Vt.value)&&(I.nodeVirtual===!0?Zt.value.length>0:Zt.value.length>Un.value)}),Ga=D(()=>An.value||Ge.value||hn.value),va=D(()=>I.viewportPriority!==!1),Xf=D(()=>!!va.value&&!K.value);var Dr;Dr=D(()=>va.value),Gn(xq,Dr);const zl=D(()=>{var j;return!(Q.value||I.deferNodesUntilVisible===!1||((j=I.maxLiveNodes)!=null?j:0)<=0||An.value||Zt.value.length>900||I.viewportPriority===!1)}),gr=Q9e(j=>{var oe;return ge((oe=j??F.value)!=null?oe:null)},va),{requestFrame:Go,cancelFrame:Xi,hasIdleCallback:vr,isTestEnv:yr}=(function(j){const oe=j.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,ye=j.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,we=j.isClient&&typeof window.requestIdleCallback=="function",Ee=(function(){var He;if(typeof globalThis>"u"||!("process"in globalThis))return;const Je=(He=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:He.value;return Je?.env})();return{requestFrame:oe,cancelFrame:ye,hasIdleCallback:we,isTestEnv:Ee?.NODE_ENV==="test"}})({isClient:U}),Qa=D(()=>Ne.value===!0&&!Ye.value),{resolvedBatchSize:jl,resolvedInitialBatch:ol,batchingEnabled:Eu,incrementalRenderingActive:ya,renderedCount:Bs,previousRenderContext:Bo,adaptiveBatchSize:ks,previousBatchConfig:Hl}=(function(j,oe){var ye;const we=D(()=>{var gt;const Xe=Math.trunc((gt=j.renderBatchSize)!=null?gt:80);return Number.isFinite(Xe)?Math.max(0,Xe):0}),Ee=D(()=>{var gt;const Xe=Math.trunc((gt=j.initialRenderBatchSize)!=null?gt:we.value);return Number.isFinite(Xe)?Math.max(0,Xe):we.value}),He=D(()=>!oe.renderAsFragment.value&&j.batchRendering!==!1&&we.value>0&&oe.isClient&&!oe.isTestEnv),Je=q(0),nt=q({key:j.indexKey,total:0}),vt=q(Math.max(1,we.value||1)),it=D(()=>{var gt,Xe,at;return He.value&&!((gt=oe.continuousStreaming)!=null&>.value)&&!((Xe=oe.forceFullRenderFinalContent)!=null&&Xe.value)&&((at=j.maxLiveNodes)!=null?at:0)<=0}),lt=q({batchSize:we.value,initial:Ee.value,delay:(ye=j.renderBatchDelay)!=null?ye:16,enabled:it.value});return{resolvedBatchSize:we,resolvedInitialBatch:Ee,batchingEnabled:He,incrementalRenderingActive:it,renderedCount:Je,previousRenderContext:nt,adaptiveBatchSize:vt,previousBatchConfig:lt}})(I,{isClient:U,isTestEnv:yr,renderAsFragment:Q,forceFullRenderFinalContent:Qa,continuousStreaming:D(()=>pt.value&&Ne.value!==!0)}),bs=D(()=>{var j;return!Q.value&&I.batchRendering!==!1&&jl.value>0&&!yr&&((j=I.maxLiveNodes)!=null?j:0)<=0&&!Qa.value}),Ai=D(()=>bs.value),$o=D(()=>ei.value||Ai.value),Hi=D(()=>{var j;return $o.value&&((j=mr.value)==null?void 0:j.codeBlockEstimation)!==!1}),xi=new Map,Rr=new Map,Ya=new WeakMap;let zo=null;const Ja=new WeakMap,_o=new Map,sl=[];let Qo=[],vo=[],ai=-1;const ws=_u(sl),Xs=new Set,Or=q(0);let kr=0;const bc=q(0),wc=D(()=>(bc.value,Array.from(xi.entries()).sort((j,oe)=>j[0]-oe[0]))),Xa=q(null),jo=q(null);let Cs,Pr=null,br=0,Io=null;function ui(){Cs.markFallbackHeightPrefixDirty()}function Br(j){return Cs.getFallbackNodeHeight(j)}function $s(j,oe){return Cs.estimateHeightRange(j,oe)}function Wl(j){return Cs.estimateIndexForOffset(j)}const{activeRestoreAnchor:lo,getRelativeScrollTopWithinContainer:Lu,setRelativeScrollTopWithinContainer:ka,resolveAnchorOffset:md,clearRestoreReconcile:ql,scheduleRestoreReconcile:ba,captureRestoreAnchor:wr,restoreAnchor:wa,getAnchorDrift:As}=(function(j){const{isClient:oe,containerRef:ye,parsedNodeCount:we,requestFrame:Ee,cancelFrame:He,resolveScrollContainer:Je,getNormalizedScrollTop:nt,getOffsetTopWithinRoot:vt,isReverseFlexScrollRoot:it,estimateIndexForOffset:lt,estimateHeightRange:gt,getFallbackNodeHeight:Xe,clamp:at}=j,It=q(null);let At=null,Ut=[];function Dt(){const Cn=Je(),Wn=ye.value;if(!Cn||!Wn)return null;const Jn=Cn.ownerDocument||Wn.ownerDocument||document;if(Cn===Jn.documentElement||Cn===Jn.body||Cn===Jn.scrollingElement){const Oi=Wn.getBoundingClientRect();return Math.max(0,-Oi.top)}return Math.max(0,nt(Cn,Jn,!1)-vt(Wn,Cn))}function rn(Cn){var Wn;const Jn=Je(),Oi=ye.value;if(!Jn||!Oi)return;const er=Math.max(0,Cn),Us=Jn.ownerDocument||Oi.ownerDocument||document,nu=Us.defaultView||(typeof window<"u"?window:null);if(Jn===Us.documentElement||Jn===Us.body||Jn===Us.scrollingElement){const Ru=nt(Jn,Us,!0)+Oi.getBoundingClientRect().top;return void((Wn=nu?.scrollTo)==null||Wn.call(nu,0,Math.max(0,Ru+er)))}wF(Jn,Us,vt(Oi,Jn)+er,{isReverseFlexScrollRoot:Ru=>{var _g;return(_g=it?.(Ru))!=null&&_g},getNormalizedScrollTop:nt})}function cn(Cn){const Wn=we.value,Jn=at(Cn.nodeIndex,0,Math.max(0,Wn-1));return gt(0,Jn)+Math.max(0,Cn.offsetWithinNodePx)}function wn(){if(At!=null&&(He?.(At),At=null),oe)for(const Cn of Ut)window.clearTimeout(Cn);Ut=[]}function yn(Cn){const Wn=cn(Cn),Jn=Dt();Jn!=null&&Math.abs(Jn-Wn)<=.5||rn(Wn)}return{activeRestoreAnchor:It,getRelativeScrollTopWithinContainer:Dt,setRelativeScrollTopWithinContainer:rn,resolveAnchorOffset:cn,clearRestoreReconcile:wn,applyRestoreAnchor:yn,scheduleRestoreReconcile:function(){It.value&&oe&&At==null&&(At=Ee?Ee(()=>{At=null,It.value&&yn(It.value)}):null,At==null&&It.value&&yn(It.value))},captureRestoreAnchor:function(){const Cn=Dt(),Wn=we.value;if(Cn==null||Wn<=0)return null;const Jn=at(lt(Cn+1),0,Wn-1),Oi=gt(0,Jn),er=Xe(Jn);return{nodeIndex:Jn,offsetWithinNodePx:at(Cn-Oi,0,Math.max(0,er-1))}},restoreAnchor:function(Cn){const Wn=we.value;if(It.value={nodeIndex:at(Cn.nodeIndex,0,Math.max(0,Wn-1)),offsetWithinNodePx:Math.max(0,Cn.offsetWithinNodePx)},wn(),yn(It.value),oe)for(const Jn of[0,120,280,480])Ut.push(window.setTimeout(()=>{It.value&&yn(It.value)},Jn))},getAnchorDrift:function(Cn){const Wn=Dt();return Wn==null?null:Wn-cn(Cn)}}})({isClient:U,containerRef:F,parsedNodeCount:Oo,requestFrame:Go,cancelFrame:Xi,resolveScrollContainer:()=>Xa.value||ae(),getNormalizedScrollTop:ve,getOffsetTopWithinRoot:ce,isReverseFlexScrollRoot:Ce,estimateIndexForOffset:Wl,estimateHeightRange:$s,getFallbackNodeHeight:Br,clamp:Xo}),{nodeHeights:rl,heightStats:ao,heightTreeSize:eo,heightSumTree:Ul,heightKnownTree:gd,averageNodeHeight:Vl,resetHeightMeasurements:Kl,pruneHeightMeasurements:Zl,rebuildHeightTrees:ll,recordNodeHeight:vd,removeNodeHeights:Ca,exportHeightCache:eu,importHeightCache:Cc,fenwickRangeSum:zs}=(function(j={}){const oe=po({}),ye=po({total:0,count:0}),we=q(0),Ee=q([]),He=q([]);function Je(){for(const Xe of Object.keys(oe))delete oe[Number(Xe)];ye.total=0,ye.count=0,we.value=0,Ee.value=[],He.value=[]}function nt(Xe,at,It){for(let At=at+1;At0;At-=At&-At)It+=Xe[At];return It}function it(Xe){we.value=Xe;const at=new Array(Xe+1).fill(0),It=new Array(Xe+1).fill(0);for(const[At,Ut]of Object.entries(oe)){const Dt=Number(At),rn=Number(Ut);!Number.isFinite(Dt)||Dt<0||Dt>=Xe||!Number.isFinite(rn)||rn<=0||(nt(at,Dt,rn),nt(It,Dt,1))}Ee.value=at,He.value=It}function lt(Xe){if(!Number.isInteger(Xe)||Xe<0)return!1;const at=oe[Xe];if(!Number.isFinite(at)||at<=0)return!1;if(delete oe[Xe],ye.total=Math.max(0,ye.total-at),ye.count=Math.max(0,ye.count-1),we.value>Xe){const It=Ee.value,At=He.value;It.length&&At.length&&(nt(It,Xe,-at),nt(At,Xe,-1))}return!0}const gt=D(()=>ye.count>0?Math.max(12,ye.total/ye.count):32);return{nodeHeights:oe,heightStats:ye,heightTreeSize:we,heightSumTree:Ee,heightKnownTree:He,averageNodeHeight:gt,resetHeightMeasurements:Je,pruneHeightMeasurements:function(Xe){if(Xe<=0)return void Je();let at=0,It=0;for(const[At,Ut]of Object.entries(oe)){const Dt=Number(At),rn=Number(Ut);!Number.isFinite(Dt)||Dt<0||Dt>=Xe||!Number.isFinite(rn)||rn<=0?delete oe[Dt]:(at+=rn,It++)}ye.total=at,ye.count=It},rebuildHeightTrees:it,recordNodeHeight:function(Xe,at,It={}){(function(At,Ut,Dt={}){var rn;if(!Number.isFinite(Ut)||Ut<=0)return!1;const cn=oe[At];if(cn&&(Dt.allowShrink===!1&&UtAt){const wn=Ee.value,yn=He.value;if(wn.length&&yn.length)if(cn){const Cn=Ut-cn;Cn!==0&&nt(wn,At,Cn)}else nt(wn,At,Ut),nt(yn,At,1)}Dt.notify!==!1&&((rn=j.onHeightRecorded)==null||rn.call(j))})(Xe,at,Dn(Bt({},It),{notify:!0}))},removeNodeHeight:function(Xe,at={}){var It;const At=lt(Xe);return At&&at.notify!==!1&&((It=j.onHeightRecorded)==null||It.call(j)),At},removeNodeHeights:function(Xe,at={}){var It;let At=0;for(const Ut of Xe)lt(Number(Ut))&&At++;return At>0&&at.notify!==!1&&((It=j.onHeightRecorded)==null||It.call(j)),At},exportHeightCache:function(){return Object.entries(oe).map(([Xe,at])=>({index:Number(Xe),height:Number(at)})).filter(Xe=>Number.isFinite(Xe.index)&&Xe.index>=0&&Number.isFinite(Xe.height)&&Xe.height>0).sort((Xe,at)=>Xe.index-at.index)},importHeightCache:function(Xe,at={}){var It;if(!Array.isArray(Xe))return;const At=we.value;let Ut=!1;if(at.mode!=="merge"){const Dt=Object.keys(oe);if(Dt.length>0){for(const rn of Dt)delete oe[Number(rn)];Ut=!0}}for(const Dt of Xe){const rn=Number(Dt.index),cn=Number(Dt.height);if(!Number.isInteger(rn)||rn<0||At>0&&rn>=At||!Number.isFinite(cn)||cn<=0)continue;const wn=oe[rn];wn&&Math.abs(wn-cn)<=1||(oe[rn]=cn,Ut=!0)}Ut&&((function(){let Dt=0,rn=0;const cn=we.value;for(const[wn,yn]of Object.entries(oe)){const Cn=Number(wn),Wn=Number(yn);!Number.isFinite(Cn)||Cn<0||cn>0&&Cn>=cn||!Number.isFinite(Wn)||Wn<=0?delete oe[Cn]:(Dt+=Wn,rn++)}ye.total=Dt,ye.count=rn})(),At>0&&it(At),(It=j.onHeightRecorded)==null||It.call(j))},fenwickRangeSum:function(Xe,at,It){if(It<=at)return 0;const At=vt(Xe,It-1);return at<=0?At:At-vt(Xe,at-1)}}})({onHeightRecorded:()=>{ui(),hn.value&&bg(),lo.value&&ba(),jo.value&&Vp(),to("node-resize")}});function Yo(j){Number.isInteger(j)&&j>=0&&Xs.add(j)}function js(j){for(const oe of j)Yo(Number(oe))}function Hs(j){kr++;let oe=!0;try{const ye=j();return oe=ye!==!1,ye}finally{kr--,kr===0&&oe&&Or.value++}}function qe(){Qo=[],vo=[],ai=-1,Xs.clear(),ws.value=sl}function Re(){qe(),Hs(()=>Kl()),_o.clear()}function ct(j){!Number.isInteger(j)||j<0||j>=Zt.value.length||_o.set(j,ug(j))}function un(j,oe,ye={}){const we=rl[j];Yo(j),vd(j,oe,ye);const Ee=rl[j];return Object.is(we,Ee)?(Xs.delete(j),!1):(Ee&&Ee>0?ct(j):we&&_o.delete(j),!0)}function Rn(j,oe){const ye=Ve("getNodeLayoutHeight.slot.offsetHeight",()=>{var we,Ee;return(Ee=(we=xi.get(j))==null?void 0:we.offsetHeight)!=null?Ee:0});return ye>0?ye:Ve("getNodeLayoutHeight.content.offsetHeight",()=>oe.offsetHeight)}function In(j,oe={}){oe.mode!=="merge"?qe():js(j.map(ye=>ye.index)),Hs(()=>Cc(j,oe)),Hw()}const oi=D(()=>zl.value&&Xf.value),Si=D(()=>{var j;return!Q.value&&I.batchRendering!==!1&&jl.value>0&&((j=I.maxLiveNodes)!=null?j:0)<=0}),xs=D(()=>!Q.value&&Ze&&Ne.value===!0&&!An.value&&!Ye.value&&!Ue.value&&!oi.value&&!Si.value),al=D(()=>!!gr&&oi.value),ul=D(()=>An.value||hn.value),{focusIndex:Ho,liveRange:uo,updateLiveRange:tu}=(function(j,oe){const{parsedNodeCount:ye,virtualizationEnabled:we,maxLiveNodesResolved:Ee,liveNodeBufferResolved:He,clamp:Je}=oe,nt=He??D(()=>{var lt;return Math.max(0,(lt=j.liveNodeBuffer)!=null?lt:60)}),vt=q(0),it=po({start:0,end:0});return{liveNodeBufferResolved:nt,focusIndex:vt,liveRange:it,updateLiveRange:function(){const lt=ye.value;if(!we.value||lt===0)return it.start=0,void(it.end=lt);const gt=Math.min(Ee.value,lt),Xe=nt.value,at=Je(vt.value-Xe,0,Math.max(0,lt-gt));it.start=at,it.end=Math.min(lt,at+gt)}}})(I,{parsedNodeCount:Oo,virtualizationEnabled:An,maxLiveNodesResolved:Un,liveNodeBufferResolved:Ri,clamp:Xo}),$r=new Map,Aa=new Map,Gl=new Map,Nu=[],cl=new Map,zr=new Set,Fu=q(0);let yd=!1;const dl=D(()=>(Fu.value,zr.size)),Yn=new Map,Ss=new Map,Cr=q(0),fl=D(()=>{Cr.value;let j=0;for(const oe of Yn.values())j+=Math.max(0,oe);return j});let Ws=null;const Ac=D(()=>{if(!An.value)return Zt.value.length;const j=Ri.value,oe=Math.max(uo.end+j,ol.value),ye=Math.min(Zt.value.length,oe);return Math.max(Bs.value,ye)});function xc(){yd||(yd=!0,queueMicrotask(()=>{yd=!1,Fu.value+=1}))}function Ie(j,oe,ye="node-resize"){if(!U||typeof window>"u")return null;const we=window.setTimeout(()=>{zr.delete(we)&&xc();try{oe()}finally{to(ye)}},Math.max(0,j));return zr.add(we),xc(),we}function $e(j){U&&j!=null&&(zr.delete(j)&&xc(),window.clearTimeout(j))}function yt(){if(U&&typeof window<"u")for(const j of zr)window.clearTimeout(j);zr.size&&(zr.clear(),xc()),Nu.length=0,Gl.clear()}function Ht(j){P.value=j}function vn(j){z.value=j}function Bn(j){W.value=j}const{cancelScheduledFocusSync:Vn,scheduleFocusSync:ti}=(function(j){const{isClient:oe,containerRef:ye,virtualizationEnabled:we,requestFrame:Ee,cancelFrame:He,syncFocusToScroll:Je}=j;let nt=null;function vt(){var lt,gt,Xe;return(Xe=(gt=(lt=ye.value)==null?void 0:lt.ownerDocument)==null?void 0:gt.defaultView)!=null?Xe:typeof window<"u"?window:null}function it(){if(!nt)return;const lt=vt();nt.viaTimeout?lt?lt.clearTimeout(nt.id):clearTimeout(nt.id):He?.(nt.id),nt=null}return{cancelScheduledFocusSync:it,scheduleFocusSync:function(lt={}){if(!we.value)return;if(!oe)return void Je(!0);if(lt.immediate)return it(),void Je(!0);if(nt)return;const gt=()=>{nt=null,Je()};if(Ee)return void(nt={id:Ee(gt),viaTimeout:!1});const Xe=vt();nt={id:Xe?Xe.setTimeout(gt,16):setTimeout(gt,16),viaTimeout:!0}}}})({isClient:U,containerRef:F,virtualizationEnabled:An,requestFrame:Go,cancelFrame:Xi,syncFocusToScroll:function(j=!1){var oe;if(!An.value)return;const ye=Xa.value||ae();if(!ye)return;const we=ye.ownerDocument||((oe=F.value)==null?void 0:oe.ownerDocument)||document,Ee=we?.defaultView||(typeof window<"u"?window:null),He=ye===we?.documentElement||ye===we?.body,Je=Zt.value.length;if(Je<=0)return;if(!He&&Je>0&&Ce(ye)){const At=Ve("syncFocusToScroll.clientHeight",()=>ye.clientHeight||0),Ut=Ve("syncFocusToScroll.scrollTop",()=>ye.scrollTop),Dt=Ut<0?-Ut:Ut;return void kd(Xo((nt=Math.max(0,Dt)+.5*Math.max(0,At),Cs.estimateIndexForOffsetFromEnd(nt)),0,Math.max(0,Je-1)),j)}var nt;const vt=(function(At,Ut,Dt,rn){const cn=F.value;if(!cn)return null;const wn=rn?0:Ve("syncFocusToScroll.model.root.getBoundingClientRect",()=>At.getBoundingClientRect().top),yn=Ve("syncFocusToScroll.model.container.getBoundingClientRect",()=>cn.getBoundingClientRect().top),Cn=Math.max(0,wn-yn),Wn=rn?Ve("syncFocusToScroll.model.viewport.clientHeight",()=>{var Jn,Oi,er,Us;return(Us=(er=(Oi=Dt?.innerHeight)!=null?Oi:(Jn=Ut.documentElement)==null?void 0:Jn.clientHeight)!=null?er:At.clientHeight)!=null?Us:0}):Ve("syncFocusToScroll.model.root.clientHeight",()=>At.clientHeight);return Xo(Wl(Cn+.5*Math.max(0,Wn)),0,Math.max(0,Zt.value.length-1))})(ye,we,Ee,He);if(vt!=null)return void kd(vt,j);const it=He?null:Ve("syncFocusToScroll.root.getBoundingClientRect",()=>ye.getBoundingClientRect()),lt=He?0:it.top,gt=He?Ve("syncFocusToScroll.viewport.clientHeight",()=>{var At,Ut;return(Ut=(At=Ee?.innerHeight)!=null?At:ye.clientHeight)!=null?Ut:0}):it.bottom,Xe=wc.value;let at=null,It=null;for(const[At,Ut]of Xe){if(!Ut)continue;const Dt=Ve("syncFocusToScroll.slot.getBoundingClientRect",()=>Ut.getBoundingClientRect());Dt.bottom<=lt||Dt.top>=gt||(at==null&&(at=At),It=At)}if(at==null||It==null){const At=F.value;if(!At)return;const Ut=He?{top:0}:Ve("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>ye.getBoundingClientRect()),Dt=Ve("syncFocusToScroll.fallback.scrollTop",()=>ve(ye,we,He)),rn=He?(()=>{const wn=Ve("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>At.getBoundingClientRect()),yn=(He?0:Ut.top)-wn.top;return Math.max(0,yn)})():(()=>{const wn=ce(At,ye);return Math.max(0,Dt-wn)})(),cn=He?Ve("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var wn,yn,Cn,Wn;return(Wn=(Cn=(yn=Ee?.innerHeight)!=null?yn:(wn=we?.documentElement)==null?void 0:wn.clientHeight)!=null?Cn:ye.clientHeight)!=null?Wn:0}):Ve("syncFocusToScroll.fallback.root.clientHeight",()=>ye.clientHeight);return void kd(Xo(Wl(rn+.5*Math.max(0,cn)),0,Math.max(0,Zt.value.length-1)),!0)}kd(Math.round((at+It)/2),j)}}),{visibleNodeIndices:Jo,nodeVisibilityHandles:hl,nodeVisibilityWatchStops:Ql,nodeVisibilityFallbackTimers:Pp,clearVisibilityFallback:Bp,markNodeVisible:Du,cleanupNodeVisibility:D2,destroyNodeVisibilityState:rg}=g4e({isClient:U,shouldTrackVisibleNodeIndices:()=>oi.value,shouldCleanupNodeVisibility:()=>An.value,onNodeMarkedVisible:j=>{An.value?ti():Ho.value=Xo(j,0,Math.max(0,Zt.value.length-1))},onNodeVisibilityCleaned:j=>{xi.delete(j)&&gI()}}),{cleanupScrollListener:R2,setupScrollListener:O2}=(function(j){const{isClient:oe,virtualizationEnabled:ye,listenerEnabled:we,scrollRootElement:Ee,resolveScrollContainer:He,scheduleFocusSync:Je,onScroll:nt}=j;let vt=null,it=null;function lt(){vt&&(vt(),vt=null),it=null,Ee.value=null}function gt(Xe){const at=j.getScrollTop?j.getScrollTop(Xe):Xe.scrollTop;return Math.max(0,Number.isFinite(at)?Math.abs(at):0)}return{cleanupScrollListener:lt,setupScrollListener:function(){if(!oe)return;if(!((Xe=we?.value)!=null?Xe:ye.value))return void lt();var Xe;const at=He();if(!at)return void lt();if(Ee.value===at&&vt)return;lt(),it=gt(at);const It=()=>{if(nt?.(),ye.value){const At=(function(Ut){const Dt=gt(Ut),rn=it;it=Dt;const cn=Math.max(480,.75*(Ut.clientHeight||0));return rn==null?Dt>cn?{immediate:!0}:void 0:Math.abs(Dt-rn)>cn?{immediate:!0}:void 0})(at);At?Je(At):Je()}};at.addEventListener("scroll",It,{passive:!0}),Ee.value=at,vt=()=>{at.removeEventListener("scroll",It)}}}})({isClient:U,virtualizationEnabled:An,listenerEnabled:ul,scrollRootElement:Xa,resolveScrollContainer:ae,scheduleFocusSync:ti,onScroll:function(){const j=jo.value;if(!j)return;const oe=ag();if(!oe||(function(we){if(pg()>=br)return Io=null,!1;const Ee=Io;if(Ee==null)return!0;const He=Math.abs(we.scrollTop-Ee)<=2;return He||(Io=null),He})(oe))return;const ye=oI(oe);ye!=null?(ye<-32||Math.abs(Math.max(0,ye)-Math.max(0,j.distanceFromBottomPx))>32)&&Up("restore"):Up("restore")},getScrollTop:j=>{var oe;const ye=j.ownerDocument||((oe=F.value)==null?void 0:oe.ownerDocument)||document,we=j===ye.documentElement||j===ye.body||j===ye.scrollingElement;return Ve("scrollListener.getScrollTop",()=>ve(j,ye,we))}});function kd(j,oe=!1){const ye=Xo(j,0,Math.max(0,Zt.value.length-1));!oe&&Math.abs(ye-Ho.value)<=1||(Ho.value=ye,tu())}function Xo(j,oe,ye){return Math.min(Math.max(j,oe),ye)}function $p(j=Zt.value.length){const oe=Ro();return!Number.isInteger(oe)||oe<0?j:Xo(oe,0,j)}function bd(j){return j?.firstElementChild}function P2(j,oe){var ye;return j?(ye=j.matches)!=null&&ye.call(j,oe)?j:j.querySelector(oe):null}function wd(j,oe){j<1||j>6||($[j]=oe)}function B2(){if(!ei.value)return void(te.value=0);const j=Ve("updateExperimentContainerWidth.clientWidth",()=>{var oe,ye;return(ye=(oe=F.value)==null?void 0:oe.clientWidth)!=null?ye:0});te.value=j>0?j:0}let Cd=null;function lg(){Cd?.disconnect(),Cd=null}const zp=d0("ViewportDeferredMarkdownCodeBlockNode",Xu({loader:()=>io(null,null,function*(){return(yield qo(()=>import("./index5-CI5HVqyi.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:gb,delay:0,suspensible:!1}),gb);function Me(j){return j===zp}const st=D(()=>m.value==="pre"?bl:m.value==="shiki"?zp:k8);function et(){var j;return((j=I.codeBlockProps)==null?void 0:j.showHeader)!==!1}function _t(j,oe,ye){const we=rl[oe],Ee=typeof we=="number"&&we>0;if(Mt.value&&!Ee&&!(function(He){return!!Sn.value.paragraph&&(He.type==="paragraph"||He.type==="list_item"||He.type==="list")})(j)){const He=Eq(j,ye,le.value);if(He)return He}if(Hi.value&&j.type==="code_block"){const He=(function(Je){if(Je.type!=="code_block")return null;const nt=MI(Je,Z2(Je));return Me(nt)?"markdown":nt===bl?"pre":nt===st.value||nt===k8?"monaco":null})(j);if(He==="monaco"||He==="markdown"||He==="pre")return(function(Je,nt){var vt,it,lt;if(!Je||Je.type!=="code_block")return null;const gt=nt.rendererKind,Xe=gt!=="pre"&&nt.showHeader!==!1,at=!!Je.diff;let It=0,At=500;if(gt==="monaco"){const Dt=(vt=nt.monacoOptions)!=null?vt:{},rn=M8(Je,Dt,nt.width),cn=(function(yn){const Cn=typeof yn?.fontSize=="number"&&yn.fontSize>0?yn.fontSize:12;return typeof yn?.lineHeight=="number"&&yn.lineHeight>0?yn.lineHeight:Math.round(1.5*Cn)})(Dt),wn=(function(yn,Cn){var Wn,Jn;const Oi=typeof((Wn=yn?.padding)==null?void 0:Wn.top)=="number"?yn.padding.top:Cn?0:8,er=typeof((Jn=yn?.padding)==null?void 0:Jn.bottom)=="number"?yn.padding.bottom:Cn?0:8;return Math.max(0,Oi)+Math.max(0,er)})(Dt,at);At=typeof Dt.MAX_HEIGHT=="number"&&Dt.MAX_HEIGHT>0?Dt.MAX_HEIGHT:500,It=Math.round(rn*cn+wn)}else if(gt==="markdown"){const Dt=M8(Je);It=Math.round(21*Dt+32)}else{const Dt=M8(Je);It=Math.round(28*Dt),At=Number.POSITIVE_INFINITY}const Ut=Math.max(1,Math.min(It,At));return Bt({kind:"code-block",height:Math.round(Ut+(Xe?40:0)),contentHeight:Ut,rendererKind:gt},at&>==="monaco"?{diffInline:Wx((it=nt.monacoOptions)!=null?it:{},(lt=nt.width)!=null?lt:0)}:{})})(j,{rendererKind:He,monacoOptions:I.codeBlockMonacoOptions,showHeader:et(),width:ye})}return null}Y1(()=>{if(Or.value,kr>0)return;const j=Zt.value,oe=Js();if(!j.length||!$o.value)return Qo=[],vo=[],ai=-1,Xs.clear(),void(ws.value=sl);const ye=te.value||Ve("estimatedNodeHeights.clientWidth",()=>{var it;return((it=F.value)==null?void 0:it.clientWidth)||0});if(!Number.isFinite(ye)||ye<=0)return Qo=[],vo=[],ai=-1,Xs.clear(),void(ws.value=sl);const we=(function(it){return[Math.round(it),Mt.value,Hi.value,le.value,I.codeBlockMonacoOptions,et(),m.value,Sn.value,S8.value]})(ye),Ee=Qo.length<=j.length&&(Je=we,(He=vo).length===Je.length&&He.every((it,lt)=>Object.is(it,Je[lt])));var He,Je;const nt=Ee&&ai===oe?j.length:Ee?$p(j.length):0,vt=Ee?Array.from(Xs):[];Qo.length=j.length;for(let it=nt;it=0&&itws.value);Cs=(function(j){let oe=!0,ye=[0],we="";function Ee(lt){var gt;const Xe=j.nodeHeights[lt];if(Number.isFinite(Xe)&&Xe>0)return Xe;const at=j.parsedNodes.value[lt],It=at?.type,At=!!((gt=j.hasCustomParagraphComponent)!=null&>.call(j)),Ut=j.estimatedNodeHeights.value[lt],Dt=Ut?.height;if(!(function(cn,wn,yn){return!!(yn&&wn?.kind==="simple-text"&&(cn==="paragraph"||cn==="list_item"||cn==="list"))})(It,Ut,At)&&Number.isFinite(Dt)&&Dt>0)return Dt;const rn=o4e(at,j.getContainerWidth()||640);return It==="heading"||It==="paragraph"&&rn<=28&&(function(cn,wn){if(wn)return!1;const yn=cn.children;return!Array.isArray(yn)||!yn.length||yn.every(Nq)})(at,At)?rn:Math.max(j.averageNodeHeight.value,rn)}function He(){var lt;const gt=j.parsedNodes.value.length,Xe=j.getPrefixCacheKeyParts().join(":");if(!oe&&we===Xe)return ye;const at=new Array(gt+1);at[0]=0;for(let It=0;It=((gt=It[at])!=null?gt:0))return at-1;let At=0,Ut=at-1,Dt=at-1;for(;At<=Ut;){const rn=At+Ut>>1;((Xe=It[rn+1])!=null?Xe:0)>=lt?(Dt=rn,Ut=rn-1):At=rn+1}return Dt}function nt(lt,gt){var Xe,at;if(lt>=gt)return 0;if(j.heightEstimationActive.value)return(function(Ut,Dt){var rn,cn;const wn=j.parsedNodes.value.length,yn=xF(Math.trunc(Ut),0,wn),Cn=xF(Math.trunc(Dt),yn,wn);if(yn>=Cn)return 0;const Wn=He();return((rn=Wn[Cn])!=null?rn:0)-((cn=Wn[yn])!=null?cn:0)})(lt,gt);if(j.heightTreeSize.value!==j.parsedNodes.value.length){let Ut=0;for(let Dt=lt;Dtyn<=0?0:j.fenwickRangeSum(At,0,yn)+(yn-j.fenwickRangeSum(Ut,0,yn))*It;let rn=0,cn=Xe.length-1,wn=Xe.length-1;for(;rn<=cn;){const yn=rn+cn>>1;Dt(yn+1)>=lt?(wn=yn,cn=yn-1):rn=yn+1}return wn}let at=lt;for(let It=0;It0||lt++}return lt}return{markFallbackHeightPrefixDirty:function(){oe=!0},getFallbackNodeHeight:Ee,estimateHeightRange:nt,estimateIndexForOffset:vt,estimateIndexForOffsetFromEnd:function(lt){var gt,Xe;const at=j.parsedNodes.value;if(!at.length)return 0;if(lt<=0)return Math.max(0,at.length-1);if(j.heightEstimationActive.value){const At=(gt=He()[at.length])!=null?gt:0;return Je(Math.max(0,At-lt))}if(j.heightTreeSize.value===at.length){const At=nt(0,at.length);return vt(Math.max(0,At-lt))}let It=lt;for(let At=at.length-1;At>=0;At--){const Ut=(Xe=j.nodeHeights[At])!=null?Xe:j.averageNodeHeight.value;if(It<=Ut)return At;It-=Ut}return 0},getEstimatedNodeHeightCount:it,buildVirtualHeightSummary:function(lt){var gt;const Xe=j.parsedNodes.value.length;return{totalNodes:Xe,measuredCount:j.heightStats.count,estimatedCount:it(),averageNodeHeight:j.averageNodeHeight.value,topSpacerHeight:lt.topSpacerHeight,bottomSpacerHeight:lt.bottomSpacerHeight,estimatedTotalHeight:nt(0,Xe),width:(gt=lt.width)!=null?gt:j.getContainerWidth()}}}})({parsedNodes:Zt,nodeHeights:rl,heightStats:ao,heightTreeSize:eo,heightSumTree:Ul,heightKnownTree:gd,averageNodeHeight:Vl,heightEstimationActive:ei,estimatedNodeHeights:an,getContainerWidth:ht,hasCustomParagraphComponent:()=>!!Sn.value.paragraph,getPrefixCacheKeyParts:()=>{var j;const oe=zg(te.value||Ve("getFallbackHeightPrefix.clientWidth",()=>{var we;return((we=F.value)==null?void 0:we.clientWidth)||0})),ye=((j=i.virtualScroll)==null?void 0:j.measurementKey)==null?"":String(i.virtualScroll.measurementKey);return[Zt.value.length,ao.count,Math.round(ao.total),Math.round(100*Vl.value),ye,oe,ei.value?1:0,S8.value,G.value,Sn.value.paragraph?1:0]},fenwickRangeSum:zs}),ze(()=>Zt.value.length,j=>{var oe;ui(),j<=0?Re():(jZl(oe))),j!==eo.value&&ll(j))},{immediate:!0});const On=D(()=>{if(!An.value)return Zt.value.map((we,Ee)=>({node:we,index:Ee}));const j=Zt.value.length,oe=Xo(uo.start,0,j),ye=Xo(uo.end,oe,j);return Zt.value.slice(oe,ye).map((we,Ee)=>({node:we,index:oe+Ee}))}),xn=D(()=>An.value?$s(0,Math.min(uo.start,Zt.value.length)):0),En=D(()=>{if(!An.value)return 0;const j=Zt.value.length;return $s(Math.min(uo.end,j),j)});function Mn(){return Cs.buildVirtualHeightSummary({topSpacerHeight:xn.value,bottomSpacerHeight:En.value,width:th()})}function Wi(){const j=Zt.value,oe=Mn();return Dn(Bt({},oe),{probe:{paragraphReady:!!le.value.paragraph,listItemReady:!!le.value.listItem,listWrapperOverhead:le.value.listWrapperOverhead,headingReadyLevels:Object.entries(le.value.headings).filter(([,ye])=>!!ye).map(([ye])=>Number(ye))},nodes:j.map((ye,we)=>{var Ee,He,Je,nt,vt,it,lt,gt,Xe;return{index:we,type:ye.type,estimateKind:(He=(Ee=an.value[we])==null?void 0:Ee.kind)!=null?He:null,rendererKind:(nt=(Je=an.value[we])==null?void 0:Je.rendererKind)!=null?nt:null,estimatedHeight:(it=(vt=an.value[we])==null?void 0:vt.height)!=null?it:null,estimatedContentHeight:(gt=(lt=an.value[we])==null?void 0:lt.contentHeight)!=null?gt:null,measuredHeight:(Xe=rl[we])!=null?Xe:null}})})}function qs(){return i.indexKey!=null?String(i.indexKey):Ye.value?`virtual-${vi()}`:"markdown-renderer"}function Yl(j){const oe=String(j),ye=`${qs()}-`;if(!oe.startsWith(ye))return null;const we=oe.slice(ye.length).match(/^(\d+)(?:$|-)/);if(!we)return null;const Ee=Number(we[1]);return!Number.isInteger(Ee)||Ee<0||Ee>=Zt.value.length?null:Ee}function vi(){var j,oe,ye;const we=(j=i.virtualScroll)==null?void 0:j.sessionKey;return String(we!=null&&we!==""?we:(ye=(oe=i.indexKey)!=null?oe:I.customId)!=null?ye:kt)}function qi(){var j;const oe=(j=i.virtualScroll)==null?void 0:j.threadKey;return oe==null||oe===""?void 0:String(oe)}const eh=D(()=>{var j,oe,ye;return(ye=qi())!=null?ye:String((oe=(j=i.indexKey)!=null?j:I.customId)!=null?oe:kt)});function _w(j){var oe;return(j??"")===((oe=qi())!=null?oe:"")}function Sc(){var j,oe,ye;return oe=(j=i.virtualScroll)==null?void 0:j.measurementKey,ye=(function(){const we=m.value;return(function(Ee){var He,Je;const nt=Ee.renderer,vt=nt==="monaco"?Ee.codeBlockMonacoOptions:void 0,it=Ee.codeBlockProps,lt=nt==="shiki";return[Ee.isDark?"dark":"light",nt==="monaco"?"code-rich":nt==="pre"?"code-pre":"code-shiki",Ee.codeBlockStream===!1?"code-static":"code-stream",Vs(Ee.codeBlockMinWidth),Vs(Ee.codeBlockMaxWidth),...lt?[Gye((He=it?.themes)!=null?He:Ee.themes,(Je=it?.langs)!=null?Je:Ee.langs)]:[],Vs(vt?.fontSize),Vs(vt?.lineHeight),Vs(vt?.fontFamily),Vs(vt?.tabSize),Vs(vt?.MAX_HEIGHT),Vs(vt?.wordWrap),Vs(vt?.wrappingIndent),Vs(vt?.padding),Vs(it?.showHeader),Vs(it?.showCopyButton),Vs(it?.showExpandButton),Vs(it?.showPreviewButton),Vs(it?.showCollapseButton),Vs(it?.showFontSizeButtons)].join("\0")})({renderer:we,isDark:I.isDark,codeBlockStream:I.codeBlockStream,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockMonacoOptions:we==="monaco"?I.codeBlockMonacoOptions:void 0,codeBlockProps:I.codeBlockProps,themes:we==="shiki"?I.themes:void 0,langs:we==="shiki"?I.langs:void 0})})(),[oe==null?"":String(oe),ye].join("\0")}function th(){return ht()}const $2=D(()=>zg(th())),Jl=D(()=>[Sc(),$2.value].join("\0")),fY=D(()=>{var j;return Ye.value?["virtual",(j=qi())!=null?j:"",vi(),Jl.value].join("\0"):i.indexKey});function jp(){Cr.value+=1}function Iw(j){return!(!j||!Number.isInteger(j.index)||j.index<0||j.index>=Zt.value.length||j.sessionKey!==vi()||j.threadKey!==qi()||j.layoutEpochKey!==Jl.value)}function X_(j){const oe=String(j),ye=Ss.get(oe);return ye?Iw(ye)?ye.index:null:Yl(oe)}function eI(j="async-node"){(Yn.size||Ss.size)&&(Yn.clear(),Ss.clear(),jp(),to(j))}const Hp=en(MA,null),Mw={reportHeight(j,oe){if(!hn.value)return;const ye=X_(j);if(ye==null)return;const we=$r.get(ye);if(!we)return;const Ee=Number(oe),He=Rn(ye,we);(function(Je,nt,vt={}){Hs(()=>un(Je,nt,vt))})(ye,Number.isFinite(Ee)&&Ee>0?Math.max(Ee,He||0):He)},markPending(j){if(!hn.value)return;const oe=Yl(j);oe!=null&&(function(ye,we){var Ee;const He=Ss.get(ye);if(He&&Iw(He))return Yn.set(ye,Math.max(0,(Ee=Yn.get(ye))!=null?Ee:0)+1),jp(),void to("async-node");Yn.set(ye,1),Ss.set(ye,(function(Je){return{index:Je,sessionKey:vi(),threadKey:qi(),layoutEpochKey:Jl.value}})(we)),jp(),to("async-node")})(String(j),oe)},markSettled(j){if(!hn.value)return;const oe=String(j),ye=X_(j);(ye!=null||(function(we){return Yn.has(String(we))})(oe))&&(function(we){var Ee;const He=(Ee=Yn.get(we))!=null?Ee:0;return!(He<=0||(He<=1?(Yn.delete(we),Ss.delete(we)):Yn.set(we,He-1),jp(),He===1&&to("async-node"),0))})(oe)&&ye!=null&&_c()}};function hY(){let j=0;for(const oe of $r.values())j+=Ve("getVisibleDomHeight.offsetHeight",()=>{var ye;return(ye=oe?.offsetHeight)!=null?ye:0});return Math.ceil(Math.max(0,j))}Gn(MA,{reportHeight(j,oe){Mw.reportHeight(j,oe),Hp?.reportHeight(j,oe)},markPending(j){Mw.markPending(j),Hp?.markPending(j)},markSettled(j){Mw.markSettled(j),Hp?.markSettled(j)}});let Tw,Ew=null,Wp=null;function z2(j){return j!==!1&&j!=null&&j!==""}function tI(){return An.value?(function(){if(!An.value)return!0;const j=Zt.value.length,oe=Xo(uo.start,0,j),ye=Xo(uo.end,oe,j);if(oe>=ye)return!0;for(let we=oe;we=Ac.value}function Lw(){return Ne.value===!0&&!rt.value&&fl.value===0&&zr.size===0&&cl.size===0&&Ws==null&&tI()}function nI(){var j,oe;if(((j=i.virtualScroll)==null?void 0:j.settleMode)!=="manual"||Ew===vi()&&Tw===qi())return!0;const ye=(oe=i.virtualScroll)==null?void 0:oe.settledToken;return!!z2(ye)&&Wp===wg(ye)}function Nw(){return Lw()&&nI()}function pY(j,oe){return oe.totalNodes<=0?j==="final"?"final":"estimate":oe.measuredCount>=oe.totalNodes?j==="final"?"final":"measured":oe.measuredCount>0||oe.estimatedCount>0?"mixed":"estimate"}function nh(j="manual",oe){const ye=Mn(),we=(function(Ee){return Ee||(Ne.value!==!0?Zt.value.length>0?"streaming":"estimating":!tI()||cl.size>0||Ws!=null?"measuring":Nw()?"settled":"settling")})(oe);return{sessionKey:vi(),threadKey:qi(),phase:we,nodeCount:ye.totalNodes,liveRange:{start:uo.start,end:uo.end},renderedCount:Bs.value,measuredCount:ye.measuredCount,estimatedCount:ye.estimatedCount,averageNodeHeight:ye.averageNodeHeight,topSpacerHeight:ye.topSpacerHeight,bottomSpacerHeight:ye.bottomSpacerHeight,visibleDomHeight:hY(),totalHeight:iI(),width:ye.width,final:Ne.value===!0,stable:Nw(),confidence:pY(we,ye),reason:j}}function ag(){const j=Xa.value||ae(),oe=F.value;if(!j||!oe)return null;const ye=j.ownerDocument||oe.ownerDocument||document,we=j===ye.documentElement||j===ye.body||j===ye.scrollingElement,Ee=Ve("getScrollBox.scrollTop",()=>ve(j,ye,we)),He=Ve("getScrollBox.scrollHeight",()=>{var nt,vt,it,lt,gt;return we?Math.max((vt=(nt=ye.documentElement)==null?void 0:nt.scrollHeight)!=null?vt:0,(lt=(it=ye.body)==null?void 0:it.scrollHeight)!=null?lt:0,(gt=j.scrollHeight)!=null?gt:0):j.scrollHeight}),Je=Ve("getScrollBox.clientHeight",()=>{var nt;return we?((nt=ye.documentElement)==null?void 0:nt.clientHeight)||j.clientHeight||0:j.clientHeight});return{root:j,doc:ye,isViewportRoot:we,scrollTop:Ee,scrollHeight:He,clientHeight:Je}}function iI(){const j=Zt.value.length,oe=Math.max(0,$s(0,j)),ye=Ve("getRendererLogicalHeight.offsetHeight",()=>{var Ee,He;return(He=(Ee=F.value)==null?void 0:Ee.offsetHeight)!=null?He:0}),we=Math.max(0,ye>0?ye:Ve("getRendererLogicalHeight.scrollHeight",()=>{var Ee,He;return(He=(Ee=F.value)==null?void 0:Ee.scrollHeight)!=null?He:0}));return j<=0?Math.ceil(ye):An.value?oe>0?Math.max(1,Math.ceil(oe),(function(){let Ee=xn.value+En.value;for(const He of xi.values())He&&(Ee+=Math.max(0,Ve("getVirtualizedDomLogicalHeight.offsetHeight",()=>He.offsetHeight||0)));return Math.ceil(Math.max(0,Ee))})(),(function(Ee,He){return Ee<=0||He<=0?0:He<=Ee+Math.max(512,.05*Ee)?Math.ceil(He):0})(oe,we)):Math.max(1,Math.ceil(we)):hn.value?oe>0||ao.count>0||Cs.getEstimatedNodeHeightCount()>0?(ya.value&&Bs.value,Math.max(1,Math.ceil(we),Math.ceil(oe))):Math.ceil(we):Math.max(1,Math.ceil(we),Math.ceil(oe))}function oI(j){const oe=F.value;if(!oe)return null;const ye=Ve("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>oe.getBoundingClientRect());return(function(Ee){return Ee.isViewportRoot?Ee.clientHeight:Ve("getViewportBottomInRoot.getBoundingClientRect",()=>Ee.root.getBoundingClientRect().bottom)})(j)-ye.bottom}function mY(j={}){const oe=j.requireViewport!==!1,ye=(function(He=64){const Je=ag(),nt=F.value;if(!Je||!nt)return!1;const vt=(function(lt){if(lt.isViewportRoot)return{top:0,bottom:lt.clientHeight};const gt=Ve("getVirtualViewportRect.getBoundingClientRect",()=>lt.root.getBoundingClientRect());return{top:gt.top,bottom:gt.bottom}})(Je),it=Ve("isRendererNearVirtualViewport.getBoundingClientRect",()=>nt.getBoundingClientRect());return it.bottom>=vt.top-He&&it.top<=vt.bottom+He})();if(oe&&!ye)return null;const we=(function(){const He=ag(),Je=F.value;if(!He||!Je||Math.max(0,He.scrollHeight-He.scrollTop-He.clientHeight)>64)return null;const nt=oI(He);return nt==null?null:nt>=-8&&nt<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,nt)}:null})();if(we)return{anchor:we,captured:!0};const Ee=wr();if(Ee)return{anchor:{type:"node",nodeIndex:Ee.nodeIndex,offsetWithinNodePx:Ee.offsetWithinNodePx},captured:ye};if(j.allowFallback===!0){const He=(function(){const Je=Zt.value.length;return Je<=0?null:{type:"node",nodeIndex:Xo(Ho.value,0,Math.max(0,Je-1)),offsetWithinNodePx:0}})();return He?{anchor:He,captured:!1}:null}return null}function Fw(j){let oe=2166136261;for(let ye=0;ye>>0).toString(36)}function gY(j,oe){let ye=j;for(let we=0;we8192?`${we.slice(0,8192)}...${we.length}`:we;return`${we.length}:${Fw(Ee)}`})(j)}`;if(typeof j=="function")return"fn";if(typeof j!="object")return typeof j;if(oe.has(j))return"cycle";if(ye>=6)return"max-depth";oe.add(j);try{if(Array.isArray(j)){if(j.length<=160){const it=[];for(let lt=0;lt=nt&&Je.push(lt)}return[`a:${j.length}`,`h=${He.join(",")}`,`t=${Je.join(",")}`,`all=${(vt>>>0).toString(36)}`].join(":")}const we=j,Ee=Object.keys(we).filter(He=>{const Je=we[He];return He!=="parent"&&He!=="el"&&He!=="component"&&(Je==null||typeof Je=="string"||typeof Je=="number"||typeof Je=="boolean"||vY.has(He))}).sort();return`o:${Ee.length}:${Ee.map(He=>`${He}=${j2(we[He],oe,ye+1)}`).join(";")}`}finally{oe.delete(j)}}let Dw=-1,Rw="",ih=[2166136261];function ug(j){const oe=Zt.value[j];return oe?Fw(j2(oe)):""}function yY(j,oe){let ye=j;for(let we=0;we>>0}function Ow(){var j,oe;const ye=G.value;if(Dw===ye)return Rw;const we=Zt.value.length;let Ee=$p(we);(Dw!==ye-1||Ee>we||ih.length>>0).toString(36),Dw=ye,Rw}function qp(j,oe={}){var ye;const we=oe.includeHeightCache===!0,Ee=(ye=oe.includeContentHash)!=null?ye:we,He=we?(function(nt){const vt=(function(){var At,Ut;const Dt=Number((Ut=(At=i.virtualScroll)==null?void 0:At.heightCacheLimit)!=null?Ut:5e3);return!Number.isFinite(Dt)||Dt<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(Dt))})();if(!Number.isFinite(vt)||nt.length<=vt)return nt;const it=new Map,lt=At=>{!At||it.size>=vt||it.set(At.index,At)},gt=Zt.value.length,Xe=Xo(uo.start-2*Ri.value,0,gt),at=Xo(uo.end+2*Ri.value,Xe,gt);for(const At of nt)At.index>=Xe&&At.index=0&&it.sizeAt.index-Ut.index).slice(0,vt)})(eu().map(nt=>{var vt;const it=Zt.value[nt.index];return it?Dn(Bt({},nt),{nodeType:String((vt=it.type)!=null?vt:""),signature:ug(nt.index)}):null}).filter(nt=>!!nt)):[],Je=mY({allowFallback:oe.allowAnchorFallback===!0,requireViewport:oe.requireViewport});return Je||He.length||oe.includeEmptyState===!0?Dn(Bt({sessionKey:j.sessionKey,threadKey:j.threadKey},Je?{anchor:Je.anchor,anchorCaptured:Je.captured}:{anchorCaptured:!1}),{metrics:j,width:j.width,contentHash:Ee?Ow():void 0,measurementKey:Sc()||void 0,heightCache:He.length?He:void 0}):null}function Pw(j){var oe,ye;const we=ag();if(!we)return;const Ee=(function(nt){const vt=F.value;if(!vt)return null;const it=ce(vt,nt.root),lt=Zt.value.length,gt=Ve("getRendererBottomOffsetWithinRoot.offsetHeight",()=>vt.offsetHeight||0),Xe=Math.max(0,gt>0?gt:lt>0?Ve("getRendererBottomOffsetWithinRoot.scrollHeight",()=>vt.scrollHeight||0):0),at=iI();return it+Math.max(Xe,at)})(we);if(Ee==null)return;const He=Math.max(0,j.distanceFromBottomPx),Je=Math.max(0,Ee-we.clientHeight-He);(function(nt){br=pg()+120,Io=nt})(Je),we.isViewportRoot?(ye=(oe=we.doc.defaultView)==null?void 0:oe.scrollTo)==null||ye.call(oe,0,Je):wF(we.root,we.doc,Je,{isReverseFlexScrollRoot:Ce,getNormalizedScrollTop:ve})}const Bw=[];function sI(){if(U)for(Pr!=null&&(Xi?.(Pr),Pr=null);Bw.length;){const j=Bw.pop();j!=null&&window.clearTimeout(j)}}function Up(j){const oe=!!jo.value;jo.value=null,br=0,Io=null,sI(),oe&&j&&to(j)}function Vp(){if(!jo.value||!U||Pr!=null)return;const j=()=>{Pr=null;const oe=jo.value;oe&&Pw(oe)};Pr=Go?Go(j):null,Pr==null&&j()}function rI(j,oe={}){const ye=Zt.value.length;return ye<=0?[]:j.filter(we=>!(!Number.isInteger(we.index)||we.index<0||we.index>=ye)&&!(!Number.isFinite(we.height)||we.height<=0)&&!(oe.requireSignature&&!we.signature)&&!(oe.requireCompatibilityMetadata&&!we.nodeType&&!we.signature)&&(function(Ee){var He;const Je=Zt.value[Ee.index];return!(!Je||Ee.nodeType&&Ee.nodeType!==String((He=Je.type)!=null?He:"")||Ee.signature&&Ee.signature!==ug(Ee.index))})(we))}function lI(j){const oe=zg(th()),ye=zg(j);return oe!==-1&&ye!==-1&&oe===ye}function $w(j){var oe;const ye=Number(j?.width);if(Number.isFinite(ye)&&ye>0)return ye;const we=Number((oe=j?.metrics)==null?void 0:oe.width);return Number.isFinite(we)&&we>0?we:null}function aI(j){var oe;return j.sessionKey===vi()&&!!_w(j.threadKey)&&((oe=j.measurementKey)!=null?oe:"")===Sc()&&!!lI($w(j))&&!!(function(ye){const we=ye.heightCache;return!!we?.length&&(uI(ye)?we.some(Ee=>!!(Ee.nodeType||Ee.signature)):we.some(Ee=>!!Ee.signature))})(j)}function uI(j){return!!(j.contentHash&&j.contentHash===Ow())}function kY(j){return!uI(j)}let oh=null,sh=null,H2=null,cg=null,dg=null;function zw(j){var oe;const ye=j.map(Ee=>{var He,Je;return[Ee.index,Math.round(10*Ee.height),(He=Ee.nodeType)!=null?He:"",(Je=Ee.signature)!=null?Je:""].join("")}).join(""),we=zg(th());return[(oe=qi())!=null?oe:"",vi(),Sc(),Zt.value.length,we,j.length,Fw(ye)].join(":")}function cI(j=(oe=>(oe=i.virtualScroll)==null?void 0:oe.heightCache)()){if(!hn.value||!j?.length||Zt.value.length<=0||!lI((oe=i.virtualScroll)==null?void 0:oe.heightCacheWidth))return!1;var oe;const ye=rI(j,{requireSignature:!0});if(!ye.length)return!1;const we=zw(ye);return we===oh?(sh="standalone",!0):(In(ye,{mode:"merge"}),ui(),oh=we,sh="standalone",gg(),to("restore"),!0)}function jw(j,oe={}){var ye,we,Ee;if(!hn.value||!j||j.sessionKey!==vi()||!_w(j.threadKey)||Zt.value.length<=0)return!1;const He=!!((ye=j.heightCache)!=null&&ye.length)&&!W2(),Je=!j.anchor||j.anchorCaptured===!1&&oe.allowUncapturedAnchor!==!0?null:j.anchor,nt=oe.restoreAnchor===!0&&!!Je&&!W2()&&Number($w(j))>0;let vt=!1;if((we=j.heightCache)!=null&&we.length&&aI(j)){const lt=rI(j.heightCache,{requireCompatibilityMetadata:!j.contentHash,requireSignature:kY(j)});lt.length&&(In(lt,{mode:"merge"}),ui(),oh=zw(lt),sh="restore",gg(),vt=!0)}if(He||nt)return!1;if(!oe.restoreAnchor||!Je)return vt&&to("restore"),!0;const it=(function(lt,gt){var Xe;const at=lt.anchor,It=at?at.type==="bottom"?`bottom:${Math.round(at.distanceFromBottomPx)}`:`node:${at.nodeIndex}:${Math.round(at.offsetWithinNodePx)}`:"none";return[(Xe=qi())!=null?Xe:"",vi(),Sc(),$2.value,gt,It].join(":")})(j,(Ee=oe.restoreToken)!=null?Ee:"imperative");return H2===it?(vt&&to("restore"),!0):(H2=it,(function(lt){const gt=()=>{if(lt.type==="node")return Up(),void wa({nodeIndex:lt.nodeIndex,offsetWithinNodePx:lt.offsetWithinNodePx});if(ql(),lo.value=null,jo.value=lt,sI(),Pw(lt),U)for(const Xe of[0,120,280,480])Bw.push(window.setTimeout(()=>{const at=jo.value;at&&Pw(at)},Xe))};(function(Xe){if(!An.value)return!1;const at=Zt.value.length;return!(at<=0||(Ho.value=Xe.type==="node"?Xo(Xe.nodeIndex,0,at-1):at-1,tu(),0))})(lt)?ft(gt):gt()})(Je),to("restore"),!0)}function W2(){const j=th();return Number.isFinite(j)&&j>0}function dI(j){var oe;return j.sessionKey===vi()&&!!_w(j.threadKey)&&(Zt.value.length<=0||!(!((oe=j.heightCache)!=null&&oe.length)||W2())||!(!(j.anchor&&Number($w(j))>0)||W2()))}function Hw(){_o.clear();for(const j of Object.keys(rl)){const oe=Number(j);Number.isInteger(oe)&&oe>=0&&oe{let oe=!1,ye=null;const we=()=>{oe||(oe=!0,ye!=null&&window.clearTimeout(ye),j())};if(Go)return Go(we),void(ye=window.setTimeout(we,50));ye=window.setTimeout(we,0)})}function Ww(j,oe=qi(),ye=Jl.value){return vi()===j&&qi()===oe&&Jl.value===ye}function qw(){return io(this,arguments,function*(j={}){var oe,ye,we,Ee,He;const Je=vi(),nt=qi(),vt=Jl.value,it=(oe=j.frames)!=null?oe:2,lt=(ye=j.timeoutMs)!=null?ye:120,gt=(we=j.reason)!=null?we:"manual",Xe=j.expectedSettledTokenKey,at=j.flushPendingTimers===!0,It=nh(gt),At=()=>Dn(Bt({},It),{phase:It.final?"settling":It.phase,stable:!1,confidence:It.confidence==="final"?"mixed":It.confidence,reason:gt}),Ut=()=>Ww(Je,nt,vt)&&(Xe==null||mg()===Xe);for(let wn=0;wnwindow.setTimeout(yn,wn))})(lt),!Ut()||(at&&yt(),_c(),fg(),!Ut()))return At();const Dt=Lw();Dt&&(Ew=Je,Tw=nt,((Ee=i.virtualScroll)==null?void 0:Ee.settleMode)==="manual"&&Xe!=null&&z2((He=i.virtualScroll)==null?void 0:He.settledToken)&&mg()===Xe&&(Wp=wg(i.virtualScroll.settledToken)));const rn=Ut()&&Dt&&nI(),cn=nh(gt,rn?"final":void 0);return Gw(cn,!0),cn})}let Uw="content",rh=null,lh=null,Vw=0,hg=null,Kp=null,Kw=null,Zw=null;function pg(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function hI(j){var oe,ye;const we=hg;if(!we)return!0;const Ee=(ye=(oe=i.virtualScroll)==null?void 0:oe.heightDiffThresholdPx)!=null?ye:1;return Math.abs(j.totalHeight-we.totalHeight)>Ee||j.sessionKey!==we.sessionKey||j.phase!==we.phase||j.stable!==we.stable||j.final!==we.final||j.threadKey!==we.threadKey||j.nodeCount!==we.nodeCount||j.measuredCount!==we.measuredCount||j.width!==we.width}function mg(j=(oe=>(oe=i.virtualScroll)==null?void 0:oe.settledToken)()){return Vs(j)}function pI(j,oe){var ye,we;return[j,oe.sessionKey,(ye=oe.threadKey)!=null?ye:"",Sc(),Ow(),Vs((we=i.virtualScroll)==null?void 0:we.settledToken),Math.round(oe.totalHeight),Math.round(oe.width)].join("\0")}function gg(){Kw=null,Zw=null,Kp=null}function bY(j){const oe=j.heightCache;return oe?.length?zw(oe):""}function vg(j){var oe,ye,we;const Ee=j.metrics,He=j.anchor?(Je=j.anchor).type==="bottom"?`bottom:${Math.round(Je.distanceFromBottomPx)}`:`node:${Je.nodeIndex}:${Math.round(Je.offsetWithinNodePx)}`:"none";var Je;return[j.sessionKey,(oe=j.threadKey)!=null?oe:"",(ye=j.measurementKey)!=null?ye:Sc(),(we=j.contentHash)!=null?we:"",bY(j),He,j.anchorCaptured?1:0,Ee.liveRange.start,Ee.liveRange.end,Ee.renderedCount,Ee.nodeCount,Math.round(Ee.totalHeight),Math.round(Ee.width),Ee.phase,Ee.stable?1:0].join("\0")}function Gw(j,oe=!1){if(!hn.value||(function(Je=!1){return!Je&&Ye.value&&!So.value})(oe))return;const ye=oe||hI(j),we=(function(Je,nt=!1){return nt||Je.stable||Je.phase==="final"?{state:qp(Je,{includeHeightCache:!0})}:{state:qp(Je)}})(j,oe),Ee=we.state,He=!!(Ee&&(ye||(function(Je,nt=!1){return!!nt||vg(Je)!==Kp})(Ee,oe)));if(ye&&(O(j),hg=j,Vw=pg()),Ee&&He&&(H(Ee),Ee.anchor&&R(Ee.anchor),Kp=vg(Ee)),j.stable){const Je=pI("settled",j);if(Je!==Kw){Kw=Je;const nt=qp(j,{includeHeightCache:!0});nt&&(H(nt),Kp=vg(nt)),(function(vt){o("render-settled",vt)})(j)}}if(j.phase==="final"){const Je=pI("final",j);if(Je!==Zw){Zw=Je;const nt=qp(j,{includeHeightCache:!0});nt&&(H(nt),Kp=vg(nt)),(function(vt){o("render-final",vt)})(j)}}}function Qw(){rh!=null&&(Xi?.(rh),rh=null),lh!=null&&U&&(window.clearTimeout(lh),lh=null)}function mI(){rh=null,lh=null,(function(j){if(cl.size>0||Ws!=null)return!0;switch(j){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Uw)&&(_c(),fg()),Gw(nh(Uw))}function to(j){var oe,ye;if(!hn.value||(Uw=j,rh!=null||lh!=null))return;const we=Math.max(0,(ye=(oe=i.virtualScroll)==null?void 0:oe.emitIntervalMs)!=null?ye:32),Ee=Math.max(0,we-(pg()-Vw)),He=()=>{lh=null,rh=Go?Go(mI):null,rh==null&&mI()};U&&Ee>0?lh=window.setTimeout(He,Ee):He()}function gI(){bc.value+=1}function q2(j){if(ya.value&&j>=Bs.value){const oe=Zt.value[j],ye=Ae.value===!0&&Ne.value!==!0&&j>=Zt.value.length-2,we=oe?.type==="code_block"||oe?.type==="image"||oe?.type==="mermaid"||oe?.type==="infographic";if(!ye||we)return!1}return!oi.value||j=he.value&&(K.value||(K.value=!0,rg()),!al.value||!gr))return Zp(j),void(oe&&Du(j,!0));if(j{if(Pp.delete(He),!oi.value||Jo.value.has(He))return;const vt=xi.get(He);if(!vt)return;const it=ae(vt),lt=vt.ownerDocument||document,gt=lt.defaultView||window,Xe=!it||it===lt.documentElement||it===lt.body,at=!Xe&&it?Ve("nodeVisibilityFallback.root.getBoundingClientRect",()=>it.getBoundingClientRect()):null,It=Xe?0:at.top,At=Xe?Ve("nodeVisibilityFallback.clientHeight",()=>{var Dt,rn;return(rn=(Dt=gt.innerHeight)!=null?Dt:it?.clientHeight)!=null?rn:0}):at.bottom,Ut=Ve("nodeVisibilityFallback.node.getBoundingClientRect",()=>vt.getBoundingClientRect());Ut.bottom>=It-500&&Ut.top<=At+500&&Du(He,!0)},1800+Je);Pp.set(He,nt)})(j);let Ee=null;Ee=ze(()=>we.isVisible.value,He=>{if(He){Bp(j),Du(j,!0),Ee?.(),Ql.delete(j),hl.get(j)===we&&hl.delete(j);try{we.destroy()}catch{}}},{immediate:!0}),Ql.set(j,Ee),An.value&&ti()}function Yw(){Ws=null,Hs(()=>{let j=!1;for(const[oe,ye]of cl)cl.delete(oe),$r.get(oe)===ye.el&&Aa.get(oe)===ye.version&&(j=un(oe,ye.height,{allowShrink:ye.allowShrink})||j);return j})}function Gp(){Ws!=null&&(Xi?.(Ws),Ws=null),cl.clear()}function V2(j,oe){(function(ye,we,Ee){var He;if(!Number.isFinite(Ee)||Ee<=0||$r.get(ye)!==we)return;const Je=Aa.get(ye);if(Je==null)return;const nt=Zt.value[ye],vt=rt.value&&Ne.value!==!0&&!((He=i.nodes)!=null&&He.length)&&ye>=Zt.value.length-2,it=!(nt?.loading===!0||vt),lt=cl.get(ye),gt=lt?lt.allowShrink&&it:it,Xe=lt&&!gt?Math.max(lt.height,Ee):Ee;cl.set(ye,{height:Xe,allowShrink:gt,version:Je,el:we}),Ws==null&&(Ws=Go?Go(Yw):null,Ws==null&&Yw())})(j,oe,Rn(j,oe))}function _c(){for(const[j,oe]of $r)oe&&V2(j,oe)}function vI(){zo?.disconnect(),zo=null,Rr.clear()}function Jw(){for(;Nu.length;)$e(Nu.pop())}ze(So,j=>{j&&to("content")},{flush:"post"}),t({getVirtualMetrics:nh,captureVirtualState:function(j={}){var oe;return qp(nh("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:j.allowFallbackAnchor===!0,requireViewport:j.requireViewport===!0,includeEmptyState:(oe=j.includeEmptyState)==null||oe})},restoreVirtualState:function(j,oe={}){const ye=oe.restoreAnchor===!0,we=oe.restoreToken==null?"imperative":String(oe.restoreToken);cg=j,dg={restoreAnchor:ye,restoreToken:we,allowUncapturedAnchor:oe.allowUncapturedAnchor===!0},!jw(j,{restoreAnchor:ye,restoreToken:we,allowUncapturedAnchor:oe.allowUncapturedAnchor===!0})&&dI(j)||(cg=null,dg=null)},forceMeasure:function(j="manual"){return io(this,null,function*(){yield ft(),yield fI(),_c(),fg(),yield ft();const oe=nh(j);return Gw(oe,!0),oe})},settle:qw,scrollToNode:function(j,oe="start"){Up(),ql();const ye=Zt.value.length;if(ye<=0)return;const we=Xo(j,0,ye-1),Ee=()=>{var He;const Je=md({nodeIndex:we,offsetWithinNodePx:0}),nt=Br(we),vt=ag(),it=(He=vt?.clientHeight)!=null?He:0,lt=Lu();let gt=Je;if(oe==="center")gt=Je-it/2+nt/2;else if(oe==="end")gt=Je-it+nt;else if(oe==="nearest"&<!=null){if(Je>=lt&&Je+nt<=lt+it)return;gt=JeGa.value,j=>{if(!j){vI();for(const oe of Gl.values())for(const ye of oe)$e(ye);Gl.clear(),Aa.clear(),Jw(),Gp()}},{immediate:!0}),ze(Ne,j=>{j&&(function(){if(U&&Ne.value&&$r.size){Jw();for(const oe of[80,240,640]){const ye=Ie(oe,()=>{for(const[we,Ee]of $r)Ee&&V2(we,Ee)},"final");ye!=null&&Nu.push(ye)}}})(),to(j?"final":"content")});const wY=CF(()=>to("content"),16),CY=CF(()=>to("batch"),16);ze([()=>Zt.value.length,()=>Bs.value],()=>{jo.value&&Vp(),wY()},{flush:"post",immediate:!0}),ze([()=>uo.start,()=>uo.end],()=>{CY()},{flush:"post"});const{cleanupBatchScheduler:AY}=(function(j){const{props:oe,isClient:ye,isTestEnv:we,parsedNodesIdentity:Ee,parsedNodeCount:He,desiredRenderedCount:Je,datasetKey:nt,batchingEnabled:vt,incrementalRenderingActive:it,resolvedBatchSize:lt,resolvedInitialBatch:gt,renderedCount:Xe,adaptiveBatchSize:at,previousRenderContext:It,previousBatchConfig:At,requestFrame:Ut,cancelFrame:Dt,hasIdleCallback:rn,cleanupNodeVisibility:cn,onDatasetKeyChanged:wn,onDatasetChanged:yn}=j;let Cn=null,Wn="raf",Jn=null,Oi=0,er=!1,Us=!1;const nu=new Set,Ru=new Set;function _g(){if(ye){Cn!=null&&(Wn==="raf"&&Dt?Dt(Cn):Wn==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(Cn):Wn==="timeout"&&window.clearTimeout(Cn),Cn=null),Oi+=1;for(const Ar of nu)Dt&&Dt(Ar);for(const Ar of Ru)window.clearTimeout(Ar);nu.clear(),Ru.clear(),Jn=null,er=!1,Us=!1}}function ty(){return typeof performance<"u"?performance.now():Date.now()}function RI(Ar){(function(Ic){var xd;if(!it.value)return;const Mc=Math.max(2,(xd=oe.renderBatchBudgetMs)!=null?xd:6),Tc=Math.max(1,lt.value||1),iu=Math.max(1,Math.floor(Tc/4));Ic>1.5*Mc?at.value=Math.max(iu,Math.floor(.8*at.value)):Ic<.6*Mc&&at.value=Mc)return;const Tc=Math.max(1,Ar),iu=()=>{const Jp=ty();Cn=null;const Ig=Jn??Tc;Jn=null;const Xp=ty();Xe.value=Math.min(Mc,Xe.value+Ig),cn(Xe.value),(function(s3,ny){if(!ye)return void RI(ny);er=!0;const $I=++Oi;ft().then(()=>{var zI;if($I!==Oi)return;const qY=ty(),UY=Math.max(ny,qY-s3),jI=()=>{$I===Oi&&RI(UY)};if(Ut){let uh=null,e1=null,WI=!1;const qI=()=>{WI||(WI=!0,uh!==null&&(nu.delete(uh),uh=null),e1!==null&&(Ru.delete(e1),window.clearTimeout(e1),e1=null),jI())};return uh=Ut(()=>{qI()}),nu.add(uh),e1=window.setTimeout(()=>{uh!==null&&Dt&&Dt(uh),qI()},Math.max(32,(zI=oe.renderBatchIdleTimeoutMs)!=null?zI:120)),void Ru.add(e1)}const HI=window.setTimeout(()=>{Ru.delete(HI),jI()},0);Ru.add(HI)})})(Jp,ty()-Xp)};if(!ye||ml.immediate)return void iu();const Sd=Math.max(0,(Ic=oe.renderBatchDelay)!=null?Ic:16);if(Jn=Jn!=null?Math.max(Jn,Tc):Tc,Cn==null){if(!we&&rn&&window.requestIdleCallback){const Jp=Math.max(0,(xd=oe.renderBatchIdleTimeoutMs)!=null?xd:120);return Wn="idle",void(Cn=window.requestIdleCallback(()=>iu(),{timeout:Jp}))}if(Ut&&!we)return Wn="raf",void(Cn=Ut(()=>{Sd===0?iu():(Wn="timeout",Cn=window.setTimeout(()=>iu(),Sd))}));Wn="timeout",Cn=window.setTimeout(()=>iu(),Sd)}}function PI(Ar,ml={}){er?Us=!0:Ar==null?BI():OI(Ar,ml)}function BI(){it.value&&OI(vt.value?Math.max(1,Math.round(at.value)):Math.max(1,lt.value))}return ze([Ee,He,nt,it,lt,gt,()=>oe.renderBatchDelay],()=>{var Ar;const ml=He.value,Ic=It.value,xd=nt.value,Mc=!Object.is(xd,Ic.key),Tc=ml!==Ic.total,iu=Mc||Tc;It.value={key:xd,total:ml};const Sd=At.value,Jp=(Ar=oe.renderBatchDelay)!=null?Ar:16,Ig=Sd.batchSize!==lt.value||Sd.initial!==gt.value||Sd.delay!==Jp||Sd.enabled!==it.value;At.value={batchSize:lt.value,initial:gt.value,delay:Jp,enabled:it.value},Mc&&wn(ml),(iu||Ig||!it.value)&&_g(),(iu||Ig)&&(at.value=Math.max(1,lt.value||1)),iu&&yn();const Xp=Je.value;if(!ml)return Xe.value=0,void cn(0);if(!it.value)return Xe.value=Xp,void cn(Xe.value);const s3=Mc||Ic.total===0;Xe.value=s3||Ig?Math.min(Xp,gt.value):Math.min(Xe.value,Xp);const ny=Math.max(1,gt.value||lt.value||ml);Xe.value{it.value&&(typeof ml=="number"&&Ar<=ml||Ar>Xe.value&&PI())}),{cleanupBatchScheduler:_g}})({props:I,isClient:U,isTestEnv:yr,parsedNodesIdentity:Fr,parsedNodeCount:Oo,desiredRenderedCount:Ac,datasetKey:fY,batchingEnabled:Eu,incrementalRenderingActive:ya,resolvedBatchSize:jl,resolvedInitialBatch:ol,renderedCount:Bs,adaptiveBatchSize:ks,previousRenderContext:Bo,previousBatchConfig:Hl,requestFrame:Go,cancelFrame:Xi,hasIdleCallback:vr,cleanupNodeVisibility:D2,onDatasetKeyChanged:j=>{Gp(),Re(),ui(),gg(),j>0&&ll(j)},onDatasetChanged:()=>{An.value&&ti({immediate:!0})}});ze([ul,An,()=>F.value,()=>Y()],([j,oe])=>{if(!j)return R2(),void Vn();O2(),oe?ti({immediate:!0}):Vn()},{flush:"post",immediate:!0}),ze([()=>Zt.value.length,()=>An.value],j=>io(null,[j],function*([oe,ye]){ye&&oe&&U&&(yield ft(),ti({immediate:!0}))}),{flush:"post"}),ze(ei,j=>{j&&(function(){var oe;if(pr.value&&Zo.value&&Po.value&&((oe=fo.value)!=null&&oe[1]))return;const ye=Lt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),we=Lt({type:"list_item",children:[ye],raw:"- Probe paragraph text"}),Ee=Lt({type:"list",ordered:!1,items:[we],raw:"- Probe paragraph text"});pr.value=ye,Zo.value=we,Po.value=Ee;const He={1:null,2:null,3:null,4:null,5:null,6:null};for(let Je=1;Je<=6;Je++)He[Je]=Lt({type:"heading",level:Je,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Je)} Probe heading`});fo.value=He})()},{immediate:!0}),ze([()=>F.value,ei],()=>{if(!ei.value)return lg(),void(te.value=0);B2(),lg(),ei.value&&F.value&&typeof ResizeObserver<"u"&&(Cd=new ResizeObserver(()=>{B2(),lo.value&&ba(),jo.value&&Vp(),to("resize")}),Cd.observe(F.value))},{immediate:!0}),ze([ei,$t,Jl],()=>io(null,null,function*(){if(!ei.value)return le.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ui();yield ft(),(function(){if(!ei.value||typeof window>"u")return le.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ui();const j={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},oe=P2(bd(P.value),".paragraph-node");j.paragraph=T8(P.value,oe,"pre-wrap");const ye=bd(z.value),we=ye?.querySelector(".paragraph-node");j.listItem=T8(z.value,we,"pre-wrap");const Ee=Ve("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Je,nt;return(nt=(Je=W.value)==null?void 0:Je.offsetHeight)!=null?nt:0}),He=Ve("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Je,nt;return(nt=(Je=z.value)==null?void 0:Je.offsetHeight)!=null?nt:0});j.listWrapperOverhead=Math.max(0,Ee-He);for(let Je=1;Je<=6;Je++){const nt=P2(bd($[Je]),`h${Je}`);j.headings[Je]=T8($[Je],nt,"pre-wrap")}le.value=j,ui()})()}),{flush:"post",immediate:!0}),ze(()=>Zt.value.length,()=>{An.value&&ti({immediate:!0})}),ze([ei,te],()=>{ui(),An.value&&ti({immediate:!0}),lo.value&&ba(),jo.value&&Vp(),to("resize")},{immediate:!1}),ze(()=>oi.value,j=>{if(j)for(const[oe,ye]of xi)U2(oe,ye);else if(rg(),An.value)ti({immediate:!0});else for(const[oe,ye]of xi)ye&&Du(oe,!0)},{immediate:!1}),ze([se,he,()=>Y()],()=>{var j;(j=gr.refresh)==null||j.call(gr);for(const[oe,ye]of xi)U2(oe,ye)},{immediate:!1}),ze([()=>I.viewportPriority,()=>Zt.value.length,he],([j,oe,ye])=>{if(j!==!1){if(K.value&&(oe<=200||oe<=ye)){K.value=!1;for(const[we,Ee]of xi)U2(we,Ee)}}else K.value=!1}),ze(()=>Bs.value,()=>{An.value&&ti({immediate:!0})}),ze([Ho,Un,Ri,()=>Zt.value.length,An],()=>{tu()},{immediate:!0});let yg=null,kg=!1,Qp=null;function bg(){yg=null,Ew=null,Tw=void 0,Wp=null,gg()}function Xw(){Gp(),Re(),ui(),_o.clear();const j=Zt.value.length;j>0&&ll(j),Hw()}function e3(){Qw(),yt(),hg=null,oh=null,sh=null,H2=null,cg=null,dg=null,kg=!1,bg(),eI("restore"),ql(),Up()}function wg(j){var oe;return[(oe=qi())!=null?oe:"",vi(),Sc(),$2.value,mg(j),Zt.value.length,Math.round($s(0,Zt.value.length)),Math.round(th()),ao.count,Math.round(ao.total)].join(":")}function yI(){return io(this,null,function*(){var j,oe,ye,we;const Ee=(j=i.virtualScroll)==null?void 0:j.settledToken,He=mg(Ee),Je=vi(),nt=qi(),vt=Jl.value;if(hn.value&&((oe=i.virtualScroll)==null?void 0:oe.settleMode)==="manual"&&z2(Ee))if(Lw()){if(wg(Ee)!==Wp&&!kg){kg=!0;try{const it=yield qw({reason:"manual",expectedSettledTokenKey:He}),lt=mg()===He;Ww(Je,nt,vt)&&it.sessionKey===Je&&it.threadKey===nt&<&&it.stable&&it.phase==="final"&&(Wp=wg((ye=i.virtualScroll)==null?void 0:ye.settledToken))}finally{kg=!1,yield ft();const it=(we=i.virtualScroll)==null?void 0:we.settledToken,lt=z2(it)?wg(it):"";Ww(Je,nt,vt)&<&&Wp!==lt&&yI()}}}else to("manual")})}ze(hn,(j,oe)=>{if(j!==oe){if(!j)return e3(),void Qw();e3(),Xw(),Qp=Jl.value,to("content")}},{flush:"post"}),ze([hn,Jl],([j,oe])=>{j?Qp!=null?Qp!==oe&&(Qp=oe,(function(ye="resize"){Gp(),Re(),ui(),_o.clear();const we=Zt.value.length;we>0&&ll(we),Hw(),oh=null,sh=null,H2=null,hg=null,kg=!1,bg(),cI(),ft(()=>{_c(),lo.value&&ba(),jo.value&&Vp(),to(ye)})})("resize")):Qp=oe:Qp=null},{flush:"post",immediate:!0}),ze([hn,()=>vi(),()=>qi()],([j])=>{j&&(e3(),Xw(),eI("content"),to("content"))}),ze([hn,()=>vi(),()=>qi(),Jl,()=>Zt.value.length],([j])=>{j&&(function(oe="async-node"){let ye=!1;for(const[we,Ee]of Array.from(Ss.entries()))Iw(Ee)||(Ss.delete(we),Yn.delete(we),ye=!0);ye&&(jp(),to(oe))})("async-node")},{flush:"post"}),ze([hn,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.sessionKey},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.measurementKey},()=>i.indexKey,()=>G.value],([j])=>{j&&(gg(),(function(oe="content"){if(!hn.value)return;const ye=[],we=Zt.value.length,Ee=$p(we);for(const He of Array.from(_o.keys())){if(He>=we){ye.push(He);continue}if(He=we&&_o.delete(He);ye.length&&((function(He,Je={}){const nt=Array.from(He,Number);js(nt);let vt=0;if(Hs(()=>(vt=Ca(nt,Je),vt>0)),vt>0)(function(it){for(const lt of it)_o.delete(lt)})(nt);else for(const it of nt)Xs.delete(it)})(ye,{notify:!1}),ui(),bg(),lo.value&&ba(),jo.value&&Vp(),to(oe))})("content"))},{flush:"post",immediate:!0}),ze([hn,()=>Zt.value.length,()=>vi(),()=>qi()],([j,oe,ye,we],[Ee,He,Je,nt])=>{j&&Ee&&ye===Je&&we===nt&&oe!==He&&bg()},{flush:"post"}),ze([hn,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.heightCache},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.heightCacheWidth},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.restoreState},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.measurementKey},()=>Zt.value.length,()=>vi(),te],()=>{cI()},{flush:"post",immediate:!0}),ze([hn,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.restoreState},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.restoreAnchor},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.measurementKey},()=>Zt.value.length,()=>vi(),te],j=>io(null,[j],function*([oe,ye]){if(!oe||!ye)return;yield ft();const we=(function(){var Ee;const He=(Ee=i.virtualScroll)==null?void 0:Ee.restoreAnchor;return He==null||He===!1?null:He===!0?"true":String(He)})();jw(ye,{restoreAnchor:we!=null,restoreToken:we??void 0})}),{flush:"post",immediate:!0}),ze([hn,te,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.restoreState},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.measurementKey}],([j])=>{var oe;if(!j)return;const ye=(oe=i.virtualScroll)==null?void 0:oe.restoreState;ye&&oh&&sh==="restore"&&(aI(ye)||(Xw(),oh=null,sh=null,to("resize")))},{flush:"post"}),ze([hn,()=>Zt.value.length,()=>vi(),te],j=>io(null,[j],function*([oe]){var ye;const we=cg,Ee=dg;oe&&we&&(yield ft(),!jw(we,{restoreAnchor:Ee?.restoreAnchor===!0,restoreToken:(ye=Ee?.restoreToken)!=null?ye:"imperative",allowUncapturedAnchor:Ee?.allowUncapturedAnchor===!0})&&dI(we)||(cg=null,dg=null))}),{flush:"post",immediate:!0}),ze([hn,Ne,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.settleMode},()=>vi(),()=>qi(),Jl,fl,dl,()=>Bs.value,Ac,()=>ao.count,()=>ao.total],([j,oe,ye])=>{if(!j||oe!==!0||ye==="manual"||!Nw())return;const we=(function(){var Ee;const He=Zt.value.length;return[(Ee=qi())!=null?Ee:"",vi(),Sc(),$2.value,He,Math.round($s(0,He)),Math.round(th()),ao.count,Math.round(ao.total)].join(":")})();yg!==we&&(yg=we,qw({reason:"final"}).then(Ee=>{Ee.stable||yg!==we||(yg=null)}))},{flush:"post",immediate:!0}),ze([hn,Ne,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.settleMode},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.settledToken},()=>vi(),()=>qi(),Jl,fl,dl,()=>Bs.value,Ac,()=>Zt.value.length,()=>ao.count,()=>ao.total],()=>{yI()},{flush:"post",immediate:!0}),ze([()=>Zt.value.length,An,Un,Ri,()=>uo.start,()=>uo.end],([j,oe,ye,we,Ee,He])=>{ue.value&&Ke("virtualization",{nodes:j,virtualization:oe,maxLiveNodes:ye,buffer:we,focusIndex:Ho.value,scroll:oe?(()=>{const Je=Xa.value||ae();return Je?{reverse:Ce(Je),scrollTop:Math.round(Je.scrollTop),scrollTopAbs:Math.round(Math.abs(Je.scrollTop)),scrollHeight:Math.round(Je.scrollHeight),clientHeight:Math.round(Je.clientHeight)}:null})():null,liveRange:{start:Ee,end:He},rendered:Bs.value})}),ze([()=>I.customId],([j],oe,ye)=>{if(!j||Ps)return;const we=(function(Ee,He){return Ee?(_s.controllers[Ee]=He,()=>{_s.controllers[Ee]===He&&delete _s.controllers[Ee]}):()=>{}})(j,{captureRestoreAnchor:wr,restoreAnchor:wa,getAnchorDrift:As,getReport:Wi});ye(()=>{we()})},{immediate:!0}),ii(()=>{(function(){if(hn.value)try{_c(),fg();const j=nh("manual");hI(j)&&(O(j),hg=j,Vw=pg());const oe=qp(j,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});oe&&(H(oe),oe.anchor&&R(oe.anchor),Kp=vg(oe))}catch{}})(),AY(),rg(),be(),vI();for(const j of Gl.values())for(const oe of j)$e(oe);Gl.clear(),Aa.clear(),_o.clear(),Jw(),Gp(),lg(),ql(),Up(),Qw(),R2(),Vn()});const xY=d0("ViewportDeferredMermaidBlockNode",Xu({loader:()=>io(null,null,function*(){try{return(yield qo(()=>import("./index11-oTpPg1Iy.js"),__vite__mapDeps([7,5]))).default}catch(j){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".',j),bl}}),loadingComponent:OF,delay:0}),OF),SY=d0("ViewportDeferredInfographicBlockNode",Xu({loader:()=>io(null,null,function*(){try{return(yield qo(()=>import("./index10-DPt9V4bc.js"),[])).default}catch(j){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.',j),bl}}),loadingComponent:RF,delay:0}),RF),_Y=d0("ViewportDeferredD2BlockNode",Xu(()=>io(null,null,function*(){try{return(yield qo(()=>import("./index8-MiLy1Wbt.js"),[])).default}catch(j){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".',j),bl}})),bl),kI={text:Fo,paragraph:rp,heading:Z4,code_block:k8,list:um,list_item:am,blockquote:j9,table:G0,definition_list:H9,footnote:W9,footnote_reference:la,footnote_anchor:K0,admonition:K9,vmr_container:U9,hardbreak:ff,link:Xr,image:df,thematic_break:q9,math_inline:Iu,math_block:_q,strong:Yr,emphasis:el,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,superscript:Ml,emoji:Il,checkbox:ra,checkbox_input:ra,inline_code:Er,html_inline:aa,reference:Qr,html_block:Z0},IY=D(()=>qs()),bI=D(()=>bF(I.codeBlockProps)),MY=D(()=>bF(I.codeBlockProps,{omit:["langs"]})),wI=D(()=>Bt(Bt({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 me.value=="boolean"?{showTooltips:me.value}:{}),MY.value)),CI=D(()=>Bt(Dn(Bt({},wI.value),{langs:I.langs}),bI.value));function AI(j){return typeof j=="boolean"?j:void 0}const TY=D(()=>{const j=I.codeBlockProps||{},oe={},ye=AI(j.showLineNumbers);ye!==void 0&&(oe.showLineNumbers=ye);const we=AI(j.diffInline);we!==void 0&&(oe.diffInline=we);const Ee=(function(He){const Je=Number(He);return Number.isFinite(Je)&&Je>0?Je:void 0})(j.reservedHeightPx);return Ee!==void 0&&(oe.reservedHeightPx=Ee),oe}),EY=D(()=>Bt(Bt({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,themes:I.themes,langs:I.langs,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof me.value=="boolean"?{showTooltips:me.value}:{}),bI.value)),LY=D(()=>Bt({},I.mermaidProps||{})),xI=D(()=>Bt({},I.d2Props||{})),NY=D(()=>Bt({},I.infographicProps||{})),Cg=D(()=>({typewriter:f.value,fade:I.fade,customHtmlTags:Ji.value.customHtmlTags})),FY=D(()=>Bt(Bt({},Cg.value),typeof me.value=="boolean"?{showTooltip:me.value}:{})),DY=D(()=>Bt(Bt({},Cg.value),typeof me.value=="boolean"?{showTooltips:me.value}:{})),RY=D(()=>Bt(Bt({},Cg.value),typeof me.value=="boolean"?{showTooltips:me.value}:{})),OY=D(()=>Bt(Bt({},Cg.value),typeof me.value=="boolean"?{showTooltips:me.value}:{}));function PY(j){return Array.isArray(j.children)&&j.children.length>0}const K2=D(()=>On.value.map(j=>{var oe,ye,we,Ee,He,Je,nt,vt;let it=(function(Dt){var rn,cn,wn,yn,Cn,Wn,Jn;if(Dt.type!=="code_block")return Dt;const Oi=Dt,er=[String((rn=Oi.language)!=null?rn:""),String((cn=Oi.loading)!=null?cn:""),String((wn=Oi.diff)!=null?wn:""),String((yn=Oi.code)!=null?yn:""),String((Cn=Oi.originalCode)!=null?Cn:""),String((Wn=Oi.updatedCode)!=null?Wn:""),String((Jn=Oi.raw)!=null?Jn:"")].join("\0"),Us=Ja.get(Oi);if(Us&&Us.signature===er)return Us.node;const nu=Bt({},Oi);return Ja.set(Oi,{signature:er,node:nu}),nu})(j.node);const lt=Z2(it);let gt=MI(it,lt);if((it.type==="html_block"||it.type==="html_inline")&>===kI[it.type]){const Dt=it,rn=String((oe=Dt.tag)!=null?oe:"").trim().toLowerCase()||YH(Dt.content);if(rn){const cn=Sn.value[rn];if(Yi.value.has(rn)&&cn)gt=cn,it=Dn(Bt({},Dt),{type:rn,tag:rn,content:gme(Dt.content,rn)});else if(JH((ye=Dt.content)!=null?ye:Dt.raw,rn)){const wn=String((Ee=(we=Dt.content)!=null?we:Dt.raw)!=null?Ee:"");it.type==="html_inline"?(gt=Fo,it={type:"text",content:wn,raw:wn}):(gt=rp,it={type:"paragraph",children:[{type:"text",content:wn,raw:wn}],raw:wn})}}}const Xe=it.type==="code_block"&&m.value==="pre"&>===bl&&!t3(Sn.value,lt);let at=Bt({},(function(Dt,rn,cn){const wn=rn??Z2(Dt);if(Dt.type==="code_block"){const yn=wn?t3(Sn.value,wn):void 0;if(cn&&m.value==="pre"&&!yn&&cn===bl)return TY.value;if(cn&&wn&&cn===yn)return wn==="mermaid"?_I(Dt):wn==="infographic"?II(Dt):wn==="d2"||wn==="d2lang"?xI.value:CI.value;if(cn&&cn===Sn.value.code_block)return CI.value;if(Me(cn))return EY.value}return wn==="mermaid"?_I(Dt):wn==="infographic"?II(Dt):wn==="d2"||wn==="d2lang"?xI.value:Dt.type==="link"?FY.value:Dt.type==="list"?DY.value:Dt.type==="blockquote"?RY.value:Dt.type==="table"?OY.value:Dt.type==="code_block"?wI.value:Cg.value})(it,lt,gt));const It=ei.value?an.value[j.index]:null;it.type==="code_block"&&It?.kind==="code-block"&&(at=Dn(Bt({},at),Xe?{reservedHeightPx:(He=It.height)!=null?He:It.contentHeight}:{estimatedHeightPx:It.height,estimatedContentHeightPx:It.contentHeight,estimatedDiffInline:It.diffInline})),Xe||it.type!=="code_block"||lt!=="mermaid"||O1(at.estimatedPreviewHeightPx)!=null||(at=Dn(Bt({},at),{estimatedPreviewHeightPx:fb(cb(String((Je=it.code)!=null?Je:"")))})),Xe||it.type!=="code_block"||lt!=="infographic"||O1(at.estimatedPreviewHeightPx)!=null||(at=Dn(Bt({},at),{estimatedPreviewHeightPx:hb(db(String((nt=it.code)!=null?nt:"")))})),it.type==="math_block"&&(at=Dn(Bt({},at),{cacheScope:Nn}));const At=(function(Dt,rn){const cn=String(Dt.type);return!v2(cn)&&Sn.value[cn]===rn})(it,gt),Ut=At?$x(it,pe.value):void 0;return Dn(Bt({},j),{node:it,component:gt,bindings:at,customBindings:Bt(Bt({},Ut??{}),at),rendersCustomNode:At,hasSlotChildren:PY(it),slotContent:String((vt=it.content)!=null?vt:""),isCodeBlock:it.type==="code_block",indexKey:`${IY.value}-${j.index}`,vnodeKey:`${eh.value}\0${j.index}\0${it.type}`})}));function Z2(j){var oe;return j?.type==="code_block"?String((oe=j.language)!=null?oe:"").trim().toLowerCase():""}function t3(j,oe){const ye=oe.trim().toLowerCase();if(ye)for(const we of[ye,U4(ye),aq(ye)]){const Ee=we&&j[we];if(Ee)return Ee}}function SI(j,oe,ye,we){var Ee,He;const Je=Bt({},j.value);return O1(Je.estimatedPreviewHeightPx)==null&&(Je.estimatedPreviewHeightPx=we(ye(String((Ee=oe?.code)!=null?Ee:"")),void 0,Je.maxHeight==="none"?null:(He=O1(Je.maxHeight))!=null?He:void 0)),Je}function _I(j){return SI(LY,j,cb,fb)}function II(j){return SI(NY,j,db,hb)}function MI(j,oe){if(!j)return zA;const ye=Sn.value,we=ye[String(j.type)];if(j.type==="code_block"){const Ee=oe??Z2(j),He=Ee?t3(ye,Ee):void 0;return He||(m.value==="pre"?ye.code_block||bl:Ee==="mermaid"?ye.mermaid||xY:Ee==="infographic"?ye.infographic||SY:Ee==="d2"||Ee==="d2lang"?ye.d2||_Y:we||ye.code_block||st.value)}return we||kI[String(j.type)]||zA}function n3(j){o("click",j)}function BY(j){var oe;(oe=j.target)!=null&&oe.closest("[data-node-index]")&&o("mouseover",j)}function $Y(j){var oe;(oe=j.target)!=null&&oe.closest("[data-node-index]")&&o("mouseout",j)}function TI(j){o("mouseover",j)}function EI(j){o("mouseout",j)}const ah=q(null),pl=q(!1),Ag=q(null),zY=D(()=>!(I.domMode!=="minimal"||Q.value||I.fade!==!1||f.value||pl.value||bs.value||An.value||fn.value||Ue.value||zl.value||Object.keys(Sn.value).length!==0));let xg,Yp=null,i3=0,G2=0,Q2=0;const LI=["code_block","admonition","table","math_block","html_block","image","thematic_break"],jY=new Set(LI),NI=[".typewriter-cursor",".height-estimation-probes",...LI.map(j=>`[data-node-type="${j}"]`),"script","style"].join(",");function FI(j){if(!j||typeof j!="object")return!1;const oe=j.type;return typeof oe=="string"&&jY.has(oe)}function Y2(j){var oe,ye;if(!j||typeof j!="object")return 0;const we=j,Ee=(ye=(oe=we.raw)!=null?oe:we.content)!=null?ye:we.code;if(typeof Ee=="string")return Ee.length;const He=we.children;if(Array.isArray(He))return He.reduce((nt,vt)=>nt+Y2(vt),0);const Je=we.items;return Array.isArray(Je)?Je.reduce((nt,vt)=>nt+Y2(vt),0):0}function J2(){xg&&(clearTimeout(xg),xg=void 0)}function o3(){i3+=1,Yp!=null&&(Xi?.(Yp),Yp=null)}function Sg(){o3(),Ad(),ah.value&&(ah.value.style.visibility="hidden")}function HY(j){var oe;if(j.nodeType!==Node.TEXT_NODE||!((oe=j.textContent)!=null?oe:"").trim())return!1;const ye=j.parentElement;return!!ye&&!ye.closest(NI)}function WY(j){let oe=j.lastChild;for(;oe;){if(HY(oe))return oe;if(oe.nodeType===Node.ELEMENT_NODE){const ye=oe;if(!ye.matches(NI)&&ye.lastChild){oe=ye.lastChild;continue}}for(;oe&&oe!==j&&!oe.previousSibling;)oe=oe.parentNode;if(!oe||oe===j)break;oe=oe.previousSibling}return null}function DI(){const j=K2.value;for(let oe=j.length-1;oe>=0;oe--){const ye=j[oe];if(!ye||FI(ye.node)||!q2(ye.index))continue;const we=xi.get(ye.index);if(!we)continue;const Ee=WY(we);if(Ee)return Ee}return null}function Ad(){Ag.value&&(Ag.value.classList.remove(PF),Ag.value=null)}function X2(){if(d.value!=="simple"||!U||!pl.value||!F.value)return void Ad();const j=DI(),oe=j?(function(ye){var we;const Ee=(we=ye.parentElement)==null?void 0:we.closest(".text-node");return Ee instanceof HTMLElement?Ee:ye.parentElement})(j):null;oe!==Ag.value&&(Ad(),oe&&(oe.classList.add(PF),Ag.value=oe))}function ey(){if(d.value!=="precise"||!U||!pl.value||Yp!=null)return;const j=i3,oe=()=>{Yp=null,j===i3&&(function(){var ye,we;if(d.value!=="precise"||!(U&&pl.value&&F.value&&ah.value))return;const Ee=F.value,He=ah.value;He.style.visibility="hidden";const Je=DI();if(!Je)return;let nt=0,vt=0,it=20,lt=!1;if(Je?.textContent){const gt=Je.textContent.length,Xe=document.createRange();Xe.setStart(Je,Math.max(0,gt-1)),Xe.setEnd(Je,gt);const at=typeof Xe.getClientRects=="function"?Xe.getClientRects():void 0,It=(we=at?.[at.length-1])!=null?we:(ye=Je.parentElement)==null?void 0:ye.getBoundingClientRect();if(It){const At=Ve("typewriterCursor.root.getBoundingClientRect",()=>Ee.getBoundingClientRect());nt=It.right-At.left+Ee.scrollLeft,vt=It.top-At.top+Ee.scrollTop,it=It.height||it,lt=!0}Xe.detach()}lt&&(He.style.transform=`translate(${Math.max(0,nt)}px, ${Math.max(0,vt)}px)`,He.style.height=`${it}px`,He.style.visibility="visible")})()};Go?Yp=Go(oe):oe()}return ze([ke,()=>i.content,()=>i.nodes,()=>I.typewriter,Ne],()=>io(null,null,function*(){var j,oe;if(!U||Q.value||!re.value)return;if(Ne.value)return pl.value=!1,J2(),void Sg();if((j=i.nodes)!=null&&j.length)return pl.value=!1,J2(),Sg(),G2=((oe=i.content)!=null?oe:"").length,void(Q2=ke.value.length);const ye=(function(){var nt,vt;return(nt=i.nodes)!=null&&nt.length?i.nodes.reduce((it,lt)=>it+Y2(lt),0):((vt=i.content)!=null?vt:"").length})(),we=(function(){var nt;return(nt=i.nodes)!=null&&nt.length?i.nodes.reduce((vt,it)=>vt+Y2(it),0):ke.value.length})(),Ee=!FI(Zt.value[Zt.value.length-1]),He=ye>G2,Je=we>Q2;if(!f.value||!Ee||!He&&!Je)return f.value&&Ee||(pl.value=!1,Sg()),G2=ye,void(Q2=we);G2=ye,Q2=we,pl.value=!0,d.value==="precise"&&ah.value&&(ah.value.style.visibility="hidden"),J2(),yield ft(),d.value==="simple"?X2():(Ad(),ey()),xg=setTimeout(()=>{xg=void 0,pl.value=!1},3e3)}),{flush:"post",immediate:!0}),ze(pl,j=>io(null,null,function*(){j?(yield ft(),d.value!=="simple"?(Ad(),d.value==="precise"&&ey()):X2()):Sg()}),{flush:"post"}),ze(d,()=>io(null,null,function*(){if(U&&!Q.value&&re.value&&pl.value){if(yield ft(),d.value==="simple")return o3(),void X2();Ad(),d.value!=="precise"?Sg():ey()}}),{flush:"post"}),ze([()=>Bs.value,()=>uo.start,()=>uo.end],()=>io(null,null,function*(){U&&!Q.value&&re.value&&pl.value&&(yield ft(),d.value!=="simple"?(Ad(),d.value==="precise"&&ey()):X2())}),{flush:"post"}),ii(()=>{J2(),o3(),Ad(),Wt.clear()}),(j,oe)=>{const ye=QB("NodeRenderer",!0);return p(Q)?(b(!0),N(Le,{key:0},Ct(K2.value,we=>(b(),N(Le,{key:we.vnodeKey},[we.rendersCustomNode?(b(),fe(To(we.component),ci({key:0,ref_for:!0},we.customBindings,{node:we.node,loading:we.node.loading,"index-key":we.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onClick:n3,onMouseover:TI,onMouseout:EI,onCopy:oe[0]||(oe[0]=Ee=>s(Ee)),onHandleArtifactClick:oe[1]||(oe[1]=Ee=>o("handleArtifactClick",Ee))}),{default:de(()=>[we.hasSlotChildren?(b(),fe(ye,ci({key:0,ref_for:!0},ji.value,{nodes:we.node.children,"index-key":we.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):we.slotContent?(b(),fe(ye,ci({key:1,ref_for:!0},ji.value,{content:we.slotContent,final:!we.node.loading,"index-key":`${we.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):X("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),fe(To(we.component),ci({key:1,node:we.node,loading:we.node.loading,"index-key":we.indexKey},{ref_for:!0},we.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onClick:n3,onMouseover:TI,onMouseout:EI,onCopy:oe[2]||(oe[2]=Ee=>s(Ee)),onHandleArtifactClick:oe[3]||(oe[3]=Ee=>o("handleArtifactClick",Ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(b(),N("div",{key:1,ref_key:"containerRef",ref:F,class:De(["markstream-vue markdown-renderer",[{dark:I.isDark},{virtualized:An.value},{"virtual-scroll-coordinated":So.value},{"stable-layout":xs.value},{"typewriter-simple-cursor":pl.value&&d.value==="simple"}]]),"data-custom-id":I.customId,onClick:n3,onMouseover:BY,onMouseout:$Y},[Li.value||An.value?(b(),N(Le,{key:0},[Li.value?(b(),fe(A4e,{key:0,width:$t.value,"flow-root":An.value||So.value,"paragraph-node":pr.value,"list-item-node":Zo.value,"list-node":Po.value,"heading-nodes":fo.value,"set-paragraph-wrapper":Ht,"set-list-item-wrapper":vn,"set-list-wrapper":Bn,"set-heading-wrapper":wd},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):X("",!0),An.value?(b(),N("div",{key:1,class:"node-spacer",style:on({height:`${xn.value}px`}),"aria-hidden":"true"},null,4)):X("",!0)],64)):X("",!0),zY.value?(b(!0),N(Le,{key:1},Ct(K2.value,we=>(b(),N(Le,{key:we.vnodeKey},[q2(we.index)?(b(),fe(To(we.component),ci({key:0,node:we.node,loading:we.node.loading,"index-key":we.indexKey},{ref_for:!0},we.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onMouseover:oe[4]||(oe[4]=Ee=>o("mouseover",Ee)),onMouseout:oe[5]||(oe[5]=Ee=>o("mouseout",Ee)),onCopy:oe[6]||(oe[6]=Ee=>s(Ee)),onHandleArtifactClick:oe[7]||(oe[7]=Ee=>o("handleArtifactClick",Ee))}),null,16,["node","loading","index-key","custom-id","is-dark"])):X("",!0)],64))),128)):(b(!0),N(Le,{key:2},Ct(K2.value,we=>(b(),N("div",{key:we.vnodeKey,ref_for:!0,ref:Ee=>U2(we.index,Ee),class:"node-slot","data-node-index":we.index,"data-node-type":we.node.type},[q2(we.index)?(b(),N("div",{key:0,ref_for:!0,ref:Ee=>(function(He,Je){var nt;Je||(function(gt){const Xe=`${qs()}-${gt}`;let at=!1;for(const It of Array.from(Yn.keys())){const At=Ss.get(It);(At?.index===gt||It===Xe||It.startsWith(`${Xe}-`))&&(Yn.delete(It),Ss.delete(It),at=!0)}at&&(jp(),to("async-node"))})(He),cl.delete(He),(function(gt){var Xe;const at=((Xe=Aa.get(gt))!=null?Xe:0)+1;Aa.set(gt,at)})(He);const vt=Gl.get(He);if(vt){for(const gt of vt)$e(gt);Gl.delete(He)}if((function(gt){const Xe=Rr.get(gt);Xe&&(zo?.unobserve(Xe),Ya.delete(Xe),Rr.delete(gt))})(He),!Je||!Ga.value)return $r.delete(He),void Aa.delete(He);$r.set(He,Je);const it=()=>{V2(He,Je)};queueMicrotask(it);const lt=(zo||typeof ResizeObserver>"u"||(zo=new ResizeObserver(gt=>{if(gt.length)for(const Xe of gt){const at=Ya.get(Xe.target),It=Rr.get(at??-1);at!=null&&It&&V2(at,It)}else _c()})),zo);if(lt&&(Rr.set(He,Je),Ya.set(Je,He),lt.observe(Je)),typeof window<"u"){const gt=((nt=Zt.value[He])==null?void 0:nt.type)==="code_block"?[16,80,240,800]:Ne.value?[80]:[];if(gt.length){const Xe=gt.map(at=>Ie(at,it,"node-resize")).filter(at=>at!=null);Xe.length&&Gl.set(He,Xe)}}})(we.index,Ee),class:"node-content"},[we.isCodeBlock?we.rendersCustomNode?(b(),fe(To(we.component),ci({key:1,ref_for:!0},we.customBindings,{node:we.node,loading:we.node.loading,"index-key":we.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:oe[12]||(oe[12]=Ee=>s(Ee)),onHandleArtifactClick:oe[13]||(oe[13]=Ee=>o("handleArtifactClick",Ee))}),{default:de(()=>[we.hasSlotChildren?(b(),fe(ye,ci({key:0,ref_for:!0},ji.value,{nodes:we.node.children,"index-key":we.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):we.slotContent?(b(),fe(ye,ci({key:1,ref_for:!0},ji.value,{content:we.slotContent,final:!we.node.loading,"index-key":`${we.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):X("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),fe(To(we.component),ci({key:2,node:we.node,loading:we.node.loading,"index-key":we.indexKey},{ref_for:!0},we.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:oe[14]||(oe[14]=Ee=>s(Ee)),onHandleArtifactClick:oe[15]||(oe[15]=Ee=>o("handleArtifactClick",Ee))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(b(),fe(mo,{key:0,name:"fade",css:I.fade!==!1,appear:I.fade!==!1},{default:de(()=>[we.rendersCustomNode?(b(),fe(To(we.component),ci({key:0,ref_for:!0},we.customBindings,{node:we.node,loading:we.node.loading,"index-key":we.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:oe[8]||(oe[8]=Ee=>s(Ee)),onHandleArtifactClick:oe[9]||(oe[9]=Ee=>o("handleArtifactClick",Ee))}),{default:de(()=>[we.hasSlotChildren?(b(),fe(ye,ci({key:0,ref_for:!0},ji.value,{nodes:we.node.children,"index-key":we.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):we.slotContent?(b(),fe(ye,ci({key:1,ref_for:!0},ji.value,{content:we.slotContent,final:!we.node.loading,"index-key":`${we.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):X("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),fe(To(we.component),ci({key:1,node:we.node,loading:we.node.loading,"index-key":we.indexKey},{ref_for:!0},we.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:oe[10]||(oe[10]=Ee=>s(Ee)),onHandleArtifactClick:oe[11]||(oe[11]=Ee=>o("handleArtifactClick",Ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(b(),N("div",{key:1,class:"node-placeholder",style:on({height:`${Br(we.index)}px`})},null,4))],8,_4e))),128)),pl.value&&d.value==="precise"?(b(),N("span",{key:3,ref_key:"typewriterCursorRef",ref:ah,class:"typewriter-cursor","aria-hidden":"true"},null,512)):X("",!0),An.value?(b(),N("div",{key:4,class:"node-spacer",style:on({height:`${En.value}px`}),"aria-hidden":"true"},null,4)):X("",!0)],42,S4e))}}})),[["__scopeId","data-v-a9489508"]]),Ll=zq;Ll.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Ll.__name,Ll.name].filter(n=>!!n));for(const n of t)e.component(n,zq)};const Xx=Object.freeze(Object.defineProperty({__proto__:null,default:Ll},Symbol.toStringTag,{value:"Module"})),I4e={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"},M4e={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"},T4e={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"},E4e={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"},L4e={class:"admonition-title"},N4e=["aria-expanded","aria-controls"],F4e=["id"],K9=Ei(ot({__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=q(!!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)=>(b(),N("div",{class:De(["admonition",[`admonition-${i.node.kind}`]])},[_("div",{id:a,class:"admonition-legend"},[i.node.kind==="note"||i.node.kind==="info"?(b(),N("svg",I4e,[...c[1]||(c[1]=[_("circle",{cx:"12",cy:"12",r:"10"},null,-1),_("path",{d:"M12 16v-4"},null,-1),_("path",{d:"M12 8h.01"},null,-1)])])):i.node.kind==="tip"?(b(),N("svg",M4e,[...c[2]||(c[2]=[_("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),_("path",{d:"M9 18h6"},null,-1),_("path",{d:"M10 22h4"},null,-1)])])):i.node.kind==="warning"||i.node.kind==="caution"?(b(),N("svg",T4e,[...c[3]||(c[3]=[_("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),_("path",{d:"M12 9v4"},null,-1),_("path",{d:"M12 17h.01"},null,-1)])])):i.node.kind==="danger"||i.node.kind==="error"?(b(),N("svg",E4e,[...c[4]||(c[4]=[_("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),_("path",{d:"M12 8v4"},null,-1),_("path",{d:"M12 16h.01"},null,-1)])])):X("",!0),_("span",L4e,B(s.value),1),i.node.collapsible?(b(),N("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(b(),N("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]=[_("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,N4e)):X("",!0)]),si(_("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[V(p(Ll),{"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,F4e),[[Eo,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);K9.install=e=>{e.component(K9.__name,K9)};const UA=()=>qo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let Py=null,By=UA,$y=null,BF=!1,$F=!1;function V8t(){return io(this,null,function*(){if(Py)return Py;const e=By;return e?e===UA&&BF?null:$y||($y=io(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===UA)return e===By&&(BF=!0,(function(i){$F||($F=!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===By&&($y=null)}return e!==By?null:t?(Py=(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),Py):null}),$y):null})}let zy=null,jq=null,jy=null;function K8t(){return typeof jq=="function"}function Z8t(){return io(this,null,function*(){if(zy)return zy;const e=jq;return e?jy||(jy=io(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?(zy=n,zy):null}).finally(()=>{jy=null}),jy):null})}const G8t=Symbol("markstreamLanguageIconResolver");function D4e(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function R4e(e){return new Worker("/assets/mermaidParser.worker-BFSlSHEW.js",{type:"module",name:e?.name})}let zF=!1;function Hq(){zF||typeof Worker>"u"||(zF=!0,f9e(new D4e),S9e(new R4e))}Hq();function Jd(e,t,n="/api/v1"){return`${e}${n}${t.startsWith("/")?t:`/${t}`}`}function jF(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 eS={},Cb=Symbol("resolveImage"),Dc=3e4,Hy=5*6e4,HF=5*6e4,Wq="0123456789ABCDEFGHJKMNPQRSTVWXYZ",VA=500,qq=40101;function WF(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 f0(e=Dc){try{return AbortSignal.timeout(e)}catch{return}}function O4e(e,t){const n=f0(e);if(n===void 0)return t;try{return AbortSignal.any([n,t])}catch{return t}}function P4e(e,t){let n="",i=e;for(let o=0;oWq[n%32]).join("")}function jg(){return`${P4e(Date.now(),10)}${B4e(16)}`}function qF(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>VA?`${t.slice(0,VA)}...`:t:void 0}catch{return}}class UF{constructor(t){this.opts=t,this.tracer=t.tracer??eS}tracer;async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t,n,i){let o=Jd(this.opts.origin,t,this.opts.restBasePath);if(n){const c=new URLSearchParams;WF(c,n);const d=c.toString();d&&(o=`${o}?${d}`)}const s=jg(),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:f0()})}catch(c){throw this.tracer.restFailure?.({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c}),new Xl({message:`Network error calling GET ${t}`,cause:c,method:"GET",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Dc,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 z7({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 Zu({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)}async postZip(t,n,i){const o="POST",s=Jd(this.opts.origin,t,this.opts.restBasePath),r=jg(),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:f0(Hy)})}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new Xl({message:`Network error calling ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"fetch",timeoutMs:Hy,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 y=h?.code??u.status,k=h?.msg??u.statusText;throw this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:y,msg:k,envelopeRequestId:h?.request_id}),new Zu({code:y,msg:k,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 Xl({message:`Invalid ZIP response from ${o} ${t}`,cause:g,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:Hy,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 Xl({message:`Failed to read ZIP response from ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:Hy,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=Jd(this.opts.origin,t,this.opts.restBasePath),s=jg(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:qF(n)});let a;try{a=await fetch(o,{method:"POST",headers:r,body:n,signal:f0()})}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:d}),new Xl({message:`Network error calling POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Dc,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 Xl({message:`Failed to parse JSON response from POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Dc,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 Zu({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=Jd(this.opts.origin,t,this.opts.restBasePath),s=jg(),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:qF(n)}),new Promise((a,u)=>{const c=new XMLHttpRequest;c.open("POST",o),c.timeout=Dc;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 Xl({message:`Network error calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Dc,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 Xl({message:`Timeout calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Dc,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 Xl({message:`Failed to parse JSON response from POST ${t}`,cause:f,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Dc,status:c.status,statusText:c.statusText,bodyPreview:c.responseText.slice(0,VA),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 Zu({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={}){const r=s.allowCodes??[],l=s.timeoutMs??Dc,a=s.signal;let u=Jd(this.opts.origin,n,this.opts.restBasePath);if(o){const y=new URLSearchParams;WF(y,o);const k=y.toString();k&&(u=`${u}?${k}`)}const c=jg(),d={"X-Request-Id":c};this.addClientHeaders(d),i!==void 0&&(d["Content-Type"]="application/json; charset=utf-8");const f=Date.now();this.tracer.restRequest?.({method:t,path:n,url:u,requestId:c,body:i});let h;try{h=await fetch(u,{method:t,headers:d,body:i!==void 0?JSON.stringify(i):void 0,signal:a!==void 0?O4e(l,a):f0(l)})}catch(y){throw a?.aborted&&y instanceof Error&&y.name==="AbortError"?y:(this.tracer.restFailure?.({method:t,path:n,requestId:c,phase:"fetch",durationMs:Date.now()-f,error:y}),new Xl({message:`Network error calling ${t} ${n}`,cause:y,method:t,path:n,url:u,requestId:c,phase:"fetch",timeoutMs:l,timestamp:Date.now(),durationMs:Date.now()-f}))}let m;const g=h.clone();try{const y=await h.text();m=h.status===204&&y===""?{code:0,msg:"",data:null,request_id:c}:JSON.parse(y)}catch(y){throw a?.aborted&&y instanceof Error&&y.name==="AbortError"?y:(this.tracer.restFailure?.({method:t,path:n,requestId:c,phase:"parse",durationMs:Date.now()-f,status:h.status,error:y}),new Xl({message:`Failed to parse JSON response from ${t} ${n}`,cause:y,method:t,path:n,url:u,requestId:c,phase:"parse",timeoutMs:l,status:h.status,statusText:h.statusText,contentType:h.headers.get("content-type")??void 0,bodyPreview:await E8(g),timestamp:Date.now(),durationMs:Date.now()-f}))}if(this.tracer.restResponse?.({method:t,path:n,requestId:c,status:h.status,durationMs:Date.now()-f,code:m.code,msg:m.msg,envelopeRequestId:m.request_id,data:m.data}),this.checkAuthRequired(h,m.code),m.code!==0&&!r.includes(m.code))throw new Zu({code:typeof m.code=="number"?m.code:h.status,msg:typeof m.msg=="string"&&m.msg.length>0?m.msg:`HTTP ${h.status}${h.statusText?` ${h.statusText}`:""}`,requestId:m.request_id??c,details:m.details,timestamp:Date.now(),durationMs:Date.now()-f});return m.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===qq)&&this.opts.credentialStore?.markAuthRequired?.()}}function Uq(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 VF(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Wu(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:Uq(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 Wy(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:e.activity.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 Y0(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function KF(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 Q4(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:KF(e.source)};case"video":return{type:"video",source:KF(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 Vq(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Q4),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Kq(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 $4e(e){return{content:e.content.map(Kq),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,skills:e.skills}}function z4e(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function j4e(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 H4e(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function W4e(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(H4e),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function q4e(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(W4e),createdAt:e.created_at}}function U4e(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 V4e(e){const t={};for(const[n,i]of Object.entries(e.answers))t[n]=U4e(i);return{answers:t,method:e.method,note:e.note}}function KA(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 ZF(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 Fd(e,t){const n=e[t];return typeof n=="string"?n:void 0}function d1(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Sa(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Zq(e){if(!e||typeof e!="object")return null;const t=e,n=Fd(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:Fd(t,"goalId")??Fd(t,"goal_id")??"goal",objective:Fd(t,"objective")??"",completionCriterion:Fd(t,"completionCriterion")??Fd(t,"completion_criterion"),status:n,turnsUsed:d1(t,"turnsUsed")??d1(t,"turns_used")??0,tokensUsed:d1(t,"tokensUsed")??d1(t,"tokens_used")??0,wallClockMs:d1(t,"wallClockMs")??d1(t,"wall_clock_ms")??0,terminalReason:Fd(t,"terminalReason")??Fd(t,"terminal_reason"),budget:{tokenBudget:Sa(o,"tokenBudget")??Sa(o,"token_budget"),remainingTokens:Sa(o,"remainingTokens")??Sa(o,"remaining_tokens"),turnBudget:Sa(o,"turnBudget")??Sa(o,"turn_budget"),remainingTurns:Sa(o,"remainingTurns")??Sa(o,"remaining_turns"),wallClockBudgetMs:Sa(o,"wallClockBudgetMs")??Sa(o,"wall_clock_budget_ms"),remainingWallClockMs:Sa(o,"remainingWallClockMs")??Sa(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function K4e(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Wu(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Wu(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:Y0(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Y0(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:Uq(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=Zq(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:Vq(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Q4),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:j4e(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:q4e(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:KA(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:ZA(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 Z4e(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 f1(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 GF(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 ZA(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 G4e(e){return e.session_id}function Q4e(e){return e.seq}function Y4e(e){const t=Number(e.slice(1));return Number.isFinite(t)?t:0}function QF(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}const J4e={items:[],tasks:new Map,interactions:new Map,attachments:new Map,todos:new Map,prompts:new Map,meta:{},pendingInteractions:new Set,hasMoreOlder:!1};function X4e(e,t){switch(t.op){case"reset":return ewe(e,t);case"turn.upsert":return nwe(e,t.turn);case"step.upsert":return owe(e,t.turnId,t.step);case"frame.upsert":return rwe(e,t);case"append":return awe(e,t);case"marker.upsert":return JF(e,t.item,t.item.markerId,t.beforeTurn);case"taskref.upsert":return JF(e,t.item,t.item.refId,t.beforeTurn);case"task.upsert":return dwe(e,t.task);case"interaction.upsert":return fwe(e,t.interaction);case"attachment.upsert":return pwe(e,t.attachment);case"todo.upsert":return gwe(e,t.todo);case"prompt.upsert":return ywe(e,t.prompt);case"meta.merge":return wwe(e,t.meta);case"items.remove":return cwe(e,t.ids)}}function ewe(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 YF(e,t){return{...e,kind:"turn",steps:[...t]}}function Gq(e){return{kind:"turn",turnId:e,ordinal:Y4e(e),state:"running",origin:{kind:"other"},steps:[]}}function twe(e,t){const n=Number(e.slice(t.length+1))||0;return{kind:"step",stepId:e,turnId:t,ordinal:n,state:"running",frames:[]}}function Am(e,t){const n=e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}function tS(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 Y4(e,t,n){return e.map(i=>i.kind==="turn"&&i.turnId===t?n(i):i)}function nwe(e,t){const n=Am(e,t.turnId);return n?iwe(n,t)?{state:e,changed:!1}:{state:{...e,items:Y4(e.items,t.turnId,i=>YF(t,i.steps))},changed:!0}:{state:{...e,items:tS(e.items,YF(t,[]))},changed:!0}}function iwe(e,t){return e.ordinal===t.ordinal&&e.triggerPromptId===t.triggerPromptId&&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 owe(e,t,n){const i=Am(e,t)??Gq(t),o=i.steps.findIndex(u=>u.stepId===n.stepId);let s,r=!0;if(o>=0){const u=i.steps[o];u&&swe(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=Am(e,t)?Y4(e.items,t,()=>l):tS(e.items,l);return{state:{...e,items:a},changed:!0}}function swe(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 rwe(e,t){const n=Am(e,t.turnId)??Gq(t.turnId),i=n.steps.find(c=>c.stepId===t.stepId)??twe(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&&lwe(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=Am(e,t.turnId)?Y4(e.items,t.turnId,()=>a):tS(e.items,a);return{state:{...e,items:u},changed:!0}}function lwe(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 awe(e,t){if(t.target.type==="task")return uwe(e,t);const{turnId:n,stepId:i,frameId:o}=t.target,s=Am(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=Qq(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:Y4(e.items,n,()=>d)},changed:!0}}function uwe(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=Qq(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 Qq(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 JF(e,t,n,i){if(e.items.some(s=>GA(s)===n)){let s=!1;const r=e.items.map(l=>GA(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 GA(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}function cwe(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(GA(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 dwe(e,t){const n=e.tasks.get(t.taskId);if(n&&bwe(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 fwe(e,t){const n=e.interactions.get(t.interactionId);if(n&&hwe(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 hwe(e,t){return e.interactionKind===t.interactionKind&&e.toolCallId===t.toolCallId&&e.state===t.state&&e.request===t.request&&e.response===t.response}function pwe(e,t){const n=e.attachments.get(t.attachmentId);if(n&&mwe(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 mwe(e,t){return e.mediaType===t.mediaType&&e.name===t.name&&e.size===t.size&&e.source===t.source&&e.placeholder===t.placeholder}function gwe(e,t){const n=e.todos.get(t.todoId);if(n&&vwe(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 vwe(e,t){return e.items===t.items&&e.updatedAt===t.updatedAt}function ywe(e,t){const n=e.prompts.get(t.promptId);if(n&&kwe(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 kwe(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 bwe(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 wwe(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 Cwe{constructor(t){this.agentId=t}#e=J4e;#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=X4e(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 Ft(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 cm extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Yq extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Jq={};function Ef(e){return Jq}function Xq(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 QA(e,t){return typeof t=="bigint"?t.toString():t}function J4(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function nS(e){return e==null}function iS(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Awe(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 XF=Symbol("evaluating");function Di(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==XF)return i===void 0&&(i=XF,i=n()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Fp(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Uf(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function eD(e){return JSON.stringify(e)}function xwe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const eU="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Bv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Swe=J4(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function xm(e){if(Bv(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Bv(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function tU(e){return xm(e)?{...e}:Array.isArray(e)?[...e]:e}const _we=new Set(["string","number","symbol"]);function Sm(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vf(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function _n(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 Iwe(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Mwe={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 Twe(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=Uf(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 Fp(this,"shape",r),r},checks:[]});return Vf(e,s)}function Ewe(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=Uf(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 Fp(this,"shape",r),r},checks:[]});return Vf(e,s)}function Lwe(e,t){if(!xm(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=Uf(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Fp(this,"shape",s),s}});return Vf(e,o)}function Nwe(e,t){if(!xm(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Uf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Fp(this,"shape",i),i}});return Vf(e,n)}function Fwe(e,t){const n=Uf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Fp(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return Vf(e,n)}function Dwe(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=Uf(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 Fp(this,"shape",a),a},checks:[]});return Vf(t,r)}function Rwe(e,t,n){const i=Uf(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 Fp(this,"shape",s),s}});return Vf(t,i)}function B1(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 qy(e){return typeof e=="string"?e:e?.message}function Lf(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=qy(e.inst?._zod.def?.error?.(e))??qy(t?.error?.(e))??qy(n.customError?.(e))??qy(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function oS(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function $v(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const nU=(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,QA,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},iU=Ft("$ZodError",nU),oU=Ft("$ZodError",nU,{Parent:Error});function Owe(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 Pwe(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 cm;if(r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>Lf(a,s,Ef())));throw eU(l,o?.callee),l}return r.value},rS=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=>Lf(a,s,Ef())));throw eU(l,o?.callee),l}return r.value},X4=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 cm;return s.issues.length?{success:!1,error:new(e??iU)(s.issues.map(r=>Lf(r,o,Ef())))}:{success:!0,data:s.value}},Bwe=X4(oU),ew=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=>Lf(r,o,Ef())))}:{success:!0,data:s.value}},$we=ew(oU),zwe=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return sS(e)(t,n,o)},jwe=e=>(t,n,i)=>sS(e)(t,n,i),Hwe=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return rS(e)(t,n,o)},Wwe=e=>async(t,n,i)=>rS(e)(t,n,i),qwe=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return X4(e)(t,n,o)},Uwe=e=>(t,n,i)=>X4(e)(t,n,i),Vwe=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ew(e)(t,n,o)},Kwe=e=>async(t,n,i)=>ew(e)(t,n,i),Zwe=/^[cC][^\s-]{8,}$/,Gwe=/^[0-9a-z]+$/,Qwe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ywe=/^[0-9a-vA-V]{20}$/,Jwe=/^[A-Za-z0-9]{27}$/,Xwe=/^[a-zA-Z0-9_-]{21}$/,e3e=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,t3e=/^([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})$/,tD=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)$/,n3e=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,i3e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function o3e(){return new RegExp(i3e,"u")}const s3e=/^(?:(?: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])$/,r3e=/^(([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}|:))$/,l3e=/^((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])$/,a3e=/^(([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])$/,u3e=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sU=/^[A-Za-z0-9_-]*$/,c3e=/^\+[1-9]\d{6,14}$/,rU="(?:(?:\\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])))",d3e=new RegExp(`^${rU}$`);function lU(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 f3e(e){return new RegExp(`^${lU(e)}$`)}function h3e(e){const t=lU({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(`^${rU}T(?:${i})$`)}const p3e=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},m3e=/^-?\d+$/,aU=/^-?\d+(?:\.\d+)?$/,g3e=/^(?:true|false)$/i,v3e=/^[^A-Z]*$/,y3e=/^[^a-z]*$/,Pl=Ft("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),uU={number:"number",bigint:"bigint",object:"date"},cU=Ft("$ZodCheckLessThan",(e,t)=>{Pl.init(e,t);const n=uU[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{Pl.init(e,t);const n=uU[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})}}),k3e=Ft("$ZodCheckMultipleOf",(e,t)=>{Pl.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):Awe(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})}}),b3e=Ft("$ZodCheckNumberFormat",(e,t)=>{Pl.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,s]=Mwe[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=m3e)}),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})}}),w3e=Ft("$ZodCheckMaxLength",(e,t)=>{var n;Pl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!nS(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=oS(o);i.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),C3e=Ft("$ZodCheckMinLength",(e,t)=>{var n;Pl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!nS(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=oS(o);i.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),A3e=Ft("$ZodCheckLengthEquals",(e,t)=>{var n;Pl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!nS(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=oS(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})}}),tw=Ft("$ZodCheckStringFormat",(e,t)=>{var n,i;Pl.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=()=>{})}),x3e=Ft("$ZodCheckRegex",(e,t)=>{tw.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})}}),S3e=Ft("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=v3e),tw.init(e,t)}),_3e=Ft("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=y3e),tw.init(e,t)}),I3e=Ft("$ZodCheckIncludes",(e,t)=>{Pl.init(e,t);const n=Sm(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})}}),M3e=Ft("$ZodCheckStartsWith",(e,t)=>{Pl.init(e,t);const n=new RegExp(`^${Sm(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})}}),T3e=Ft("$ZodCheckEndsWith",(e,t)=>{Pl.init(e,t);const n=new RegExp(`.*${Sm(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})}}),E3e=Ft("$ZodCheckOverwrite",(e,t)=>{Pl.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class L3e{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 N3e={major:4,minor:3,patch:6},Co=Ft("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=N3e;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=B1(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 cm;if(c||h instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await h,r.issues.length!==f&&(u||(u=B1(r,f)))});else{if(r.issues.length===f)continue;u||(u=B1(r,f))}}return c?c.then(()=>r):r},s=(r,l,a)=>{if(B1(r))return r.aborted=!0,r;const u=o(l,i,a);if(u instanceof Promise){if(a.async===!1)throw new cm;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 cm;return a.then(u=>o(u,i,l))}return o(a,i,l)}}Di(e,"~standard",()=>({validate:o=>{try{const s=Bwe(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return $we(e,o).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),lS=Ft("$ZodString",(e,t)=>{Co.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??p3e(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}}),go=Ft("$ZodStringFormat",(e,t)=>{tw.init(e,t),lS.init(e,t)}),F3e=Ft("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=t3e),go.init(e,t)}),D3e=Ft("$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=tD(i))}else t.pattern??(t.pattern=tD());go.init(e,t)}),R3e=Ft("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=n3e),go.init(e,t)}),O3e=Ft("$ZodURL",(e,t)=>{go.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})}}}),P3e=Ft("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=o3e()),go.init(e,t)}),B3e=Ft("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Xwe),go.init(e,t)}),$3e=Ft("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Zwe),go.init(e,t)}),z3e=Ft("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Gwe),go.init(e,t)}),j3e=Ft("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Qwe),go.init(e,t)}),H3e=Ft("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ywe),go.init(e,t)}),W3e=Ft("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Jwe),go.init(e,t)}),q3e=Ft("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=h3e(t)),go.init(e,t)}),U3e=Ft("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=d3e),go.init(e,t)}),V3e=Ft("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=f3e(t)),go.init(e,t)}),K3e=Ft("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=e3e),go.init(e,t)}),Z3e=Ft("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=s3e),go.init(e,t),e._zod.bag.format="ipv4"}),G3e=Ft("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=r3e),go.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})}}}),Q3e=Ft("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=l3e),go.init(e,t)}),Y3e=Ft("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=a3e),go.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 fU(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const J3e=Ft("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=u3e),go.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{fU(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function X3e(e){if(!sU.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return fU(n)}const e8e=Ft("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=sU),go.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{X3e(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),t8e=Ft("$ZodE164",(e,t)=>{t.pattern??(t.pattern=c3e),go.init(e,t)});function n8e(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 i8e=Ft("$ZodJWT",(e,t)=>{go.init(e,t),e._zod.check=n=>{n8e(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),hU=Ft("$ZodNumber",(e,t)=>{Co.init(e,t),e._zod.pattern=e._zod.bag.pattern??aU,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}}),o8e=Ft("$ZodNumberFormat",(e,t)=>{b3e.init(e,t),hU.init(e,t)}),s8e=Ft("$ZodBoolean",(e,t)=>{Co.init(e,t),e._zod.pattern=g3e,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}}),r8e=Ft("$ZodUnknown",(e,t)=>{Co.init(e,t),e._zod.parse=n=>n}),l8e=Ft("$ZodNever",(e,t)=>{Co.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function nD(e,t,n){e.issues.length&&t.issues.push(...$1(n,e.issues)),t.value[n]=e.value}const a8e=Ft("$ZodArray",(e,t)=>{Co.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;rnD(u,n,r))):nD(a,n,r)}return s.length?Promise.all(s).then(()=>n):n}});function Ab(e,t,n,i,o){if(e.issues.length){if(o&&!(n in i))return;t.issues.push(...$1(n,e.issues))}e.value===void 0?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function pU(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=Iwe(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function mU(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=>Ab(h,n,d,t,c))):Ab(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 u8e=Ft("$ZodObject",(e,t)=>{if(Co.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=J4(()=>pU(t));Di(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=Bv,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(y=>Ab(y,l,f,u,m))):Ab(g,l,f,u,m)}return s?mU(c,u,l,a,i.value,e):c.length?Promise.all(c).then(()=>l):l}}),c8e=Ft("$ZodObjectJIT",(e,t)=>{u8e.init(e,t);const n=e._zod.parse,i=J4(()=>pU(t)),o=f=>{const h=new L3e(["shape","payload","ctx"]),m=i.value,g=C=>{const w=eD(C);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`};h.write("const input = payload.value;");const y=Object.create(null);let k=0;for(const C of m.keys)y[C]=`key_${k++}`;h.write("const newResult = {};");for(const C of m.keys){const w=y[C],M=eD(C),E=f[C]?._zod?.optout==="optional";h.write(`const ${w} = ${g(C)};`),E?h.write(` + if (${w}.issues.length) { + if (${M} in input) { + payload.issues = payload.issues.concat(${w}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${M}, ...iss.path] : [${M}] + }))); + } + } + + if (${w}.value === undefined) { + if (${M} in input) { + newResult[${M}] = undefined; + } + } else { + newResult[${M}] = ${w}.value; + } + + `):h.write(` + if (${w}.issues.length) { + payload.issues = payload.issues.concat(${w}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${M}, ...iss.path] : [${M}] + }))); + } + + if (${w}.value === undefined) { + if (${M} in input) { + newResult[${M}] = undefined; + } + } else { + newResult[${M}] = ${w}.value; + } + + `)}h.write("payload.value = newResult;"),h.write("return payload;");const v=h.compile();return(C,w)=>v(f,C,w)};let s;const r=Bv,l=!Jq.jitless,u=l&&Swe.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?mU([],m,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function iD(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=>!B1(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=>Lf(r,i,Ef())))}),t)}const gU=Ft("$ZodUnion",(e,t)=>{Co.init(e,t),Di(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Di(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Di(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Di(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=>iS(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=>iD(a,o,e,s)):iD(l,o,e,s)}}),d8e=Ft("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,gU.init(e,t);const n=e._zod.parse;Di(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=J4(()=>{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(!Bv(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)}}),f8e=Ft("$ZodIntersection",(e,t)=>{Co.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])=>oD(n,a,u)):oD(n,s,r)}});function YA(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(xm(e)&&xm(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=YA(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}),B1(e))return e;const r=YA(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 h8e=Ft("$ZodRecord",(e,t)=>{Co.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!xm(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(...$1(u,d.issues)),n.value[u]=d.value})):(c.issues.length&&n.issues.push(...$1(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"&&aU.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=>Lf(d,i,Ef())),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(...$1(l,d.issues)),n.value[a.value]=d.value})):(c.issues.length&&n.issues.push(...$1(l,c.issues)),n.value[a.value]=c.value)}}return s.length?Promise.all(s).then(()=>n):n}}),p8e=Ft("$ZodEnum",(e,t)=>{Co.init(e,t);const n=Xq(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(o=>_we.has(typeof o)).map(o=>typeof o=="string"?Sm(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}}),m8e=Ft("$ZodLiteral",(e,t)=>{if(Co.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"?Sm(i):i?Sm(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}}),g8e=Ft("$ZodTransform",(e,t)=>{Co.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Yq(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 cm;return n.value=o,n}});function sD(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const vU=Ft("$ZodOptional",(e,t)=>{Co.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Di(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Di(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${iS(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=>sD(s,n.value)):sD(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),v8e=Ft("$ZodExactOptional",(e,t)=>{vU.init(e,t),Di(e._zod,"values",()=>t.innerType._zod.values),Di(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),y8e=Ft("$ZodNullable",(e,t)=>{Co.init(e,t),Di(e._zod,"optin",()=>t.innerType._zod.optin),Di(e._zod,"optout",()=>t.innerType._zod.optout),Di(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${iS(n.source)}|null)$`):void 0}),Di(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)}),k8e=Ft("$ZodDefault",(e,t)=>{Co.init(e,t),e._zod.optin="optional",Di(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=>rD(s,t)):rD(o,t)}});function rD(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const b8e=Ft("$ZodPrefault",(e,t)=>{Co.init(e,t),e._zod.optin="optional",Di(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))}),w8e=Ft("$ZodNonOptional",(e,t)=>{Co.init(e,t),Di(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=>lD(s,e)):lD(o,e)}});function lD(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 C8e=Ft("$ZodCatch",(e,t)=>{Co.init(e,t),Di(e._zod,"optin",()=>t.innerType._zod.optin),Di(e._zod,"optout",()=>t.innerType._zod.optout),Di(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=>Lf(r,i,Ef()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>Lf(s,i,Ef()))},input:n.value}),n.issues=[]),n)}}),A8e=Ft("$ZodPipe",(e,t)=>{Co.init(e,t),Di(e._zod,"values",()=>t.in._zod.values),Di(e._zod,"optin",()=>t.in._zod.optin),Di(e._zod,"optout",()=>t.out._zod.optout),Di(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=>Uy(r,t.in,i)):Uy(s,t.in,i)}const o=t.in._zod.run(n,i);return o instanceof Promise?o.then(s=>Uy(s,t.out,i)):Uy(o,t.out,i)}});function Uy(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const x8e=Ft("$ZodReadonly",(e,t)=>{Co.init(e,t),Di(e._zod,"propValues",()=>t.innerType._zod.propValues),Di(e._zod,"values",()=>t.innerType._zod.values),Di(e._zod,"optin",()=>t.innerType?._zod?.optin),Di(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(aD):aD(o)}});function aD(e){return e.value=Object.freeze(e.value),e}const S8e=Ft("$ZodCustom",(e,t)=>{Pl.init(e,t),Co.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=>uD(s,n,i,e));uD(o,n,i,e)}});function uD(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($v(o))}}var cD;class _8e{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 I8e(){return new _8e}(cD=globalThis).__zod_globalRegistry??(cD.__zod_globalRegistry=I8e());const h0=globalThis.__zod_globalRegistry;function M8e(e,t){return new e({type:"string",..._n(t)})}function T8e(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,..._n(t)})}function dD(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,..._n(t)})}function E8e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,..._n(t)})}function L8e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._n(t)})}function N8e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._n(t)})}function F8e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._n(t)})}function D8e(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,..._n(t)})}function R8e(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,..._n(t)})}function O8e(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,..._n(t)})}function P8e(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,..._n(t)})}function B8e(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,..._n(t)})}function $8e(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,..._n(t)})}function z8e(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,..._n(t)})}function j8e(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,..._n(t)})}function H8e(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,..._n(t)})}function W8e(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,..._n(t)})}function q8e(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._n(t)})}function U8e(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._n(t)})}function V8e(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,..._n(t)})}function K8e(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,..._n(t)})}function Z8e(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,..._n(t)})}function G8e(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,..._n(t)})}function Q8e(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._n(t)})}function Y8e(e,t){return new e({type:"string",format:"date",check:"string_format",..._n(t)})}function J8e(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,..._n(t)})}function X8e(e,t){return new e({type:"string",format:"duration",check:"string_format",..._n(t)})}function e5e(e,t){return new e({type:"number",checks:[],..._n(t)})}function t5e(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",..._n(t)})}function n5e(e,t){return new e({type:"boolean",..._n(t)})}function i5e(e){return new e({type:"unknown"})}function o5e(e,t){return new e({type:"never",..._n(t)})}function fD(e,t){return new cU({check:"less_than",..._n(t),value:e,inclusive:!1})}function L8(e,t){return new cU({check:"less_than",..._n(t),value:e,inclusive:!0})}function hD(e,t){return new dU({check:"greater_than",..._n(t),value:e,inclusive:!1})}function N8(e,t){return new dU({check:"greater_than",..._n(t),value:e,inclusive:!0})}function pD(e,t){return new k3e({check:"multiple_of",..._n(t),value:e})}function yU(e,t){return new w3e({check:"max_length",..._n(t),maximum:e})}function xb(e,t){return new C3e({check:"min_length",..._n(t),minimum:e})}function kU(e,t){return new A3e({check:"length_equals",..._n(t),length:e})}function s5e(e,t){return new x3e({check:"string_format",format:"regex",..._n(t),pattern:e})}function r5e(e){return new S3e({check:"string_format",format:"lowercase",..._n(e)})}function l5e(e){return new _3e({check:"string_format",format:"uppercase",..._n(e)})}function a5e(e,t){return new I3e({check:"string_format",format:"includes",..._n(t),includes:e})}function u5e(e,t){return new M3e({check:"string_format",format:"starts_with",..._n(t),prefix:e})}function c5e(e,t){return new T3e({check:"string_format",format:"ends_with",..._n(t),suffix:e})}function Jm(e){return new E3e({check:"overwrite",tx:e})}function d5e(e){return Jm(t=>t.normalize(e))}function f5e(){return Jm(e=>e.trim())}function h5e(){return Jm(e=>e.toLowerCase())}function p5e(){return Jm(e=>e.toUpperCase())}function m5e(){return Jm(e=>xwe(e))}function g5e(e,t,n){return new e({type:"array",element:t,..._n(n)})}function v5e(e,t,n){return new e({type:"custom",check:"custom",fn:t,..._n(n)})}function y5e(e){const t=k5e(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push($v(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($v(o))}},e(n.value,n)));return t}function k5e(e,t){const n=new Pl({check:"custom",..._n(t)});return n._zod.check=e,n}function bU(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??h0,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 ps(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),ps(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"&&Hr(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 wU(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 CU(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:Sb(t,"input",e.processors),output:Sb(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch{throw new Error("Error converting schema to JSON.")}}function Hr(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 Hr(i.element,n);if(i.type==="set")return Hr(i.valueType,n);if(i.type==="lazy")return Hr(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 Hr(i.innerType,n);if(i.type==="intersection")return Hr(i.left,n)||Hr(i.right,n);if(i.type==="record"||i.type==="map")return Hr(i.keyType,n)||Hr(i.valueType,n);if(i.type==="pipe")return Hr(i.in,n)||Hr(i.out,n);if(i.type==="object"){for(const o in i.shape)if(Hr(i.shape[o],n))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(Hr(o,n))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(Hr(o,n))return!0;return!!(i.rest&&Hr(i.rest,n))}return!1}const b5e=(e,t={})=>n=>{const i=bU({...n,processors:t});return ps(e,i),wU(i,e),CU(i,e)},Sb=(e,t,n={})=>i=>{const{libraryOptions:o,target:s}=i??{},r=bU({...o??{},target:s,io:t,processors:n});return ps(e,r),wU(r,e),CU(r,e)},w5e={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},C5e=(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=w5e[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}))])}},A5e=(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)},x5e=(e,t,n,i)=>{n.type="boolean"},S5e=(e,t,n,i)=>{n.not={}},_5e=(e,t,n,i)=>{},I5e=(e,t,n,i)=>{const o=e._zod.def,s=Xq(o.entries);s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),n.enum=s},M5e=(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},T5e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},E5e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},L5e=(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=ps(s.element,t,{...i,path:[...i.path,"items"]})},N5e=(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]=ps(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=ps(s.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},F5e=(e,t,n,i)=>{const o=e._zod.def,s=o.inclusive===!1,r=o.options.map((l,a)=>ps(l,t,{...i,path:[...i.path,s?"oneOf":"anyOf",a]}));s?n.oneOf=r:n.anyOf=r},D5e=(e,t,n,i)=>{const o=e._zod.def,s=ps(o.left,t,{...i,path:[...i.path,"allOf",0]}),r=ps(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},R5e=(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=ps(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=ps(s.keyType,t,{...i,path:[...i.path,"propertyNames"]})),o.additionalProperties=ps(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)}},O5e=(e,t,n,i)=>{const o=e._zod.def,s=ps(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"}]},P5e=(e,t,n,i)=>{const o=e._zod.def;ps(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},B5e=(e,t,n,i)=>{const o=e._zod.def;ps(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},$5e=(e,t,n,i)=>{const o=e._zod.def;ps(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)))},z5e=(e,t,n,i)=>{const o=e._zod.def;ps(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},j5e=(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;ps(s,t,i);const r=t.seen.get(e);r.ref=s},H5e=(e,t,n,i)=>{const o=e._zod.def;ps(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},AU=(e,t,n,i)=>{const o=e._zod.def;ps(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},W5e=Ft("ZodISODateTime",(e,t)=>{q3e.init(e,t),xo.init(e,t)});function q5e(e){return Q8e(W5e,e)}const U5e=Ft("ZodISODate",(e,t)=>{U3e.init(e,t),xo.init(e,t)});function V5e(e){return Y8e(U5e,e)}const K5e=Ft("ZodISOTime",(e,t)=>{V3e.init(e,t),xo.init(e,t)});function Z5e(e){return J8e(K5e,e)}const G5e=Ft("ZodISODuration",(e,t)=>{K3e.init(e,t),xo.init(e,t)});function Q5e(e){return X8e(G5e,e)}const Y5e=(e,t)=>{iU.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Pwe(e,n)},flatten:{value:n=>Owe(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,QA,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,QA,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ka=Ft("ZodError",Y5e,{Parent:Error}),J5e=sS(Ka),X5e=rS(Ka),eCe=X4(Ka),tCe=ew(Ka),nCe=zwe(Ka),iCe=jwe(Ka),oCe=Hwe(Ka),sCe=Wwe(Ka),rCe=qwe(Ka),lCe=Uwe(Ka),aCe=Vwe(Ka),uCe=Kwe(Ka),Ao=Ft("ZodType",(e,t)=>(Co.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Sb(e,"input"),output:Sb(e,"output")}}),e.toJSONSchema=b5e(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Uf(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)=>Vf(e,n,i),e.brand=()=>e,e.register=((n,i)=>(n.add(e,i),e)),e.parse=(n,i)=>J5e(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>eCe(e,n,i),e.parseAsync=async(n,i)=>X5e(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>tCe(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>nCe(e,n,i),e.decode=(n,i)=>iCe(e,n,i),e.encodeAsync=async(n,i)=>oCe(e,n,i),e.decodeAsync=async(n,i)=>sCe(e,n,i),e.safeEncode=(n,i)=>rCe(e,n,i),e.safeDecode=(n,i)=>lCe(e,n,i),e.safeEncodeAsync=async(n,i)=>aCe(e,n,i),e.safeDecodeAsync=async(n,i)=>uCe(e,n,i),e.refine=(n,i)=>e.check(nAe(n,i)),e.superRefine=n=>e.check(iAe(n)),e.overwrite=n=>e.check(Jm(n)),e.optional=()=>vD(e),e.exactOptional=()=>WCe(e),e.nullable=()=>yD(e),e.nullish=()=>vD(yD(e)),e.nonoptional=n=>GCe(e,n),e.array=()=>pi(e),e.or=n=>DCe([e,n]),e.and=n=>PCe(e,n),e.transform=n=>kD(e,jCe(n)),e.default=n=>VCe(e,n),e.prefault=n=>ZCe(e,n),e.catch=n=>YCe(e,n),e.pipe=n=>kD(e,n),e.readonly=()=>eAe(e),e.describe=n=>{const i=e.clone();return h0.add(i,{description:n}),i},Object.defineProperty(e,"description",{get(){return h0.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return h0.get(e);const i=e.clone();return h0.add(i,n[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),xU=Ft("_ZodString",(e,t)=>{lS.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(i,o,s)=>C5e(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(s5e(...i)),e.includes=(...i)=>e.check(a5e(...i)),e.startsWith=(...i)=>e.check(u5e(...i)),e.endsWith=(...i)=>e.check(c5e(...i)),e.min=(...i)=>e.check(xb(...i)),e.max=(...i)=>e.check(yU(...i)),e.length=(...i)=>e.check(kU(...i)),e.nonempty=(...i)=>e.check(xb(1,...i)),e.lowercase=i=>e.check(r5e(i)),e.uppercase=i=>e.check(l5e(i)),e.trim=()=>e.check(f5e()),e.normalize=(...i)=>e.check(d5e(...i)),e.toLowerCase=()=>e.check(h5e()),e.toUpperCase=()=>e.check(p5e()),e.slugify=()=>e.check(m5e())}),cCe=Ft("ZodString",(e,t)=>{lS.init(e,t),xU.init(e,t),e.email=n=>e.check(T8e(dCe,n)),e.url=n=>e.check(D8e(fCe,n)),e.jwt=n=>e.check(G8e(ICe,n)),e.emoji=n=>e.check(R8e(hCe,n)),e.guid=n=>e.check(dD(mD,n)),e.uuid=n=>e.check(E8e(Vy,n)),e.uuidv4=n=>e.check(L8e(Vy,n)),e.uuidv6=n=>e.check(N8e(Vy,n)),e.uuidv7=n=>e.check(F8e(Vy,n)),e.nanoid=n=>e.check(O8e(pCe,n)),e.guid=n=>e.check(dD(mD,n)),e.cuid=n=>e.check(P8e(mCe,n)),e.cuid2=n=>e.check(B8e(gCe,n)),e.ulid=n=>e.check($8e(vCe,n)),e.base64=n=>e.check(V8e(xCe,n)),e.base64url=n=>e.check(K8e(SCe,n)),e.xid=n=>e.check(z8e(yCe,n)),e.ksuid=n=>e.check(j8e(kCe,n)),e.ipv4=n=>e.check(H8e(bCe,n)),e.ipv6=n=>e.check(W8e(wCe,n)),e.cidrv4=n=>e.check(q8e(CCe,n)),e.cidrv6=n=>e.check(U8e(ACe,n)),e.e164=n=>e.check(Z8e(_Ce,n)),e.datetime=n=>e.check(q5e(n)),e.date=n=>e.check(V5e(n)),e.time=n=>e.check(Z5e(n)),e.duration=n=>e.check(Q5e(n))});function zt(e){return M8e(cCe,e)}const xo=Ft("ZodStringFormat",(e,t)=>{go.init(e,t),xU.init(e,t)}),dCe=Ft("ZodEmail",(e,t)=>{R3e.init(e,t),xo.init(e,t)}),mD=Ft("ZodGUID",(e,t)=>{F3e.init(e,t),xo.init(e,t)}),Vy=Ft("ZodUUID",(e,t)=>{D3e.init(e,t),xo.init(e,t)}),fCe=Ft("ZodURL",(e,t)=>{O3e.init(e,t),xo.init(e,t)}),hCe=Ft("ZodEmoji",(e,t)=>{P3e.init(e,t),xo.init(e,t)}),pCe=Ft("ZodNanoID",(e,t)=>{B3e.init(e,t),xo.init(e,t)}),mCe=Ft("ZodCUID",(e,t)=>{$3e.init(e,t),xo.init(e,t)}),gCe=Ft("ZodCUID2",(e,t)=>{z3e.init(e,t),xo.init(e,t)}),vCe=Ft("ZodULID",(e,t)=>{j3e.init(e,t),xo.init(e,t)}),yCe=Ft("ZodXID",(e,t)=>{H3e.init(e,t),xo.init(e,t)}),kCe=Ft("ZodKSUID",(e,t)=>{W3e.init(e,t),xo.init(e,t)}),bCe=Ft("ZodIPv4",(e,t)=>{Z3e.init(e,t),xo.init(e,t)}),wCe=Ft("ZodIPv6",(e,t)=>{G3e.init(e,t),xo.init(e,t)}),CCe=Ft("ZodCIDRv4",(e,t)=>{Q3e.init(e,t),xo.init(e,t)}),ACe=Ft("ZodCIDRv6",(e,t)=>{Y3e.init(e,t),xo.init(e,t)}),xCe=Ft("ZodBase64",(e,t)=>{J3e.init(e,t),xo.init(e,t)}),SCe=Ft("ZodBase64URL",(e,t)=>{e8e.init(e,t),xo.init(e,t)}),_Ce=Ft("ZodE164",(e,t)=>{t8e.init(e,t),xo.init(e,t)}),ICe=Ft("ZodJWT",(e,t)=>{i8e.init(e,t),xo.init(e,t)}),SU=Ft("ZodNumber",(e,t)=>{hU.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(i,o,s)=>A5e(e,i,o),e.gt=(i,o)=>e.check(hD(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(fD(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(gD(i)),e.safe=i=>e.check(gD(i)),e.positive=i=>e.check(hD(0,i)),e.nonnegative=i=>e.check(N8(0,i)),e.negative=i=>e.check(fD(0,i)),e.nonpositive=i=>e.check(L8(0,i)),e.multipleOf=(i,o)=>e.check(pD(i,o)),e.step=(i,o)=>e.check(pD(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 kn(e){return e5e(SU,e)}const MCe=Ft("ZodNumberFormat",(e,t)=>{o8e.init(e,t),SU.init(e,t)});function gD(e){return t5e(MCe,e)}const TCe=Ft("ZodBoolean",(e,t)=>{s8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>x5e(e,n,i)});function y2(e){return n5e(TCe,e)}const ECe=Ft("ZodUnknown",(e,t)=>{r8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>_5e()});function Ts(){return i5e(ECe)}const LCe=Ft("ZodNever",(e,t)=>{l8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>S5e(e,n,i)});function _U(e){return o5e(LCe,e)}const NCe=Ft("ZodArray",(e,t)=>{a8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>L5e(e,n,i,o),e.element=t.element,e.min=(n,i)=>e.check(xb(n,i)),e.nonempty=n=>e.check(xb(1,n)),e.max=(n,i)=>e.check(yU(n,i)),e.length=(n,i)=>e.check(kU(n,i)),e.unwrap=()=>e.element});function pi(e,t){return g5e(NCe,e,t)}const FCe=Ft("ZodObject",(e,t)=>{c8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>N5e(e,n,i,o),Di(e,"shape",()=>t.shape),e.keyof=()=>wo(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ts()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ts()}),e.strict=()=>e.clone({...e._zod.def,catchall:_U()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Lwe(e,n),e.safeExtend=n=>Nwe(e,n),e.merge=n=>Fwe(e,n),e.pick=n=>Twe(e,n),e.omit=n=>Ewe(e,n),e.partial=(...n)=>Dwe(MU,e,n[0]),e.required=(...n)=>Rwe(TU,e,n[0])});function Gt(e,t){const n={type:"object",shape:e??{},..._n(t)};return new FCe(n)}const IU=Ft("ZodUnion",(e,t)=>{gU.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>F5e(e,n,i,o),e.options=t.options});function DCe(e,t){return new IU({type:"union",options:e,..._n(t)})}const RCe=Ft("ZodDiscriminatedUnion",(e,t)=>{IU.init(e,t),d8e.init(e,t)});function fd(e,t,n){return new RCe({type:"union",options:t,discriminator:e,..._n(n)})}const OCe=Ft("ZodIntersection",(e,t)=>{f8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>D5e(e,n,i,o)});function PCe(e,t){return new OCe({type:"intersection",left:e,right:t})}const BCe=Ft("ZodRecord",(e,t)=>{h8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>R5e(e,n,i,o),e.keyType=t.keyType,e.valueType=t.valueType});function aS(e,t,n){return new BCe({type:"record",keyType:e,valueType:t,..._n(n)})}const JA=Ft("ZodEnum",(e,t)=>{p8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(i,o,s)=>I5e(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 JA({...t,checks:[],..._n(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 JA({...t,checks:[],..._n(o),entries:s})}});function wo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new JA({type:"enum",entries:n,..._n(t)})}const $Ce=Ft("ZodLiteral",(e,t)=>{m8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>M5e(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 zn(e,t){return new $Ce({type:"literal",values:Array.isArray(e)?e:[e],..._n(t)})}const zCe=Ft("ZodTransform",(e,t)=>{g8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>E5e(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Yq(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push($v(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($v(r))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function jCe(e){return new zCe({type:"transform",transform:e})}const MU=Ft("ZodOptional",(e,t)=>{vU.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>AU(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function vD(e){return new MU({type:"optional",innerType:e})}const HCe=Ft("ZodExactOptional",(e,t)=>{v8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>AU(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function WCe(e){return new HCe({type:"optional",innerType:e})}const qCe=Ft("ZodNullable",(e,t)=>{y8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>O5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function yD(e){return new qCe({type:"nullable",innerType:e})}const UCe=Ft("ZodDefault",(e,t)=>{k8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>B5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function VCe(e,t){return new UCe({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():tU(t)}})}const KCe=Ft("ZodPrefault",(e,t)=>{b8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>$5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function ZCe(e,t){return new KCe({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():tU(t)}})}const TU=Ft("ZodNonOptional",(e,t)=>{w8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>P5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function GCe(e,t){return new TU({type:"nonoptional",innerType:e,..._n(t)})}const QCe=Ft("ZodCatch",(e,t)=>{C8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>z5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function YCe(e,t){return new QCe({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const JCe=Ft("ZodPipe",(e,t)=>{A8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>j5e(e,n,i,o),e.in=t.in,e.out=t.out});function kD(e,t){return new JCe({type:"pipe",in:e,out:t})}const XCe=Ft("ZodReadonly",(e,t)=>{x8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>H5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function eAe(e){return new XCe({type:"readonly",innerType:e})}const tAe=Ft("ZodCustom",(e,t)=>{S8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>T5e(e,n)});function nAe(e,t={}){return v5e(tAe,e,t)}function iAe(e){return y5e(e)}const kp=zt().min(1),uS=zt().min(1),k2=zt().min(1),bp=zt().min(1),ga=zt().min(1),oAe=/^[A-Za-z0-9._-]{1,128}$/;function sAe(e){return oAe.test(e)&&e!=="."&&e!==".."}const EU=fd("kind",[Gt({kind:zn("user"),payload:Ts().optional()}),Gt({kind:zn("cron"),taskId:bp.optional(),payload:Ts().optional()}),Gt({kind:zn("task"),taskId:bp,payload:Ts().optional()}),Gt({kind:zn("hook"),payload:Ts().optional()}),Gt({kind:zn("compaction"),payload:Ts().optional()}),Gt({kind:zn("side"),payload:Ts().optional()}),Gt({kind:zn("other"),payload:Ts().optional()})]),rAe=Gt({inputTokens:kn().optional(),outputTokens:kn().optional(),cachedTokens:kn().optional(),cost:kn().optional()}),J0=Gt({inputOther:kn(),output:kn(),inputCacheRead:kn(),inputCacheCreation:kn()}),lAe=Gt({llmFirstTokenLatencyMs:kn().optional(),llmStreamDurationMs:kn().optional(),llmRequestBuildMs:kn().optional(),llmServerFirstTokenMs:kn().optional(),llmServerDecodeMs:kn().optional(),llmClientConsumeMs:kn().optional()}),aAe=Gt({failedAttempt:kn(),nextAttempt:kn(),maxAttempts:kn(),delayMs:kn(),errorName:zt(),errorMessage:zt(),statusCode:kn().optional()}),LU=wo(["queued","running","completed","failed","cancelled"]),uAe=wo(["running","completed","interrupted","failed"]),cAe=Gt({skillName:zt(),skillArgs:zt().optional()}),dAe=Gt({kind:zn("user"),skillActivations:pi(cAe).optional()}),bD={kind:zn("text"),frameId:k2,text:zt(),attachmentIds:pi(zt()).optional(),taskId:bp.optional(),promptIds:pi(zt()).optional()},fAe=fd("role",[Gt({...bD,role:zn("assistant"),origin:_U().optional()}),Gt({...bD,role:zn("user"),origin:dAe.optional()})]),hAe=Gt({kind:zn("thinking"),frameId:k2,text:zt()}),pAe=Gt({agentId:ga,role:wo(["child","member"]).optional()}),mAe=Gt({kind:wo(["stdout","stderr","progress","status","custom"]),text:zt().optional(),percent:kn().optional(),customKind:zt().optional(),customData:Ts().optional()}),gAe=Gt({kind:zn("tool"),frameId:k2,toolCallId:zt(),name:zt(),view:zt().optional(),state:wo(["running","done","error"]),input:Ts().optional(),output:Ts().optional(),display:Ts().optional(),error:zt().optional(),inputText:zt().optional(),progress:mAe.optional(),taskId:bp.optional(),approvalId:zt().optional(),todoId:zt().optional(),agentRefs:pi(pAe).optional()}),cS=Gt({interactionId:zt(),interactionKind:wo(["approval","question"]),toolCallId:zt().optional(),state:wo(["pending","approved","rejected","cancelled","answered","dismissed"]),request:Ts().optional(),response:Ts().optional()}),vAe=Gt({kind:zn("notice"),frameId:k2,level:wo(["error","warning","info"]),source:zt().optional(),message:zt(),detail:Ts().optional()}),NU=fd("kind",[fAe,hAe,gAe,vAe]),FU=Gt({kind:zn("step"),stepId:uS,turnId:kp,ordinal:kn().int(),state:uAe,frames:pi(NU),startedAt:zt().optional(),endedAt:zt().optional(),usage:J0.optional(),finishReason:zt().optional(),timing:lAe.optional(),retry:aAe.optional(),endReason:zt().optional(),endMessage:zt().optional()}),DU=Gt({kind:zn("turn"),turnId:kp,triggerPromptId:zt().min(1).optional(),ordinal:kn().int(),state:LU,origin:EU,prompt:zt().optional(),attachmentIds:pi(zt()).optional(),steps:pi(FU),startedAt:zt().optional(),endedAt:zt().optional(),usage:rAe.optional(),durationMs:kn().optional(),error:zt().optional()}),RU=Gt({kind:zn("marker"),markerId:zt(),marker:zt(),payload:Ts().optional(),at:zt().optional()}),OU=Gt({kind:zn("taskref"),refId:zt(),taskId:bp,at:zt().optional()}),PU=fd("kind",[DU,RU,OU]),dS=Gt({taskId:bp,kind:wo(["shell","subagent","tool","other"]),state:wo(["running","completed","failed","timed_out","killed","lost"]),detached:y2(),description:zt().optional(),agentId:ga.optional(),outputTail:zt(),startedAt:zt().optional(),endedAt:zt().optional(),resultSummary:zt().optional(),error:zt().optional(),stateReason:zt().optional(),usage:J0.optional(),model:zt().optional(),thinkingEffort:zt().optional()}),BU=Gt({objective:zt(),status:wo(["active","paused","blocked","complete"]),completionCriterion:zt().optional(),budgetUsed:kn().optional(),budgetLimit:kn().optional()}),yAe=Gt({plan:Gt({reviewPath:zt().optional(),version:kn().optional()}).optional(),swarm:Gt({trigger:zt().optional()}).optional(),tower:Gt({}).optional()}),kAe=Gt({plan:Gt({reviewPath:zt().optional(),version:kn().optional()}).nullable().optional(),swarm:Gt({trigger:zt().optional()}).nullable().optional(),tower:Gt({}).nullable().optional()}),bAe=fd("kind",[Gt({kind:zn("idle")}),Gt({kind:zn("running"),turnId:kn(),step:kn(),stepId:zt(),since:kn()}),Gt({kind:zn("streaming"),turnId:kn(),step:kn(),stepId:zt(),stream:wo(["assistant","thinking","tool_call"]),toolCallId:zt().optional(),toolName:zt().optional(),since:kn()}),Gt({kind:zn("tool_call"),turnId:kn(),step:kn(),toolCallId:zt(),name:zt(),since:kn()}),Gt({kind:zn("retrying"),turnId:kn(),step:kn(),stepId:zt(),failedAttempt:kn(),nextAttempt:kn(),maxAttempts:kn(),delayMs:kn(),errorName:zt().optional(),statusCode:kn().optional(),since:kn()}),Gt({kind:zn("awaiting_approval"),turnId:kn(),step:kn().optional(),approval:Ts().optional(),since:kn()}),Gt({kind:zn("interrupted"),turnId:kn(),step:kn().optional(),reason:wo(["aborted","max_steps","error"]),message:zt().optional(),at:kn()}),Gt({kind:zn("ended"),turnId:kn(),reason:wo(["completed","cancelled","failed","blocked"]),durationMs:kn().optional(),at:kn()})]),wAe=Gt({byModel:aS(zt(),J0).optional(),currentTurn:J0.optional(),total:J0.optional()}),CAe=Gt({model:zt().optional(),thinkingEffort:zt().optional(),usage:wAe.optional(),contextTokens:kn().optional(),maxContextTokens:kn().optional(),contextUsage:kn().optional(),permission:wo(["manual","yolo","auto"]).optional(),phase:bAe.optional()}),fS=Gt({goal:BU.optional(),modes:yAe.optional(),activity:wo(["idle","turn","disposing","unknown"]).optional(),agent:CAe.optional()}),AAe=fS.extend({goal:BU.nullable().optional(),modes:kAe.optional()}),nw=Gt({attachmentId:zt(),mediaType:zt(),name:zt().optional(),size:kn().optional(),source:fd("kind",[Gt({kind:zn("url"),url:zt()}),Gt({kind:zn("file"),fileId:zt()}),Gt({kind:zn("session_media"),fileId:zt()})]).optional(),placeholder:zt().optional()}),xAe=Gt({title:zt(),status:wo(["pending","in_progress","done"])}),hS=Gt({todoId:zt(),items:pi(xAe),updatedAt:zt().optional()}),pS=Gt({promptId:zt(),status:wo(["running","queued","blocked","completed","failed","aborted"]),userMessageId:zt().optional(),content:Ts().optional(),createdAt:zt(),finishedAt:zt().optional(),steeredAt:zt().optional()}),$U=Gt({items:pi(PU),tasks:pi(dS),interactions:pi(cS).default([]),attachments:pi(nw).default([]),todos:pi(hS).default([]),prompts:pi(pS).default([]),meta:fS,hasMoreOlder:y2().optional()}),SAe=DU.omit({steps:!0}),_Ae=FU.omit({frames:!0}),IAe=fd("type",[Gt({type:zn("frame"),turnId:kp,stepId:uS,frameId:k2}),Gt({type:zn("task"),taskId:bp})]),mS=fd("op",[Gt({op:zn("reset"),agentId:ga,snapshot:$U}),Gt({op:zn("turn.upsert"),turn:SAe}),Gt({op:zn("step.upsert"),turnId:kp,step:_Ae}),Gt({op:zn("frame.upsert"),turnId:kp,stepId:uS,frame:NU}),Gt({op:zn("append"),target:IAe,offset:kn().int().nonnegative(),text:zt()}),Gt({op:zn("marker.upsert"),item:RU,beforeTurn:kn().int().optional()}),Gt({op:zn("taskref.upsert"),item:OU,beforeTurn:kn().int().optional()}),Gt({op:zn("task.upsert"),task:dS}),Gt({op:zn("interaction.upsert"),interaction:cS}),Gt({op:zn("attachment.upsert"),attachment:nw}),Gt({op:zn("todo.upsert"),todo:hS}),Gt({op:zn("prompt.upsert"),prompt:pS}),Gt({op:zn("meta.merge"),meta:AAe}),Gt({op:zn("items.remove"),ids:pi(zt())})]);Gt({agentId:ga,ops:pi(mS)});const MAe=wo(["off","turn","block","delta"]),_m=kn().int().nonnegative(),TAe=aS(zt(),MAe);Gt({session_id:zt().min(1),transcript:TAe,transcript_since:aS(zt(),_m).optional()});Gt({agent_id:ga,before_turn:zt().min(1).optional(),after_turn:zt().min(1).optional(),page_size:kn().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"]}),sAe(e.agent_id)||t.addIssue({code:"custom",message:"agent_id must be a plain agent id (no path separators)",path:["agent_id"]})});const EAe=Gt({agentId:ga,type:wo(["main","sub","independent"]).optional(),parentAgentId:ga.optional(),label:zt().optional(),createdAt:zt().optional(),disposedAt:zt().optional()}),LAe=Gt({agent_id:ga,items:pi(PU),has_more:y2(),tasks:pi(dS),interactions:pi(cS).default([]),attachments:pi(nw).default([]),todos:pi(hS).default([]),prompts:pi(pS).default([]),meta:fS,agents:pi(EAe),pending_interactions:pi(zt()),seq:_m.optional()});Gt({agent_id:ga,batches:pi(Gt({seq:_m,ops:pi(mS)})),latest_seq:_m,complete:y2()});const NAe=Gt({turn_id:kp,ordinal:kn().int(),state:LU,origin:EU,prompt:zt(),attachment_ids:pi(zt()).optional(),started_at:zt().optional()});Gt({agents:pi(Gt({agent_id:ga,messages:pi(NAe),attachments:pi(nw).default([])}))});const FAe=Gt({state:wo(["pending","approved","rejected","cancelled"]),selected_option:zt().optional(),feedback:zt().optional()}),DAe=Gt({tool_call_id:zt(),turn_id:kp,source:wo(["interaction","display","output"]),plan:zt(),path:zt().optional(),options:pi(Gt({label:zt(),description:zt().optional()})).optional(),review:FAe.optional()});Gt({agent_id:ga,plans:pi(DAe)});const RAe=Gt({agent_id:ga,snapshot:$U,has_more_older:y2(),seq:_m.optional()}),OAe=Gt({agent_id:ga,ops:pi(mS),seq:_m.optional()}),zU=RAe.extend({type:zn("transcript.reset")}),jU=OAe.extend({type:zn("transcript.ops")});fd("type",[zU,jU]);const wD=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"]),PAe=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"]),BAe=new Set(["server_hello","ack","ping","resync_required","error","pong"]),$Ae=new Set(["assistant.delta","thinking.delta"]);function zAe(e,t){if(BAe.has(e))return{route:"ignore"};const n=e.startsWith("event."),i=n?e.slice(6):e;return $Ae.has(i)?jAe(t)?{route:"agent",agentType:i}:{route:"protocol"}:n?PAe.has(i)?{route:"protocol"}:wD.has(i)?{route:"agent",agentType:i}:{route:"protocol"}:wD.has(i)?{route:"agent",agentType:i}:{route:"agent",agentType:i}}function jAe(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 HAe="kimi-code.bearer.",WAe=3e4;class CD{constructor(t){this.opts=t,this.tracer=t.tracer??eS}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?[`${HAe}${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=Ky(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(Ky(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(Ky(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,WAe),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=zU.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=jU.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=Ky(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=zAe(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 Ky(e,t){return`${e}\0${t}`}async function qAe(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=LAe.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 F8=10485760,UAe=5e3,AD=40001;function VAe(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 KAe(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 D8(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 xD(e){return e==="auto_compact"||e==="manual_compact"}class ZAe{constructor(t){this.opts=t,this.tracer=t.tracer??eS,this.http=new UF({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore}),this.httpV2=new UF({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(Wu),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 Wu(i)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Wu(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.towerMode!==void 0&&(o.tower_mode=n.towerMode),n.towerBase!==void 0&&(o.tower_base=n.towerBase),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 Wu(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,towerMode:n.tower_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 Zq(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 getTurnFileChanges(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/file-history/changes`,{turn_id:n});return i.recorded===!1?"unrecorded":i.changes??[]}async getTurnFileContent(t,n,i,o){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/file-history/content`,{turn_id:n,path:i,phase:o})).content??null}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 Wu(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(Vq),hasMore:o.has_more}}async getSessionTranscript(t,n){return qAe(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&&li(d)&&d.code===AD)u=await this.http.postZip(r,{web_log:n},l);else throw d}const c=`${t}.zip`;return{blob:u.blob,fileName:VAe(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`,$4e(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,origin:o.origin,status:o.status}}catch(o){throw this.tracer.traceKeyEvent?.("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-i,...KAe(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:HF});return Wu(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:HF});return Wu(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Wu)}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)}`,z4e(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)}`,V4e(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=>KA(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 KA(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(D8)}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 D8(o)}async getTerminal(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return D8(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(Kq));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(ZF)])):void 0;return{items:o.items.map(ZF),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,i){const o={workspace:t,query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post("/workspace/fs:search",o,{signal:i?.signal});return{items:s.items.map(r=>({path:r.path,name:r.name,kind:r.kind,score:r.score,matchPositions:r.match_positions})),truncated:s.truncated}}async suggestFiles(t,n,i){const o={workspace:t,query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post("/workspace/fs:suggest",o,{signal:i?.signal});return{items:s.items.map(r=>({path:r.path,name:r.name,kind:r.kind,score:r.score,matchPositions:r.match_positions})),truncated:s.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 Jd(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(Y0)}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 Y0(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 Y0(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(Z4e)}async listProviders(){return(await this.http.get("/providers")).items.map(f1)}async getProvider(t){const n=await this.http.get(`/providers/${encodeURIComponent(t)}`),i=f1(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 f1(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:f1(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(GF)}async getCatalogProvider(t){const n=await this.http.get(`/catalog/providers/${encodeURIComponent(t)}`);return GF(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:f1(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(f1),modelsImported:i.models_imported}}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return R8(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return R8(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return R8(t)}async getConfig(){const t=await this.http.get("/config");return ZA(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 ZA(o)}async getAuth(){const t=await this.http.get("/auth");return{modelsReady:t.models_ready,providersCount:t.providers_count,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&&li(i)&&i.code===AD)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")),UAe)})]);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 Jd(this.opts.origin,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}getSessionMediaUrl(t,n){return Jd(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:F8});if(n.size>F8)throw new z7({size:n.size,limit:F8});const i=n.type,o=!GAe(i),s=i||(o?"application/octet-stream":"text/plain");if(o){const l=await QAe(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=jF(this.opts.origin,this.opts.identity.clientId),i=this.opts.projectorFactory(),o=new CD({wsUrl:n,clientId:this.opts.identity.clientId,tracer:this.tracer,credentialStore:this.opts.credentialStore,mainAgentOnly:this.opts.mainAgentOnly,handlers:{onWireEvent:s=>{const r=G4e(s),l=Q4e(s),a=K4e(s);a.type==="historyCompacted"&&!xD(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"&&!xD(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 CD({wsUrl:jF(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 R8(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 GAe(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 QAe(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 YAe="main",JAe=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 O8(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 XAe(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 SD(){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 _r(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 _a(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function e6e(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,i=n&&typeof n=="object"?n:{},o=_r(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const s=_r(t,"goalId")??_r(t,"goal_id")??"goal",r=_r(t,"objective")??"";return{goalId:s,objective:r,completionCriterion:_r(t,"completionCriterion")??_r(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:_r(t,"terminalReason")??_r(t,"terminal_reason"),budget:{tokenBudget:_a(i,"tokenBudget")??_a(i,"token_budget"),remainingTokens:_a(i,"remainingTokens")??_a(i,"remaining_tokens"),turnBudget:_a(i,"turnBudget")??_a(i,"turn_budget"),remainingTurns:_a(i,"remainingTurns")??_a(i,"remaining_turns"),wallClockBudgetMs:_a(i,"wallClockBudgetMs")??_a(i,"wall_clock_budget_ms"),remainingWallClockMs:_a(i,"remainingWallClockMs")??_a(i,"remaining_wall_clock_ms"),overBudget:i.overBudget===!0||i.over_budget===!0}}}function Wd(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 t6e(e,t,n){if(t==="turn.step.started")return null;if(t==="tool.use"||t==="tool.call.started"){const i=_r(n,"name")??_r(n,"toolName")??"tool",o=Ez(e,n6e(i)),s=i6e(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=_r(i,"text");if(s)return P8(s);const r=_r(i,"message");if(r)return P8(r)}const o=_r(n,"message");if(o)return P8(o)}return null}function n6e(e){return e.replace(/_\d+$/,"")}const _D=2e3;function P8(e){return e.length>_D?`${e.slice(0,_D)}…`:e}function i6e(e,t,n){if(n==null)return"";const i=typeof n=="string"?n:JSON.stringify(n);return $7(e,t,i)}function o6e(e,t,n,i,o,s,r){if(r.has(i)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const h=_r(s,"delta");if(!h)return[];const m=t.subagentMeta.get(i),g=Wd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:m?.startedAt??new Date().toISOString()}),y=[];return g&&y.push({type:"taskCreated",sessionId:n,task:g}),y.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:h,stream:"stdout",kind:"text"}),y}const l=t6e(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=Wd(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 s6e(e){return Array.isArray(e)?e.map(t=>Q4(t)):[]}function r6e(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 l6e=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 a6e(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=e6e(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 u6e(e){const{t}=e,n=new Map,i=new Set;function o(f){let h=n.get(f);return h||(h=SD(),n.set(f,h)),h}function s(f){n.set(f,SD())}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(y){return Gu("[agentProjector] Error projecting event:",f,y instanceof Error?y.message:y),[]}}function d(f,h,m,g){if(l6e.has(f))return a6e(f,h,m);const y=o(m),k=h,v=[],C=k?.agentId;if(typeof C=="string"&&C!==YAe){const w=i.has(C);if(f==="prompt.submitted"){if(!w)return[];const M=k?.promptId,L=k?.userMessageId;if(!M||!L)return[];const E=s6e(k?.content);return E.length===0?[]:[{type:"messageCreated",agentId:C,message:{id:L,sessionId:m,role:"user",content:E,createdAt:typeof k?.createdAt=="string"?k.createdAt:new Date().toISOString(),promptId:M}}]}if(w&&(f==="thinking.delta"||f==="assistant.delta")){const M=k?.delta??"";return M?[{type:"agentDelta",sessionId:m,agentId:C,delta:{[f==="thinking.delta"?"thinking":"text"]:M}}]:[]}if(w&&f==="turn.ended")return[{type:"agentTurnEnded",sessionId:m,agentId:C,reason:k?.reason}];if(JAe.has(f))return o6e(t,y,m,C,f,k??{},i)}switch(f){case"turn.started":{const w=k?.turnId,M=y.currentPromptId??O8("pr_");y.currentPromptId=M,w!==void 0&&y.turnPromptId.set(w,M),v.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 w=XAe(k?.usage);y.totalInput+=w.input,y.totalOutput+=w.output,y.totalCacheRead+=w.cacheRead,y.totalCacheCreate+=w.cacheCreate;break}case"agent.status.updated":{k?.model&&(y.model=k.model),k?.contextTokens!==void 0&&(y.contextTokens=k.contextTokens),k?.maxContextTokens!==void 0&&(y.contextLimit=k.maxContextTokens);const w=k?.phase;w!=null&&w.kind==="retrying"?(y.retryActive=!0,v.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:nr(w,"failedAttempt")??0,nextAttempt:nr(w,"nextAttempt")??0,maxAttempts:nr(w,"maxAttempts")??0,delayMs:nr(w,"delayMs")??0,errorName:_r(w,"errorName"),statusCode:nr(w,"statusCode"),turnId:nr(w,"turnId")}})):y.retryActive&&w!==void 0&&w!==null&&typeof w.kind=="string"&&(y.retryActive=!1,v.push({type:"turnRetry",sessionId:m,retry:void 0})),v.push({type:"sessionUsageUpdated",sessionId:m,usage:r6e(y),model:y.model||void 0,swarmMode:k?.swarmMode===!0?!0:k?.swarmMode===!1?!1:void 0,towerMode:k?.towerMode===!0?!0:k?.towerMode===!1?!1:void 0,planMode:k?.planMode===!0?!0:k?.planMode===!1?!1:void 0,thinking:typeof k?.thinkingEffort=="string"&&k.thinkingEffort.length>0?k.thinkingEffort:void 0});break}case"turn.ended":{const w=k?.turnId,M=(w!==void 0?y.turnPromptId.get(w):void 0)??y.currentPromptId;v.push({type:"turnActiveChanged",sessionId:m,active:!1,reason:k?.reason,promptId:M}),y.turnCount++,y.currentPromptId=void 0;break}case"prompt.completed":{const w=k?.promptId;typeof w=="string"&&w.length>0&&v.push({type:"promptCompleted",sessionId:m,promptId:w,reason:k?.reason??"completed"});break}case"prompt.aborted":{const w=k?.promptId;typeof w=="string"&&w.length>0&&v.push({type:"promptAborted",sessionId:m,promptId:w});break}case"turn.step.retrying":{y.retryActive=!0,v.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:nr(k??{},"failedAttempt")??0,nextAttempt:nr(k??{},"nextAttempt")??0,maxAttempts:nr(k??{},"maxAttempts")??0,delayMs:nr(k??{},"delayMs")??0,errorName:_r(k??{},"errorName"),statusCode:nr(k??{},"statusCode"),turnId:typeof k?.turnId=="number"?k.turnId:void 0}});break}case"turn.step.interrupted":break;case"subagent.spawned":{const w=typeof k?.subagentId=="string"&&k.subagentId.length>0?k.subagentId:O8("task_"),M=typeof k?.taskId=="string"&&k.taskId.length>0?k.taskId:void 0,L=M!==void 0&&M!==w?y.subagentMeta.get(M):void 0,E=y.subagentMeta.get(w);L!==void 0&&y.subagentMeta.delete(M),M!==void 0&&!y.registrationOrderByKey.has(M)&&y.registrationOrderByKey.set(M,++y.registrationSeq);const S=E===void 0||L===void 0?E??L:{...E,createdAt:L.createdAt,startedAt:L.startedAt??E.startedAt,runInBackground:!0,backgroundTaskId:E.backgroundTaskId??M},x=S?.backgroundTaskId??(S!==void 0&&M!==void 0&&S.id===M?M:void 0),A=M!==void 0?y.registrationOrderByKey.get(M):void 0,T=x!==void 0?y.registrationOrderByKey.get(x):void 0,I=y.retiredBindings.has(M??"")||A!==void 0&&T!==void 0&&A0?k.model:S?.model,thinkingEffort:typeof k?.thinkingEffort=="string"&&k.thinkingEffort.length>0?k.thinkingEffort:S?.thinkingEffort,parentToolCallId:typeof k?.parentToolCallId=="string"?k.parentToolCallId:S?.parentToolCallId,swarmIndex:typeof k?.swarmIndex=="number"?k.swarmIndex:S?.swarmIndex,runInBackground:O?k?.runInBackground===!0||k?.runInBackground===void 0&&S?.runInBackground===!0:k?.runInBackground===!0||S?.runInBackground===!0,outputPreview:O?void 0:S?.outputPreview,outputBytes:O?void 0:S?.outputBytes,outputLines:O?void 0:S?.outputLines,suspendedReason:O?void 0:S?.suspendedReason,text:O?void 0:S?.text,backgroundTaskId:I?S?.backgroundTaskId:O?M:M??S?.backgroundTaskId};y.subagentMeta.set(R.id,R),v.push({type:"taskCreated",sessionId:m,task:R});break}case"subagent.started":{const w=typeof k?.subagentId=="string"?k.subagentId:void 0,M=w!==void 0&&(y.subagentMeta.get(w)?.status!==void 0&&y.subagentMeta.get(w).status!=="running"||y.settledByKernel.has(w));M&&y.settledByKernel.delete(w);const L=Wd(t,y,m,k?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString(),suspendedReason:void 0,...M?{createdAt:new Date().toISOString(),completedAt:void 0,completedAtEstimated:void 0,outputPreview:void 0,outputBytes:void 0,outputLines:void 0,text:void 0}:{}});M&&w!==void 0&&y.restartedThisRun.add(w),L&&v.push({type:"taskCreated",sessionId:m,task:L});break}case"subagent.suspended":{const w=Wd(t,y,m,k?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof k?.reason=="string"?k.reason:void 0});w&&v.push({type:"taskCreated",sessionId:m,task:w});break}case"subagent.completed":{const w=typeof k?.resultSummary=="string"?k.resultSummary:void 0,M=Wd(t,y,m,k?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:w});M&&v.push({type:"taskCreated",sessionId:m,task:M}),M!==null&&y.restartedThisRun.delete(M.id),v.push({type:"taskCompleted",sessionId:m,taskId:k?.subagentId??"",status:"completed",outputPreview:w});break}case"subagent.failed":{const w=typeof k?.error=="string"?k.error:void 0,M=Wd(t,y,m,k?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:w});M&&v.push({type:"taskCreated",sessionId:m,task:M}),M!==null&&y.restartedThisRun.delete(M.id),v.push({type:"taskCompleted",sessionId:m,taskId:k?.subagentId??"",status:"failed",outputPreview:w});break}case"error":{v.push({type:"unknown",raw:{_agentError:!0,code:k?.code,message:k?.message,name:k?.name,details:k?.details,retryable:k?.retryable}});break}case"warning":{v.push({type:"unknown",raw:{_agentWarning:!0,message:k?.message}});break}case"task.started":case"background.task.started":{const w=k?.info??{},M=typeof w.startedAt=="number"?new Date(w.startedAt).toISOString():void 0,L=typeof w.taskId=="string"?w.taskId:typeof w.taskId=="number"?String(w.taskId):O8("task_"),E=typeof w.description=="string"?w.description:typeof w.command=="string"?w.command:t("tasks.defaultDescription");if(w.kind==="agent"){const x=typeof w.agentId=="string"&&w.agentId.length>0?w.agentId:void 0;if(x!==void 0){const A=y.subagentMeta.get(x),T=y.registrationOrderByKey.get(L),I=A?.backgroundTaskId!==void 0?y.registrationOrderByKey.get(A.backgroundTaskId):void 0;if(y.retiredBindings.has(L)||T!==void 0&&I!==void 0&&TI.backgroundTaskId===L);if(A===void 0&&(y.retiredBindings.has(L)||y.registrationOrderByKey.has(L)&&y.registrationOrderByKey.get(L)0&&y.settledByKernel.add(w.agentId),v.push({type:"taskCompleted",sessionId:m,taskId:typeof w.taskId=="string"?w.taskId:typeof w.taskId=="number"?String(w.taskId):"",status:w.status==="killed"?"cancelled":M?"failed":"completed"});break}}return v}return{project:c,bindNextPromptId:u,reset:s,forgetSession:r,markSideChannelAgent:a,hasSessionState:l}}function c6e(e){return new ZAe({origin:e.origin,identity:e.identity,tracer:e.tracer,credentialStore:e.credentialStore,projectorFactory:()=>u6e({t:e.t}),mainAgentOnly:e.mainAgentOnly})}const d6e={t:e=>e},ID="Sub Agent";function f6e(){return{sessions:[],activeSessionId:void 0,approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},turnErrorBySession:{},turnRetryBySession:{},compactionBySession:{},warnings:[]}}function h6e(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 p6e(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 Zy(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 m6e={"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 XA(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?m6e[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${s}`),message:e.message,details:n.length>0?n:void 0}}function g6e(e,t,n,i=d6e){const o=h6e(e);switch(p6e(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.goalVersionBySession[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(!Zy(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),y=g!==void 0&&(t.task.status==="running"||t.task.status!==g.status),k=!m&&h.status!=="running"||t.task.backgroundTaskId!==void 0&&h.backgroundTaskId!==void 0&&t.task.backgroundTaskId!==h.backgroundTaskId,v=m&&h.completedAt!==void 0&&h.completedAtEstimated!==!0;f[d]={...t.task,status:y?g.status:t.task.status,subagentPhase:y?g.subagentPhase:t.task.subagentPhase,completedAt:y?g.completedAt:v?h.completedAt:t.task.completedAt,completedAtEstimated:y?g.completedAtEstimated:v?h.completedAtEstimated:t.task.completedAtEstimated,outputLines:y?g.outputLines:k?u?.outputLines??t.task.outputLines:h.outputLines??u?.outputLines??t.task.outputLines,text:y?g.text:k?u?.text??t.task.text:h.text??u?.text??t.task.text,outputPreview:y?g.outputPreview:t.task.outputPreview??(k?u?.outputPreview:h.outputPreview??u?.outputPreview),outputBytes:y?g.outputBytes:t.task.outputBytes??(k?u?.outputBytes:h.outputBytes??u?.outputBytes),description:t.task.description===ID&&h.description!==ID?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:k?t.task.runInBackground:t.task.runInBackground??h.runInBackground,backgroundTaskId:k?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(!Zy(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(!Zy(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(Zy(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,XA(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 v6e(e,t){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const o of n)if(e[o]!==t[o])return!1;return!0}function y6e(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n]*)>([\s\S]*?)<\/notification>/g,b6e=/([\w-]+)="([^"]*)"/g,w6e=/]*)>[\s\S]*?<\/output-file>/,C6e=/]*)>([\s\S]*?)<\/output-preview>/,A6e=/^Title: (.*)$/m,x6e=/^Severity: (.*)$/m;function Z9(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function B8(e){const t={};for(const n of e.matchAll(b6e))n[1]!==void 0&&n[2]!==void 0&&(t[n[1]]=Z9(n[2]));return t}function S6e(e,t,n){const i=B8(e),o=A6e.exec(t)?.[1]?.trim()??"",s=x6e.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=w6e.exec(t),u=a?(()=>{const f=B8(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=C6e.exec(t),d=c?(()=>{const f=B8(c[1]??""),h=(c[2]??"").replace(/^\n/,""),m=h.indexOf(` +`),g=Z9(m===-1?"":h.slice(m+1)).replace(/\n$/,""),y=Number(f.bytes),k=Number(f.total_bytes);return{text:g,bytes:Number.isFinite(y)?y:void 0,totalBytes:Number.isFinite(k)?k: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:Z9(o),severity:s,body:Z9(r),outputFile:u,outputPreview:d,raw:n}}function _6e(e){if(!e.includes("(/^Background (process|agent)$/.test(u.description)&&(u={...u,description:""}),u),r=E6e.exec(n);if(r?.[1]!==void 0&&r[2]!==void 0)return s({status:r[2]==="timed out"?"timed_out":r[2],description:r[1],reason:r[3],rest:o});const l=L6e.exec(n);if(l?.[1]!==void 0)return s({status:"killed",description:l[1],userStopped:l[2]!==void 0,reason:l[3],rest:o});const a=N6e.exec(n);if(a?.[1]!==void 0&&a[2]!==void 0)return s({status:a[2]==="was killed"?"killed":a[2]==="timed out"?"timed_out":a[2],description:a[1],reason:a[3],rest:o})}function D6e(e){if(!WU(e.title))return;const t=F6e(e.body);if(!(t===void 0||t.status!==_b(e)))return t}const R6e=1e6,MD=5e3;function hc(e){return e===""?[]:e.endsWith(` +`)?e.slice(0,-1).split(` +`):e.split(` +`)}const qU="\0";function TD(e){return e===""||e.endsWith(` +`)?e:`${e}${qU}`}function UU(e,t){const n=Ib(TD(e),TD(t));return n===null?null:n.map(i=>i.text.endsWith(qU)?{...i,text:i.text.slice(0,-1)}:i)}function Ib(e,t){const n=hc(e),i=hc(t),o=n.length,s=i.length;if(o===0&&s===0)return[];if(o>MD||s>MD||(o+1)*(s+1)>R6e)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 ED=500;function LD(e,t){const n=[],i=hc(e),o=hc(t),s=Math.min(i.length,ED),r=Math.min(o.length,ED);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 O6e(e){let t=0,n=0;for(const i of e)i.type==="add"?t++:i.type==="del"&&n++;return{added:t,removed:n}}function td(e){const t=e;return t?.kind!=="user"||!Array.isArray(t.skillActivations)?[]:t.skillActivations.flatMap(n=>{if(typeof n!="object"||n===null)return[];const i=n;return typeof i.skillName!="string"?[]:[{name:i.skillName,...typeof i.skillArgs=="string"?{args:i.skillArgs}:{}}]})}function P6e(e){return{content:e.content,skillActivations:td(e.metadata?.origin)}}function X0(e,t){return e.length===t.length&&e.every((n,i)=>{const o=t[i];return o!==void 0&&n.name===o.name&&n.args===o.args})}const B6e=/^read[_-]?media(?:file)?$/i,$6e=/^data:([^;]+);base64,(.*)$/s,z6e=/^<(image|video|audio)\s+path="([^"]+)">$/,j6e=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,H6e=/Mime type:\s*([^.\s]+)/i,W6e=/Size:\s*(\d+)\s*bytes/i,q6e=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,U6e="Image compressed to fit model limits:",V6e=/Image compressed to fit model limits:[\s\S]*?<\/system>/g;function ND(e){return e.includes(U6e)?e.replace(V6e,""):e}function K6e(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function FD(e){const t=j6e.exec(e.trim());return t?{kind:t[1],path:K6e(t[2])}:null}const VU=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,Z6e=/f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/;function e6(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),i=n>0?t.slice(0,n):t;return VU.test(i)?i:void 0}const Gc='Attached file "',KU=" — open it with the Read tool";function G6e(e,t,n,i){const o=`-${e}`,s=i.endsWith(o)?i.slice(0,-o.length):i,r=Z6e.exec(s)?.[0];return{name:e,mediaType:t,size:Number(n),fileId:r!==void 0&&VU.test(r)?r:void 0}}const ZU="attachmentRecords",Q6e=65536;function Y6e(e,t,n){const i=t+Gc.length,o=e.slice(i,n),s=o.indexOf('" (');if(s<=0)return!1;const r=o.indexOf(", ",s+3);if(r<=s+3)return!1;let l=i+r+2;if(l>=n||e.charCodeAt(l)<48||e.charCodeAt(l)>57)return!1;for(;l=48&&e.charCodeAt(l)<=57;)l++;return e.startsWith(" bytes): ",l)}function J6e(e,t,n){let i=e.indexOf(Gc,t);for(;i>=0&&i=n?n:s;if(Y6e(e,i,r))return i;if(s<0||s>=n)return-1;i=s}return-1}function X6e(e,t){const n=t+Gc.length,i=Math.min(e.length,n+Q6e),o=e.slice(n,i),s=o.indexOf('" (');if(s<=0)return null;const r=n+s,l=o.indexOf(", ",s+3);if(l<=s+3)return null;const a=n+l+2;let u=a;for(;u=48&&e.charCodeAt(u)<=57;)u++;if(u===a||!e.startsWith(" bytes): ",u))return null;const c=e.slice(a,u),d=u+9,f=J6e(e,r,i),h=f>=0?Math.min(f,i):i,m=e.slice(d,h),g=o.slice(0,s),y=`-${g}${KU}`;let k=m.lastIndexOf(y);for(;k>=0;){const C=m.slice(0,k),w=Math.max(C.lastIndexOf("/"),C.lastIndexOf("\\"));if(!/\s/.test(C.slice(w+1)))break;k=m.lastIndexOf(y,k-1)}if(k<0)return null;const v=m.slice(0,k+1+g.length);return{start:t,end:d+k+y.length,info:G6e(g,o.slice(s+3,l),c,v)}}function gS(e){if(!e.includes(KU))return[];const t=[];let n=e.indexOf(Gc);for(;n>=0;){const i=X6e(e,n);n=i?e.indexOf(Gc,i.end):e.indexOf(Gc,n+Gc.length),i&&t.push(i)}return t}function DD(e){const t=gS(e);if(t.length===0)return e;let n="",i=0;for(const o of t)n+=e.slice(i,o.start),i=o.end;return n+e.slice(i)}function e7e(e){const t=[];for(const o of e.content)o.type==="file"&&t.push({fileId:o.fileId,name:o.name});const n=[...t],i=e.metadata?.[ZU];if(Array.isArray(i))for(const o of i){if(typeof o!="object"||o===null)continue;const s=o.fileId,r=o.name,l={fileId:typeof s=="string"&&s.length>0?s:void 0,name:typeof r=="string"&&r.length>0?r:void 0},a=n.findIndex(u=>l.fileId!==void 0?u.fileId===l.fileId:u.fileId===void 0&&u.name===l.name);a>=0?n.splice(a,1):t.push(l)}return t.length>0?t:null}function t7e(e){const t=e7e(e);if(t)return{kind:"paired",records:t};let n=0;for(const s of e.content)if(s.type==="text")for(const r of t6(s.text))n=Math.max(n,r);const i=e.metadata?.origin;for(const s of[i?.skillArgs,i?.commandArgs])if(typeof s=="string")for(const r of t6(s))n=Math.max(n,r);if(n===0)return{kind:"legacy"};let o=0;for(const s of e.content)s.type==="text"&&(o+=gS(s.text).length);return{kind:"pill",keepLast:n,total:o}}function n7e(e){let t=0;const n=e.kind==="pill"?Math.max(0,e.total-e.keepLast):0;return i=>{const o=gS(i);if(o.length===0)return{notices:[],text:i};const s=[];for(const a of o){const u=t++;if(e.kind==="legacy")s.push(a);else if(e.kind==="pill")u>=n&&s.push(a);else{const c=a.info.fileId,d=e.records.findIndex(f=>c!==void 0?f.fileId===c:f.fileId===void 0&&f.name===a.info.name);d>=0&&(e.records.splice(d,1),s.push(a))}}if(s.length===0)return{notices:[],text:i};let r="",l=0;for(const a of s)r+=i.slice(l,a.start),l=a.end;return{notices:s.map(a=>a.info),text:r+i.slice(l)}}}const i7e=/(?=0&&e[i]==="\\";)n+=1,i-=1;return n%2===1}function GU(e){let t="",n=0,i=0;for(;i0?t:void 0}return[JSON.stringify(e)]}}function d7e(e,t){if(hr(e)==="task")for(const n of t??[]){const i=/^agent_id:\s*(\S+)\s*$/.exec(n);if(i?.[1])return i[1]}}function f7e(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 QU(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=UU(o,s)??LD(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=Ib(t.before,t.after)??LD(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:Uae(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 YU(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):h7e(e)}function h7e(e){const t=e.split(` +`);return t.length>=2&&t[0]?.startsWith(""?t.slice(1,-1).join(` +`):e}function p7e(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function m7e(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(` +`);return YU(t)}function g7e(e,t){const n=e.metadata?.origin??{},i=m7e(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 v7e(e,t,n){const{text:i,cron:o}=g7e(e,n);return{id:e.id,role:"cron",no:t,text:i,createdAt:e.createdAt,cron:o}}function y7e(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 k7e(e){const t=e.metadata?.["kimiWeb.steeredPromptIds"];if(Array.isArray(t)){const i=t.filter(o=>typeof o=="string"&&o.length>0);if(i.length>0)return i}if(e.promptId!==void 0&&e.promptId.length>0)return[e.promptId];const n=e.metadata?.["kimiWeb.promptId"];if(typeof n=="string"&&n.length>0)return[n]}function b7e(e){return e.metadata?.origin?.kind==="compaction_summary"}function w7e(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function C7e(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 A7e(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 iw(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 y=d;if(d=null,!g&&y.blocks.length===0&&y.textParts.length===0&&y.thinkingParts.length===0&&y.tools.length===0)return;if(!g||!i)for(let C=0;CE.kind==="tool"&&E.tool.id===M.id);L&&L.kind==="tool"&&(L.tool=M)}const k=y.sources.find(C=>C.daemonTurnId!==void 0),v={id:y.id,sessionId:y.sources.find(C=>C.sessionId)?.sessionId||void 0,role:"assistant",no:a++,text:y.textParts.join(` +`),thinking:y.thinkingParts.length>0?y.thinkingParts.join(` +`):void 0,tools:y.tools.length>0?y.tools:void 0,blocks:y.blocks.length>0?y.blocks:void 0,approval:y.approval,approvalId:y.approvalId,durationMs:y.durationMs,createdAt:y.createdAt,endedAt:y.endedAt,goalContinuation:y.goalContinuation,daemonTurnId:k?.daemonTurnId,daemonTurnState:k?.daemonTurnState};l.push(v),u?.(v,y.sources)}function h(g,y){let k=null;for(const v of y)if(v.type==="text"){if(v.text){k==="text"?g.textParts[g.textParts.length-1]+=v.text:g.textParts.push(v.text);const C=g.blocks.at(-1);C&&C.kind==="text"?C.text+=(k==="text"?"":` +`)+v.text:g.blocks.push({kind:"text",text:v.text}),k="text"}}else if(v.type==="thinking"){if(v.thinking){k==="thinking"?g.thinkingParts[g.thinkingParts.length-1]+=v.thinking:g.thinkingParts.push(v.thinking);const C=g.blocks.at(-1);if(C&&C.kind==="thinking"){C.thinking+=(k==="thinking"?"":` +`)+v.thinking;const w=[C.startedAt,v.startedAt].filter(E=>E!==void 0).sort()[0],M=C.startedAt!==void 0&&C.durationMs===void 0||v.startedAt!==void 0&&v.durationMs===void 0,L=[C,v].flatMap(E=>E.startedAt!==void 0&&E.durationMs!==void 0?[Date.parse(E.startedAt)+E.durationMs]:[]);C.startedAt=w,C.durationMs=!M&&w!==void 0&&L.length>0?Math.max(...L)-Date.parse(w):void 0}else g.blocks.push({kind:"thinking",thinking:v.thinking,startedAt:v.startedAt,durationMs:v.durationMs});k="thinking"}}else if(v.type==="toolUse"){k=null;const C=c.get(v.toolCallId),w=v.toolName==="ExitPlanMode"?s[v.toolCallId]:void 0,M={id:v.toolCallId,name:v.toolName,arg:typeof v.input=="string"?v.input:JSON.stringify(v.input),agentId:hr(v.toolName)==="task"?v.agentRefs?.find(L=>L.role!=="member")?.agentId??v.agentRefs?.[0]?.agentId:void 0,status:"running",output:v.outputLines,plan:w,planPath:v.toolName==="ExitPlanMode"?w?.path??o[v.toolCallId]?.path:void 0};g.tools.push(M),g.blocks.push({kind:"tool",tool:M}),C&&(g.approval=QU(C),g.approvalId=C.approvalId)}else if(v.type==="toolResult"){k=null;const C=g.tools.findIndex(w=>w.id===v.toolCallId);if(C!==-1){const w=g.tools[C],M=vS(v.output),L={...w,status:v.isError?"error":"ok",output:M,media:v.isError?void 0:c7e(w.name,v.output),agentId:w.agentId??d7e(w.name,M)};L.name==="ExitPlanMode"&&!L.planPath&&(L.planPath=C7e(L.output)),g.tools[C]=L;const E=g.blocks.find(S=>S.kind==="tool"&&S.tool.id===v.toolCallId);E&&E.kind==="tool"&&(E.tool=L)}}else k=null}function m(g,y){if(g.type==="image"||g.type==="video"){const k=g.type,v=g.source;if(v.kind==="url")return{url:v.url,kind:k};if(v.kind==="base64")return{url:`data:${v.mediaType};base64,${v.data}`,kind:k};if(v.kind==="file"&&n)return{url:n(v.fileId),kind:k,fileId:v.fileId};if(v.kind==="sessionMedia")return{url:r?.getSessionMediaUrl?.(y,v.fileId)??"",kind:k,fileId:v.fileId,sessionId:y}}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(b7e(g)){f();const w=g.metadata?.[tj],M={id:g.id,role:"compaction",no:a,text:g.content.filter(L=>L.type==="text").map(L=>L.text).join(` +`),compaction:{trigger:w?.trigger,tokensBefore:w?.tokensBefore,tokensAfter:w?.tokensAfter}};l.push(M),u?.(M,[g]);continue}if(g.role==="user"){const w=p7e(g),M=g.metadata?.origin?.kind,L=M==="skill_activation"&&g.metadata?.origin?.trigger!=="user-slash";if(w===void 0&&(M==="injection"||L))continue;if(w===void 0&&(M==="task"||M==="background_task"||M==="task_notification")){const J=g.content.filter(ue=>ue.type==="text").map(ue=>ue.text).join(` +`),U=I6e(g.metadata),Q=U!==void 0?[U]:_6e(J);if(Q.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 ue of Q)d.blocks.push({kind:"notification",notification:{...ue,createdAt:g.createdAt}})}continue}if(f(),w!==void 0){const J=v7e(g,a++,w);l.push(J),u?.(J,[g]);continue}if(M==="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(!y7e(g))continue;const E=g.metadata?.origin,S=E?.kind==="skill_activation"&&E?.trigger==="user-slash",x=E?.kind==="plugin_command"&&E?.trigger==="user-slash",A=P6e(g),T=A.skillActivations,I=A.content,O=[];let H=[];const R=n7e(t7e(g)),F=new Set,P=J=>{const U={kind:"file",url:J.fileId&&n?n(J.fileId):"",fileId:J.fileId,name:J.name,mediaType:J.mediaType,size:J.size};H.push(U),F.add(U)};for(const J of I){if(J.type==="text")if(S){const Q=FD(J.text);if(Q&&(Q.kind==="video"||Q.kind==="image")&&n){const ue=e6(Q.path);if(ue){H.push({url:n(ue),kind:Q.kind,fileId:ue});continue}}for(const ue of R(J.text).notices)P(ue)}else if(x)O.push(E.commandArgs??"");else{const Q=FD(J.text);if(Q&&(Q.kind==="video"||Q.kind==="image")&&n){const pe=e6(Q.path);if(pe){H.push({url:n(pe),kind:Q.kind,fileId:pe});continue}}const ue=R(J.text);if(ue.notices.length>0){for(const ee of ue.notices)P(ee);if(ue.text.trim().length===0)continue;const pe=ND(ue.text);if(pe!==ue.text&&pe.trim().length===0)continue;O.push(pe);continue}const me=ND(J.text);if(me!==J.text&&me.trim().length===0)continue;O.push(me)}const U=m(J,g.sessionId);if(U){H.push({url:U.url,kind:U.kind,name:J.type==="file"?J.name:void 0,fileId:U.fileId,sessionId:U.sessionId});continue}J.type==="file"&&n&&H.push({kind:"file",url:n(J.fileId),fileId:J.fileId,name:J.name,mediaType:J.mediaType||void 0,size:J.size})}const z=new Map;for(const J of F){if(J.fileId===void 0)continue;const U=`${J.kind}|${J.fileId}`;z.set(U,(z.get(U)??0)+1)}H=H.filter(J=>{if(F.has(J)||J.fileId===void 0)return!0;const U=`${J.kind}|${J.fileId}`,Q=z.get(U)??0;return Q>0?(z.set(U,Q-1),!1):!0});const W=S?E?.skillArgs??"":O.join(` +`),$=t6(W),K=r7e(W),ne=H.filter(J=>J.kind==="file"),G=H.filter(J=>J.kind==="image"||J.kind==="video"),te=[...$].some(J=>J<=ne.length),le=[...K].some(J=>J<=G.length),ie=te||le?H:[];let _e=0,Z=0;const se=H.filter(J=>J.kind==="file"?(_e+=1,!(te&&$.has(_e))):J.kind==="image"||J.kind==="video"?(Z+=1,!(le&&K.has(Z))):!0),he=g.metadata?.["kimiWeb.steeredPromptIds"],Y={id:g.id,role:"user",no:a++,text:W,hasUndoAnchor:g.metadata?.["kimiWeb.settledWithoutEcho"]===!0||g.metadata?.["kimiWeb.steered"]===!0?!1:void 0,steered:g.metadata?.["kimiWeb.steered"]===!0||Array.isArray(he)&&he.length>0?!0:void 0,promptIds:k7e(g),attachments:se.length>0?se:void 0,inlineAttachments:ie.length>0?ie:void 0,skillActivation:S?{name:E.skillName,args:E.skillArgs}:void 0,skillActivations:T.length>0?T.map(J=>({name:J.name,args:J.args})):void 0,pluginCommand:x?{pluginId:E.pluginId,commandName:E.commandName,args:E.commandArgs}:void 0,createdAt:g.createdAt};l.push(Y),u?.(Y,[g]);continue}if(g.role==="tool"){d&&(d.sources.push(g),h(d,g.content),d.endedAt=g.createdAt);continue}const y=g.promptId;w7e(d,y)?d!==null&&d.promptId===void 0&&y!==void 0&&(d.promptId=y):(f(),d={id:g.id,promptId:y,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[],durationMs:g.durationMs,createdAt:g.createdAt});const v=d;if(v===null)continue;const C=A7e(g.content);v.promptId!==void 0&&v.seenSigs.has(C)||(v.seenSigs.add(C),v.sources.push(g),g.durationMs!==void 0&&(v.durationMs=g.durationMs),h(v,g.content),g.endedAt!==void 0?v.endedAt=g.endedAt:g.id!==v.id&&(v.endedAt=g.createdAt))}return f(!0),l}function JU(e,t,n){return e.state==="running"&&e.frames.at(-1)===t&&!n}function x7e(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||JU(a,c,u)||(d.settledAt=i)}}}function S7e(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 _7e(e,t,n,i){const o=e.items.filter(f=>f.kind==="turn"),s=o[0]?.turnId,r=o.length===1?s:void 0,l=new Map(e.tasks.map(f=>[f.taskId,f])),a=new Map(e.prompts.map(f=>[f.promptId,f])),u=eV(e.prompts,XU(e.items)),c=e.items.flatMap(f=>f.kind==="turn"?yS(f,e.attachments,l,f.turnId===s?n?.createdAt:void 0,f.turnId===r?n?.disposedAt:void 0,i?.sessionId,{promptById:a,promptForTurn:u}):[]),d=e.meta.activity==="turn";return iw(c,[],t,d,{},{},{getSessionMediaUrl:i?.getSessionMediaUrl}).map(L7e)}function RD(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(typeof n!="object"||n===null)continue;const i=n;if(i.type!=="file")continue;const o=typeof i.fileId=="string"?i.fileId:i.file_id;t.push({fileId:typeof o=="string"?o:void 0,name:typeof i.name=="string"?i.name:void 0})}return t}function OD(e,t){return t.length===0?e:{...e,[ZU]:t}}const I7e=new Set(["user","skill_activation","plugin_command"]);function M7e(e){return(e.origin.payload??e.origin)?.kind}function T7e(e){const t=e.content;if(!Array.isArray(t))return;const n=[];for(const i of t)if(typeof i=="object"&&i!==null&&i.type==="text"){const o=i.text;typeof o=="string"&&n.push(o)}return n.join("")}function XU(e){const t=new Set;for(const n of e)if(n.kind==="turn"){for(const i of n.steps)for(const o of i.frames)if(o.kind==="text")for(const s of o.promptIds??[])t.add(s)}return t}function eV(e,t){const n=new Set(t??[]);return i=>{const o=M7e(i);if(o!==void 0&&!I7e.has(o)||i.prompt===void 0&&(i.attachmentIds??[]).length===0)return;const s=DD(i.prompt??"");for(const r of e){if(n.has(r.promptId))continue;const l=T7e(r);if(l!==void 0&&DD(l)===s)return n.add(r.promptId),r}}}function yS(e,t,n,i,o,s="",r){const l=[],a=new Map(t.map(k=>[k.attachmentId,k])),u=n6([e.startedAt,...e.steps.map(k=>k.startedAt),i])??"",c=PD(e.endedAt)??PD(o),d=e.triggerPromptId??e.turnId,f=e.origin.payload??e.origin,h=(e.attachmentIds??[]).length>0,m=r?.includeOrigin===!0&&td(f).length>0;if(e.prompt!==void 0&&e.prompt.length>0||h||m){const k=e.prompt!==void 0&&e.prompt.length>0?[{type:"text",text:e.prompt}]:[];for(const v of e.attachmentIds??[]){const C=BD(a.get(v));C!==void 0&&k.push(C)}l.push({id:`${e.turnId}:input`,sessionId:s,role:"user",content:k,createdAt:u,promptId:d,metadata:OD(r?.includeOrigin===!0||e.origin.kind==="task"&&(e.prompt??"").includes("0;if(v.role==="user"){if(v.taskId!==void 0){if(v.text.length===0&&!C)continue;const A=E7e(v.taskId,v.text,n.get(v.taskId));l.push({id:v.frameId,sessionId:s,role:"user",content:[{type:"text",text:v.text}],createdAt:k.startedAt??u,promptId:d,metadata:{origin:{kind:"task",taskId:v.taskId},[HU]:A}});continue}const w=v.text.length>0?[{type:"text",text:v.text}]:[];for(const A of v.attachmentIds??[]){const T=BD(a.get(A));T!==void 0&&w.push(T)}const M=v.promptIds?.map(A=>r?.promptById?.get(A)).find(A=>A!==void 0),L=[];for(const A of v.promptIds??[])L.push(...RD(r?.promptById?.get(A)?.content));const E=v.origin,S=td(E);if(v.text.length===0&&!C&&S.length===0)continue;const x={...S.length>0?{origin:E}:{},...(v.promptIds?.length??0)>0?{"kimiWeb.steeredPromptIds":v.promptIds}:{}};l.push({id:v.frameId,sessionId:s,role:"user",content:w,createdAt:M?.createdAt??k.startedAt??u,promptId:d,metadata:OD(Object.keys(x).length>0?x:void 0,L)});continue}if(v.text.length===0&&!C)continue;l.push({id:v.frameId,sessionId:s,role:"assistant",content:[{type:"text",text:v.text}],createdAt:k.startedAt??u,promptId:d})}else if(v.kind==="thinking"){if(v.text.length===0)continue;const C=r?.pendingInteractionAtByStepId?.get(k.stepId),w=JU(k,v,C!==void 0),M=r?.thinkingTiming,L=M?.get(v.frameId);let E,S;if(L!==void 0)L.settledAt===void 0&&!w&&(L.settledAt=new Date().toISOString()),E=L.startedAt,S=$8(L.startedAt,L.settledAt);else if(M!==void 0&&w){const x=new Date().toISOString();M.set(v.frameId,{startedAt:x}),E=x}else E=k.startedAt,S=$8(k.startedAt,n6([k.endedAt,C]));l.push({id:v.frameId,sessionId:s,role:"assistant",content:[{type:"thinking",thinking:v.text,startedAt:E,durationMs:S}],createdAt:k.startedAt??u,promptId:d})}else v.kind==="tool"&&(l.push({id:`${v.frameId}:call`,sessionId:s,role:"assistant",content:[{type:"toolUse",toolCallId:v.toolCallId,toolName:v.name,input:v.input??v.display??{},outputLines:v.state==="running"?vS(v.output):void 0,agentRefs:v.agentRefs}],createdAt:k.startedAt??u,promptId:d}),v.state!=="running"&&l.push({id:`${v.frameId}:result`,sessionId:s,role:"tool",content:[{type:"toolResult",toolCallId:v.toolCallId,output:v.output??v.error??"",isError:v.state==="error"}],createdAt:k.endedAt??k.startedAt??u,promptId:d}));const g=e.durationMs??$8(u||void 0,c),y=l.findLastIndex(k=>k.role==="assistant");y>=0&&(g!==void 0||c!==void 0)&&(l[y]={...l[y],durationMs:g,endedAt:c??l[y].endedAt});for(const k of l)k.daemonTurnId=e.ordinal,k.daemonTurnState=e.state;return l}function E7e(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 L7e(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function n6(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 $D=6e3,Im=256*1024,N7e=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function zD(e,t){return t===0?e:e-1}function F7e(e,t){const n=hc(t),i=[];let o=0;for(const s of e){if(s.type==="hunk"){const r=N7e.exec(s.text);if(!r)return null;const l=zD(Number(r[1]),r[2]===void 0?1:Number(r[2])),a=zD(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(;oIm||hc(n).length>$D)return null;const i=F7e(e,n);return i===null||i.length>Im||hc(i).length>$D?null:{before:i,after:n}}const R7e=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function O7e(e){return R7e.has(e.type)}const P7e=50,B7e=100,i6=32*1024,$7e={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,P7e)},cancelTask(e){clearTimeout(e)}};function z7e(e,t,n={}){const i=n.scheduler??$7e,o=Math.max(1,Math.floor(n.maxItemsPerSlice??B7e)),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 k=++u,v=()=>{k===u&&m()};l=i.requestFrame(v),a=i.requestTask(v)};m=()=>{f();let k=0;for(;!c&&k{if(!c){if(t(k)){const v=s.length>r?s.at(-1):void 0,C=v===void 0?void 0:n.coalesce?.(v,k);C===void 0?s.push(k):s[s.length-1]=C,g();return}if(d()===0){e(k);return}s.push(k),m()}});return y.flush=()=>{if(!c){for(f();!c&&r{if(c||d()===0)return;let v=r;for(let C=r;C{c||(c=!0,f(),s.length=0,r=0)},y}function o6(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 j7e(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,i=o6(t);if(n===void 0||i===void 0||n.kind!==i.kind||i.value.length<=i6)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 H7e(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,i=t.meta.stream,o=o6(e.appEvent),s=o6(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>i6)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 tV(e){return Array.isArray(e)?e.filter(t=>typeof t=="object"&&t!==null&&t.type==="text").map(t=>t.text).join(""):""}function W7e(e){for(let t=e.items.length-1;t>=0;t--){const n=e.items[t];if(n.kind==="marker"){const i=n.at;if(typeof i=="string")return i;continue}if(n.kind==="turn"){let i;const o=s=>{typeof s=="string"&&(i===void 0||s>i)&&(i=s)};o(n.endedAt),o(n.startedAt);for(const s of n.steps)o(s.endedAt),o(s.startedAt);if(i!==void 0)return i}}}function q7e(e,t){if(t===void 0)return;const n=e.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n.startedAt:void 0}function wp(e,t){const n=q7e(e,t?.["kimiWeb.anchorTurnId"]),i=t?.["kimiWeb.anchorPromptCreatedAt"];return typeof i=="string"&&(n===void 0||i>=n)?{at:i,exclusive:!0}:n!==void 0?{at:n,exclusive:!1}:void 0}function kS(e,t,n){const i=new Map,o=new Set(n??[]);for(const s of e){if(s.skills.length>0)continue;const r=t.find(l=>!o.has(l.promptId)&&l.status!=="queued"&&(s.floor===void 0||(s.floor.exclusive?l.createdAt>s.floor.at:l.createdAt>=s.floor.at))&&tV(l.content)===s.text);r!==void 0&&(o.add(r.promptId),i.set(s.id,r.promptId))}return i}function bS(e,t,n){const i=[];for(const r of t.items){if(r.kind!=="turn")continue;const l=td(r.origin.payload);l.length>0&&i.push({id:`turn:${r.turnId}`,text:r.prompt??"",attachmentCount:r.attachmentIds?.length??0,at:r.startedAt,skills:l})}const o=new Map,s=new Set(n??[]);for(const r of e){const l=i.find(a=>s.has(a.id)||r.floor!==void 0&&(a.at===void 0||(r.floor.exclusive?a.at<=r.floor.at:a.atr.kind==="turn"&&r.turnId===t);return t!==void 0&&s===-1?!1:e.slice(s+1).some(r=>{if(r.kind!=="marker"||r.marker!=="skill")return!1;if(o!==void 0){const a=r.at;if(typeof a!="string"||a<=o)return!1}const l=r.payload?.origin;return l?.kind==="skill_activation"&&l.skillName===n&&l.skillArgs===i})}function nV(e,t,n,i,o){const s=t===void 0?-1:e.findIndex(r=>r.kind==="turn"&&r.turnId===t);return t!==void 0&&s===-1?!1:e.slice(s+1).some(r=>{if(r.kind!=="turn"||o?.terminalOnly===!0&&r.state==="running")return!1;const l=r.origin.payload??r.origin;return l.kind==="skill_activation"&&l.skillName===n&&l.skillArgs===i})}function wS(e,t,n){const i=new Map,o=new Set(n??[]);for(const s of e){const r=s.anchorTurnId===void 0?-1:t.findIndex(a=>a.kind==="turn"&&a.turnId===s.anchorTurnId);if(s.anchorTurnId!==void 0&&r===-1)continue;const l=t.slice(r+1).find(a=>{if(a.kind==="turn"){if(o.has(a.turnId))return!1;const u=a.origin.payload??a.origin;return u.kind==="skill_activation"&&u.skillName===s.skillName&&u.skillArgs===s.skillArgs}if(a.kind==="marker"&&a.marker==="skill"){if(o.has(a.markerId))return!1;if(s.promptFloor!==void 0){const c=a.at;if(typeof c!="string"||c<=s.promptFloor)return!1}const u=a.payload?.origin;return u?.kind==="skill_activation"&&u.skillName===s.skillName&&u.skillArgs===s.skillArgs}return!1});if(l!==void 0){const a=l.kind==="turn"?l.turnId:l.markerId;o.add(a),i.set(s.id,a)}}return i}function Qs(e){return td(e?.origin)}function s6(e,t){const n=Qs(e.metadata);if(n.length===0)return!1;const i=e.content.filter(u=>u.type==="text").map(u=>"text"in u?u.text:"").join(""),o=e.content.filter(u=>u.type!=="text").length,s=e.metadata?.["kimiWeb.promptId"];if(s!==void 0)return t.items.some(c=>c.kind==="turn"&&c.steps.some(d=>d.frames.some(f=>f.kind==="text"&&f.role==="user"&&(f.promptIds?.includes(s)??!1)&&X0(td(f.origin),n))))?!0:t.items.some(c=>c.kind==="turn"&&c.triggerPromptId===s&&(c.prompt??"")===i&&(c.attachmentIds?.length??0)===o&&X0(td(c.origin.payload),n));const r=e.metadata?.["kimiWeb.anchorTurnId"],l=r===void 0?-1:t.items.findIndex(u=>u.kind==="turn"&&u.turnId===r);return r!==void 0&&l===-1?!1:(l===-1?t.items:t.items.slice(l+1)).some(u=>u.kind==="turn"&&(u.prompt??"")===i&&(u.attachmentIds?.length??0)===o&&X0(td(u.origin.payload),n))}function V7e(e,t){const i=e.items.filter(h=>h.kind==="turn")[0]?.turnId,o=new Map(e.tasks.map(h=>[h.taskId,h])),s=new Map(e.prompts.map(h=>[h.promptId,h])),r=eV(e.prompts,XU(e.items)),l=h=>h.kind==="turn"?h.origin.payload??h.origin:void 0,a=new Set,u=K7e(e.items),c=e.items.flatMap((h,m)=>{if(h.kind==="turn"){const g=u.turnPart.get(m)??h,y=g.startedAt!==void 0||g.steps.some(k=>k.startedAt!==void 0);return jD(g,e.attachments,o,h.turnId===i&&!y&&e.hasMoreOlder!==!0?t.agentCreatedAt:void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s,r)}if(h.kind==="marker"&&h.marker==="compaction"){const g=Z7e(h.payload,h.at,t.sessionId,h.markerId,Q7e(e.items,m));if(g===void 0)return[];const y=u.continuation.get(h.markerId);return y===void 0?[g]:[g,...jD(y,e.attachments,o,void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s,r,!0,`:${h.markerId}`)]}if(h.kind==="marker"&&h.marker==="cron.fired"){const g=h.payload,y=g?.origin?.jobId,k=typeof g?.prompt=="string"?g.prompt:void 0,v=e.items.slice(m+1).find(w=>{if(w.kind!=="turn"||a.has(w.turnId))return!1;const M=l(w);return M?.kind==="cron_job"&&(y===void 0||M.jobId===y)&&(k===void 0||w.kind==="turn"&&YU(w.prompt??"")===k)});if(v!==void 0&&v.kind==="turn")return a.add(v.turnId),[];const C=G7e(h.payload,h.at,t.sessionId,h.markerId);return C===void 0?[]:[C]}return[]}),d=e.interactions.map(h=>_1(h,t.sessionId)).filter(h=>h!==void 0),f=e.meta.activity==="turn";return iw(c,d,t.getFileUrl,f,t.planReviewByToolCallId??{},t.plansByToolCallId??{},{getSessionMediaUrl:t.getSessionMediaUrl}).map(X7e)}function K7e(e){const t=new Map,n=new Map;for(let i=0;i[]);let a=-1;for(const u of o.steps){for(;a+1=s[a+1].at;)a+=1;a<0?r.push(u):l[a].push(u)}if(r.length!==o.steps.length){t.set(i,{...o,steps:r,endedAt:r.at(-1)?.endedAt,durationMs:void 0});for(let u=0;ug.startedAt),i])??"",promptId:e.turnId,daemonTurnId:e.ordinal,daemonTurnState:e.state,metadata:{origin:f}}]:[],...yS(e,t,n,i,o,s,{includeOrigin:c!==!0,pendingInteractionAtByStepId:r,thinkingTiming:l,promptById:a,promptForTurn:u})]}function Z7e(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"},[tj]:l}}}function G7e(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 Q7e(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 _1(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 Hg(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(Y7e),createdAt:""}}function Y7e(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(J7e),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 J7e(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 X7e(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function exe(){let e=[];const t=(n,i)=>{const s=V7e(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 iV(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack:e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function txe(e){if(e instanceof Error)return{name:e.name,message:e.message};const t=e;return{name:typeof t?.name=="string"?t.name:void 0,message:typeof t?.message=="string"?t.message:void 0}}function nxe(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function ixe(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function HD(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function oxe(e,t,n){const i=lxe(e),o=rxe(e),s=new Map(e.prompts.map(d=>[d.promptId,d])),r=n.filter(d=>{const f=d.metadata?.["kimiWeb.promptId"];if(f===void 0||o===void 0)return!0;const h=s.get(f)?.steeredAt;return h===void 0||h>=o}),l=e.prompts.filter(sxe).filter(d=>!i.has(d.promptId)).filter(d=>o===void 0||d.steeredAt>=o);if(l.length===0)return[...r];l.sort((d,f)=>d.steeredAtt)&&(t=n.startedAt);return t}function lxe(e){const t=new Set;for(const n of e.items)if(n.kind==="turn"){for(const i of n.steps)for(const o of i.frames)if(!(o.kind!=="text"||o.role!=="user"))for(const s of o.promptIds??[])t.add(s)}return t}function axe(e){return Array.isArray(e)?e.map(t=>Q4(t)).filter(t=>t.type!=="text"||t.text.length>0):[]}function uxe(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 cxe(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&&uxe(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 WD(e){return e?e.split(` +`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function dxe(e){return e.suspendedReason||WD(e.text)||WD(e.outputLines?.join(` +`))||e.summary||""}function fxe(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(` +`):e.summary??""}function hxe(e){return e==="completed"?"completed":e==="failed"?"failed":e==="aborted"?"cancelled":"working"}function qD(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:hxe(e.outcome),body:e.body}}function pxe(e,t){return!!(t.agentId&&e.agentId===t.agentId||t.item&&e.name.includes(t.item))}function mxe(e,t){const n=e.map(o=>({id:o.id,agentId:o.agentId,name:o.name,activity:dxe(o),phase:o.phase,body:fxe(o)}));if(!t)return n;const i=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(s=>pxe(s,o))).map((o,s)=>qD(o,s));return n.length>0?[...n,...i]:t.subagents.map((o,s)=>qD(o,s))}const gxe=["queued","working","suspended","completed","failed","cancelled"];function oV(e){return e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase?e.subagentPhase:"working"}function vxe(){return{queued:0,working:0,suspended:0,completed:0,failed:0,cancelled:0}}function yxe(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:oV(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=vxe();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 kxe(e){let t=0,n=0;for(const i of e){n+=i.members.length;for(const o of gxe)(o==="completed"||o==="failed"||o==="cancelled")&&(t+=i.counts[o])}return{done:t,total:n}}function bxe(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:oV(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 CS(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 sV(e){for(const t of["path","file_path","filePath","filename"]){const n=e[t];if(typeof n=="string"&&n.length>0)return n}}const p0=100*1024;function wxe(e){const t=hr(e.name);if(t!=="edit"&&t!=="multi_edit")return null;const n=CS(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>p0||a.length>p0?null:Ib(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>p0||c.length>p0)return null;const d=Ib(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+=hc(u).length,r+=hc(c).length}return o}const Cxe=5e3;function Axe(e){if(hr(e.name)!=="write")return null;const t=CS(e.arg);return!t||typeof t.content!="string"||t.content.length>p0||t.content.split(` +`).length>Cxe?null:{content:t.content,path:sV(t)}}function xxe(e){const t=CS(e.arg);return t?sV(t):void 0}function Sxe(e){switch(e){case"running":return"running";case"completed":return"completed";case"killed":return"cancelled";default:return"failed"}}function _xe(e,t){return t==="running"?e.stateReason!==void 0?"suspended":"working":t}function Ixe(e){return e==="subagent"?"subagent":e==="shell"?"bash":"tool"}function Mxe(e){return rV(e).parents}function rV(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 Txe(e,t,n){const i=rV(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=Sxe(u.state);return{id:u.taskId,agentId:u.agentId,sessionId:t,kind:Ixe(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"?_xe(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 Exe(){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,x)=>l.set(S,x);let y=n!==null;if(y){const S=n,x=Object.keys(h);y=x.length===Object.keys(S).length&&x.every(A=>h[A]===S[A])}let k=i!==null;if(k){const S=i,x=Object.keys(m);k=x.length===Object.keys(S).length&&x.every(A=>m[A]===S[A])}const v=e.length>0&&d===t&&y&&k&&u.getFileUrl===o&&u.getSessionMediaUrl===s;let C=0,w=0,M=1;if(v){let S=-1;for(let x=e.length-1;x>=0;x--)if(e[x].role==="assistant"){S=x;break}for(let x=0;x0?[...e.slice(0,C),...L]:L;return e=E,t=d,n={...h},i={...m},o=u.getFileUrl,s=u.getSessionMediaUrl,r=f,E};return a.reset=()=>{e=[],t=null,n=null,i=null,o=void 0,r=!0},a}function Lxe(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"&&o.hasUndoAnchor!==!1&&(n++,t.set(o.id,n))}return t}const lV=["light","dark","system"],Nxe=["small","medium","large","xlarge"],z8="medium",aV="kimi-web.color-scheme",r6="kimi-web.font-scale",UD="kimi-web.ui-font-size";function l6(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function AS(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Fxe(e){try{globalThis.localStorage.removeItem(e)}catch{}}function Dxe(){const e=l6(aV);return e&&lV.includes(e)?e:"system"}const Gy={light:"#ffffff",dark:"#121212"};function Rxe(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 uV(e){return Nxe.includes(e)}function Oxe(e){return e<=13?"small":e<=15?"medium":e<=17?"large":"xlarge"}function Pxe(){const e=l6(r6);if(e==="xxlarge")return"xlarge";if(e!==null)return uV(e)?e:z8;const t=l6(UD);if(t===null)return z8;const n=Number(t),i=Number.isFinite(n)?Oxe(n):z8;return AS(r6,i),Fxe(UD),i}function Bxe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.fontScale=e)}const xS=q(Dxe()),SS=q(Pxe());let VD=!1;function $xe(){VD||(VD=!0,ze(xS,Rxe,{immediate:!0}),ze(SS,Bxe,{immediate:!0}))}function zxe(e){lV.includes(e)&&(xS.value=e,AS(aV,e))}function jxe(e){uV(e)&&(SS.value=e,AS(r6,e))}function Xm(){return $xe(),{colorScheme:xS,fontScale:SS,setColorScheme:zxe,setFontScale:jxe}}const Qy=q(!1);let KD=!1;function j8(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function ow(){return!KD&&typeof window<"u"&&typeof document<"u"&&(KD=!0,Qy.value=j8(),new MutationObserver(()=>{Qy.value=j8()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Qy.value=j8()})),Qy}const cV="kimi-web.sidebar-multi-tab";function Hxe(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function Wxe(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function qxe(){return Hxe(cV)==="1"}const dV=q(qxe());function Uxe(e){dV.value=e,Wxe(cV,e?"1":"0")}function Dp(){return{sidebarTabs:dV,setSidebarTabs:Uxe}}function ev(e){let t="";for(const n of e)n.codePointAt(0)>127||/[A-Za-z0-9\-._~]/.test(n)?t+=n:t+=`%${n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`;return t}function Vxe(e){const t=e.split("/").map(ev).join("/");return t.startsWith("//")?`/%2F${t.slice(2)}`:t}function _S(e){return e.replace(/%/g,"%25").replace(/&/g,"%26").replace(//g,"%3E").replace(/([\\[\]])/g,"\\$1").replace(/\n/g,"%0A").replace(/\r/g,"%0D")}function ZD(e){return e.replace(/\\([\\[\]])/g,"$1").replace(/%0A/g,` +`).replace(/%0D/g,"\r").replace(/%26/g,"&").replace(/%3C/g,"<").replace(/%3E/g,">").replace(/%25/g,"%")}function Kxe(e){return e.replace(/%0A/g,` +`).replace(/%0D/g,"\r").replace(/%26/g,"&").replace(/%3C/g,"<").replace(/%3E/g,">").replace(/%25/g,"%")}function Zxe(e,t){const n=t?e.replace(/\\([\\<>])/g,"$1"):e.replace(/\\([\\()])/g,"$1");return tv(n)}function tv(e){try{return decodeURIComponent(e)}catch{return e}}let GD;function a6(e){return GD??=new Intl.Segmenter("und",{granularity:"grapheme"}),[...GD.segment(e)].map(t=>t.segment)}function fV(e,t){const n=a6(e);return n.length<=t?e:`${n.slice(0,t-1).join("")}…`}const Mb="kimi-code://skill/";function IS(e){return e?e.startsWith(Mb)&&e.length>Mb.length?"skill":e.startsWith("#")||e.startsWith("?")||e.startsWith("//")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)&&!/^[a-zA-Z]:(?:[\\/]|%5c)/i.test(e)?null:e.endsWith("/")||e.endsWith("\\")||/%5c$/i.test(e)?"folder":"file":null}function z1(e){const t=e.search(/[#?]/);return t>0?e.slice(0,t):e}function hV(e){const t=e.slice(Mb.length);return tv(t)}function Rp(e){const t=_S(e.name);if(e.kind==="skill")return`[${t}](${Mb}${ev(e.name)})`;const n=e.kind==="folder"&&!e.path.endsWith("/")&&!e.path.endsWith("\\")?`${e.path}/`:e.path;return`[${t}](${Vxe(n)})`}const G9="kimi-code-composer://attachments/";function Nf(e){return`[${_S(e.name)}](${G9}${e.attId})`}const qh="kimi-code-composer://quote/",Gxe=12;function Mm(e){const t=e.split(` +`).map(i=>i.trim()).find(i=>i.length>0)??"",n=fV(t,Gxe);return n.length>0?n:"…"}function sw(e){const t=e.source!==void 0&&e.source.length>0?`?source=${ev(e.source)}`:"",n=e.comment!==void 0&&e.comment.length>0?`?comment=${ev(e.comment)}`:"";return`[${_S(Mm(e.text))}](${qh}${ev(e.text)}${t}${n})`}function pV(e){const t=e.indexOf("?source="),n=e.indexOf("?comment="),i=[t,n].filter(s=>s>=0).sort((s,r)=>s-r)[0]??-1,o={text:tv(i===-1?e:e.slice(0,i))};if(t>=0){const s=n>t?n:e.length;o.source=tv(e.slice(t+8,s))}if(n>=0){const s=t>n?t:e.length;o.comment=tv(e.slice(n+9,s))}return o}const QD=document.createElement("i");function Qxe(e){const t="&"+e+";";QD.innerHTML=t;const n=QD.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function pc(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?(pc(e,e.length,0,t),e):t}const YD={}.hasOwnProperty;function Yxe(e){const t={};let n=-1;for(;++n-1&&e.test(String.fromCharCode(n))}}function oo(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return r;function r(a){return Ii(a)?(e.enter(n),l(a)):t(a)}function l(a){return Ii(a)&&s++r))return;const E=t.events.length;let S=E,x,A;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(x){A=t.events[S][1].end;break}x=!0}for(k(i),L=E;LC;){const M=n[w];t.containerState=M[1],M[0].exit.call(t,e)}n.length=C}function v(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function uSe(e,t,n){return oo(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function XD(e){if(e===null||Nl(e)||oSe(e))return 1;if(iSe(e))return 2}function TS(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};eR(d,-a),eR(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=Da(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=Da(u,[["enter",o,t],["enter",r,t],["exit",r,t],["enter",s,t]]),u=Da(u,TS(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=Da(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=Da(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,pc(e,i-1,n-i+3,u),n=i+u.length-c-2;break}}for(n=-1;++n0&&Ii(L)?oo(e,v,"linePrefix",s+1)(L):v(L)}function v(L){return L===null||jn(L)?e.check(tR,g,w)(L):(e.enter("codeFlowValue"),C(L))}function C(L){return L===null||jn(L)?(e.exit("codeFlowValue"),v(L)):(e.consume(L),C)}function w(L){return e.exit("codeFenced"),t(L)}function M(L,E,S){let x=0;return A;function A(R){return L.enter("lineEnding"),L.consume(R),L.exit("lineEnding"),T}function T(R){return L.enter("codeFencedFence"),Ii(R)?oo(L,I,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):I(R)}function I(R){return R===l?(L.enter("codeFencedFenceSequence"),O(R)):S(R)}function O(R){return R===l?(x++,L.consume(R),O):x>=r?(L.exit("codeFencedFenceSequence"),Ii(R)?oo(L,H,"whitespace")(R):H(R)):S(R)}function H(R){return R===null||jn(R)?(L.exit("codeFencedFence"),E(R)):S(R)}}}function wSe(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:ASe},CSe={partial:!0,tokenize:xSe};function ASe(e,t,n){const i=this;return o;function o(u){return e.enter("codeIndented"),oo(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):jn(u)?e.attempt(CSe,r,a)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||jn(u)?(e.exit("codeFlowValue"),r(u)):(e.consume(u),l)}function a(u){return e.exit("codeIndented"),t(u)}}function xSe(e,t,n){const i=this;return o;function o(r){return i.parser.lazy[i.now().line]?n(r):jn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),o):oo(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):jn(r)?o(r):n(r)}}const SSe={name:"codeText",previous:ISe,resolve:_Se,tokenize:MSe};function _Se(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&&Wg(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),Wg(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Wg(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 kV(e,t,n,i,o,s,r,l,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return d;function d(k){return k===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(k),e.exit(s),f):k===null||k===32||k===41||u6(k)?n(k):(e.enter(i),e.enter(r),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(k))}function f(k){return k===62?(e.enter(s),e.consume(k),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===62?(e.exit("chunkString"),e.exit(l),f(k)):k===null||k===60||jn(k)?n(k):(e.consume(k),k===92?m:h)}function m(k){return k===60||k===62||k===92?(e.consume(k),h):h(k)}function g(k){return!c&&(k===null||k===41||Nl(k))?(e.exit("chunkString"),e.exit(l),e.exit(r),e.exit(i),t(k)):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):jn(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||jn(h)||l++>999?(e.exit("chunkString"),c(h)):(e.consume(h),a||(a=!Ii(h)),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),l++,d):d(h)}}function wV(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):jn(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),oo(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===r||f===null||jn(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 nv(e,t){let n;return i;function i(o){return jn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Ii(o)?oo(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const OSe={name:"definition",tokenize:BSe},PSe={partial:!0,tokenize:$Se};function BSe(e,t,n){const i=this;let o;return s;function s(h){return e.enter("definition"),r(h)}function r(h){return bV.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function l(h){return o=MS(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 Nl(h)?nv(e,u)(h):u(h)}function u(h){return kV(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(PSe,d,d)(h)}function d(h){return Ii(h)?oo(e,f,"whitespace")(h):f(h)}function f(h){return h===null||jn(h)?(e.exit("definition"),i.parser.defined.push(o),t(h)):n(h)}}function $Se(e,t,n){return i;function i(l){return Nl(l)?nv(e,o)(l):n(l)}function o(l){return wV(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Ii(l)?oo(e,r,"whitespace")(l):r(l)}function r(l){return l===null||jn(l)?t(l):n(l)}}const zSe={name:"hardBreakEscape",tokenize:jSe};function jSe(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return jn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const HSe={name:"headingAtx",resolve:WSe,tokenize:qSe};function WSe(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"},pc(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function qSe(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||Nl(c)?(e.exit("atxHeadingSequence"),l(c)):n(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||jn(c)?(e.exit("atxHeading"),t(c)):Ii(c)?oo(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||Nl(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}const USe=["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"],iR=["pre","script","style","textarea"],VSe={concrete:!0,name:"htmlFlow",resolveTo:GSe,tokenize:QSe},KSe={partial:!0,tokenize:JSe},ZSe={partial:!0,tokenize:YSe};function GSe(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 QSe(e,t,n){const i=this;let o,s,r,l,a;return u;function u(G){return c(G)}function c(G){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(G),d}function d(G){return G===33?(e.consume(G),f):G===47?(e.consume(G),s=!0,g):G===63?(e.consume(G),o=3,i.interrupt?t:$):Yu(G)?(e.consume(G),r=String.fromCharCode(G),y):n(G)}function f(G){return G===45?(e.consume(G),o=2,h):G===91?(e.consume(G),o=5,l=0,m):Yu(G)?(e.consume(G),o=4,i.interrupt?t:$):n(G)}function h(G){return G===45?(e.consume(G),i.interrupt?t:$):n(G)}function m(G){const te="CDATA[";return G===te.charCodeAt(l++)?(e.consume(G),l===te.length?i.interrupt?t:I:m):n(G)}function g(G){return Yu(G)?(e.consume(G),r=String.fromCharCode(G),y):n(G)}function y(G){if(G===null||G===47||G===62||Nl(G)){const te=G===47,le=r.toLowerCase();return!te&&!s&&iR.includes(le)?(o=1,i.interrupt?t(G):I(G)):USe.includes(r.toLowerCase())?(o=6,te?(e.consume(G),k):i.interrupt?t(G):I(G)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(G):s?v(G):C(G))}return G===45||mu(G)?(e.consume(G),r+=String.fromCharCode(G),y):n(G)}function k(G){return G===62?(e.consume(G),i.interrupt?t:I):n(G)}function v(G){return Ii(G)?(e.consume(G),v):A(G)}function C(G){return G===47?(e.consume(G),A):G===58||G===95||Yu(G)?(e.consume(G),w):Ii(G)?(e.consume(G),C):A(G)}function w(G){return G===45||G===46||G===58||G===95||mu(G)?(e.consume(G),w):M(G)}function M(G){return G===61?(e.consume(G),L):Ii(G)?(e.consume(G),M):C(G)}function L(G){return G===null||G===60||G===61||G===62||G===96?n(G):G===34||G===39?(e.consume(G),a=G,E):Ii(G)?(e.consume(G),L):S(G)}function E(G){return G===a?(e.consume(G),a=null,x):G===null||jn(G)?n(G):(e.consume(G),E)}function S(G){return G===null||G===34||G===39||G===47||G===60||G===61||G===62||G===96||Nl(G)?M(G):(e.consume(G),S)}function x(G){return G===47||G===62||Ii(G)?C(G):n(G)}function A(G){return G===62?(e.consume(G),T):n(G)}function T(G){return G===null||jn(G)?I(G):Ii(G)?(e.consume(G),T):n(G)}function I(G){return G===45&&o===2?(e.consume(G),F):G===60&&o===1?(e.consume(G),P):G===62&&o===4?(e.consume(G),K):G===63&&o===3?(e.consume(G),$):G===93&&o===5?(e.consume(G),W):jn(G)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(KSe,ne,O)(G)):G===null||jn(G)?(e.exit("htmlFlowData"),O(G)):(e.consume(G),I)}function O(G){return e.check(ZSe,H,ne)(G)}function H(G){return e.enter("lineEnding"),e.consume(G),e.exit("lineEnding"),R}function R(G){return G===null||jn(G)?O(G):(e.enter("htmlFlowData"),I(G))}function F(G){return G===45?(e.consume(G),$):I(G)}function P(G){return G===47?(e.consume(G),r="",z):I(G)}function z(G){if(G===62){const te=r.toLowerCase();return iR.includes(te)?(e.consume(G),K):I(G)}return Yu(G)&&r.length<8?(e.consume(G),r+=String.fromCharCode(G),z):I(G)}function W(G){return G===93?(e.consume(G),$):I(G)}function $(G){return G===62?(e.consume(G),K):G===45&&o===2?(e.consume(G),$):I(G)}function K(G){return G===null||jn(G)?(e.exit("htmlFlowData"),ne(G)):(e.consume(G),K)}function ne(G){return e.exit("htmlFlow"),t(G)}}function YSe(e,t,n){const i=this;return o;function o(r){return jn(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 JSe(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(rw,t,n)}}const XSe={name:"htmlText",tokenize:e_e};function e_e(e,t,n){const i=this;let o,s,r;return l;function l($){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume($),a}function a($){return $===33?(e.consume($),u):$===47?(e.consume($),M):$===63?(e.consume($),C):Yu($)?(e.consume($),S):n($)}function u($){return $===45?(e.consume($),c):$===91?(e.consume($),s=0,m):Yu($)?(e.consume($),v):n($)}function c($){return $===45?(e.consume($),h):n($)}function d($){return $===null?n($):$===45?(e.consume($),f):jn($)?(r=d,P($)):(e.consume($),d)}function f($){return $===45?(e.consume($),h):d($)}function h($){return $===62?F($):$===45?f($):d($)}function m($){const K="CDATA[";return $===K.charCodeAt(s++)?(e.consume($),s===K.length?g:m):n($)}function g($){return $===null?n($):$===93?(e.consume($),y):jn($)?(r=g,P($)):(e.consume($),g)}function y($){return $===93?(e.consume($),k):g($)}function k($){return $===62?F($):$===93?(e.consume($),k):g($)}function v($){return $===null||$===62?F($):jn($)?(r=v,P($)):(e.consume($),v)}function C($){return $===null?n($):$===63?(e.consume($),w):jn($)?(r=C,P($)):(e.consume($),C)}function w($){return $===62?F($):C($)}function M($){return Yu($)?(e.consume($),L):n($)}function L($){return $===45||mu($)?(e.consume($),L):E($)}function E($){return jn($)?(r=E,P($)):Ii($)?(e.consume($),E):F($)}function S($){return $===45||mu($)?(e.consume($),S):$===47||$===62||Nl($)?x($):n($)}function x($){return $===47?(e.consume($),F):$===58||$===95||Yu($)?(e.consume($),A):jn($)?(r=x,P($)):Ii($)?(e.consume($),x):F($)}function A($){return $===45||$===46||$===58||$===95||mu($)?(e.consume($),A):T($)}function T($){return $===61?(e.consume($),I):jn($)?(r=T,P($)):Ii($)?(e.consume($),T):x($)}function I($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(e.consume($),o=$,O):jn($)?(r=I,P($)):Ii($)?(e.consume($),I):(e.consume($),H)}function O($){return $===o?(e.consume($),o=void 0,R):$===null?n($):jn($)?(r=O,P($)):(e.consume($),O)}function H($){return $===null||$===34||$===39||$===60||$===61||$===96?n($):$===47||$===62||Nl($)?x($):(e.consume($),H)}function R($){return $===47||$===62||Nl($)?x($):n($)}function F($){return $===62?(e.consume($),e.exit("htmlTextData"),e.exit("htmlText"),t):n($)}function P($){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),z}function z($){return Ii($)?oo(e,W,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):W($)}function W($){return e.enter("htmlTextData"),r($)}}const ES={name:"labelEnd",resolveAll:o_e,resolveTo:s_e,tokenize:r_e},t_e={tokenize:l_e},n_e={tokenize:a_e},i_e={tokenize:u_e};function o_e(e){let t=-1;const n=[];for(;++t=3&&(u===null||jn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===o?(e.consume(u),i++,a):(e.exit("thematicBreakSequence"),Ii(u)?oo(e,l,"whitespace")(u):l(u))}}const vl={continuation:{tokenize:k_e},exit:w_e,name:"list",tokenize:y_e},g_e={partial:!0,tokenize:C_e},v_e={partial:!0,tokenize:b_e};function y_e(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:c6(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(Q9,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 c6(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(rw,i.interrupt?n:c,e.attempt(g_e,f,d))}function c(h){return i.containerState.initialBlankLine=!0,s++,f(h)}function d(h){return Ii(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 k_e(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(rw,o,s);function o(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,oo(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Ii(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(v_e,t,r)(l))}function r(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,oo(e,e.attempt(vl,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function b_e(e,t,n){const i=this;return oo(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 w_e(e){e.exit(this.containerState.type)}function C_e(e,t,n){const i=this;return oo(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!Ii(s)&&r&&r[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const oR={name:"setextUnderline",resolveTo:A_e,tokenize:x_e};function A_e(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 x_e(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"),Ii(u)?oo(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||jn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const S_e={tokenize:__e};function __e(e){const t=this,n=e.attempt(rw,i,e.attempt(this.parser.constructs.flowInitial,o,oo(e,e.attempt(this.parser.constructs.flow,o,e.attempt(LSe,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 I_e={resolveAll:AV()},M_e=CV("string"),T_e=CV("text");function CV(e){return{resolveAll:AV(e==="text"?E_e: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 W_e(e,t){let n=-1;const i=[];let o;for(;++n0;if(s||e[c]!==(h?"!":"[")||r===null)continue;const m=e.slice(c+(h?2:1),d-1);let g=e.slice(r.start,r.end),y=!1;g.startsWith("<")&&(y=!0,g=g.slice(1,-1)),!(!m||!g)&&n.push({start:c,end:f,rawText:m,rawDest:g,angle:y,image:h})}return n}function Z_e(e,t){const{start:n,end:i,rawText:o,rawDest:s,angle:r,image:l}=e;if(l&&!s.startsWith(qh))return null;if(s.startsWith(G9)&&s.length>G9.length){const u=ZD(o),c=s.slice(G9.length);return{type:"attachment",start:n,end:i,attrs:{attId:c,name:u,kind:t?.(c)??(u.endsWith("/")?"folder":"file")},rawDest:s}}if(s.startsWith(qh)&&s.length>qh.length)return{type:"quote",start:n,end:i,attrs:pV(s.slice(qh.length)),rawDest:s};const a=IS(s);return a===null?null:a==="skill"?{type:"mention",start:n,end:i,attrs:{kind:a,name:hV(s),path:""},rawDest:s}:{type:"mention",start:n,end:i,attrs:{kind:a,name:ZD(o),path:Zxe(s,r)},rawDest:s}}const rR=/\[(?:\\.|[^\\[\]\n])*\]\((kimi-code-composer:\/\/quote\/[^\s)]+)\)/g;function G_e(e){const t=[];rR.lastIndex=0;let n;for(;(n=rR.exec(e))!==null;){let i=0;for(let s=n.index-1;s>=0&&e[s]==="\\";s-=1)i+=1;if(i%2===0)continue;const o=n[1];o===void 0||o.length<=qh.length||t.push({type:"quote",start:n.index-1,end:n.index+n[0].length,attrs:pV(o.slice(qh.length)),rawDest:o})}return t}function lw(e,t){const n=[];for(const i of xV(e)){const o=Z_e(i,t);o&&n.push(o)}return n.push(...G_e(e)),n.sort((i,o)=>i.start-o.start),n}function Ff(e){return lw(e).filter(t=>t.type==="mention").map(({start:t,end:n,attrs:i,rawDest:o})=>({start:t,end:n,attrs:i,rawDest:o}))}function Al(e){return lw(e).filter(t=>t.type==="attachment").map(({start:t,end:n,attrs:i,rawDest:o})=>({start:t,end:n,attrs:i,rawDest:o}))}function SV(e){return lw(e).filter(t=>t.type==="quote").map(({start:t,end:n,attrs:i,rawDest:o})=>({start:t,end:n,attrs:i,rawDest:o}))}function _V(e,t){const n=lw(e,t);if(n.length===0)return[{type:"text",value:e}];const i=[];let o=0;for(const s of n)s.start>o&&i.push({type:"text",value:e.slice(o,s.start)}),s.type==="mention"?i.push({type:"mention",attrs:s.attrs,rawDest:s.rawDest}):s.type==="attachment"?i.push({type:"attachment",attrs:s.attrs,rawDest:s.rawDest}):i.push({type:"quote",attrs:s.attrs,rawDest:s.rawDest}),o=s.end;return o[a,u+1])),s=new Map(t.mediaAttIds.map((a,u)=>[a,u+1]));let r="",l=0;for(const a of i){r+=e.slice(l,a.start),l=a.end;const{attId:u,name:c,kind:d}=a.attrs,f=d==="folder"?n?.resolveFolder?.(u):void 0;if(f!==void 0){const y=f==="/"||/^[a-zA-Z]:\/$/.test(f)?f.slice(0,-1)||"/":c.endsWith("/")?c.slice(0,-1):c;r+=Rp({kind:"folder",name:y,path:f});continue}const h=o.get(u);if(h!==void 0){r+=Nf({attId:String(h),name:c});continue}const m=s.get(u);if(m!==void 0){r+=Nf({attId:`m${m}`,name:c});continue}r+=c}return r+=e.slice(l),r}function lR(e,t,n=0){if(t<=0&&n<=0)return e;const i=Al(e);if(i.length===0)return e;let o="",s=0;for(const r of i){const{attId:l,name:a,kind:u}=r.attrs;let c;t>0&&/^[1-9]\d*$/.test(l)?c=String(Number(l)+t):n>0&&/^m[1-9]\d*$/.test(l)&&(c=`m${Number(l.slice(1))+n}`),c!==void 0&&(o+=e.slice(s,r.start),s=r.end,o+=Nf({attId:c,name:a}))}return o+=e.slice(s),o}function tf(e,t){const n=Al(e);if(n.length===0)return e;let i="",o=0;for(const s of n)i+=e.slice(o,s.start)+(t?.(s.attrs.name)??s.attrs.name),o=s.end;return i+=e.slice(o),i}function aR(e,t){const n=Al(e);if(n.length===0)return e;let i="",o=0;for(const s of n)t.has(s.attrs.attId)||(i+=e.slice(o,s.start)+s.attrs.name,o=s.end);return i+=e.slice(o),i}function f6(e){const t=Al(e);if(t.length===0)return e;let n="",i=0;for(const o of t)n+=e.slice(i,o.start),i=o.end;return n+=e.slice(i),n}let Y_e=!0;const J_e=/^> (.*)$/,X_e=/^>$/;function LS(e){return e.replaceAll("%","%25").replaceAll(` +`,"%0A").replaceAll("\r","%0D")}function eIe(e){return e.replaceAll("%0A",` +`).replaceAll("%0D","\r").replaceAll("%25","%")}const tIe=/^from: (.+)$/;function IV(e){let t=e,n;const i=e.indexOf(` +`),o=tIe.exec(i===-1?e:e.slice(0,i));o!==null&&(n=eIe(o[1]),t=i===-1?"":e.slice(i+1));const s=[];for(const r of t.split(` +`)){const l=J_e.exec(r);if(l!==null){s.push(l[1]??"");continue}if(X_e.test(r)){s.push("");continue}return null}return{text:s.join(` +`),...n!==void 0?{source:n}:{}}}function NS(e){const t=[];for(const i of e.split(/(\n{2,})/)){if(i==="")continue;if(/^\n{2,}$/.test(i)){t.push({type:"sep",text:i});continue}const o=IV(i);t.push(o===null?{type:"inline",text:i}:{type:"quote",text:o.text,...o.source!==void 0?{source:o.source}:{}})}const n=[];for(let i=0;i`> ${t}`).join(` +`)}function iIe(e){const t=e.split(/(\n{2,})/),n=new Array(t.length).fill(!1);let i=!1;for(let s=t.length-1;s>=0;s-=1){n[s]=i;const r=t[s];r!==""&&!/^\n{2,}$/.test(r)&&(i=!0)}let o="";for(let s=0;s{i.type==="sep"&&i.text===` + +`&&t[o-1]?.type==="quote"&&t[o+1]?.type==="quote"&&n.add(o)}),t.map((i,o)=>{if(n.has(o))return" ";if(i.type!=="quote")return i.text;const s={text:i.text};return i.source!==void 0&&(s.source=i.source),i.comment!==void 0&&(s.comment=i.comment),sw(s)}).join("")}function tr(e){this.content=e}tr.prototype={constructor:tr,find:function(e){for(var t=0;t>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 EV(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 FV(e){return e>=55296&&e<56320}class sn{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 sn(i,o)}cutByIndex(t,n){return t==n?sn.empty:t==0&&n==this.content.length?this:new sn(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 sn(o,s)}addToStart(t){return new sn([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new sn(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 sn.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return sn.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return sn.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}}Fi.none=[];class zv 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=RV(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(DV(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(sn.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(sn.empty,0,0);function DV(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(DV(s.content,t-o-1,n-o-1)))}function RV(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=RV(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 oIe(e,t,n){if(n.openStart>e.depth)throw new zv("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new zv("Inconsistent open depths");return OV(e,t,n,0)}function OV(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 iv(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&&(lp(e.nodeAfter,i),s++));for(let l=s;lo&&h6(e,t,o+1),r=i.depth>o&&h6(n,i,o+1),l=[];return iv(null,e,o,l),s&&r&&t.index(o)==n.index(o)?(PV(s,r),lp(ap(s,BV(e,t,n,i,o+1)),l)):(s&&lp(ap(s,Eb(e,t,o+1)),l),iv(t,n,o,l),r&&lp(ap(r,Eb(n,i,o+1)),l)),iv(i,null,o,l),new sn(l)}function Eb(e,t,n){let i=[];if(iv(null,e,n,i),e.depth>n){let o=h6(e,t,n+1);lp(ap(o,Eb(e,t,n+1)),i)}return iv(t,null,n,i),new sn(i)}function sIe(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(sn.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class jv{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 aIe(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 jv(n,i,s)}static resolveCached(t,n){let i=uR.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()+")"),$V(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=sn.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=sn.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,o,i);return s.type.checkAttrs(s.attrs),s}};up.prototype.text=void 0;class Lb extends up{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):$V(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 Lb(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Lb(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 $V(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Cp{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let i=new cIe(t,n);if(i.next==null)return Cp.empty;let o=zV(i);i.next&&i.err("Unexpected trailing text");let s=vIe(gIe(o));return yIe(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(` +`)}}Cp.empty=new Cp(!0);class cIe{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 zV(e){let t=[];do t.push(dIe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function dIe(e){let t=[];do t.push(fIe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function fIe(e){let t=mIe(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=hIe(e,t);else break;return t}function cR(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function hIe(e,t){let n=cR(e),i=n;return e.eat(",")&&(e.next!="}"?i=cR(e):i=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function pIe(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 mIe(e){if(e.eat("(")){let t=zV(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=pIe(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 gIe(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 Cp(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:WV(this.attrs,t)}create(t=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new up(this,this.computeAttrs(t),sn.from(n),Fi.setFrom(i))}createChecked(t=null,n,i){return n=sn.from(n),this.checkContent(n),new up(this,this.computeAttrs(t),n,Fi.setFrom(i))}createAndFill(t=null,n,i){if(t=this.computeAttrs(t),n=sn.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(sn.empty,!0);return s?new up(this,t,n.append(s),Fi.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 VV(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 kIe(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 bIe{constructor(t,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?kIe(t,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class aw{constructor(t,n,i,o){this.name=t,this.rank=n,this.schema=i,this.spec=o,this.attrs=UV(t,o.attrs),this.excluded=null;let s=HV(this.attrs);this.instance=s?new Fi(this,s):null}create(t=null){return!t&&this.instance?this.instance:new Fi(this,WV(this.attrs,t))}static compile(t,n){let i=Object.create(null),o=0;return t.forEach((s,r)=>i[s]=new aw(s,o++,n,r)),i}removeFromSet(t){for(var n=0;n-1}}class wIe{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=fR.compile(this.spec.nodes,this),this.marks=aw.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]=Cp.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?hR(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==""?[]:hR(this,r.split(" "))}this.nodeFromJSON=o=>up.fromJSON(this,o),this.markFromJSON=o=>Fi.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 fR){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 Lb(i,i.defaultAttrs,t,Fi.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 hR(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 CIe(e){return e.tag!=null}function AIe(e){return e.style!=null}let KV=class m6{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(o=>{if(CIe(o))this.tags.push(o);else if(AIe(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 mR(this,n,!1);return i.addAll(t,Fi.none,n.from,n.to),i.finish()}parseSlice(t,n={}){let i=new mR(this,n,!0);return i.addAll(t,Fi.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=gR(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=gR(r)),r.node||r.ignore||r.mark||(r.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new m6(t,m6.schemaRules(t)))}};const ZV={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},xIe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},GV={ol:!0,ul:!0},Hv=1,g6=2,ov=4;function pR(e,t,n){return t!=null?(t?Hv:0)|(t==="full"?g6:0):e&&e.whitespace=="pre"?Hv|g6:n&~ov}class Jy{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=Fi.none,this.match=s||(r&ov?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(sn.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&Hv)){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=sn.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(sn.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&&!ZV.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class mR{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=pR(null,n.preserveWhitespace,0)|(i?ov:0);o?s=new Jy(o.type,o.attrs,Fi.none,!0,n.topMatch||o.type.contentMatch,r):i?s=new Jy(null,null,Fi.none,!0,null,r):s=new Jy(t.schema.topNodeType,null,Fi.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&g6?"full":this.localPreserveWS||(o.options&Hv)>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):vR(u.type,t))?(a=u.addToSet(a),!1):!0),this.nodes.push(new Jy(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|=Hv)}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 SIe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&GV.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function _Ie(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function gR(e){let t={};for(let n in e)t[n]=e[n];return t}function vR(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&&Y9(Xy(i),o(t,n),null,t.attrs)}static renderSpec(t,n,i=null,o){return typeof n=="string"?{dom:t.createTextNode(n)}:Y9(t,n,i,o)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new uc(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=yR(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return yR(t.marks)}}function yR(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function Xy(e){return e.document||window.document}const kR=new WeakMap;function IIe(e){let t=kR.get(e);return t===void 0&&kR.set(e,t=MIe(e)),t}function MIe(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}=Y9(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 ri=new wIe({nodes:{doc:{content:"block+"},paragraph:{group:"block",content:"inline*",toDOM:()=>["p",0],parseDOM:[{tag:"p"}]},text:{group:"inline"},mention:{group:"inline",inline:!0,atom:!0,selectable:!0,attrs:{kind:{},name:{},path:{default:""}},leafText:e=>Rp(e.attrs),toDOM:e=>{const t=e.attrs;return["span",{class:`mention-pill mention-${t.kind}`,"data-mention-path":t.path},t.name]}},attachment:{group:"inline",inline:!0,atom:!0,selectable:!0,attrs:{attId:{},name:{},kind:{}},leafText:e=>Nf(e.attrs),toDOM:e=>{const t=e.attrs;return["span",{class:`attachment-pill attachment-${t.kind}`,"data-attachment-id":t.attId,"data-attachment-kind":t.kind,"data-attachment-name":t.name},t.name]}},quote:{group:"inline",inline:!0,atom:!0,selectable:!0,attrs:{text:{},comment:{default:""},source:{default:""}},leafText:e=>sw(e.attrs),toDOM:e=>{const t=e.attrs,n={class:"quote-pill","data-quote-text":t.text};return typeof t.comment=="string"&&t.comment.length>0&&(n["data-quote-comment"]=t.comment),typeof t.source=="string"&&t.source.length>0&&(n["data-quote-source"]=t.source),["span",n,Mm(t.text)]}}}});function QV(e){return ri.nodes.mention.create(e)}function YV(e){return ri.nodes.attachment.create(e)}function JV(e){return ri.nodes.quote.create(e)}function TIe(e,t){return e?_V(e,t).map(n=>n.type==="mention"?QV(n.attrs):n.type==="attachment"?YV(n.attrs):n.type==="quote"?JV(n.attrs):ri.text(n.value)):[]}function Wv(e,t){const n=e.split(` +`);return ri.node("doc",null,n.map(i=>i?ri.node("paragraph",null,t?.reviveMentions?TIe(i,t?.attachmentKindFor):ri.text(i)):ri.node("paragraph")))}function qv(e){return e.textBetween(0,e.content.size,` +`)}const XV=65535,eK=Math.pow(2,16);function EIe(e,t){return e+t*eK}function bR(e){return e&XV}function LIe(e){return(e-(e&XV))/eK}const tK=1,nK=2,J9=4,iK=8;class v6{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&iK)>0}get deletedBefore(){return(this.delInfo&(tK|J9))>0}get deletedAfter(){return(this.delInfo&(nK|J9))>0}get deletedAcross(){return(this.delInfo&J9)>0}}class ia{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&ia.empty)return ia.empty}recover(t){let n=0,i=bR(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:EIe(l/3,t-a),g=t==a?nK:t==d?tK:J9;return(n<0?t!=a:t!=d)&&(g|=iK),new v6(h,g,m)}o+=c-u}return i?t+o:new v6(t+o,0,null)}touches(t,n){let i=0,o=bR(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 Uv;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 fs.fromReplace(t,this.from,this.to,s)}invert(){return new nc(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 nf(n.pos,i.pos,this.mark)}merge(t){return t instanceof nf&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new nf(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 nf(n.from,n.to,t.markFromJSON(n.mark))}}Nr.jsonID("addMark",nf);class nc extends Nr{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(FS(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return fs.fromReplace(t,this.from,this.to,i)}invert(){return new nf(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 nc(n.pos,i.pos,this.mark)}merge(t){return t instanceof nc&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new nc(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 nc(n.from,n.to,t.markFromJSON(n.mark))}}Nr.jsonID("removeMark",nc);class of extends Nr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return fs.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return fs.fromReplace(t,this.pos,this.pos+1,new mn(sn.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 ca(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 ca(n.from,n.to,n.gapFrom,n.gapTo,mn.fromJSON(t,n.slice),n.insert,!!n.structure)}}Nr.jsonID("replaceAround",ca);function y6(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 NIe(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 FIe(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 aw){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 nc(r.from,r.to,r.style)))}function DS(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 DIe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function RS(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=sn.from(i.node(m).copy(c)),d++):a--;let f=sn.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=sn.from(n[r].type.create(n[r].attrs,i))}let o=t.start,s=t.end;e.step(new ca(o,s,o,s,new mn(i,0,0),n.length,!0))}function PIe(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)&&BIe(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&&sK(e,r,l,s),DS(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 ca(d,f,d+1,f-1,new mn(sn.from(i.create(a,null,r.marks)),0,0),1,!0)),u===!0&&oK(e,r,l,s),!1}})}function oK(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 sK(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 BIe(e,t,n){let i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}function $Ie(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 ca(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new mn(sn.from(r),0,0),1,!0))}function X9(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 zIe(e,t,n=1,i){let o=e.doc.resolve(t),s=sn.empty,r=sn.empty;for(let l=o.depth,a=o.depth-n,u=n-1;l>a;l--,u--){s=sn.from(o.node(l).copy(s));let c=i&&i[u];r=sn.from(c?c.type.create(c.attrs,r):o.node(l).copy(r))}e.step(new Gs(t,t,new mn(s.append(r),n,n),!0))}function rK(e,t){let n=e.resolve(t),i=n.index();return HIe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function jIe(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 OS(e,t,n=t,i=mn.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return lK(o,s,i)?new Gs(t,n,i):new VIe(o,s,i).fit()}function lK(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class VIe{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=sn.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=sn.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 ca(i.pos,t,this.$to.pos,this.$to.end(),a,n):a.size||i.pos!=this.$to.pos?new Gs(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(sn.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 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=V8(t,n);if(o.childCount<=1&&n>0){let s=t.size-n<=n+o.size;this.unplaced=new mn(m0(t,n-1,1),n-1,s?n-1:i)}else this.unplaced=new mn(m0(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=y,c.push(aK(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=g0(this.placed,n,sn.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,y=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=g0(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=g0(this.placed,this.depth,sn.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(sn.empty,!0);n.childCount&&(this.placed=g0(this.placed,this.frontier.length,n))}}function m0(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(m0(e.firstChild.content,t-1,n)))}function g0(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(g0(e.lastChild.content,t-1,n)))}function V8(e,t){for(let n=0;n1&&(i=i.replaceChild(0,aK(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(sn.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&&!KIe(n,s.content,r)?l:null}function KIe(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=ZIe(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 uK(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(sn.empty,!0))}return e}function QIe(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=qIe(e.doc,t,i.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new mn(sn.from(i),0,0))}function YIe(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=cK(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 cK(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 dm extends Nr{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 fs.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 fs.fromReplace(t,this.pos,this.pos+1,new mn(sn.from(o),0,n.isLeaf?0:1))}getMap(){return ia.empty}invert(t){return new dm(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 dm(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 dm(n.pos,n.attr,n.value)}}Nr.jsonID("attr",dm);class Vv extends Nr{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 fs.ok(i)}getMap(){return ia.empty}invert(t){return new Vv(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 Vv(n.attr,n.value)}}Nr.jsonID("docAttr",Vv);let Tm=class extends Error{};Tm=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Tm.prototype=Object.create(Error.prototype);Tm.prototype.constructor=Tm;Tm.prototype.name="TransformError";class JIe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Uv}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Tm(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=OS(this.doc,t,n,i);return o&&this.step(o),this}replaceWith(t,n,i){return this.replace(t,n,new mn(sn.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 GIe(this,t,n,i),this}replaceRangeWith(t,n,i){return QIe(this,t,n,i),this}deleteRange(t,n){return YIe(this,t,n),this}lift(t,n){return RIe(this,t,n),this}join(t,n=1){return WIe(this,t,n),this}wrap(t,n){return OIe(this,t,n),this}setBlockType(t,n=t,i,o=null){return PIe(this,t,n,i,o),this}setNodeMarkup(t,n,i=null,o){return $Ie(this,t,n,i,o),this}setNodeAttribute(t,n,i){return this.step(new dm(t,n,i)),this}setDocAttribute(t,n){return this.step(new Vv(t,n)),this}addNodeMark(t,n){return this.step(new of(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 Fi)n.isInSet(i.marks)&&this.step(new Ap(t,n));else{let o=i.marks,s,r=[];for(;s=n.isInSet(o);)r.push(new Ap(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 zIe(this,t,n,i),this}addMark(t,n,i){return NIe(this,t,n,i),this}removeMark(t,n,i){return FIe(this,t,n,i),this}clearIncompatible(t,n,i){return DS(this,t,n,i),this}}const Z8=Object.create(null);class Bi{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new XIe(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?I1(t.node(0),t.node(s),t.before(s+1),t.index(s),n,i):I1(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 da(t.node(0))}static atStart(t){return I1(t,t,0,0,1)||new da(t)}static atEnd(t){return I1(t,t,t.content.size,t.childCount,-1)||new da(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 Xn.between(this.$anchor,this.$head).getBookmark()}}Bi.prototype.visible=!0;class XIe{constructor(t,n){this.$from=t,this.$to=n}}let wR=!1;function CR(e){!wR&&!e.parent.inlineContent&&(wR=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Xn extends Bi{constructor(t,n=t){CR(t),CR(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 Bi.near(i);let o=t.resolve(n.map(this.anchor));return new Xn(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 Xn&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new uw(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 Xn(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=Bi.findFrom(n,i,!0)||Bi.findFrom(n,-i,!0);if(s)n=s.$head;else return Bi.near(n,i)}return t.parent.inlineContent||(o==0?t=n:(t=(Bi.findFrom(t,-i,!0)||Bi.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=I1(e,l,n+o,o<0?l.childCount:0,o,s);if(a)return a}n+=l.nodeSize*o}return null}function AR(e,t,n){let i=e.steps.length-1;if(i{r==null&&(r=c)}),e.setSelection(Bi.near(e.doc.resolve(r),n))}const xR=1,e9=2,SR=4;class tMe extends JIe{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|=e9,this}ensureMarks(t){return Fi.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&e9)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~e9,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)||Fi.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(Bi.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|=SR,this}get scrolledIntoView(){return(this.updated&SR)>0}}function _R(e,t){return!t||!e?e:e.bind(t)}class v0{constructor(t,n,i){this.name=t,this.init=_R(n.init,i),this.apply=_R(n.apply,i)}}const nMe=[new v0("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new v0("selection",{init(e,t){return e.selection||Bi.atStart(t.doc)},apply(e){return e.selection}}),new v0("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new v0("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=nMe.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 v0(i.key,i.spec.state,i))})}}class Uh{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 Uh(o);return o.fields.forEach(r=>{if(r.name=="doc")s.doc=up.fromJSON(t.schema,n.doc);else if(r.name=="selection")s.selection=Bi.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 dK(e,t,n){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(t):i=="handleDOMEvents"&&(o=dK(o,t,{})),n[i]=o}return n}class b2{constructor(t){this.spec=t,this.props={},t.props&&dK(t.props,this,this.props),this.key=t.key?t.key.key:fK("plugin")}getState(t){return t[this.key]}}const Q8=Object.create(null);function fK(e){return e in Q8?e+"$"+ ++Q8[e]:(Q8[e]=0,e+"$")}class BS{constructor(t="key"){this.key=fK(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}function sv(e){return e.isText?e.text.length:e.type===ri.nodes.attachment?Nf(e.attrs).length:e.type===ri.nodes.quote?sw(e.attrs).length:Rp(e.attrs).length}function iMe(e,t){if(!t.parent.isTextblock)return ic(e,t.pos);if(t.textOffset>0)return ic(e,t.pos-t.textOffset);const n=t.nodeBefore;return n&&n.isText?ic(e,t.pos-n.nodeSize):ic(e,t.pos)}function nd(e,t){let n=Math.max(0,t),i=-1;return e.forEach((o,s)=>{if(i!==-1)return;let r=0;if(o.forEach(l=>{r+=sv(l)}),n>r){n-=r+1;return}o.forEach((l,a)=>{if(i!==-1)return;const u=s+1+a,c=sv(l);if(n<=c){l.isText?i=u+n:i=n===0?u:u+1;return}n-=c}),i===-1&&(i=s+1+o.content.size)}),i===-1?e.content.size-1:i}function ic(e,t){let n=0,i=-1;return e.forEach((o,s)=>{if(i!==-1)return;const r=s+o.nodeSize;if(t>r){o.forEach(a=>{n+=sv(a)}),n+=1;return}let l=0;o.forEach((a,u)=>{if(i!==-1)return;const c=s+1+u;if(a.isText){const d=c+a.nodeSize;if(t<=d){i=n+l+Math.max(0,t-c);return}l+=a.text.length}else{const d=c+1;if(t<=d){i=n+l+(t<=c?0:sv(a));return}l+=sv(a)}}),i===-1&&(i=n+l)}),i===-1?n:i}function oMe(e){const t=[];return e.forEach(n=>{n.forEach(i=>{!i.isText&&i.type===ri.nodes.mention&&i.attrs.kind==="skill"&&t.push({name:i.attrs.name})})}),t}function IR(e){return(t,n)=>{const i=t.selection.$head,o=e?i.start():i.end();return n&&n(t.tr.setSelection(Xn.create(t.doc,t.selection.$anchor.pos,o)).scrollIntoView()),!0}}var Nb=200,Ys=function(){};Ys.prototype.append=function(t){return t.length?(t=Ys.from(t),!this.length&&t||t.length=n?Ys.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Ys.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Ys.prototype.forEach=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length),n<=i?this.forEachInner(t,n,i,0):this.forEachInvertedInner(t,n,i,0)};Ys.prototype.map=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length);var o=[];return this.forEach(function(s,r){return o.push(t(s,r))},n,i),o};Ys.from=function(t){return t instanceof Ys?t:t&&t.length?new hK(t):Ys.empty};var hK=(function(e){function t(i){e.call(this),this.values=i}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,s){return o==0&&s==this.length?this:new t(this.values.slice(o,s))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,s,r,l){for(var a=s;a=r;a--)if(o(this.values[a],l+a)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=Nb)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=Nb)return new t(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(Ys);Ys.empty=new hK([]);var sMe=(function(e){function t(n,i){e.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(i){return il&&this.right.forEachInner(i,Math.max(o-l,0),Math.min(this.length,s)-l,r+l)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,s,r){var l=this.left.length;if(o>l&&this.right.forEachInvertedInner(i,o-l,Math.max(s,l)-l,r+l)===!1||s=s?this.right.slice(i-s,o-s):this.left.slice(i,s).append(this.right.slice(0,o-s))},t.prototype.leafAppend=function(i){var o=this.right.leafAppend(i);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(i){var o=this.left.leafPrepend(i);if(o)return new t(o,this.right)},t.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new t(this.left,new t(this.right,i)):new t(this,i)},t})(Ys);const rMe=500;class fu{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let o,s;n&&(o=this.remapping(i,this.items.length),s=o.maps.length);let r=t.tr,l,a,u=[],c=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(i,f+1),s=o.maps.length),s--,c.push(d);return}if(o){c.push(new qu(d.map));let h=d.step.map(o.slice(s)),m;h&&r.maybeStep(h).doc&&(m=r.mapping.maps[r.mapping.maps.length-1],u.push(new qu(m,void 0,void 0,u.length+c.length))),s--,m&&o.appendMap(m,s)}else r.maybeStep(d.step);if(d.selection)return l=o?d.selection.map(o.slice(s)):d.selection,a=new fu(this.items.slice(0,i).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:r,selection:l}}addTransform(t,n,i,o){let s=[],r=this.eventCount,l=this.items,a=!o&&l.length?l.get(l.length-1):null;for(let c=0;caMe&&(l=lMe(l,u),r-=u),new fu(l.append(s),r)}remapping(t,n){let i=new Uv;return this.items.forEach((o,s)=>{let r=o.mirrorOffset!=null&&s-o.mirrorOffset>=t?i.maps.length-o.mirrorOffset:void 0;i.appendMap(o.map,r)},t,n),i}addMaps(t){return this.eventCount==0?this:new fu(this.items.append(t.map(n=>new qu(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let i=[],o=Math.max(0,this.items.length-n),s=t.mapping,r=t.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},o);let a=n;this.items.forEach(f=>{let h=s.getMirror(--a);if(h==null)return;r=Math.min(r,h);let m=s.maps[h];if(f.step){let g=t.steps[h].invert(t.docs[h]),y=f.selection&&f.selection.map(s.slice(a+1,h));y&&l++,i.push(new qu(m,g,y))}else i.push(new qu(m))},o);let u=[];for(let f=n;frMe&&(d=d.compress(this.items.length-i.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),i=n.maps.length,o=[],s=0;return this.items.forEach((r,l)=>{if(l>=t)o.push(r),r.selection&&s++;else if(r.step){let a=r.step.map(n.slice(i)),u=a&&a.getMap();if(i--,u&&n.appendMap(u,i),a){let c=r.selection&&r.selection.map(n.slice(i));c&&s++;let d=new qu(u.invert(),a,c),f,h=o.length-1;(f=o.length&&o[h].merge(d))?o[h]=f:o.push(d)}}else r.map&&i--},this.items.length,0),new fu(Ys.from(o.reverse()),s)}}fu.empty=new fu(Ys.empty,0);function lMe(e,t){let n;return e.forEach((i,o)=>{if(i.selection&&t--==0)return n=o,!1}),e.slice(n)}class qu{constructor(t,n,i,o){this.map=t,this.step=n,this.selection=i,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new qu(n.getMap().invert(),n,this.selection)}}}class qd{constructor(t,n,i,o,s){this.done=t,this.undone=n,this.prevRanges=i,this.prevTime=o,this.prevComposition=s}}const aMe=20;function uMe(e,t,n,i){let o=n.getMeta(cp),s;if(o)return o.historyState;n.getMeta(mK)&&(e=new qd(e.done,e.undone,null,0,-1));let r=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(r&&r.getMeta(cp))return r.getMeta(cp).redo?new qd(e.done.addTransform(n,void 0,i,ek(t)),e.undone,MR(n.mapping.maps),e.prevTime,e.prevComposition):new qd(e.done,e.undone.addTransform(n,void 0,i,ek(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(r&&r.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=e.prevTime==0||!r&&e.prevComposition!=l&&(e.prevTime<(n.time||0)-i.newGroupDelay||!cMe(n,e.prevRanges)),u=r?Y8(e.prevRanges,n.mapping):MR(n.mapping.maps);return new qd(e.done.addTransform(n,a?t.selection.getBookmark():void 0,i,ek(t)),fu.empty,u,n.time,l??e.prevComposition)}else return(s=n.getMeta("rebased"))?new qd(e.done.rebased(n,s),e.undone.rebased(n,s),Y8(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new qd(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Y8(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function cMe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((i,o)=>{for(let s=0;s=t[s]&&(n=!0)}),n}function MR(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((i,o,s,r)=>t.push(s,r));return t}function Y8(e,t){if(!e)return null;let n=[];for(let i=0;i{let o=cp.getState(n);if(!o||(e?o.undone:o.done).eventCount==0)return!1;if(i){let s=dMe(o,n,e);s&&i(t?s.scrollIntoView():s)}return!0}}const vK=gK(!1,!0),k6=gK(!0,!0);function hMe(e,t,n){const i=nd(e.doc,n.start),o=nd(e.doc,n.end),s=qv(e.doc),r=n.start>0?s.charAt(n.start-1):"",l=s.charAt(n.end),a=[];(r==="!"||r==="\\")&&a.push(ri.text(" ")),a.push(QV(t)),(l===""||!/\s/.test(l))&&a.push(ri.text(" "));const u=e.tr.replaceWith(i,o,a);return u.setSelection(Xn.create(u.doc,i+a.reduce((c,d)=>c+d.nodeSize,0))),u.scrollIntoView()}function pMe(e,t,n){const i=nd(e.doc,n.start),o=nd(e.doc,n.end),s=e.tr.insertText(t,i,o);return s.setSelection(Xn.create(s.doc,i+t.length)),pK(s.scrollIntoView())}function mMe(e,t,n){const i=n?n.start:ic(e.doc,e.selection.from),o=n?n.end:ic(e.doc,e.selection.to),s=nd(e.doc,i),r=nd(e.doc,o),l=qv(e.doc),a=i>0?l.charAt(i-1):"",u=l.charAt(o),c=[];(a==="!"||a==="\\")&&c.push(ri.text(" ")),c.push(YV(t)),(u===""||!/\s/.test(u))&&c.push(ri.text(" "));const d=e.tr.replaceWith(s,r,c);return d.setSelection(Xn.create(d.doc,s+c.reduce((f,h)=>f+h.nodeSize,0))),d.scrollIntoView()}function gMe(e,t,n){const i=e.selection.to,o=qv(e.doc),s=ic(e.doc,i),r=s>0?o.charAt(s-1):"",l=o.charAt(s),a=[];r!==""&&!/\s/.test(r)&&a.push(ri.text(" ")),a.push(JV(n!==void 0&&n.length>0?{...t,comment:n}:t)),(l===""||!/\s/.test(l))&&a.push(ri.text(" "));const u=e.tr.replaceWith(i,i,a);return u.setSelection(Xn.create(u.doc,i+a.reduce((c,d)=>c+d.nodeSize,0))),u.scrollIntoView()}function t9(e,t){return mn.maxOpen(Wv(e.replace(/\r\n?/g,` +`),t).content)}function ER(e){const t=typeof e.source=="string"&&e.source.length>0?`from: ${LS(e.source)} +`:"",n=typeof e.comment=="string"&&e.comment.length>0?` + +${e.comment}`:"";return`${t}${MV(e.text)}${n}`}function yK(e){const t=i=>i.isText?i.text??"":i.type===ri.nodes.mention?Rp(i.attrs):i.type===ri.nodes.attachment?i.attrs.name:i.type===ri.nodes.quote?ER(i.attrs):i.textBetween(0,i.content.size,""),n=[];return e.content.forEach(i=>{if(i.type===ri.nodes.mention||i.type===ri.nodes.attachment||i.type===ri.nodes.quote)n.push(t(i));else{let o="",s=!1;i.forEach(r=>{if(r.type===ri.nodes.quote){const a=ER(r.attrs);o=o.length>0?`${o.replace(/ +$/,"")} + +${a}`:a,s=!0;return}let l=t(r);s&&(l=l.replace(/^ /,""),o+=` + +`,s=!1),o+=l}),n.push(o)}}),n.join(` +`)}const b6=` + + + + +`,kK=` + + + + +`,bK='',wK=` + + + +`,CK=` + + +`,AK='',xK=` + + +`,SK=` + + +`,_K=` + + +`,vMe='',yMe='',kMe='',bMe='',wMe='',CMe={sm:14,md:16,lg:20},AMe={file:b6,folder:kK,skill:bK,copy:wK,check:CK,"external-link":AK,target:xK,"file-edit":SK,close:_K,attachment:vMe,image:yMe,video:kMe,fullscreen:bMe,quote:wMe};function tl(e,t="md"){const n=CMe[t];return AMe[e].replace(/]*>/,i=>i.replace(/\s(?:width|height)="[^"]*"/g,"")).replace(/^
      /i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},bw=/^(?:[ \t]*(?:\n|$))+/,kw=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ww=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ro=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Tw=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,il=/(?:[*+-]|\d{1,9}[.)])/,Gf=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xf=xt(Gf).replace(/bull/g,il).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Sw=xt(Gf).replace(/bull/g,il).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ol=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,_w=/^[^\n]+/,sl=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Bw=xt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",sl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),vw=xt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,il).getRegex(),_s="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",al=/|$))/,Lw=xt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",al).replace("tag",_s).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Vf=xt(ol).replace("hr",ro).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",_s).getRegex(),Fw=xt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Vf).getRegex(),nl={blockquote:Fw,code:kw,def:Bw,fences:ww,heading:Tw,hr:ro,html:Lw,lheading:Xf,list:vw,newline:bw,paragraph:Vf,table:Ii,text:_w},Hh=xt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ro).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",_s).getRegex(),Aw={...nl,lheading:Sw,table:Hh,paragraph:xt(ol).replace("hr",ro).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Hh).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",_s).getRegex()},Ew={...nl,html:xt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",al).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ii,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xt(ol).replace("hr",ro).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Xf).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Mw=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,$w=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Zf=/^( {2,}|\\)\n(?!\s*$)/,Ow=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",xw?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Jf=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Nw=xt(Jf,"u").replace(/punct/g,Bs).getRegex(),qw=xt(Jf,"u").replace(/punct/g,Qf).getRegex(),tp="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ww=xt(tp,"gu").replace(/notPunctSpace/g,Kf).replace(/punctSpace/g,ll).replace(/punct/g,Bs).getRegex(),zw=xt(tp,"gu").replace(/notPunctSpace/g,Pw).replace(/punctSpace/g,Dw).replace(/punct/g,Qf).getRegex(),Hw=xt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Kf).replace(/punctSpace/g,ll).replace(/punct/g,Bs).getRegex(),Yw=xt(/\\(punct)/,"gu").replace(/punct/g,Bs).getRegex(),Uw=xt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[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])?)+(?![-_])/).getRegex(),jw=xt(al).replace("(?:-->|$)","-->").getRegex(),Gw=xt("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",jw).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ss=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Xw=xt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ss).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ep=xt(/^!?\[(label)\]\[(ref)\]/).replace("label",ss).replace("ref",sl).getRegex(),rp=xt(/^!?\[(ref)\](?:\[\])?/).replace("ref",sl).getRegex(),Vw=xt("reflink|nolink(?!\\()","g").replace("reflink",ep).replace("nolink",rp).getRegex(),Yh=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,hl={_backpedal:Ii,anyPunctuation:Yw,autolink:Uw,blockSkip:Rw,br:Zf,code:$w,del:Ii,emStrongLDelim:Nw,emStrongRDelimAst:Ww,emStrongRDelimUnd:Hw,escape:Mw,link:Xw,nolink:rp,punctuation:Iw,reflink:ep,reflinkSearch:Vw,tag:Gw,text:Ow,url:Ii},Zw={...hl,link:xt(/^!?\[(label)\]\((.*?)\)/).replace("label",ss).getRegex(),reflink:xt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ss).getRegex()},Ja={...hl,emStrongRDelimAst:zw,emStrongLDelim:qw,url:xt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Yh).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:xt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Uh=e=>Qw[e];function ve(e,t){if(t){if(te.escapeTest.test(e))return e.replace(te.escapeReplace,Uh)}else if(te.escapeTestNoEncode.test(e))return e.replace(te.escapeReplaceNoEncode,Uh);return e}function jh(e){try{e=encodeURI(e).replace(te.percentDecode,"%")}catch{return null}return e}function Gh(e,t){let r=e.replace(te.findPipe,(s,a,n)=>{let l=!1,c=a;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(te.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length0?-2:-1}function Xh(e,t,r,i,o){let s=t.href,a=t.title||null,n=e[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,l}function tT(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(` +`).map(s=>{let a=s.match(r.other.beginningSpace);if(a===null)return s;let[n]=a;return n.length>=o.length?s.slice(o.length):s}).join(` +`)}var as=class{options;rules;lexer;constructor(t){this.options=t||Ar}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:yi(i,` +`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],o=tT(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let o=yi(i,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(i=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:yi(r[0],` +`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=yi(r[0],` +`).split(` +`),o="",s="",a=[];for(;i.length>0;){let n=!1,l=[],c;for(c=0;c1,s={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let a=this.rules.other.listItemRegex(i),n=!1;for(;t;){let c=!1,h="",d="";if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let f=r[2].split(` +`,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),u=t.split(` +`,1)[0],g=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(u)&&(h+=u+` +`,t=t.substring(u.length+1),c=!0),!c){let b=this.rules.other.nextBulletRegex(m),k=this.rules.other.hrRegex(m),T=this.rules.other.fencesBeginRegex(m),S=this.rules.other.headingBeginRegex(m),_=this.rules.other.htmlBeginRegex(m);for(;t;){let L=t.split(` +`,1)[0],v;if(u=L,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),v=u):v=u.replace(this.rules.other.tabCharGlobal," "),T.test(u)||S.test(u)||_.test(u)||b.test(u)||k.test(u))break;if(v.search(this.rules.other.nonSpaceChar)>=m||!u.trim())d+=` +`+v.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(f)||S.test(f)||k.test(f))break;d+=` +`+u}!g&&!u.trim()&&(g=!0),h+=L+` +`,t=t.substring(L.length+1),f=v.slice(m)}}s.loose||(n?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(n=!0));let y=null,C;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(C=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:h,task:!!y,checked:C,loose:!1,text:d,tokens:[]}),s.raw+=h}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;cf.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=d}if(s.loose)for(let c=0;c({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[c]})));return a}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===` +`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let a=yi(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=Jw(r[2],"()");if(a===-2)return;if(a>-1){let n=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,n).trim(),r[3]=""}}let o=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(o);a&&(o=a[1],s=a[3])}else s=r[3]?r[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?o=o.slice(1):o=o.slice(1,-1)),Xh(r,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let o=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[o.toLowerCase()];if(!s){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return Xh(i,s,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!(!o||o[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[2])||!i||this.rules.inline.punctuation.exec(i))){let s=[...o[0]].length-1,a,n,l=s,c=0,h=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+s);(o=h.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(n=[...a].length,o[3]||o[4]){l+=n;continue}else if((o[5]||o[6])&&s%3&&!((s+n)%3)){c+=n;continue}if(l-=n,l>0)continue;n=Math.min(n,n+l+c);let d=[...o[0]][0].length,f=t.slice(0,s+o.index+d+n);if(Math.min(s,n)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let u=f.slice(2,-2);return{type:"strong",raw:f,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(i),s=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return o&&s&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,o;return r[2]==="@"?(i=r[1],o="mailto:"+i):(i=r[1],o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,o;if(r[2]==="@")i=r[0],o="mailto:"+i;else{let s;do s=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(s!==r[0]);i=r[0],r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},pe=class tn{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ar,this.options.tokenizer=this.options.tokenizer||new as,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:te,block:Co.normal,inline:mi.normal};this.options.pedantic?(r.block=Co.pedantic,r.inline=mi.pedantic):this.options.gfm&&(r.block=Co.gfm,this.options.breaks?r.inline=mi.breaks:r.inline=mi.gfm),this.tokenizer.rules=r}static get rules(){return{block:Co,inline:mi}}static lex(t,r){return new tn(r).lex(t)}static lexInline(t,r){return new tn(r).inlineTokens(t)}lex(t){t=t.replace(te.carriageReturn,` +`),this.blockTokens(t,this.tokens);for(let r=0;r(o=a.call({lexer:this},t,r))?(t=t.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let a=r.at(-1);o.raw.length===1&&a!==void 0?a.raw+=` +`:r.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+o.raw,a.text+=` +`+o.text,this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+o.raw,a.text+=` +`+o.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),r.push(o);continue}let s=t;if(this.options.extensions?.startBlock){let a=1/0,n=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},n),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(s=t.substring(0,a+1))}if(this.state.top&&(o=this.tokenizer.paragraph(s))){let a=r.at(-1);i&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+o.raw,a.text+=` +`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o),i=s.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+o.raw,a.text+=` +`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,o=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)s=o[2]?o[2].length:0,i=i.slice(0,o.index+s)+"["+"a".repeat(o[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,n="";for(;t;){a||(n=""),a=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,i,n)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(u=>{f=u.call({lexer:this},d),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(n=l.raw.slice(-1)),a=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},ns=class{options;parser;constructor(t){this.options=t||Ar}space(t){return""}code({text:t,lang:r,escaped:i}){let o=(r||"").match(te.notSpaceStart)?.[0],s=t.replace(te.endingNewline,"")+` +`;return o?'
      '+(i?s:ve(s,!0))+`
      +`:"
      "+(i?s:ve(s,!0))+`
      +`}blockquote({tokens:t}){return`
      +${this.parser.parse(t)}
      +`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`${this.parser.parseInline(t)} +`}hr(t){return`
      +`}list(t){let r=t.ordered,i=t.start,o="";for(let n=0;n +`+o+" +`}listitem(t){let r="";if(t.task){let i=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=i+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=i+" "+ve(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`
    1. ${r}
    2. +`}checkbox({checked:t}){return"'}paragraph({tokens:t}){return`

      ${this.parser.parseInline(t)}

      +`}table(t){let r="",i="";for(let s=0;s${o}`),` + +`+r+` +`+o+`
      +`}tablerow({text:t}){return` +${t} +`}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+` +`}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${ve(t,!0)}`}br(t){return"
      "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:r,tokens:i}){let o=this.parser.parseInline(i),s=jh(t);if(s===null)return o;t=s;let a='
      ",a}image({href:t,title:r,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));let s=jh(t);if(s===null)return ve(i);t=s;let a=`${i}{let n=s[a].flat(1/0);i=i.concat(this.walkTokens(n,r))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let o={...i};if(o.async=this.defaults.async||o.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...n){let l=s.renderer.apply(this,n);return l===!1&&(l=a.apply(this,n)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),o.extensions=r),i.renderer){let s=this.defaults.renderer||new ns(this.defaults);for(let a in i.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let n=a,l=i.renderer[n],c=s[n];s[n]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d||""}}o.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new as(this.defaults);for(let a in i.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let n=a,l=i.tokenizer[n],c=s[n];s[n]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d}}o.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new vi;for(let a in i.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let n=a,l=i.hooks[n],c=s[n];vi.passThroughHooks.has(a)?s[n]=h=>{if(this.defaults.async&&vi.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(s,h);return c.call(s,f)})();let d=l.call(s,h);return c.call(s,d)}:s[n]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,h);return f===!1&&(f=await c.apply(s,h)),f})();let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d}}o.hooks=s}if(i.walkTokens){let s=this.defaults.walkTokens,a=i.walkTokens;o.walkTokens=function(n){let l=[];return l.push(a.call(this,n)),s&&(l=l.concat(s.call(this,n))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return pe.lex(t,r??this.defaults)}parser(t,r){return ge.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let o={...i},s={...this.defaults,...o},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&o.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let n=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer():t?pe.lex:pe.lexInline)(n,s),c=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():t?ge.parse:ge.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let n=(s.hooks?s.hooks.provideLexer():t?pe.lex:pe.lexInline)(r,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():t?ge.parse:ge.parseInline)(n,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(n){return a(n)}}}onError(t,r){return i=>{if(i.message+=` +Please report this to https://github.com/markedjs/marked.`,t){let o="

      An error occurred:

      "+ve(i.message+"",!0)+"
      ";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},Lr=new eT;function wt(e,t){return Lr.parse(e,t)}wt.options=wt.setOptions=function(e){return Lr.setOptions(e),wt.defaults=Lr.defaults,jf(wt.defaults),wt};wt.getDefaults=rl;wt.defaults=Ar;wt.use=function(...e){return Lr.use(...e),wt.defaults=Lr.defaults,jf(wt.defaults),wt};wt.walkTokens=function(e,t){return Lr.walkTokens(e,t)};wt.parseInline=Lr.parseInline;wt.Parser=ge;wt.parser=ge.parse;wt.Renderer=ns;wt.TextRenderer=cl;wt.Lexer=pe;wt.lexer=pe.lex;wt.Tokenizer=as;wt.Hooks=vi;wt.parse=wt;wt.options;wt.setOptions;wt.use;wt.walkTokens;wt.parseInline;ge.parse;pe.lex;function ip(e){for(var t=[],r=1;r/g,` +`).replace(/\n{2,}/g,` +`);return ip(i)}p(op,"preprocessMarkdown");function sp(e){return e.split(/\\n|\n|/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}p(sp,"nonMarkdownToLines");function ap(e,t={}){const r=op(e,t),i=wt.lexer(r),o=[[]];let s=0;function a(n,l="normal"){n.type==="text"?n.text.split(` +`).forEach((h,d)=>{d!==0&&(s++,o.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&o[s].push({content:f,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&o[s].push({content:n.text,type:"normal"})}return p(a,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{a(l)}):n.type==="html"?o[s].push({content:n.text,type:"normal"}):o[s].push({content:n.raw,type:"normal"})}),o}p(ap,"markdownToLines");function np(e){return e?`

      ${e.replace(/\\n|\n/g,"
      ")}

      `:""}p(np,"nonMarkdownToHTML");function lp(e,{markdownAutoWrap:t}={}){const r=wt.lexer(e);function i(o){return o.type==="text"?t===!1?o.text.replace(/\n */g,"
      ").replace(/ /g," "):o.text.replace(/\n */g,"
      "):o.type==="strong"?`${o.tokens?.map(i).join("")}`:o.type==="em"?`${o.tokens?.map(i).join("")}`:o.type==="paragraph"?`

      ${o.tokens?.map(i).join("")}

      `:o.type==="space"?"":o.type==="html"?`${o.text}`:o.type==="escape"?o.text:(q.warn(`Unsupported markdown: ${o.type}`),o.raw)}return p(i,"output"),r.map(i).join("")}p(lp,"markdownToHTML");function hp(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}p(hp,"splitTextToChars");function cp(e,t){const r=hp(t.content);return dl(e,[],r,t.type)}p(cp,"splitWordToFitWidth");function dl(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[o,...s]=r,a=[...t,o];return e([{content:a.join(""),type:i}])?dl(e,a,s,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}p(dl,"splitWordToFitWidthRecursion");function dp(e,t){if(e.some(({content:r})=>r.includes(` +`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return ls(e,t)}p(dp,"splitLineToFitWidth");function ls(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let o="";e[0].content===" "&&(o=" ",e.shift());const s=e.shift()??{content:" ",type:"normal"},a=[...i];if(o!==""&&a.push({content:o,type:"normal"}),a.push(s),t(a))return ls(e,t,r,a);if(i.length>0)r.push(i),e.unshift(s);else if(s.content){const[n,l]=cp(t,s);r.push([n]),l.content&&e.unshift(l)}return ls(e,t,r)}p(ls,"splitLineToFitWidthRecursion");function rn(e,t){t&&e.attr("style",t)}p(rn,"applyStyle");var Vh=16384;async function up(e,t,r,i,o=!1,s=vt()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,Vh)}px`),a.attr("height",`${Math.min(10*r,Vh)}px`);const n=a.append("xhtml:div"),l=Pi(t.label)?await jc(t.label.replace(Zi.lineBreakRegex,` +`),s):be(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");h.html(l),rn(h,t.labelStyle),h.attr("class",`${c} ${i}`),rn(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),o&&n.attr("class","labelBkg");let d=n.node().getBoundingClientRect();return d.width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px"),d=n.node().getBoundingClientRect()),a.node()}p(up,"addHtmlSpan");function vs(e,t,r,i=!1){const o=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&o.attr("text-anchor","middle"),o}p(vs,"createTspan");function fp(e,t,r){const i=e.append("text"),o=vs(i,1,t);Ls(o,r);const s=o.node().getComputedTextLength();return i.remove(),s}p(fp,"computeWidthOfText");function rT(e,t,r){const i=e.append("text"),o=vs(i,1,t);Ls(o,[{content:r,type:"normal"}]);const s=o.node()?.getBoundingClientRect();return s&&i.remove(),s}p(rT,"computeDimensionOfText");function pp(e,t,r,i=!1,o=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");o&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=p(u=>fp(a,1.1,u)<=e,"checkWidth"),f=d(h)?[h]:dp(h,d);for(const u of f){const g=vs(l,c,1.1,o);Ls(g,u),c++}}if(i){const h=l.node().getBBox(),d=2;return n.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),a.node()}else return l.node()}p(pp,"createFormattedText");function on(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}p(on,"decodeHTMLEntities");function Ls(e,t){e.text(""),t.forEach((r,i)=>{const o=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?o.text(on(r.content)):o.text(" "+on(r.content))})}p(Ls,"updateTextContentAndStyles");async function gp(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,s,a)=>(r.push((async()=>{const n=`${s}:${a}`;return await Cw(n)?await eo(n,void 0,{class:"label-icon"}):``})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}p(gp,"replaceIconSubstring");var Pe=p(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:s=!0,markdown:a=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(q.debug("XYZ createText",t,r,i,o,s,n,"addSvgBackground: ",c),s){const d=a?lp(t,h):np(t),f=await gp(vr(d),h),u=t.replace(/\\\\/g,"\\"),g={isNode:n,label:Pi(t)?u:f,labelStyle:r.replace("fill:","color:")};return await up(e,g,l,o,c,h)}else{const d=vr(t.replace(//g,"
      ")),f=a?ap(d.replace("
      ","
      "),h):sp(d),u=pp(l,e,f,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ct(u).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");ct(u).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ct(u).select("text").attr("style",m)}return i?ct(u).selectAll("tspan.text-outer-tspan").classed("title-row",!0):ct(u).selectAll("tspan.text-outer-tspan").classed("row",!0),u}},"createText");function la(e,t,r){if(e&&e.length){const[i,o]=t,s=Math.PI/180*r,a=Math.cos(s),n=Math.sin(s);for(const l of e){const[c,h]=l;l[0]=(c-i)*a-(h-o)*n+i,l[1]=(c-i)*n+(h-o)*a+o}}}function iT(e,t){return e[0]===t[0]&&e[1]===t[1]}function oT(e,t,r,i=1){const o=r,s=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(o)for(const c of a)la(c,n,o);const l=(function(c,h,d){const f=[];for(const b of c){const k=[...b];iT(k[0],k[k.length-1])||k.push([k[0][0],k[0][1]]),k.length>2&&f.push(k)}const u=[];h=Math.max(h,.1);const g=[];for(const b of f)for(let k=0;kb.ymink.ymin?1:b.xk.x?1:b.ymax===k.ymax?0:(b.ymax-k.ymax)/Math.abs(b.ymax-k.ymax))),!g.length)return u;let m=[],y=g[0].ymin,C=0;for(;m.length||g.length;){if(g.length){let b=-1;for(let k=0;ky);k++)b=k;g.splice(0,b+1).forEach((k=>{m.push({s:y,edge:k})}))}if(m=m.filter((b=>!(b.edge.ymax<=y))),m.sort(((b,k)=>b.edge.x===k.edge.x?0:(b.edge.x-k.edge.x)/Math.abs(b.edge.x-k.edge.x))),(d!==1||C%h==0)&&m.length>1)for(let b=0;b=m.length)break;const T=m[b].edge,S=m[k].edge;u.push([[Math.round(T.x),y],[Math.round(S.x),y]])}y+=d,m.forEach((b=>{b.edge.x=b.edge.x+d*b.edge.islope})),C++}return u})(a,s,i);if(o){for(const c of a)la(c,n,-o);(function(c,h,d){const f=[];c.forEach((u=>f.push(...u))),la(f,h,d)})(l,n,-o)}return l}function io(e,t){var r;const i=t.hachureAngle+90;let o=t.hachureGap;o<0&&(o=4*t.strokeWidth),o=Math.round(Math.max(o,.1));let s=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=o),oT(e,o,i,s||1)}class ul{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=io(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const o of t)i.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],r));return i}}function Fs(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class sT extends ul{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=io(t,Object.assign({},r,{hachureGap:i})),s=Math.PI/180*r.hachureAngle,a=[],n=.5*i*Math.cos(s),l=.5*i*Math.sin(s);for(const[c,h]of o)Fs([c,h])&&a.push([[c[0]-n,c[1]+l],[...h]],[[c[0]+n,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}}class aT extends ul{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(t,o);return i.ops=i.ops.concat(s.ops),i}}class nT{constructor(t){this.helper=t}fillPolygons(t,r){const i=io(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let o=r.hachureGap;o<0&&(o=4*r.strokeWidth),o=Math.max(o,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=o/4;for(const n of t){const l=Fs(n),c=l/o,h=Math.ceil(c)-1,d=l-h*o,f=(n[0][0]+n[1][0])/2-o/4,u=Math.min(n[0][1],n[1][1]);for(let g=0;g{const n=Fs(a),l=Math.floor(n/(i+o)),c=(n+o-l*(i+o))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let u=0;u{const a=Fs(s),n=Math.round(a/(2*r));let l=s[0],c=s[1];l[0]>c[0]&&(l=s[1],c=s[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;dh%2?c+r:c+t));s.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":s.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],s.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":s.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],s.push({key:"T",data:[t,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=i,r=o}return s}function yp(e){const t=[];let r="",i=0,o=0,s=0,a=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,o]=h,[s,a]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],o=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,o]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,o]});break;case"V":o=h[0],t.push({key:"L",data:[i,o]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=i+(i-n),f=o+(o-l)):(d=i,f=o),t.push({key:"C",data:[d,f,...h]}),n=h[0],l=h[1],i=h[2],o=h[3];break}case"T":{const[d,f]=h;let u=0,g=0;r==="Q"||r==="T"?(u=i+(i-n),g=o+(o-l)):(u=i,g=o);const m=i+2*(u-i)/3,y=o+2*(g-o)/3,C=d+2*(u-d)/3,b=f+2*(g-f)/3;t.push({key:"C",data:[m,y,C,b,d,f]}),n=u,l=g,i=d,o=f;break}case"Q":{const[d,f,u,g]=h,m=i+2*(d-i)/3,y=o+2*(f-o)/3,C=u+2*(d-u)/3,b=g+2*(f-g)/3;t.push({key:"C",data:[m,y,C,b,u,g]}),n=d,l=f,i=u,o=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),u=h[2],g=h[3],m=h[4],y=h[5],C=h[6];d===0||f===0?(t.push({key:"C",data:[i,o,y,C,y,C]}),i=y,o=C):(i!==y||o!==C)&&(Cp(i,o,y,C,d,f,u,g,m).forEach((function(b){t.push({key:"C",data:b})})),i=y,o=C);break}case"Z":t.push({key:"Z",data:[]}),i=s,o=a}r=c}return t}function Ci(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function Cp(e,t,r,i,o,s,a,n,l,c){const h=(d=a,Math.PI*d/180);var d;let f=[],u=0,g=0,m=0,y=0;if(c)[u,g,m,y]=c;else{[e,t]=Ci(e,t,-h),[r,i]=Ci(r,i,-h);const W=(e-r)/2,$=(t-i)/2;let A=W*W/(o*o)+$*$/(s*s);A>1&&(A=Math.sqrt(A),o*=A,s*=A);const F=o*o,D=s*s,M=F*D-F*$*$-D*W*W,H=F*$*$+D*W*W,Y=(n===l?-1:1)*Math.sqrt(Math.abs(M/H));m=Y*o*$/s+(e+r)/2,y=Y*-s*W/o+(t+i)/2,u=Math.asin(parseFloat(((t-y)/s).toFixed(9))),g=Math.asin(parseFloat(((i-y)/s).toFixed(9))),eg&&(u-=2*Math.PI),!l&&g>u&&(g-=2*Math.PI)}let C=g-u;if(Math.abs(C)>120*Math.PI/180){const W=g,$=r,A=i;g=l&&g>u?u+120*Math.PI/180*1:u+120*Math.PI/180*-1,f=Cp(r=m+o*Math.cos(g),i=y+s*Math.sin(g),$,A,o,s,a,0,l,[g,W,m,y])}C=g-u;const b=Math.cos(u),k=Math.sin(u),T=Math.cos(g),S=Math.sin(g),_=Math.tan(C/4),L=4/3*o*_,v=4/3*s*_,N=[e,t],R=[e+L*k,t-v*b],P=[r+L*S,i-v*T],z=[r,i];if(R[0]=2*N[0]-R[0],R[1]=2*N[1]-R[1],c)return[R,P,z].concat(f);{f=[R,P,z].concat(f);const W=[];for(let $=0;$2){const o=[];for(let s=0;s2*Math.PI&&(u=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-u)/2),C=rc(y,c,h,d,f,u,g,1,l);if(!l.disableMultiStroke){const b=rc(y,c,h,d,f,u,g,1.5,l);C.push(...b)}return a&&(n?C.push(...lr(c,h,c+d*Math.cos(u),h+f*Math.sin(u),l),...lr(c,h,c+d*Math.cos(g),h+f*Math.sin(g),l)):C.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(u),h+f*Math.sin(u)]})),{type:"path",ops:C}}function Jh(e,t){const r=yp(mp(fl(e))),i=[];let o=[0,0],s=[0,0];for(const{key:a,data:n}of r)switch(a){case"M":s=[n[0],n[1]],o=[n[0],n[1]];break;case"L":i.push(...lr(s[0],s[1],n[0],n[1],t)),s=[n[0],n[1]];break;case"C":{const[l,c,h,d,f,u]=n;i.push(...pT(l,c,h,d,f,u,s,t)),s=[f,u];break}case"Z":i.push(...lr(s[0],s[1],o[0],o[1],t)),s=[o[0],o[1]]}return{type:"path",ops:i}}function da(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,s=i.length;if(s>2){r.push({op:"move",data:[i[0][0]+ot(o,t),i[0][1]+ot(o,t)]});for(let a=1;a500?.4:-.0016668*l+1.233334;let h=o.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,f=.2+.2*kp(o);let u=o.bowing*o.maxRandomnessOffset*(i-t)/200,g=o.bowing*o.maxRandomnessOffset*(e-r)/200;u=ot(u,o,c),g=ot(g,o,c);const m=[],y=()=>ot(d,o,c),C=()=>ot(h,o,c),b=o.preserveVertices;return a?m.push({op:"move",data:[e+(b?0:y()),t+(b?0:y())]}):m.push({op:"move",data:[e+(b?0:ot(h,o,c)),t+(b?0:ot(h,o,c))]}),a?m.push({op:"bcurveTo",data:[u+e+(r-e)*f+y(),g+t+(i-t)*f+y(),u+e+2*(r-e)*f+y(),g+t+2*(i-t)*f+y(),r+(b?0:y()),i+(b?0:y())]}):m.push({op:"bcurveTo",data:[u+e+(r-e)*f+C(),g+t+(i-t)*f+C(),u+e+2*(r-e)*f+C(),g+t+2*(i-t)*f+C(),r+(b?0:C()),i+(b?0:C())]}),m}function bo(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+ot(t,r),e[0][1]+ot(t,r)]),i.push([e[0][0]+ot(t,r),e[0][1]+ot(t,r)]);for(let o=1;o3){const s=[],a=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+21&&o.push(n)):o.push(n),o.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],f=yr(l,c,.5),u=yr(c,h,.5),g=yr(h,d,.5),m=yr(f,u,.5),y=yr(u,g,.5),C=yr(m,y,.5);nn([l,f,m,C],0,r,o),nn([C,y,g,d],0,r,o)}var s,a;return o}function mT(e,t){return ds(e,0,e.length,t)}function ds(e,t,r,i,o){const s=o||[],a=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;hl&&(l=d,c=h)}return Math.sqrt(l)>i?(ds(e,t,c+1,i,s),ds(e,c,r,i,s)):(s.length||s.push(a),s.push(n)),s}function ua(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let s=0;s0?ds(i,0,i.length,r):i}const ae="none";class us{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,o,s){const a=this._o(s);return this._d("line",[xp(t,r,i,o,a)],a)}rectangle(t,r,i,o,s){const a=this._o(s),n=[],l=fT(t,r,i,o,a);if(a.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];a.fillStyle==="solid"?n.push(da([c],a)):n.push(qr([c],a))}return a.stroke!==ae&&n.push(l),this._d("rectangle",n,a)}ellipse(t,r,i,o,s){const a=this._o(s),n=[],l=bp(i,o,a),c=sn(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=sn(t,r,a,l).opset;h.type="fillPath",n.push(h)}else n.push(qr([c.estimatedPoints],a));return a.stroke!==ae&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,r,i,o){const s=this.ellipse(t,r,i,i,o);return s.shape="circle",s}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[Oo(t,!1,i)],i)}arc(t,r,i,o,s,a,n=!1,l){const c=this._o(l),h=[],d=Qh(t,r,i,o,s,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const f=Object.assign({},c);f.disableMultiStroke=!0;const u=Qh(t,r,i,o,s,a,!0,!1,f);u.type="fillPath",h.push(u)}else h.push((function(f,u,g,m,y,C,b){const k=f,T=u;let S=Math.abs(g/2),_=Math.abs(m/2);S+=ot(.01*S,b),_+=ot(.01*_,b);let L=y,v=C;for(;L<0;)L+=2*Math.PI,v+=2*Math.PI;v-L>2*Math.PI&&(L=0,v=2*Math.PI);const N=(v-L)/b.curveStepCount,R=[];for(let P=L;P<=v;P+=N)R.push([k+S*Math.cos(P),T+_*Math.sin(P)]);return R.push([k+S*Math.cos(v),T+_*Math.sin(v)]),R.push([k,T]),qr([R],b)})(t,r,i,o,s,a,c));return c.stroke!==ae&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),o=[],s=Kh(t,i);if(i.fill&&i.fill!==ae)if(i.fillStyle==="solid"){const a=Kh(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?a.push(...c):c.length===3?a.push(...ua(ic([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...ua(ic(c),10,(1+i.roughness)/2))}a.length&&o.push(qr([a],i))}return i.stroke!==ae&&o.push(s),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],s=Oo(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(da([t],i)):o.push(qr([t],i))),i.stroke!==ae&&o.push(s),this._d("polygon",o,i)}path(t,r){const i=this._o(r),o=[];if(!t)return this._d("path",o,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=i.fill&&i.fill!=="transparent"&&i.fill!==ae,a=i.stroke!==ae,n=!!(i.simplification&&i.simplification<1),l=(function(h,d,f){const u=yp(mp(fl(h))),g=[];let m=[],y=[0,0],C=[];const b=()=>{C.length>=4&&m.push(...ua(C,d)),C=[]},k=()=>{b(),m.length&&(g.push(m),m=[])};for(const{key:S,data:_}of u)switch(S){case"M":k(),y=[_[0],_[1]],m.push(y);break;case"L":b(),m.push([_[0],_[1]]);break;case"C":if(!C.length){const L=m.length?m[m.length-1]:y;C.push([L[0],L[1]])}C.push([_[0],_[1]]),C.push([_[2],_[3]]),C.push([_[4],_[5]]);break;case"Z":b(),m.push([y[0],y[1]])}if(k(),!f)return g;const T=[];for(const S of g){const _=mT(S,f);_.length&&T.push(_)}return T})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=Jh(t,i);if(s)if(i.fillStyle==="solid")if(l.length===1){const h=Jh(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else o.push(da(l,i));else o.push(qr(l,i));return a&&(n?l.forEach((h=>{o.push(Oo(h,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const s=typeof r=="number"&&r>=0?o.data.map((a=>+a.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":i+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":i+=`L${s[0]} ${s[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:ae};break;case"fillPath":a={d:this.opsToPath(s),stroke:ae,strokeWidth:0,fill:i.fill||ae};break;case"fillSketch":a=this.fillSketch(s,i)}a&&o.push(a)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||ae,strokeWidth:i,fill:ae}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class yT{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new us(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":o.save(),o.strokeStyle=i.stroke==="none"?"transparent":i.stroke,o.lineWidth=i.strokeWidth,i.strokeLineDash&&o.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(o.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(o,a,s),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,a,s,n),o.restore();break}case"fillSketch":this.fillSketch(o,a,i)}}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=o,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,o="nonzero"){t.beginPath();for(const s of r.ops){const a=typeof i=="number"&&i>=0?s.data.map((n=>+n.toFixed(i))):s.data;switch(s.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}r.type==="fillPath"?t.fill(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a),a}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a),a}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a),a}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s),s}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const ko="http://www.w3.org/2000/svg";class CT{constructor(t,r){this.svg=t,this.gen=new us(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,s=o.createElementNS(ko,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=o.createElementNS(ko,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=o.createElementNS(ko,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(o,n,i)}l&&s.appendChild(l)}return s}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const s=t.createElementNS(ko,"path");return s.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),s.setAttribute("stroke",i.fill||""),s.setAttribute("stroke-width",o+""),s.setAttribute("fill","none"),i.fillLineDash&&s.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a)}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a)}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a)}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var Z={canvas:(e,t)=>new yT(e,t),svg:(e,t)=>new CT(e,t),generator:e=>new us(e),newSeed:()=>us.newSeed()},it=p(async(e,t,r)=>{let i;const o=t.useHtmlLabels||Ie(Ct()?.htmlLabels);r?i=r:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=s.insert("g").attr("class","label").attr("style",qt(t.labelStyle));let n;t.label===void 0?n="":n=typeof t.label=="string"?t.label:t.label[0];const l=!!t.icon||!!t.img,c=t.labelType==="markdown",h=await Pe(a,be(vr(n),Ct()),{useHtmlLabels:o,width:t.width||Ct().flowchart?.wrappingWidth,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:c},Ct());let d=h.getBBox();const f=(t?.padding??0)/2;if(o){const u=h.children[0],g=ct(h);await zf(u,n),d=u.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return o?a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):a.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:f,label:a}},"labelHelper"),fa=p(async(e,t,r)=>{const i=r.useHtmlLabels??ee(Ct()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Pe(o,be(vr(t),Ct()),{useHtmlLabels:i,width:r.width||Ct()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const n=r.padding/2;if(ee(Ct())){const l=s.children[0],c=ct(s);a=l.getBoundingClientRect(),c.attr("width",a.width),c.attr("height",a.height)}return i?o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):o.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:a,halfPadding:n,label:o}},"insertLabel"),Q=p((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),rt=p((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function gt(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}p(gt,"createPathFromPoints");function hr(e,t,r,i,o,s){const a=[],l=r-e,c=i-t,h=l/s,d=2*Math.PI/h,f=t+c/2;for(let u=0;u<=50;u++){const g=u/50,m=e+g*l,y=f+o*Math.sin(d*(m-e));a.push({x:m,y})}return a}p(hr,"generateFullSineWavePoints");function ji(e,t,r,i,o,s){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;dl.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",i);const o=t.find(l=>l.getAttribute("fill")!=="none"),s=t.find(l=>l.getAttribute("stroke")!=="none"),a=p((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(o){const l={fill:a(o,"fill"),"fill-opacity":a(o,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(s){const l={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}p(ln,"mergePaths");var xT=p((e,t)=>{var r=e.x,i=e.y,o=t.x-r,s=t.y-i,a=e.width/2,n=e.height/2,l,c;return Math.abs(s)*a>Math.abs(o)*n?(s<0&&(n=-n),l=s===0?0:n*o/s,c=n):(o<0&&(a=-a),l=a,c=o===0?0:a*s/o),{x:r+l,y:i+c}},"intersectRect"),Er=xT,bT=p(async(e,t,r,i=!1,o=!1)=>{let s=t||"";typeof s=="object"&&(s=s[0]);const a=Ct(),n=ee(a);return await Pe(e,s,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},a)},"createLabel"),rr=bT,cr=p((e,t,r,i,o)=>["M",e+o,t,"H",e+r-o,"A",o,o,0,0,1,e+r,t+o,"V",t+i-o,"A",o,o,0,0,1,e+r-o,t+i,"H",e+o,"A",o,o,0,0,1,e,t+i-o,"V",t+o,"A",o,o,0,0,1,e+o,t,"Z"].join(" "),"createRoundedRectPathD"),kT=p(async(e,t)=>{const r=Ct(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,n=a,{labelStyles:l,nodeStyles:c,borderStyles:h,backgroundStyles:d}=K(t),f=e.insert("g").attr("class","cluster swimlane "+(t.cssClasses||"")).attr("id",t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look),u=Ie(r.flowchart.htmlLabels),g=t.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await Pe(m,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let C=y.getBBox();if(u){const W=y.children[0],$=ct(y);C=W.getBoundingClientRect(),$.attr("width",C.width),$.attr("height",C.height)}const b=t.padding??0,k=t.width<=C.width+b?C.width+b:t.width;t.width<=C.width+b?t.diff=(k-t.width)/2-b:t.diff=-b;const T=t.height,S=t.y-T/2,_=t.y+T/2,L=t.x-k/2,v=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:S+T/3,N=g?4:0,R=C.height+2*N;let P,z;if(g){const W=Math.max(R,C.height+2*N),$=L+W,A=Math.max(0,k-W);if(t.look==="handDrawn"){const M=Z.svg(f),H=V(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),Y=V(t,{roughness:.7,fill:"none",stroke:n,seed:o}),G=M.rectangle(L,S,W,T,H);P=f.insert(()=>G,":first-child");const lt=M.rectangle($,S,A,T,Y);z=f.insert(()=>lt,":first-child"),P.select("path:nth-child(2)").attr("style",h.join(";")),P.select("path").attr("style",d.join(";").replace("fill","stroke"))}else P=f.insert("rect",":first-child"),z=f.insert("rect",":first-child"),P.attr("class","swimlane-title").attr("style",c).attr("x",L).attr("y",S).attr("width",W).attr("height",T).attr("fill",s).attr("stroke",n),z.attr("class","swimlane-body").attr("style",c).attr("x",$).attr("y",S).attr("width",A).attr("height",T).attr("fill","none").attr("stroke",n);const F=L+W/2,D=t.y;m.attr("transform",`translate(${F}, ${D}) rotate(-90) translate(${-C.width/2}, ${-C.height/2})`)}else{const W=Math.max(0,v-S),$=Math.min(R,W),A=S+$,F=Math.max(0,_-A),D=t.x-k/2;if(t.look==="handDrawn"){const Y=Z.svg(f),G=V(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),lt=V(t,{roughness:.7,fill:"none",stroke:n,seed:o}),ht=Y.rectangle(D,S,k,$,G);P=f.insert(()=>ht,":first-child");const dt=Y.rectangle(D,A,k,F,lt);z=f.insert(()=>dt,":first-child"),P.select("path:nth-child(2)").attr("style",h.join(";")),P.select("path").attr("style",d.join(";").replace("fill","stroke"))}else P=f.insert("rect",":first-child"),z=f.insert("rect",":first-child"),P.attr("class","swimlane-title").attr("style",c).attr("x",D).attr("y",S).attr("width",k).attr("height",$).attr("fill",s).attr("stroke",n),z.attr("class","swimlane-body").attr("style",c).attr("x",D).attr("y",A).attr("width",k).attr("height",F).attr("fill","none").attr("stroke",n);const M=t.x-C.width/2,H=S+($-C.height)/2;m.attr("transform",`translate(${M}, ${H})`)}if(q.trace("Swimlane data ",t,JSON.stringify(t)),l){const W=m.select("span");W&&W.attr("style",l)}return t.offsetX=0,t.width=k,t.height=T,t.offsetY=C.height-b/2,t.intersect=function(W){return Er(t,W)},{cluster:f,labelBBox:C}},"swimlane"),wp=p(async(e,t)=>{q.info("Creating subgraph rect for ",t.id,t);const r=Ct(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=K(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=ee(r),u=d.insert("g").attr("class","cluster-label ");let g;t.labelType==="markdown"?g=await Pe(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}):g=await rr(u,t.label,t.labelStyle||"",!1,!0);let m=g.getBBox();if(ee(r)){const L=g.children[0],v=ct(g);m=L.getBoundingClientRect(),v.attr("width",m.width),v.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height,b=t.x-y/2,k=t.y-C/2;q.trace("Data ",t,JSON.stringify(t));let T;if(t.look==="handDrawn"){const L=Z.svg(d),v=V(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:o}),N=L.path(cr(b,k,y,C,0),v);T=d.insert(()=>(q.debug("Rough node insert CXC",N),N),":first-child"),T.select("path:nth-child(2)").attr("style",c.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=d.insert("rect",":first-child"),T.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",k).attr("width",y).attr("height",C);const{subGraphTitleTopMargin:S}=el(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+S})`),n){const L=u.select("span");L&&L.attr("style",n)}const _=T.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(L){return Er(t,L)},{cluster:d,labelBBox:m}},"rect"),wT=p((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),o=0*t.padding,s=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-s).attr("y",t.y-t.height/2-s).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return Er(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),TT=p(async(e,t)=>{const r=Ct(),{themeVariables:i,handDrawnSeed:o}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:n,nodeBorder:l}=i,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),h=c.insert("g",":first-child"),d=c.insert("g").attr("class","cluster-label");let f=c.append("rect");const u=await rr(d,t.label,t.labelStyle,void 0,!0);let g=u.getBBox();if(ee(r)){const N=u.children[0],R=ct(u);g=N.getBoundingClientRect(),R.attr("width",g.width),R.attr("height",g.height)}const m=0*t.padding,y=m/2,C=(t.width<=g.width+t.padding?g.width+t.padding:t.width)+m;t.width<=g.width+t.padding?t.diff=(C-t.width)/2-t.padding:t.diff=-t.padding;const b=t.height+m,k=t.height+m-g.height-6,T=t.x-C/2,S=t.y-b/2;t.width=C;const _=t.y-t.height/2-y+g.height+2;let L;if(t.look==="handDrawn"){const N=t.cssClasses.includes("statediagram-cluster-alt"),R=Z.svg(c),P=t.rx||t.ry?R.path(cr(T,S,C,b,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:l,seed:o}):R.rectangle(T,S,C,b,{seed:o});L=c.insert(()=>P,":first-child");const z=R.rectangle(T,_,C,k,{fill:N?s:a,fillStyle:N?"hachure":"solid",stroke:l,seed:o});L=c.insert(()=>P,":first-child"),f=c.insert(()=>z)}else L=h.insert("rect",":first-child"),L.attr("class","outer").attr("x",T).attr("y",S).attr("width",C).attr("height",b).attr("data-look",t.look),f.attr("class","inner").attr("x",T).attr("y",_).attr("width",C).attr("height",k);d.attr("transform",`translate(${t.x-g.width/2}, ${S+1-(ee(r)?0:3)})`);const v=L.node().getBBox();return t.height=v.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(N){return Er(t,N)},{cluster:c,labelBBox:g}},"roundedWithTitle"),ST=p(async(e,t)=>{q.info("Creating subgraph rect for ",t.id,t);const r=Ct(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=K(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=ee(r),u=d.insert("g").attr("class","cluster-label "),g=await Pe(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let m=g.getBBox();if(ee(r)){const L=g.children[0],v=ct(g);m=L.getBoundingClientRect(),v.attr("width",m.width),v.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height,b=t.x-y/2,k=t.y-C/2;q.trace("Data ",t,JSON.stringify(t));let T;if(t.look==="handDrawn"){const L=Z.svg(d),v=V(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:o}),N=L.path(cr(b,k,y,C,t.rx),v);T=d.insert(()=>(q.debug("Rough node insert CXC",N),N),":first-child"),T.select("path:nth-child(2)").attr("style",c.join(";")),T.select("path").attr("style",h.join(";").replace("fill","stroke"))}else T=d.insert("rect",":first-child"),T.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",k).attr("width",y).attr("height",C);const{subGraphTitleTopMargin:S}=el(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+S})`),n){const L=u.select("span");L&&L.attr("style",n)}const _=T.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(L){return Er(t,L)},{cluster:d,labelBBox:m}},"kanbanSection"),_T=p((e,t)=>{const r=Ct(),{themeVariables:i,handDrawnSeed:o}=r,{nodeBorder:s}=i,a=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),n=a.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const h=t.height+l,d=t.x-c/2,f=t.y-h/2;t.width=c;let u;if(t.look==="handDrawn"){const y=Z.svg(a).rectangle(d,f,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:o});u=a.insert(()=>y,":first-child")}else{u=n.insert("rect",":first-child");let m="outer";t.look,m="divider",u.attr("class",m).attr("x",d).attr("y",f).attr("width",c).attr("height",h).attr("data-look",t.look)}const g=u.node().getBBox();return t.height=g.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return Er(t,m)},{cluster:a,labelBBox:{}}},"divider"),BT=wp,vT={rect:wp,squareRect:BT,roundedWithTitle:TT,noteGroup:wT,divider:_T,kanbanSection:ST,swimlane:kT},Tp=new Map,LT=p(async(e,t)=>{const r=t.shape||"rect",i=await vT[r](e,t);return Tp.set(t.id,i),i},"insertCluster"),zL=p(()=>{Tp=new Map},"clear");function Sp(e,t){return e.intersect(t)}p(Sp,"intersectNode");var FT=Sp;function _p(e,t,r,i){var o=e.x,s=e.y,a=o-i.x,n=s-i.y,l=Math.sqrt(t*t*n*n+r*r*a*a),c=Math.abs(t*r*a/l);i.x0}p(hn,"sameSign");var ET=Lp;function Fp(e,t,r){let i=e.x,o=e.y,s=[],a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){a=Math.min(a,h.x),n=Math.min(n,h.y)}):(a=Math.min(a,t.x),n=Math.min(n,t.y));let l=i-e.width/2-a,c=o-e.height/2-n;for(let h=0;h1&&s.sort(function(h,d){let f=h.x-r.x,u=h.y-r.y,g=Math.sqrt(f*f+u*u),m=d.x-r.x,y=d.y-r.y,C=Math.sqrt(m*m+y*y);return gh,":first-child");return d.attr("class","anchor").attr("style",qt(n)),Q(t,d),t.intersect=function(f){return q.info("Circle intersect",t,a,f),X.circle(t,a,f)},s}p(Ap,"anchor");function cn(e,t,r,i,o,s,a){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),d=(r-e)/2,f=(i-t)/2,u=d/o,g=f/s,m=Math.sqrt(u**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),C=l+y*s*Math.sin(h)*(a?-1:1),b=c-y*o*Math.cos(h)*(a?-1:1),k=Math.atan2((t-b)/s,(e-C)/o);let S=Math.atan2((i-b)/s,(r-C)/o)-k;a&&S<0&&(S+=2*Math.PI),!a&&S>0&&(S-=2*Math.PI);const _=[];for(let L=0;L<20;L++){const v=L/19,N=k+v*S,R=C+o*Math.cos(N),P=b+s*Math.sin(N);_.push({x:R,y:P})}return _}p(cn,"generateArcPoints");function Ep(e,t,r){const[i,o]=[t,r].sort((s,a)=>a-s);return o*(1-Math.sqrt(1-(e/i/2)**2))}p(Ep,"calculateArcSagitta");async function Mp(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=p(N=>N+a,"calcTotalHeight"),l=p(N=>{const R=N/2;return[R/(2.5+N/50),R]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await it(e,t,rt(t)),d=n(t?.height?t?.height:h.height),[f,u]=l(d),g=Ep(d,f,u),y=(t?.width?t?.width:h.width)+s*2+g-g,C=d,{cssStyles:b}=t,k=[{x:y/2,y:-C/2},{x:-y/2,y:-C/2},...cn(-y/2,-C/2,-y/2,C/2,f,u,!1),{x:y/2,y:C/2},...cn(y/2,C/2,y/2,-C/2,f,u,!0)],T=Z.svg(c),S=V(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const _=gt(k),L=T.path(_,S),v=c.insert(()=>L,":first-child");return v.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",b),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(${f/2}, 0)`),Q(t,v),t.intersect=function(N){return X.polygon(t,k,N)},c}p(Mp,"bowTieRect");function Xe(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}p(Xe,"insertPolygonShape");var wo=12;async function $p(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?28:o,a=t.look==="neo"?24:o,{shapeSvg:n,bbox:l}=await it(e,t,rt(t)),c=(t?.width??l.width)+(t.look==="neo"?s*2:s+wo),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),d=0,f=c,u=-h,g=0,m=[{x:d+wo,y:u},{x:f,y:u},{x:f,y:g},{x:d,y:g},{x:d,y:u+wo},{x:d+wo,y:u}];let y;const{cssStyles:C}=t;if(t.look==="handDrawn"){const b=Z.svg(n),k=V(t,{}),T=gt(m),S=b.path(T,k);y=n.insert(()=>S,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),C&&y.attr("style",C)}else y=Xe(n,c,h,m);return i&&y.attr("style",i),Q(t,y),t.intersect=function(b){return X.polygon(t,m,b)},n}p($p,"card");function Op(e,t){const{nodeStyles:r}=K(t);t.label="";const i=e.insert("g").attr("class",rt(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,s=Math.max(28,t.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],n=Z.svg(i),l=V(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=gt(a),h=n.path(c,l),d=i.insert(()=>h,":first-child");return o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(f){return X.polygon(t,a,f)},i}p(Op,"choice");async function pl(e,t,r){const{labelStyles:i,nodeStyles:o}=K(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,halfPadding:n}=await it(e,t,rt(t)),l=16,c=r?.padding??n,h=t.look==="neo"?a.width/2+l*2:a.width/2+c;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=Z.svg(s),g=V(t,{}),m=u.circle(0,0,h*2,g);d=s.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",qt(f))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",h).attr("cx",0).attr("cy",0);return Q(t,d),t.calcIntersect=function(u,g){const m=u.width/2;return X.circle(u,m,g)},t.intersect=function(u){return q.info("Circle intersect",t,h,u),X.circle(t,h,u)},s}p(pl,"circle");function Ip(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,o={x:i/2*t,y:i/2*r},s={x:-(i/2)*t,y:i/2*r},a={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${s.x},${s.y} L ${n.x},${n.y} + M ${o.x},${o.y} L ${a.x},${a.y}`}p(Ip,"createLine");function Dp(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",rt(t)).attr("id",t.domId??t.id),s=Math.max(30,t?.width??0),{cssStyles:a}=t,n=Z.svg(o),l=V(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,s*2,l),h=Ip(s),d=n.path(h,l),f=o.insert(()=>c,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),a&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),Q(t,f),t.intersect=function(u){return q.info("crossedCircle intersect",t,{radius:s,point:u}),X.circle(t,s,u)},o}p(Dp,"crossedCircle");function We(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;dS,":first-child").attr("stroke-opacity",0),_.insert(()=>k,":first-child"),_.attr("class","text"),f&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-c/2+d-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),Q(t,_),t.intersect=function(L){return X.polygon(t,g,L)},o}p(Pp,"curlyBraceLeft");function ze(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;dS,":first-child").attr("stroke-opacity",0),_.insert(()=>k,":first-child"),_.attr("class","text"),f&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),Q(t,_),t.intersect=function(L){return X.polygon(t,g,L)},o}p(Rp,"curlyBraceRight");function Ht(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;dN,":first-child").attr("stroke-opacity",0),R.insert(()=>T,":first-child"),R.insert(()=>L,":first-child"),R.attr("class","text"),f&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",i),R.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),Q(t,R),t.intersect=function(P){return X.polygon(t,m,P)},o}p(Np,"curlyBraces");async function qp(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=20,l=5,{shapeSvg:c,bbox:h}=await it(e,t,rt(t)),d=Math.max(n,(h.width+s*2)*1.25,t?.width??0),f=Math.max(l,h.height+a*2,t?.height??0),u=f/2,{cssStyles:g}=t,m=Z.svg(c),y=V(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=d,b=f,k=C-u,T=b/4,S=[{x:k,y:0},{x:T,y:0},{x:0,y:b/2},{x:T,y:b},{x:k,y:b},...ji(-k,-b/2,u,50,270,90)],_=gt(S),L=m.path(_,y),v=c.insert(()=>L,":first-child");return v.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&v.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&v.selectChildren("path").attr("style",i),v.attr("transform",`translate(${-d/2}, ${-f/2})`),Q(t,v),t.intersect=function(N){return X.polygon(t,S,N)},c}p(qp,"curvedTrapezoid");var $T=p((e,t,r,i,o,s)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),OT=p((e,t,r,i,o,s)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),IT=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),oc=8,sc=8;async function Wp(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?24:o,a=t.look==="neo"?24:o;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-a,t.widthS,":first-child"),g=n.insert(()=>T,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=$T(0,0,h,u,d,f);g=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",qt(m)).attr("style",i)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),Q(t,g),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(y){const C=X.rect(t,y),b=C.x-(t.x??0);if(d!=0&&(Math.abs(b)<(t.width??0)/2||Math.abs(b)==(t.width??0)/2&&Math.abs(C.y-(t.y??0))>(t.height??0)/2-f)){let k=f*f*(1-b*b/(d*d));k>0&&(k=Math.sqrt(k)),k=f-k,y.y-(t.y??0)>0&&(k=-k),C.y+=k}return C},n}p(Wp,"cylinder");async function ai(e,t,r){const{labelStyles:i,nodeStyles:o}=K(t);t.labelStyle=i;const{shapeSvg:s,bbox:a}=await it(e,t,rt(t)),n=Math.max(a.width+r.labelPaddingX*2,t?.width||0),l=Math.max(a.height+r.labelPaddingY*2,t?.height||0),c=-n/2,h=-l/2;let d,{rx:f,ry:u}=t;const{cssStyles:g}=t;if(r?.rx&&r.ry&&(f=r.rx,u=r.ry),t.look==="handDrawn"){const m=Z.svg(s),y=V(t,{}),C=f||u?m.path(cr(c,h,n,l,f||0),y):m.rectangle(c,h,n,l,y);d=s.insert(()=>C,":first-child"),d.attr("class","basic label-container").attr("style",qt(g))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",o).attr("rx",qt(f)).attr("ry",qt(u)).attr("x",c).attr("y",h).attr("width",n).attr("height",l);return Q(t,d),t.calcIntersect=function(m,y){return X.rect(m,y)},t.intersect=function(m){return X.rect(t,m)},s}p(ai,"drawRect");async function zp(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:s,width:a,height:n}=t,l={rx:0,ry:0,labelPaddingX:i??(s??0)*2,labelPaddingY:o??s??0},c=await ai(e,t,l);if(t.look==="handDrawn"){const u=Z.svg(c),g=V(t,{}),m=c.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return c;let C=null;if(y instanceof SVGGraphicsElement)C=y.getBBox();else return c;return c.insert(()=>u.line(C.x,C.y,C.x+C.width,C.y,g),".basic.label-container g.label"),c.insert(()=>u.line(C.x,C.y+C.height,C.x+C.width,C.y+C.height,g),".basic.label-container g.label"),m.remove(),c}const h=c.select(".basic.label-container"),d=(Number(h.attr("width"))||a)??0,f=(Number(h.attr("height"))||n)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),c}p(zp,"datastore");async function Hp(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await it(e,t,rt(t)),c=n.width+o,h=n.height+s,d=h*.2,f=-c/2,u=-h/2-d/2,{cssStyles:g}=t,m=Z.svg(a),y=V(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=[{x:f,y:u+d},{x:-f,y:u+d},{x:-f,y:-u},{x:f,y:-u},{x:f,y:u},{x:-f,y:u},{x:-f,y:u+d}],b=m.polygon(C.map(T=>[T.x,T.y]),y),k=a.insert(()=>b,":first-child");return k.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),l.attr("transform",`translate(${f+(t.padding??0)/2-(n.x-(n.left??0))}, ${u+d+(t.padding??0)/2-(n.y-(n.top??0))})`),Q(t,k),t.intersect=function(T){return X.rect(t,T)},a}p(Hp,"dividedRectangle");async function Yp(e,t){const{labelStyles:r,nodeStyles:i}=K(t),o=t.look==="neo"?12:5;t.labelStyle=r;const s=t.padding??0,a=t.look==="neo"?16:s,{shapeSvg:n,bbox:l}=await it(e,t,rt(t)),c=(t?.width?t?.width/2:l.width/2)+(a??0),h=c-o;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=Z.svg(n),g=V(t,{roughness:.2,strokeWidth:2.5}),m=V(t,{roughness:.2,strokeWidth:1.5}),y=u.circle(0,0,c*2,g),C=u.circle(0,0,h*2,m);d=n.insert("g",":first-child"),d.attr("class",qt(t.cssClasses)).attr("style",qt(f)),d.node()?.appendChild(y),d.node()?.appendChild(C)}else{d=n.insert("g",":first-child");const u=d.insert("circle",":first-child"),g=d.insert("circle");d.attr("class","basic label-container").attr("style",i),u.attr("class","outer-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0),g.attr("class","inner-circle").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0)}return Q(t,d),t.intersect=function(u){return q.info("DoubleCircle intersect",t,c,u),X.circle(t,c,u)},n}p(Yp,"doublecircle");function Up(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=K(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",rt(t)).attr("id",t.domId??t.id),a=7,{cssStyles:n}=t,l=Z.svg(s),{nodeBorder:c}=r,h=V(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),f=s.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",o),Q(t,f),t.intersect=function(u){return q.info("filledCircle intersect",t,{radius:a,point:u}),X.circle(t,a,u)},s}p(Up,"filledCircle");var ac=10,nc=10;async function jp(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.heightC,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return u&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),t.width=c,t.height=h,Q(t,b),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-h/2+(t.padding??0)/2+(n.y-(n.top??0))})`),t.intersect=function(k){return q.info("Triangle intersect",t,f,k),X.polygon(t,f,k)},a}p(jp,"flippedTriangle");function Gp(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:s}=K(t);t.label="";const a=e.insert("g").attr("class",rt(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);r==="LR"&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,d=-1*c/2,f=Z.svg(a),u=V(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const g=f.rectangle(h,d,l,c,u),m=a.insert(()=>g,":first-child");n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),Q(t,m);const y=i?.padding??0;return t.width&&t.height&&(t.width+=y/2||0,t.height+=y/2||0),t.intersect=function(C){return X.rect(t,C)},a}p(Gp,"forkJoin");async function Xp(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=15,s=10,a=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.heightb,":first-child");return k.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),Q(t,k),t.intersect=function(T){return q.info("Pill intersect",t,{radius:f,point:T}),X.polygon(t,y,T)},l}p(Xp,"halfRoundedRectangle");var DT=p((e,t,r,i,o)=>[`M${e+o},${t}`,`L${e+r-o},${t}`,`L${e+r},${t-i/2}`,`L${e+r-o},${t-i}`,`L${e+o},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function Vp(e,t){const{labelStyles:r,nodeStyles:i}=K(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const s=t.padding??0,a=70,n=32,l=t.look==="neo"?a:s,c=t.look==="neo"?n:s;if(t.width||t.height){const k=(t.height??0)/o;t.width=(t?.width??0)-2*k-c,t.height=(t.height??0)-l}const{shapeSvg:h,bbox:d}=await it(e,t,rt(t)),f=(t?.height?t?.height:d.height)+l,u=f/o,g=(t?.width?t?.width:d.width)+2*u+c,m=[{x:u,y:0},{x:g-u,y:0},{x:g,y:-f/2},{x:g-u,y:-f},{x:u,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:C}=t;if(t.look==="handDrawn"){const b=Z.svg(h),k=V(t,{}),T=DT(0,0,g,f,u),S=b.path(T,k);y=h.insert(()=>S,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),C&&y.attr("style",C)}else y=Xe(h,g,f,m);return i&&y.attr("style",i),t.width=g,t.height=f,Q(t,y),t.intersect=function(b){return X.polygon(t,m,b)},h}p(Vp,"hexagon");async function Zp(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await it(e,t,rt(t)),s=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:n}=t,l=Z.svg(o),c=V(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=gt(h),f=l.path(d,c),u=o.insert(()=>f,":first-child");return u.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",i),u.attr("transform",`translate(${-s/2}, ${-a/2})`),Q(t,u),t.intersect=function(g){return q.info("Pill intersect",t,{points:h}),X.polygon(t,h,g)},o}p(Zp,"hourglass");async function Kp(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=K(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await it(e,t,"icon-shape default"),f=t.pos==="t",u=n,g=n,{nodeBorder:m}=r,{stylesMap:y}=si(t),C=-g/2,b=-u/2,k=t.label?8:0,T=Z.svg(c),S=V(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const _=T.rectangle(C,b,g,u,S),L=Math.max(g,h.width),v=u+h.height+k,N=T.rectangle(-L/2,-v/2,L,v,{...S,fill:"transparent",stroke:"none"}),R=c.insert(()=>_,":first-child"),P=c.insert(()=>N);if(t.icon){const z=c.append("g");z.html(`${await eo(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const W=z.node().getBBox(),$=W.width,A=W.height,F=W.x,D=W.y;z.attr("transform",`translate(${-$/2-F},${f?h.height/2+k/2-A/2-D:-h.height/2-k/2-A/2-D})`),z.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-v/2:v/2-h.height})`),R.attr("transform",`translate(0,${f?h.height/2+k/2:-h.height/2-k/2})`),Q(t,P),t.intersect=function(z){if(q.info("iconSquare intersect",t,z),!t.label)return X.rect(t,z);const W=t.x??0,$=t.y??0,A=t.height??0;let F=[];return f?F=[{x:W-h.width/2,y:$-A/2},{x:W+h.width/2,y:$-A/2},{x:W+h.width/2,y:$-A/2+h.height+k},{x:W+g/2,y:$-A/2+h.height+k},{x:W+g/2,y:$+A/2},{x:W-g/2,y:$+A/2},{x:W-g/2,y:$-A/2+h.height+k},{x:W-h.width/2,y:$-A/2+h.height+k}]:F=[{x:W-g/2,y:$-A/2},{x:W+g/2,y:$-A/2},{x:W+g/2,y:$-A/2+u},{x:W+h.width/2,y:$-A/2+u},{x:W+h.width/2/2,y:$+A/2},{x:W-h.width/2,y:$+A/2},{x:W-h.width/2,y:$-A/2+u},{x:W-g/2,y:$-A/2+u}],X.polygon(t,F,z)},c}p(Kp,"icon");async function Qp(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=K(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await it(e,t,"icon-shape default"),f=20,u=t.label?8:0,g=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:C}=si(t),b=Z.svg(c),k=V(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const T=C.get("fill");k.stroke=T??y;const S=c.append("g");t.icon&&S.html(`${await eo(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const _=S.node().getBBox(),L=_.width,v=_.height,N=_.x,R=_.y,P=Math.max(L,v)*Math.SQRT2+f*2,z=b.circle(0,0,P,k),W=Math.max(P,h.width),$=P+h.height+u,A=b.rectangle(-W/2,-$/2,W,$,{...k,fill:"transparent",stroke:"none"}),F=c.insert(()=>z,":first-child"),D=c.insert(()=>A);return S.attr("transform",`translate(${-L/2-N},${g?h.height/2+u/2-v/2-R:-h.height/2-u/2-v/2-R})`),S.attr("style",`color: ${C.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-$/2:$/2-h.height})`),F.attr("transform",`translate(0,${g?h.height/2+u/2:-h.height/2-u/2})`),Q(t,D),t.intersect=function(M){return q.info("iconSquare intersect",t,M),X.rect(t,M)},c}p(Qp,"iconCircle");async function Jp(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=K(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await it(e,t,"icon-shape default"),u=t.pos==="t",g=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:C}=r,{stylesMap:b}=si(t),k=-m/2,T=-g/2,S=t.label?8:0,_=Z.svg(c),L=V(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const v=b.get("fill");L.stroke=v??C;const N=_.path(cr(k,T,m,g,5),L),R=Math.max(m,h.width),P=g+h.height+S,z=_.rectangle(-R/2,-P/2,R,P,{...L,fill:"transparent",stroke:"none"}),W=c.insert(()=>N,":first-child").attr("class","icon-shape2"),$=c.insert(()=>z);if(t.icon){const A=c.append("g");A.html(`${await eo(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const F=A.node().getBBox(),D=F.width,M=F.height,H=F.x,Y=F.y;A.attr("transform",`translate(${-D/2-H},${u?h.height/2+S/2-M/2-Y:-h.height/2-S/2-M/2-Y})`),A.attr("style",`color: ${b.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-P/2:P/2-h.height})`),W.attr("transform",`translate(0,${u?h.height/2+S/2:-h.height/2-S/2})`),Q(t,$),t.intersect=function(A){if(q.info("iconSquare intersect",t,A),!t.label)return X.rect(t,A);const F=t.x??0,D=t.y??0,M=t.height??0;let H=[];return u?H=[{x:F-h.width/2,y:D-M/2},{x:F+h.width/2,y:D-M/2},{x:F+h.width/2,y:D-M/2+h.height+S},{x:F+m/2,y:D-M/2+h.height+S},{x:F+m/2,y:D+M/2},{x:F-m/2,y:D+M/2},{x:F-m/2,y:D-M/2+h.height+S},{x:F-h.width/2,y:D-M/2+h.height+S}]:H=[{x:F-m/2,y:D-M/2},{x:F+m/2,y:D-M/2},{x:F+m/2,y:D-M/2+g},{x:F+h.width/2,y:D-M/2+g},{x:F+h.width/2/2,y:D+M/2},{x:F-h.width/2,y:D+M/2},{x:F-h.width/2,y:D-M/2+g},{x:F-m/2,y:D-M/2+g}],X.polygon(t,H,A)},c}p(Jp,"iconRounded");async function tg(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=K(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await it(e,t,"icon-shape default"),u=t.pos==="t",g=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:C}=r,{stylesMap:b}=si(t),k=-m/2,T=-g/2,S=t.label?8:0,_=Z.svg(c),L=V(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const v=b.get("fill");L.stroke=v??C;const N=_.path(cr(k,T,m,g,.1),L),R=Math.max(m,h.width),P=g+h.height+S,z=_.rectangle(-R/2,-P/2,R,P,{...L,fill:"transparent",stroke:"none"}),W=c.insert(()=>N,":first-child"),$=c.insert(()=>z);if(t.icon){const A=c.append("g");A.html(`${await eo(t.icon,{height:n,width:n,fallbackPrefix:""})}`);const F=A.node().getBBox(),D=F.width,M=F.height,H=F.x,Y=F.y;A.attr("transform",`translate(${-D/2-H},${u?h.height/2+S/2-M/2-Y:-h.height/2-S/2-M/2-Y})`),A.attr("style",`color: ${b.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-P/2:P/2-h.height})`),W.attr("transform",`translate(0,${u?h.height/2+S/2:-h.height/2-S/2})`),Q(t,$),t.intersect=function(A){if(q.info("iconSquare intersect",t,A),!t.label)return X.rect(t,A);const F=t.x??0,D=t.y??0,M=t.height??0;let H=[];return u?H=[{x:F-h.width/2,y:D-M/2},{x:F+h.width/2,y:D-M/2},{x:F+h.width/2,y:D-M/2+h.height+S},{x:F+m/2,y:D-M/2+h.height+S},{x:F+m/2,y:D+M/2},{x:F-m/2,y:D+M/2},{x:F-m/2,y:D-M/2+h.height+S},{x:F-h.width/2,y:D-M/2+h.height+S}]:H=[{x:F-m/2,y:D-M/2},{x:F+m/2,y:D-M/2},{x:F+m/2,y:D-M/2+g},{x:F+h.width/2,y:D-M/2+g},{x:F+h.width/2/2,y:D+M/2},{x:F-h.width/2,y:D+M/2},{x:F-h.width/2,y:D-M/2+g},{x:F-m/2,y:D-M/2+g}],X.polygon(t,H,A)},c}p(tg,"iconSquare");async function eg(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const o=Number(i.naturalWidth.toString().replace("px","")),s=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/s;const{labelStyles:a}=K(t);t.labelStyle=a;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??o),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??s;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:f,label:u}=await it(e,t,"image-shape default"),g=t.pos==="t",m=-c/2,y=-h/2,C=t.label?8:0,b=Z.svg(d),k=V(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const T=b.rectangle(m,y,c,h,k),S=Math.max(c,f.width),_=h+f.height+C,L=b.rectangle(-S/2,-_/2,S,_,{...k,fill:"none",stroke:"none"}),v=d.insert(()=>T,":first-child"),N=d.insert(()=>L);if(t.img){const R=d.append("image");R.attr("href",t.img),R.attr("width",c),R.attr("height",h),R.attr("preserveAspectRatio","none"),R.attr("transform",`translate(${-c/2},${g?_/2-h:-_/2})`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-C/2:h/2-f.height/2+C/2})`),v.attr("transform",`translate(0,${g?f.height/2+C/2:-f.height/2-C/2})`),Q(t,N),t.intersect=function(R){if(q.info("iconSquare intersect",t,R),!t.label)return X.rect(t,R);const P=t.x??0,z=t.y??0,W=t.height??0;let $=[];return g?$=[{x:P-f.width/2,y:z-W/2},{x:P+f.width/2,y:z-W/2},{x:P+f.width/2,y:z-W/2+f.height+C},{x:P+c/2,y:z-W/2+f.height+C},{x:P+c/2,y:z+W/2},{x:P-c/2,y:z+W/2},{x:P-c/2,y:z-W/2+f.height+C},{x:P-f.width/2,y:z-W/2+f.height+C}]:$=[{x:P-c/2,y:z-W/2},{x:P+c/2,y:z-W/2},{x:P+c/2,y:z-W/2+h},{x:P+f.width/2,y:z-W/2+h},{x:P+f.width/2/2,y:z+W/2},{x:P-f.width/2,y:z+W/2},{x:P-f.width/2,y:z-W/2+h},{x:P-c/2,y:z-W/2+h}],X.polygon(t,$,R)},d}p(eg,"imageSquare");async function rg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await it(e,t,rt(t)),c=Math.max(l.width+(a??0)*2,t?.width??0),h=Math.max(l.height+(s??0)*2,t?.height??0),d=[{x:0,y:0},{x:c,y:0},{x:c+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=Z.svg(n),m=V(t,{}),y=gt(d),C=g.path(y,m);f=n.insert(()=>C,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),u&&f.attr("style",u)}else f=Xe(n,c,h,d);return i&&f.attr("style",i),t.width=c,t.height=h,Q(t,f),t.intersect=function(g){return X.polygon(t,d,g)},n}p(rg,"inv_trapezoid");async function ig(e,t){const{shapeSvg:r,bbox:i,label:o}=await it(e,t,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),Q(t,s),t.intersect=function(l){return X.rect(t,l)},r}p(ig,"labelRect");async function og(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await it(e,t,rt(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=Z.svg(n),m=V(t,{}),y=gt(d),C=g.path(y,m);f=n.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=Xe(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,Q(t,f),t.intersect=function(g){return X.polygon(t,d,g)},n}p(og,"lean_left");async function sg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await it(e,t,rt(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=Z.svg(n),m=V(t,{}),y=gt(d),C=g.path(y,m);f=n.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=Xe(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,Q(t,f),t.intersect=function(g){return X.polygon(t,d,g)},n}p(sg,"lean_right");function ag(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",rt(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,a=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),l=7,c=[{x:a,y:0},{x:0,y:n+l/2},{x:a-2*l,y:n+l/2},{x:0,y:2*n},{x:a,y:n-l/2},{x:2*l,y:n-l/2}],h=Z.svg(o),d=V(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=gt(c),u=h.path(f,d),g=o.insert(()=>u,":first-child");return g.attr("class","outer-path"),s&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",i),g.attr("transform",`translate(-${a/2},${-n})`),Q(t,g),t.intersect=function(m){return q.info("lightningBolt intersect",t,m),X.polygon(t,c,m)},o}p(ag,"lightningBolt");var PT=p((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),RT=p((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),NT=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),lc=10,hc=10;async function ng(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?24:o;if(t.width||t.height){const C=t.width??0;t.width=(t.width??0)-s,t.width_,":first-child").attr("class","line"),m=n.insert(()=>S,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const C=PT(0,0,h,u,d,f,g);m=n.insert("path",":first-child").attr("d",C).attr("class","basic label-container outer-path").attr("style",qt(y)).attr("style",i)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),Q(t,m),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),t.intersect=function(C){const b=X.rect(t,C),k=b.x-(t.x??0);if(d!=0&&(Math.abs(k)<(t.width??0)/2||Math.abs(k)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-f)){let T=f*f*(1-k*k/(d*d));T>0&&(T=Math.sqrt(T)),T=f-T,C.y-(t.y??0)>0&&(T=-T),b.y+=T}return b},n}p(ng,"linedCylinder");async function lg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;if(t.width||t.height){const T=t.width;t.width=(T??0)*10/11-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:l,label:c}=await it(e,t,rt(t)),h=(t?.width?t?.width:l.width)+(s??0)*2,d=(t?.height?t?.height:l.height)+(a??0)*2,f=t.look==="neo"?d/4:d/8,u=d+f,{cssStyles:g}=t,m=Z.svg(n),y=V(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=[{x:-h/2-h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:u/2},...hr(-h/2-h/2*.1,u/2,h/2+h/2*.1,u/2,f,.8),{x:h/2+h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:-u/2},{x:-h/2,y:-u/2},{x:-h/2,y:u/2*1.1},{x:-h/2,y:-u/2}],b=m.polygon(C.map(T=>[T.x,T.y]),y),k=n.insert(()=>b,":first-child");return k.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(0,${-f/2})`),c.attr("transform",`translate(${-h/2+(t.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(t.padding??0)-f/2-(l.y-(l.top??0))})`),Q(t,k),t.intersect=function(T){return X.polygon(t,C,T)},n}p(lg,"linedWaveEdgedRect");async function hg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2-2*n,10),t.height=Math.max((t?.height??0)-a*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await it(e,t,rt(t)),d=(t?.width?t?.width:c.width)+s*2+2*n,f=(t?.height?t?.height:c.height)+a*2+2*n,u=d-2*n,g=f-2*n,m=-u/2,y=-g/2,{cssStyles:C}=t,b=Z.svg(l),k=V(t,{}),T=[{x:m-n,y:y+n},{x:m-n,y:y+g+n},{x:m+u-n,y:y+g+n},{x:m+u-n,y:y+g},{x:m+u,y:y+g},{x:m+u,y:y+g-n},{x:m+u+n,y:y+g-n},{x:m+u+n,y:y-n},{x:m+n,y:y-n},{x:m+n,y},{x:m,y},{x:m,y:y+n}],S=[{x:m,y:y+n},{x:m+u-n,y:y+n},{x:m+u-n,y:y+g},{x:m+u,y:y+g},{x:m+u,y},{x:m,y}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=gt(T);let L=b.path(_,k);const v=gt(S);let N=b.path(v,k);t.look!=="handDrawn"&&(L=ln(L),N=ln(N));const R=l.insert("g",":first-child");return R.insert(()=>L),R.insert(()=>N),R.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),Q(t,R),t.intersect=function(P){return X.polygon(t,T,P)},l}p(hg,"multiRect");async function cg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await it(e,t,rt(t)),n=t.padding??0,l=t.look==="neo"?16:n,c=t.look==="neo"?12:n;let h=!0;(t.width||t.height)&&(h=!1,t.width=(t?.width??0)-l*2,t.height=(t?.height??0)-c*3);const d=Math.max(s.width,t?.width??0)+l*2,f=Math.max(s.height,t?.height??0)+c*3,u=t.look==="neo"?f/4:f/8,g=f+(h?u/2:-u/2),m=-d/2,y=-g/2,C=10,{cssStyles:b}=t,k=hr(m-C,y+g+C,m+d-C,y+g+C,u,.8),T=k?.[k.length-1],S=[{x:m-C,y:y+C},{x:m-C,y:y+g+C},...k,{x:m+d-C,y:T.y-C},{x:m+d,y:T.y-C},{x:m+d,y:T.y-2*C},{x:m+d+C,y:T.y-2*C},{x:m+d+C,y:y-C},{x:m+C,y:y-C},{x:m+C,y},{x:m,y},{x:m,y:y+C}],_=[{x:m,y:y+C},{x:m+d-C,y:y+C},{x:m+d-C,y:T.y-C},{x:m+d,y:T.y-C},{x:m+d,y},{x:m,y}],L=Z.svg(o),v=V(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const N=gt(S),R=L.path(N,v),P=gt(_),z=L.path(P,v),W=o.insert(()=>R,":first-child");return W.insert(()=>z),W.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&W.selectAll("path").attr("style",b),i&&t.look!=="handDrawn"&&W.selectAll("path").attr("style",i),W.attr("transform",`translate(0,${-u/2})`),a.attr("transform",`translate(${-(s.width/2)-C-(s.x-(s.left??0))}, ${-(s.height/2)+C-u/2-(s.y-(s.top??0))})`),Q(t,W),t.intersect=function($){return X.polygon(t,S,$)},o}p(cg,"multiWaveEdgedRectangle");async function dg(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=K(t);t.labelStyle=i,t.useHtmlLabels||ee(vt())||(t.centerLabel=!0);const{shapeSvg:a,bbox:n,label:l}=await it(e,t,rt(t)),c=Math.max(n.width+(t.padding??0)*2,t?.width??0),h=Math.max(n.height+(t.padding??0)*2,t?.height??0),d=-c/2,f=-h/2,{cssStyles:u}=t,g=Z.svg(a),m=V(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,c,h,m),C=a.insert(()=>y,":first-child");return C.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),u&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",u),o&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",o),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Q(t,C),t.intersect=function(b){return X.rect(t,b)},a}p(dg,"note");var qT=p((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function ug(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await it(e,t,rt(t)),a=s.width+(t.padding??0),n=s.height+(t.padding??0),l=a+n,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=Z.svg(o),g=V(t,{}),m=qT(0,0,l),y=u.path(m,g);d=o.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),f&&d.attr("style",f)}else d=Xe(o,l,l,h),d.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&d.attr("style",i),Q(t,d),t.calcIntersect=function(u,g){const m=u.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],C=X.polygon(u,y,g);return{x:C.x-.5,y:C.y-.5}},t.intersect=function(u){return this.calcIntersect(t,u)},o}p(ug,"question");async function fg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?21:o??0,a=t.look==="neo"?12:o??0,{shapeSvg:n,bbox:l,label:c}=await it(e,t,rt(t)),h=(t?.width??l.width)+(t.look==="neo"?s*2:s),d=(t?.height??l.height)+(t.look==="neo"?a*2:a),f=-h/2,u=-d/2,g=u/2,m=[{x:f+g,y:u},{x:f,y:0},{x:f+g,y:-u},{x:-f,y:-u},{x:-f,y:u}],{cssStyles:y}=t,C=Z.svg(n),b=V(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const k=gt(m),T=C.path(k,b),S=n.insert(()=>T,":first-child");return S.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),S.attr("transform",`translate(${-g/2},0)`),c.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),Q(t,S),t.intersect=function(_){return X.polygon(t,m,_)},n}p(fg,"rect_left_inv_arrow");async function pg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=s.insert("g"),n=s.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await rr(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(ee(Ct())){const v=h.children[0],N=ct(h);d=v.getBoundingClientRect(),N.attr("width",d.width),N.attr("height",d.height)}q.info("Text 2",l);const f=l||[],u=h.getBBox(),g=await rr(n,Array.isArray(f)?f.join("
      "):f,t.labelStyle,!0,!0),m=g.children[0],y=ct(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const C=(t.padding||0)/2;ct(g).attr("transform","translate( "+(d.width>u.width?0:(u.width-d.width)/2)+", "+(u.height+C+5)+")"),ct(h).attr("transform","translate( "+(d.width(q.debug("Rough node insert CXC",R),P),":first-child"),_=s.insert(()=>(q.debug("Rough node insert CXC",R),R),":first-child")}else _=a.insert("rect",":first-child"),L=a.insert("line"),_.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-C).attr("y",-d.height/2-C).attr("width",d.width+(t.padding||0)).attr("height",d.height+(t.padding||0)),L.attr("class","divider").attr("x1",-d.width/2-C).attr("x2",d.width/2+C).attr("y1",-d.height/2-C+u.height+C).attr("y2",-d.height/2-C+u.height+C);return Q(t,_),t.intersect=function(v){return X.rect(t,v)},s}p(pg,"rectWithTitle");async function gg(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,o={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return ai(e,t,o)}p(gg,"roundedRect");var gr=8;async function mg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await it(e,t,rt(t)),c=(t?.width??n.width)+o*2+(t.look==="neo"?gr:gr*2),h=(t?.height??n.height)+s*2,d=c-gr,f=h,u=gr-c/2,g=-h/2,{cssStyles:m}=t,y=Z.svg(a),C=V(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const b=[{x:u,y:g},{x:u+d,y:g},{x:u+d,y:g+f},{x:u-gr,y:g+f},{x:u-gr,y:g},{x:u,y:g},{x:u,y:g+f}],k=y.polygon(b.map(S=>[S.x,S.y]),C),T=a.insert(()=>k,":first-child");return T.attr("class","basic label-container outer-path").attr("style",qt(m)),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),m&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),l.attr("transform",`translate(${gr/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Q(t,T),t.intersect=function(S){return X.rect(t,S)},a}p(mg,"shadedProcess");async function yg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:n,bbox:l,label:c}=await it(e,t,rt(t)),h=(t?.width?t?.width:l.width)+s*2,d=((t?.height?t?.height:l.height)+a*2)*1.5,f=h,u=d/1.5,g=-f/2,m=-u/2,{cssStyles:y}=t,C=Z.svg(n),b=V(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const k=[{x:g,y:m},{x:g,y:m+u},{x:g+f,y:m+u},{x:g+f,y:m-u/2}],T=gt(k),S=C.path(T,b),_=n.insert(()=>S,":first-child");return _.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",y),i&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",i),_.attr("transform",`translate(0, ${u/4})`),c.attr("transform",`translate(${-f/2+(t.padding??0)-(l.x-(l.left??0))}, ${-u/4+(t.padding??0)-(l.y-(l.top??0))})`),Q(t,_),t.intersect=function(L){return X.polygon(t,k,L)},n}p(yg,"slopedRect");async function Cg(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,o=t.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:o};return ai(e,t,s)}p(Cg,"squareRect");async function xg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?20:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await it(e,t,rt(t)),c=l.height+(t.look==="neo"?a*2:a),h=l.width+c/4+(t.look==="neo"?s*2:s),d=c/2,{cssStyles:f}=t,u=Z.svg(n),g=V(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-c/2},{x:h/2-d,y:-c/2},...ji(-h/2+d,0,d,50,90,270),{x:h/2-d,y:c/2},...ji(h/2-d,0,d,50,270,450)],y=gt(m),C=u.path(y,g),b=n.insert(()=>C,":first-child");return b.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),Q(t,b),t.intersect=function(k){return X.polygon(t,m,k)},n}p(xg,"stadium");async function bg(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return ai(e,t,r)}p(bg,"state");function kg(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=K(t);t.labelStyle=i;const{cssStyles:s}=t,{lineColor:a,stateBorder:n,nodeBorder:l,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const h=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),d=Z.svg(h),f=V(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const u=d.circle(0,0,t.width,{...f,stroke:a,strokeWidth:2}),g=n??l,m=(t.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),C=h.insert(()=>u,":first-child");if(C.insert(()=>y),t.look!=="handDrawn"&&C.attr("class","outer-path"),s&&C.selectAll("path").attr("style",s),o&&C.selectAll("path").attr("style",o),t.width<25&&c&&t.look!=="handDrawn"){const b=e.node()?.ownerSVGElement?.id??"",k=b?`${b}-drop-shadow-small`:"drop-shadow-small";C.attr("style",`filter:url(#${k})`)}return Q(t,C),t.intersect=function(b){return X.circle(t,(t.width??0)/2,b)},h}p(kg,"stateEnd");function wg(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:o}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const l=Z.svg(s).circle(0,0,t.width,Q1(i));a=s.insert(()=>l),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else a=s.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&o&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",l=n?`${n}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${l})`)}return Q(t,a),t.intersect=function(n){return X.circle(t,(t.width??7)/2,n)},s}p(wg,"stateStart");var Wr=8;async function Tg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t?.padding??8,s=t.look==="neo"?28:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await it(e,t,rt(t)),c=(t?.width??l.width)+2*Wr+s,h=(t?.height??l.height)+a,d=c-2*Wr,f=h,u=-c/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look==="handDrawn"){const y=Z.svg(n),C=V(t,{}),b=y.rectangle(u,g,d+16,f,C),k=y.line(u+Wr,g,u+Wr,g+f,C),T=y.line(u+Wr+d,g,u+Wr+d,g+f,C);n.insert(()=>k,":first-child"),n.insert(()=>T,":first-child");const S=n.insert(()=>b,":first-child"),{cssStyles:_}=t;S.attr("class","basic label-container").attr("style",qt(_)),Q(t,S)}else{const y=Xe(n,d,f,m);i&&y.attr("style",i),Q(t,y)}return t.intersect=function(y){return X.polygon(t,m,y)},n}p(Tg,"subroutine");var pa=.2;async function Sg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-s*2-pa*(t.height+a*2),10));const{shapeSvg:n,bbox:l}=await it(e,t,rt(t)),c=(t?.height?t?.height:l.height)+a*2,h=pa*c,d=pa*c,u=(t?.width?t?.width:l.width)+s*2+h-h,g=c,m=-u/2,y=-g/2,{cssStyles:C}=t,b=Z.svg(n),k=V(t,{}),T=[{x:m-h/2,y},{x:m+u+h/2,y},{x:m+u+h/2,y:y+g},{x:m-h/2,y:y+g}],S=[{x:m+u-h/2,y:y+g},{x:m+u+h/2,y:y+g},{x:m+u+h/2,y:y+g-d}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=gt(T),L=b.path(_,k),v=gt(S),N=b.path(v,{...k,fillStyle:"solid"}),R=n.insert(()=>N,":first-child");return R.insert(()=>L,":first-child"),R.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",i),Q(t,R),t.intersect=function(P){return X.polygon(t,T,P)},n}p(Sg,"taggedRect");async function _g(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await it(e,t,rt(t)),n=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,d=.2*l,f=l+c,{cssStyles:u}=t,g=Z.svg(o),m=V(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-n/2-n/2*.1,y:f/2},...hr(-n/2-n/2*.1,f/2,n/2+n/2*.1,f/2,c,.8),{x:n/2+n/2*.1,y:-f/2},{x:-n/2-n/2*.1,y:-f/2}],C=-n/2+n/2*.1,b=-f/2-d*.4,k=[{x:C+n-h,y:(b+l)*1.3},{x:C+n,y:b+l-d},{x:C+n,y:(b+l)*.9},...hr(C+n,(b+l)*1.25,C+n-h,(b+l)*1.3,-l*.02,.5)],T=gt(y),S=g.path(T,m),_=gt(k),L=g.path(_,{...m,fillStyle:"solid"}),v=o.insert(()=>L,":first-child");return v.insert(()=>S,":first-child"),v.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n/2+(t.padding??0)-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),Q(t,v),t.intersect=function(N){return X.polygon(t,y,N)},o}p(_g,"taggedWaveEdgedRectangle");async function Bg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await it(e,t,rt(t)),a=Math.max(s.width+(t.padding??0),t?.width||0),n=Math.max(s.height+(t.padding??0),t?.height||0),l=-a/2,c=-n/2,h=o.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",a).attr("height",n),Q(t,h),t.intersect=function(d){return X.rect(t,d)},o}p(Bg,"text");var WT=p((e,t,r,i,o,s)=>`M${e},${t} + a${o},${s} 0,0,1 0,${-i} + l${r},0 + a${o},${s} 0,0,1 0,${i} + M${r},${-i} + a${o},${s} 0,0,0 0,${i} + l${-r},0`,"createCylinderPathD"),zT=p((e,t,r,i,o,s)=>[`M${e},${t}`,`M${e+r},${t}`,`a${o},${s} 0,0,0 0,${-i}`,`l${-r},0`,`a${o},${s} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),HT=p((e,t,r,i,o,s)=>[`M${e+r/2},${-i/2}`,`a${o},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),cc=5,dc=10;async function vg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?12:o/2;if(t.width||t.height){const m=t.height??0;t.height=(t.height??0)-s,t.heightk,":first-child"),g=a.insert(()=>b,":first-child"),g.attr("class","basic label-container"),u&&g.attr("style",u)}else{const m=WT(0,0,f,c,d,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",qt(u)).attr("style",i),g.attr("class","basic label-container outer-path"),u&&g.selectAll("path").attr("style",u),i&&g.selectAll("path").attr("style",i)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${c/2} )`),l.attr("transform",`translate(${-(n.width/2)-d-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Q(t,g),t.intersect=function(m){const y=X.rect(t,m),C=y.y-(t.y??0);if(h!=0&&(Math.abs(C)<(t.height??0)/2||Math.abs(C)==(t.height??0)/2&&Math.abs(y.x-(t.x??0))>(t.width??0)/2-d)){let b=d*d*(1-C*C/(h*h));b!=0&&(b=Math.sqrt(Math.abs(b))),b=d-b,m.x-(t.x??0)>0&&(b=-b),y.x+=b}return y},a}p(vg,"tiltedCylinder");async function Lg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=(t.look==="neo",o),a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await it(e,t,rt(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=Z.svg(n),m=V(t,{}),y=gt(d),C=g.path(y,m);f=n.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=Xe(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,Q(t,f),t.intersect=function(g){return X.polygon(t,d,g)},n}p(Lg,"trapezoid");async function Fg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-a*2,t.heightb,":first-child");return k.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),Q(t,k),t.intersect=function(T){return X.polygon(t,y,T)},c}p(Fg,"trapezoidalPentagon");var uc=10,fc=10;async function Ag(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.width=((t?.width??0)-s)/2,t.widthb,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),t.width=h,t.height=d,Q(t,k),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${d/2-(n.height+(t.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(T){return q.info("Triangle intersect",t,u,T),X.polygon(t,u,T)},a}p(Ag,"triangle");async function Eg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10));const{shapeSvg:l,bbox:c,label:h}=await it(e,t,rt(t)),d=(t?.width?t?.width:c.width)+(s??0)*2,f=(t?.height?t?.height:c.height)+(a??0)*2,u=t.look==="neo"?f/4:f/8,g=f+(n?u:-u),{cssStyles:m}=t,C=14-d,b=C>0?C/2:0,k=Z.svg(l),T=V(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const S=[{x:-d/2-b,y:g/2},...hr(-d/2-b,g/2,d/2+b,g/2,u,.8),{x:d/2+b,y:-g/2},{x:-d/2-b,y:-g/2}],_=gt(S),L=k.path(_,T),v=l.insert(()=>L,":first-child");return v.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(0,${-u/2})`),h.attr("transform",`translate(${-d/2+(t.padding??0)-(c.x-(c.left??0))},${-f/2+(t.padding??0)-u-(c.y-(c.top??0))})`),Q(t,v),t.intersect=function(N){return X.polygon(t,S,N)},l}p(Eg,"waveEdgedRectangle");async function Mg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?20:o;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);const T=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-a-T*(20/9)),t.width=t.width-s*2}const{shapeSvg:n,bbox:l}=await it(e,t,rt(t)),c=(t?.width?t?.width:l.width)+s*2,h=(t?.height?t?.height:l.height)+a,d=h/8,f=h+d*2,{cssStyles:u}=t,g=Z.svg(n),m=V(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-c/2,y:f/2},...hr(-c/2,f/2,c/2,f/2,d,1),{x:c/2,y:-f/2},...hr(c/2,-f/2,-c/2,-f/2,d,-1)],C=gt(y),b=g.path(C,m),k=n.insert(()=>b,":first-child");return k.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),Q(t,k),t.intersect=function(T){return X.polygon(t,y,T)},n}p(Mg,"waveRectangle");var At=10;async function $g(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-At,10),t.height=Math.max((t?.height??0)-s*2-At,10));const{shapeSvg:a,bbox:n,label:l}=await it(e,t,rt(t)),c=(t?.width?t?.width:n.width)+o*2+At,h=(t?.height?t?.height:n.height)+s*2+At,d=c-At,f=h-At,u=-d/2,g=-f/2,{cssStyles:m}=t,y=Z.svg(a),C=V(t,{}),b=[{x:u-At,y:g-At},{x:u-At,y:g+f},{x:u+d,y:g+f},{x:u+d,y:g-At}],k=`M${u-At},${g-At} L${u+d},${g-At} L${u+d},${g+f} L${u-At},${g+f} L${u-At},${g-At} + M${u-At},${g} L${u+d},${g} + M${u},${g-At} L${u},${g+f}`;t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const T=y.path(k,C),S=a.insert(()=>T,":first-child");return S.attr("transform",`translate(${At/2}, ${At/2})`),S.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(n.width/2)+At/2-(n.x-(n.left??0))}, ${-(n.height/2)+At/2-(n.y-(n.top??0))})`),Q(t,S),t.intersect=function(_){return X.polygon(t,b,_)},a}p($g,"windowPane");var pc=new Set(["redux-color","redux-dark-color"]),YT=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function gl(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:o}=vt(),{rowEven:s,rowOdd:a,nodeBorder:n,borderColorArray:l}=o;if(t.look==="handDrawn"){const{themeVariables:et}=vt(),{background:ft}=et,kt={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ft}`]};await gl(e,kt)}const c=vt();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:f}=t,{labelStyles:u,nodeStyles:g}=K(t);if(r.attributes.length===0&&t.label){const et={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};je(t.label,c)+et.labelPaddingX*20){const et=C.width+h*2-(S+_+L+v);S+=et/P,_+=et/P,L>0&&(L+=et/P),v>0&&(v+=et/P)}const W=S+_+L+v,$=Z.svg(y),A=V(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");let F=0;T.length>0&&(F=T.reduce((et,ft)=>et+(ft?.rowHeight??0),0));const D=Math.max(z.width+h*2,t?.width||0,W),M=Math.max((F??0)+C.height,t?.height||0),H=-D/2,Y=-M/2;if(y.selectAll("g:not(:first-child)").each((et,ft,kt)=>{const Bt=ct(kt[ft]),St=Bt.attr("transform");let ut=0,de=0;if(St){const Mr=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(St);Mr&&(ut=parseFloat(Mr[1]),de=parseFloat(Mr[2]),Bt.attr("class").includes("attribute-name")?ut+=S:Bt.attr("class").includes("attribute-keys")?ut+=S+_:Bt.attr("class").includes("attribute-comment")&&(ut+=S+_+L))}Bt.attr("transform",`translate(${H+h/2+ut}, ${de+Y+C.height+d/2})`)}),y.select(".name").attr("transform","translate("+-C.width/2+", "+(Y+d/2)+")"),i!=null&&pc.has(i)){const et=r.colorIndex??0;y.attr("data-color-id",`color-${et%l.length}`)}const G=$.rectangle(H,Y,D,M,A),lt=y.insert(()=>G,":first-child").attr("class","outer-path").attr("style",f.join(""));k.push(0);for(const[et,ft]of T.entries()){const Bt=(et+1)%2===0&&ft.yOffset!==0,St=$.rectangle(H,C.height+Y+ft?.yOffset,D,ft?.rowHeight,{...A,fill:Bt?s:a,stroke:n});y.insert(()=>St,"g.label").attr("style",f.join("")).attr("class",`row-rect-${Bt?"even":"odd"}`)}const ht=1e-4;let dt=Ur(H,C.height+Y,D+H,C.height+Y,ht),bt=$.polygon(dt.map(et=>[et.x,et.y]),A);if(y.insert(()=>bt).attr("class","divider"),dt=Ur(S+H,C.height+Y,S+H,M+Y,ht),bt=$.polygon(dt.map(et=>[et.x,et.y]),A),y.insert(()=>bt).attr("class","divider"),N){const et=S+_+H;dt=Ur(et,C.height+Y,et,M+Y,ht),bt=$.polygon(dt.map(ft=>[ft.x,ft.y]),A),y.insert(()=>bt).attr("class","divider")}if(R){const et=S+_+L+H;dt=Ur(et,C.height+Y,et,M+Y,ht),bt=$.polygon(dt.map(ft=>[ft.x,ft.y]),A),y.insert(()=>bt).attr("class","divider")}for(const et of k){const ft=C.height+Y+et;dt=Ur(H,ft,D+H,ft,ht),bt=$.polygon(dt.map(kt=>[kt.x,kt.y]),A),y.insert(()=>bt).attr("class","divider")}if(Q(t,lt),g&&t.look!=="handDrawn")if(i!=null&&YT.has(i))y.selectAll("path").attr("style",g);else{const ft=g.split(";")?.filter(kt=>kt.includes("stroke"))?.map(kt=>`${kt}`).join("; ");y.selectAll("path").attr("style",ft??""),y.selectAll(".row-rect-even path").attr("style",g)}return t.intersect=function(et){return X.rect(t,et)},y}p(gl,"erBox");async function Yr(e,t,r,i=0,o=0,s=[],a=""){const n=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${o})`).attr("style",a);t!==sh(t)&&(t=sh(t),t=t.replaceAll("<","<").replaceAll(">",">"));const l=n.node().appendChild(await Pe(n,t,{width:je(t,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let c=l.getBBox();if(Ie(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=ct(l);c=h.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return c}p(Yr,"addText");function Ur(e,t,r,i,o){return e===r?[{x:e-o/2,y:t},{x:e+o/2,y:t},{x:r+o/2,y:i},{x:r-o/2,y:i}]:[{x:e,y:t-o/2},{x:e,y:t+o/2},{x:r,y:i+o/2},{x:r,y:i-o/2}]}p(Ur,"lineToPolygon");async function Og(e,t,r,i,o=r.class.padding??12){const s=i?0:3,a=e.insert("g").attr("class",rt(t)).attr("id",t.domId||t.id);let n=null,l=null,c=null,h=null,d=0,f=0,u=0;if(n=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const b=t.annotations[0];await Li(n,{text:`«${b}»`},0),d=n.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await Li(l,t,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,c=a.insert("g").attr("class","members-group text");let m=0;for(const b of t.members){const k=await Li(c,b,m,[b.parseClassifier()]);m+=k+s}u=c.node().getBBox().height,u<=0&&(u=o/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const b of t.methods){const k=await Li(h,b,y,[b.parseClassifier()]);y+=k+s}let C=a.node().getBBox();if(n!==null){const b=n.node().getBBox();n.attr("transform",`translate(${-b.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),C=a.node().getBBox(),c.attr("transform",`translate(0, ${d+f+o*2})`),C=a.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(u?u+o*4:o*2)})`),C=a.node().getBBox(),{shapeSvg:a,bbox:C}}p(Og,"textHelper");async function Li(e,t,r,i=[]){const o=e.insert("g").attr("class","label").attr("style",i.join("; ")),s=vt();let a="useHtmlLabels"in t?t.useHtmlLabels:Ie(s.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!a&&n.startsWith("\\")&&(n=n.substring(1)),Pi(n)&&(a=!0);const l=await Pe(o,Sn(vr(n)),{width:je(n,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let c,h=1;if(a){const d=l.children[0],f=ct(l);h=d.innerHTML.split("
      ").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const u=d.getElementsByTagName("img");if(u){const g=n.replace(/]*>/g,"").trim()==="";await Promise.all([...u].map(m=>new Promise(y=>{function C(){if(m.style.display="flex",m.style.flexDirection="column",g){const b=s.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,T=parseInt(b,10)*5+"px";m.style.minWidth=T,m.style.maxWidth=T}else m.style.width="100%";y(m)}p(C,"setupImage"),setTimeout(()=>{m.complete&&C()}),m.addEventListener("error",C),m.addEventListener("load",C)})))}c=d.getBoundingClientRect(),f.attr("width",c.width),f.attr("height",c.height)}else{i.includes("font-weight: bolder")&&ct(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=n[0]+n.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),n[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),c=l.getBBox()}return o.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}p(Li,"addText");async function Ig(e,t){const r=Ct(),{themeVariables:i}=r,{useGradient:o}=i,s=r.class.padding??12,a=s,n=t.useHtmlLabels??Ie(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await Og(e,t,r,n,a),{labelStyles:d,nodeStyles:f}=K(t);t.labelStyle=d,t.cssStyles=l.styles||"";const u=l.styles?.join(";")||f||"";t.cssStyles||(t.cssStyles=u.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!r.class?.hideEmptyMembersBox,m=Z.svg(c),y=V(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=Math.max(t.width??0,h.width);let b=Math.max(t.height??0,h.height);const k=(t.height??0)>h.height;l.members.length===0&&l.methods.length===0?b+=a:l.members.length>0&&l.methods.length===0&&(b+=a*2);const T=-C/2,S=-b/2;let _=g?s*2:l.members.length===0&&l.methods.length===0?-s:0;k&&(_=s*2);const L=m.rectangle(T-s,S-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0),C+2*s,b+2*s+_,y),v=c.insert(()=>L,":first-child");v.attr("class","basic label-container outer-path");const N=v.node().getBBox(),R=c.select(".annotation-group").node().getBBox().height-(g?s/2:0)||0,P=c.select(".label-group").node().getBBox().height-(g?s/2:0)||0,z=c.select(".members-group").node().getBBox().height-(g?s/2:0)||0,W=(R+P+S+s-(S-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(c.selectAll(".text").each(($,A,F)=>{const D=ct(F[A]),M=D.attr("transform");let H=0;if(M){const ht=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(M);ht&&(H=parseFloat(ht[2]))}let Y=H+S+s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(D.attr("class").includes("methods-group")){const lt=Math.max(z,a/2);k?Y=Math.max(W,R+P+lt+S+a*2+s)+a*2:Y=R+P+lt+S+a*4+s}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?Y=H-a:Y=H),n||(Y-=4);let G=T;(D.attr("class").includes("label-group")||D.attr("class").includes("annotation-group"))&&(G=-D.node()?.getBBox().width/2||0,c.selectAll("text").each(function(lt,ht,dt){window.getComputedStyle(dt[ht]).textAnchor==="middle"&&(G=0)})),D.attr("transform",`translate(${G}, ${Y})`)}),l.members.length>0||l.methods.length>0||g){const $=R+P+S+s,A=m.line(N.x,$,N.x+N.width,$+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(g||l.members.length>0||l.methods.length>0){const $=R+P+z+S+a*2+s,A=m.line(N.x,k?Math.max(W,$):$,N.x+N.width,(k?Math.max(W,$):$)+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(l.look!=="handDrawn"&&c.selectAll("path").attr("style",u),v.select(":nth-child(2)").attr("style",u),c.selectAll(".divider").select("path").attr("style",u),t.labelStyle?c.selectAll("span").attr("style",t.labelStyle):c.selectAll("span").attr("style",u),!n){const $=RegExp(/color\s*:\s*([^;]*)/),A=$.exec(u);if(A){const F=A[0].replace("color","fill");c.selectAll("tspan").attr("style",F)}else if(d){const F=$.exec(d);if(F){const D=F[0].replace("color","fill");c.selectAll("tspan").attr("style",D)}}}return Q(t,v),t.intersect=function($){return X.rect(t,$)},c}p(Ig,"classBox");async function Dg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const o=t,s=t,a=20,n=20,l="verifyMethod"in t,c=rt(t),{themeVariables:h}=Ct(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,u=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let g;l?g=await Le(u,`<<${o.type}>>`,0,t.labelStyle):g=await Le(u,"<<Element>>",0,t.labelStyle);let m=g;const y=await Le(u,o.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+n,l){const N=await Le(u,`${o.requirementId?`ID: ${o.requirementId}`:""}`,m,t.labelStyle);m+=N;const R=await Le(u,`${o.text?`Text: ${o.text}`:""}`,m,t.labelStyle);m+=R;const P=await Le(u,`${o.risk?`Risk: ${o.risk}`:""}`,m,t.labelStyle);m+=P,await Le(u,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,m,t.labelStyle)}else{const N=await Le(u,`${s.type?`Type: ${s.type}`:""}`,m,t.labelStyle);m+=N,await Le(u,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,t.labelStyle)}const C=(u.node()?.getBBox().width??200)+a,b=(u.node()?.getBBox().height??200)+a,k=-C/2,T=-b/2,S=Z.svg(u),_=V(t,{});t.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const L=S.rectangle(k,T,C,b,_),v=u.insert(()=>L,":first-child");if(v.attr("class","basic label-container outer-path").attr("style",i),d?.length){const N=t.colorIndex??0;u.attr("data-color-id",`color-${N%d.length}`)}if(u.selectAll(".label").each((N,R,P)=>{const z=ct(P[R]),W=z.attr("transform");let $=0,A=0;if(W){const H=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(W);H&&($=parseFloat(H[1]),A=parseFloat(H[2]))}const F=A-b/2;let D=k+a/2;(R===0||R===1)&&(D=$),z.attr("transform",`translate(${D}, ${F+a})`)}),m>g+y+n){const N=T+g+y+n;let R;if(t.look==="neo"){const W=[[k,N],[k+C,N],[k+C,N+.001],[k,N+.001]];R=S.polygon(W,_)}else R=S.line(k,N,k+C,N,_);u.insert(()=>R).attr("class","divider")}return Q(t,v),t.intersect=function(N){return X.rect(t,N)},i&&t.look!=="handDrawn"&&(f||d?.length)&&u.selectAll("path").attr("style",i),u}p(Dg,"requirementBox");async function Le(e,t,r,i=""){if(t==="")return 0;const o=e.insert("g").attr("class","label").attr("style",i),s=Ct(),a=s.htmlLabels??!0,n=await Pe(o,Sn(vr(t)),{width:je(t,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:i},s);let l;if(a){const c=n.children[0],h=ct(n);l=c.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const c=n.children[0];for(const h of c.children)i&&h.setAttribute("style",i);l=n.getBBox(),l.height+=6}return o.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}p(Le,"addText");var UT=p(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Pg(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=K(t);t.labelStyle=i||"";const s=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:l,label:c}=await it(e,t,rt(t)),h=t.padding||10;let d="",f;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),f=n.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const u={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await fa(f,"ticket"in t&&t.ticket||"",u):{label:g,bbox:m}=await fa(n,"ticket"in t&&t.ticket||"",u);const{label:y,bbox:C}=await fa(n,"assigned"in t&&t.assigned||"",u);t.width=a;const b=10,k=t?.width||0,T=Math.max(m.height,C.height)/2,S=Math.max(l.height+b*2,t?.height||0)+T,_=-k/2,L=-S/2;c.attr("transform","translate("+(h-k/2)+", "+(-T-l.height/2)+")"),g.attr("transform","translate("+(h-k/2)+", "+(-T+l.height/2)+")"),y.attr("transform","translate("+(h+k/2-C.width-2*s)+", "+(-T+l.height/2)+")");let v;const{rx:N,ry:R}=t,{cssStyles:P}=t;if(t.look==="handDrawn"){const z=Z.svg(n),W=V(t,{}),$=N||R?z.path(cr(_,L,k,S,N||0),W):z.rectangle(_,L,k,S,W);v=n.insert(()=>$,":first-child"),v.attr("class","basic label-container").attr("style",P||null)}else{v=n.insert("rect",":first-child"),v.attr("class","basic label-container __APA__").attr("style",o).attr("rx",N??5).attr("ry",R??5).attr("x",_).attr("y",L).attr("width",k).attr("height",S);const z="priority"in t&&t.priority;if(z){const W=n.append("line"),$=_+2,A=L+Math.floor((N??0)/2),F=L+S-Math.floor((N??0)/2);W.attr("x1",$).attr("y1",A).attr("x2",$).attr("y2",F).attr("stroke-width","4").attr("stroke",UT(z))}}return Q(t,v),t.height=S,t.intersect=function(z){return X.rect(t,z)},n}p(Pg,"kanbanItem");async function Rg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await it(e,t,rt(t)),l=s.width+10*a,c=s.height+8*a,h=.15*l,{cssStyles:d}=t,f=s.width+20,u=s.height+20,g=Math.max(l,f),m=Math.max(c,u);n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const C=`M0 0 + a${h},${h} 1 0,0 ${g*.25},${-1*m*.1} + a${h},${h} 1 0,0 ${g*.25},0 + a${h},${h} 1 0,0 ${g*.25},0 + a${h},${h} 1 0,0 ${g*.25},${m*.1} + + a${h},${h} 1 0,0 ${g*.15},${m*.33} + a${h*.8},${h*.8} 1 0,0 0,${m*.34} + a${h},${h} 1 0,0 ${-1*g*.15},${m*.33} + + a${h},${h} 1 0,0 ${-1*g*.25},${m*.15} + a${h},${h} 1 0,0 ${-1*g*.25},0 + a${h},${h} 1 0,0 ${-1*g*.25},0 + a${h},${h} 1 0,0 ${-1*g*.25},${-1*m*.15} + + a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33} + a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34} + a${h},${h} 1 0,0 ${g*.1},${-1*m*.33} + H0 V0 Z`;if(t.look==="handDrawn"){const b=Z.svg(o),k=V(t,{}),T=b.path(C,k);y=o.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",qt(d))}else y=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",C);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),Q(t,y),t.calcIntersect=function(b,k){return X.rect(b,k)},t.intersect=function(b){return q.info("Bang intersect",t,b),X.rect(t,b)},o}p(Rg,"bang");async function Ng(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await it(e,t,rt(t)),l=s.width+2*a,c=s.height+2*a,h=.15*l,d=.25*l,f=.35*l,u=.2*l,{cssStyles:g}=t;let m;const y=`M0 0 + a${h},${h} 0 0,1 ${l*.25},${-1*l*.1} + a${f},${f} 1 0,1 ${l*.4},${-1*l*.1} + a${d},${d} 1 0,1 ${l*.35},${l*.2} + + a${h},${h} 1 0,1 ${l*.15},${c*.35} + a${u},${u} 1 0,1 ${-1*l*.15},${c*.65} + + a${d},${h} 1 0,1 ${-1*l*.25},${l*.15} + a${f},${f} 1 0,1 ${-1*l*.5},0 + a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15} + + a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35} + a${u},${u} 1 0,1 ${l*.1},${-1*c*.65} + H0 V0 Z`;if(t.look==="handDrawn"){const C=Z.svg(o),b=V(t,{}),k=C.path(y,b);m=o.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",qt(g))}else m=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),Q(t,m),t.calcIntersect=function(C,b){return X.rect(C,b)},t.intersect=function(C){return q.info("Cloud intersect",t,C),X.rect(t,C)},o}p(Ng,"cloud");async function qg(e,t){const{labelStyles:r,nodeStyles:i}=K(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await it(e,t,rt(t)),l=s.width+8*a,c=s.height+2*a,h=5,d=t.look==="neo"?` + M${-l/2} ${c/2-h} + v${-c+2*h} + q0,-${h} ${h},-${h} + h${l-2*h} + q${h},0 ${h},${h} + v${c-h} + H${-l/2} + Z + `:` + M${-l/2} ${c/2-h} + v${-c+2*h} + q0,-${h} ${h},-${h} + h${l-2*h} + q${h},0 ${h},${h} + v${c-2*h} + q0,${h} ${-h},${h} + h${-(l-2*h)} + q${-h},0 ${-h},${-h} + Z + `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return o.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),o.append(()=>n.node()),Q(t,f),t.calcIntersect=function(u,g){return X.rect(u,g)},t.intersect=function(u){return X.rect(t,u)},o}p(qg,"defaultMindmapNode");async function Wg(e,t){const r={padding:t.padding??0};return pl(e,t,r)}p(Wg,"mindmapCircle");var jT=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Cg},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:gg},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:xg},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Tg},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Wp},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:zp},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:pl},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Rg},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Ng},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:ug},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Vp},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:sg},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:og},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Lg},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:rg},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Yp},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Bg},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:$p},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:mg},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:wg},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:kg},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Gp},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Zp},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Pp},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Rp},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Np},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:ag},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Eg},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Xp},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:vg},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:ng},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:qp},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Hp},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Ag},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:$g},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Up},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Fg},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:jp},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:yg},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:cg},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:hg},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Mp},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Dp},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:_g},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Sg},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Mg},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:fg},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:lg}],GT=p(()=>{const t=[...Object.entries({state:bg,choice:Op,note:dg,rectWithTitle:pg,labelRect:ig,iconSquare:tg,iconCircle:Qp,icon:Kp,iconRounded:Jp,imageSquare:eg,anchor:Ap,kanbanItem:Pg,mindmapCircle:Wg,defaultMindmapNode:qg,classBox:Ig,erBox:gl,requirementBox:Dg}),...jT.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),zg=GT();function XT(e){return e in zg}p(XT,"isValidShape");var As=new Map;async function Hg(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?zg[t.shape]:void 0;if(!s)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;r.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),o=await s(i,t,r)}else o=await s(e,t,r),i=o;return i.attr("data-look",qt(t.look)),t.tooltip&&o.attr("title",t.tooltip),As.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}p(Hg,"insertNode");var HL=p((e,t)=>{As.set(t.id,e)},"setNodeElem"),YL=p(()=>{As.clear()},"clear"),UL=p(e=>{const t=As.get(e.id);q.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),bi=p((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform"),Xt={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},gc={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function Fi(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=_t(e),t=_t(t);const[r,i]=[e.x,e.y],[o,s]=[t.x,t.y],a=o-r,n=s-i;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}p(Fi,"calculateDeltaAndAngle");var _t=p(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),VT=p(e=>({x:p(function(t,r,i){let o=0;const s=_t(i[0]).x<_t(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Xt,e.arrowTypeStart)){const{angle:u,deltaX:g}=Fi(i[0],i[1]);o=Xt[e.arrowTypeStart]*Math.cos(u)*(g>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Xt,e.arrowTypeEnd)){const{angle:u,deltaX:g}=Fi(i[i.length-1],i[i.length-2]);o=Xt[e.arrowTypeEnd]*Math.cos(u)*(g>=0?1:-1)}const a=Math.abs(_t(t).x-_t(i[i.length-1]).x),n=Math.abs(_t(t).y-_t(i[i.length-1]).y),l=Math.abs(_t(t).x-_t(i[0]).x),c=Math.abs(_t(t).y-_t(i[0]).y),h=Xt[e.arrowTypeStart],d=Xt[e.arrowTypeEnd],f=1;if(a0&&n0&&c=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Xt,e.arrowTypeEnd)){const{angle:u,deltaY:g}=Fi(i[i.length-1],i[i.length-2]);o=Xt[e.arrowTypeEnd]*Math.abs(Math.sin(u))*(g>=0?1:-1)}const a=Math.abs(_t(t).y-_t(i[i.length-1]).y),n=Math.abs(_t(t).x-_t(i[i.length-1]).x),l=Math.abs(_t(t).y-_t(i[0]).y),c=Math.abs(_t(t).x-_t(i[0]).x),h=Xt[e.arrowTypeStart],d=Xt[e.arrowTypeEnd],f=1;if(a0&&n0&&c{t.arrowTypeStart&&mc(e,"start",t.arrowTypeStart,r,i,o,s,a),t.arrowTypeEnd&&mc(e,"end",t.arrowTypeEnd,r,i,o,s,a)},"addEdgeMarkers"),KT={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},QT=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],mc=p((e,t,r,i,o,s,a=!1,n)=>{const l=KT[r],c=l&&QT.includes(l.type);if(!l){q.warn(`Unknown arrow type: ${r}`);return}const h=l.type,u=`${o}_${s}-${h}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const g=n.replace(/[^\dA-Za-z]/g,"_"),m=`${u}_${g}`;if(!document.getElementById(m)){const y=document.getElementById(u);if(y){const C=y.cloneNode(!0);C.id=m,C.querySelectorAll("path, circle, line").forEach(k=>{k.setAttribute("stroke",n),l.fill&&k.setAttribute("fill",n)}),y.parentNode?.appendChild(C)}}e.attr(`marker-${t}`,`url(${i}#${m})`)}else e.attr(`marker-${t}`,`url(${i}#${u})`)},"addEdgeMarker"),JT=p(e=>typeof e=="string"?e:Ct()?.flowchart?.curve,"resolveEdgeCurveType"),fs=new Map,Yt=new Map,jL=p(()=>{fs.clear(),Yt.clear()},"clear"),ki=p(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),tS=p(async(e,t)=>{const r=Ct();let i=ee(r);const{labelStyles:o}=K(t);t.labelStyle=o;const s=e.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await Pe(e,t.label,{style:ki(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},r);a.node().appendChild(c),q.info("abc82",t,t.labelType);let h=c.getBBox(),d=h;if(i){const u=c.children[0],g=ct(c);h=u.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const u=ct(c).select("text").node();u&&typeof u.getBBox=="function"&&(d=u.getBBox())}a.attr("transform",bi(d,i)),fs.set(t.id,s),t.width=h.width,t.height=h.height;let f;if(t.startLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await rr(g,t.startLabelLeft,ki(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const C=m.children[0],b=ct(m);y=C.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",bi(y,i)),Yt.get(t.id)||Yt.set(t.id,{}),Yt.get(t.id).startLeft=u,Ai(f,t.startLabelLeft)}if(t.startLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await rr(g,t.startLabelRight,ki(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const C=m.children[0],b=ct(m);y=C.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",bi(y,i)),Yt.get(t.id)||Yt.set(t.id,{}),Yt.get(t.id).startRight=u,Ai(f,t.startLabelRight)}if(t.endLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await rr(u,t.endLabelLeft,ki(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const C=m.children[0],b=ct(m);y=C.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",bi(y,i)),Yt.get(t.id)||Yt.set(t.id,{}),Yt.get(t.id).endLeft=u,Ai(f,t.endLabelLeft)}if(t.endLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await rr(u,t.endLabelRight,ki(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const C=m.children[0],b=ct(m);y=C.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}g.attr("transform",bi(y,i)),Yt.get(t.id)||Yt.set(t.id,{}),Yt.get(t.id).endRight=u,Ai(f,t.endLabelRight)}return c},"insertEdgeLabel");function Ai(e,t){ee(Ct())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}p(Ai,"setTerminalWidth");var eS=p((e,t)=>{q.debug("Moving label abc88 ",e.id,e.label,fs.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=Ct(),{subGraphTitleTotalMargin:o}=el(i);if(e.label){const s=fs.get(e.id);let a=e.x,n=e.y;if(r){const l=ye.calcLabelPosition(r);q.debug("Moving label "+e.label+" from (",a,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(a=l.x,n=l.y)}s.attr("transform",`translate(${a}, ${n+o/2})`)}if(e.startLabelLeft){const s=Yt.get(e.id).startLeft;let a=e.x,n=e.y;if(r){const l=ye.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const s=Yt.get(e.id).startRight;let a=e.x,n=e.y;if(r){const l=ye.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const s=Yt.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const l=ye.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const s=Yt.get(e.id).endRight;let a=e.x,n=e.y;if(r){const l=ye.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),rS=p((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,o=Math.abs(i.x-r.x),s=Math.abs(i.y-r.y);return o<.001||s<.001?t:s>=o?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),iS=p((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),s=Math.abs(t.y-i),a=e.width/2,n=e.height/2;return o>=a||s>=n},"outsideNode"),oS=p((e,t,r)=>{q.debug(`intersection calc abc89: + outsidePoint: ${JSON.stringify(t)} + insidePoint : ${JSON.stringify(r)} + node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,o=e.y,s=Math.abs(i-r.x),a=e.width/2;let n=r.xMath.abs(i-t.x)*l){let d=r.y{q.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],o=!1;return e.forEach(s=>{if(q.info("abc88 checking point",s,t),!iS(t,s)&&!o){const a=oS(t,i,s);q.debug("abc88 inside",s,i,a),q.debug("abc88 intersection",a,t);let n=!1;r.forEach(l=>{n=n||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?q.warn("abc88 no intersect",a,r):r.push(a),o=!0}else q.warn("abc88 outside",s,i),i=s,o||r.push(s)}),q.debug("returning points",r),r},"cutPathAtIntersect");function Yg(e){const t=[],r=[];for(let i=1;i5&&Math.abs(s.y-o.y)>5||o.y===s.y&&s.x===a.x&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-a.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}p(Yg,"extractCornerPoints");var Cc=p(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o),a=r/s;return{x:t.x-a*i,y:t.y-a*o}},"findAdjacentPoint"),sS=p(function(e){const{cornerPointPositions:t}=Yg(e),r=[];for(let i=0;i10&&Math.abs(s.y-o.y)>=10){q.debug("Corner point fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));const u=5;a.x===n.x?f={x:c<0?n.x-u+d:n.x+u-d,y:h<0?n.y-d:n.y+d}:f={x:c<0?n.x-d:n.x+d,y:h<0?n.y-u+d:n.y+u-d}}else q.debug("Corner point skipping fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));r.push(f,l)}else r.push(e[i]);return r},"fixCorners"),aS=p((e,t,r)=>{const i=e-t-r,o=2,s=2,a=o+s,n=Math.floor(i/a),l=Array(n).fill(`${o} ${s}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),nS=p(function(e,t,r,i,o,s,a,n=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:c}=Ct();let h=t.points,d=!1;const f=o;var u=s;const g=[];for(const M in t.cssCompiledStyles)Bf(M)||g.push(t.cssCompiledStyles[M]);if(c==="swimlane"){if(u.intersect&&f.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[f.intersect(h[0]),u.intersect(h[1])];else{const M=h.slice(1,-1),H=M[0],Y=M[M.length-1],G=.5,lt=Math.abs(h[h.length-1].x-Y.x)!Number.isNaN(M.y));const C=JT(t.curve);C!=="rounded"&&(y=sS(y));let b=Oi;switch(C){case"linear":b=Oi;break;case"basis":b=Oa;break;case"cardinal":b=Fd;break;case"bumpX":b=Sd;break;case"bumpY":b=_d;break;case"catmullRom":b=Ed;break;case"monotoneX":b=Pd;break;case"monotoneY":b=Rd;break;case"natural":b=qd;break;case"step":b=Wd;break;case"stepAfter":b=Hd;break;case"stepBefore":b=zd;break;case"rounded":b=Oi;break;default:b=Oa}const{x:k,y:T}=VT(t),S=Ik().x(k).y(T).curve(b);let _;switch(t.thickness){case"normal":_="edge-thickness-normal";break;case"thick":_="edge-thickness-thick";break;case"invisible":_="edge-thickness-invisible";break;default:_="edge-thickness-normal"}switch(t.pattern){case"solid":_+=" edge-pattern-solid";break;case"dotted":_+=" edge-pattern-dotted";break;case"dashed":_+=" edge-pattern-dashed";break;default:_+=" edge-pattern-solid"}let L,v=C==="rounded"?Ug(jg(y,t),5):S(y);const N=Array.isArray(t.style)?t.style:[t.style];let R=N.find(M=>M?.startsWith("stroke:")),P="";t.animate&&(P="edge-animation-fast"),t.animation&&(P="edge-animation-"+t.animation);let z=!1;if(t.look==="handDrawn"){const M=Z.svg(e);Object.assign([],y);const H=M.path(v,{roughness:.3,seed:l});_+=" transition",L=ct(H).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+_+(t.classes?" "+t.classes:"")+(P?" "+P:"")).attr("style",N?N.reduce((G,lt)=>G+";"+lt,""):"");let Y=L.attr("d");L.attr("d",Y),e.node().appendChild(L.node())}else{const M=g.join(";"),H=N?N.reduce((bt,et)=>bt+et+";",""):"",Y=(M?M+";"+H+";":H)+";"+(N?N.reduce((bt,et)=>bt+";"+et,""):"");L=e.append("path").attr("d",v).attr("id",`${a}-${t.id}`).attr("class"," "+_+(t.classes?" "+t.classes:"")+(P?" "+P:"")).attr("style",Y),R=Y.match(/stroke:([^;]+)/)?.[1],z=t.animate===!0||!!t.animation||M.includes("animation");const G=L.node(),lt=typeof G.getTotalLength=="function"?G.getTotalLength():0,ht=gc[t.arrowTypeStart]||0,dt=gc[t.arrowTypeEnd]||0;if(t.look==="neo"&&!z){const et=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?aS(lt,ht,dt):`0 ${ht} ${lt-ht-dt} ${dt}`}; stroke-dashoffset: 0;`;L.attr("style",et+L.attr("style"))}}L.attr("data-edge",!0),L.attr("data-et","edge"),L.attr("data-id",t.id),L.attr("data-points",m),L.attr("data-look",qt(t.look)),t.showPoints&&y.forEach(M=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",M.x).attr("cy",M.y)});let W="";(Ct().flowchart.arrowMarkerAbsolute||Ct().state.arrowMarkerAbsolute)&&(W=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,W=W.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),q.info("arrowTypeStart",t.arrowTypeStart),q.info("arrowTypeEnd",t.arrowTypeEnd);const $=!z&&t?.look==="neo";ZT(L,t,W,a,i,$,R);const A=Math.floor(h.length/2),F=h[A];ye.isLabelCoordinateInPath(F,L.attr("d"))||(d=!0);let D={};return d&&(D.updatedPath=h),D.originalPath=t.points,D},"insertEdge");function Ug(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let s=0;s({...o}));if(e.length>=2&&Xt[t.arrowTypeStart]){const o=Xt[t.arrowTypeStart],s=e[0],a=e[1],{angle:n}=dn(s,a),l=o*Math.cos(n),c=o*Math.sin(n);r[0].x=s.x+l,r[0].y=s.y+c}const i=e.length;if(i>=2&&Xt[t.arrowTypeEnd]){const o=Xt[t.arrowTypeEnd],s=e[i-1],a=e[i-2],{angle:n}=dn(a,s),l=o*Math.cos(n),c=o*Math.sin(n);r[i-1].x=s.x-l,r[i-1].y=s.y-c}return r}p(jg,"applyMarkerOffsetsToPoints");var lS=p((e,t,r,i)=>{t.forEach(o=>{ES[o](e,r,i)})},"insertMarkers"),hS=p((e,t,r)=>{q.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),cS=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),dS=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),uS=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),fS=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),pS=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),gS=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),mS=p((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),yS=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),CS=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{transitionColor:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${s}`)},"barbNeo"),xS=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),bS=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),o.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),kS=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),wS=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),o.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),TS=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${s}`)},"only_one_neo"),SS=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${s}`)},"zero_or_one_neo"),_S=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${s}`)},"one_or_more_neo"),BS=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${s}`)},"zero_or_more_neo"),vS=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 + L20,10 + M20,10 + L0,20`)},"requirement_arrow"),LS=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${s}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 + L20,10 + M20,10 + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),FS=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),AS=p((e,t,r)=>{const i=vt(),{themeVariables:o}=i,{strokeWidth:s}=o,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${s}`)},"requirement_contains_neo"),ES={extension:hS,composition:cS,aggregation:dS,dependency:uS,lollipop:fS,point:pS,circle:gS,cross:mS,barb:yS,barbNeo:CS,only_one:xS,zero_or_one:bS,one_or_more:kS,zero_or_more:wS,only_one_neo:TS,zero_or_one_neo:SS,one_or_more_neo:_S,zero_or_more_neo:BS,requirement_arrow:vS,requirement_contains:FS,requirement_arrow_neo:LS,requirement_contains_neo:AS},MS=lS,$S={common:Zi,getConfig:vt,insertCluster:LT,insertEdge:nS,insertEdgeLabel:tS,insertMarkers:MS,insertNode:Hg,interpolateToCurve:Vn,labelHelper:it,log:q,positionEdgeLabel:eS},Gi={},Gg=p(e=>{for(const t of e)Gi[t.name]=t},"registerLayoutLoaders"),OS=p(()=>{Gg([{name:"dagre",loader:p(async()=>await nt(()=>import("./dagre-VKFMJZFB-G1--45o_.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])),"loader")},{name:"swimlane",loader:p(async()=>await nt(()=>import("./swimlanes-5IMT3BWC-DiBNZxJI.js"),__vite__mapDeps([8,5,6,1,2,3,7])),"loader")},{name:"cose-bilkent",loader:p(async()=>await nt(()=>import("./cose-bilkent-JH36ORCC-DzQyBzbl.js"),__vite__mapDeps([9,10,7,5,6])),"loader")}])},"registerDefaultLayoutLoaders");OS();var GL=p(async(e,t,r)=>{if(!(e.layoutAlgorithm in Gi))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const d of e.nodes){const f=d.domId||d.id;d.domId=`${e.diagramId}-${f}`}const i=Gi[e.layoutAlgorithm],o=await i.loader(),{theme:s,themeVariables:a}=e.config,{useGradient:n,gradientStart:l,gradientStop:c}=a,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),n){const d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return o.render(e,t,$S,{algorithm:i.algorithm},r)},"render"),XL=p((e="",{fallback:t="dagre"}={})=>{if(e in Gi)return e;if(t in Gi)return q.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),ml="comm",Xg="rule",Vg="decl",IS="@media",DS="@import",PS="@supports",RS="@namespace",un="@keyframes",Zg="@layer",NS="@scope",qS=Math.abs,Di=String.fromCharCode;function Kg(e){return e.trim()}function fn(e,t,r){return e.replace(t,r)}function Zr(e,t){return e.charCodeAt(t)|0}function ii(e,t,r){return e.slice(t,r)}function Fe(e){return e.length}function Qg(e){return e.length}function To(e,t){return t.push(e),e}var Es=1,oi=1,Jg=0,ce=0,$t=0,ni="";function yl(e,t,r,i,o,s,a,n){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:Es,column:oi,length:a,return:"",siblings:n}}function WS(){return $t}function zS(){return $t=ce>0?Zr(ni,--ce):0,oi--,$t===10&&(oi=1,Es--),$t}function xe(){return $t=ce2||Xi($t)>3?"":" "}function jS(e,t){for(;--t&&xe()&&!($t<48||$t>102||$t>57&&$t<65||$t>70&&$t<97););return Ms(e,Do()+(t<6&&ir()==32&&xe()==32))}function pn(e){for(;xe();)switch($t){case e:return ce;case 34:case 39:e!==34&&e!==39&&pn($t);break;case 40:e===41&&pn(e);break;case 92:xe();break}return ce}function GS(e,t){for(;xe()&&e+$t!==57;)if(e+$t===84&&ir()===47)break;return"/*"+Ms(t,ce-1)+"*"+Di(e===47?e:xe())}function XS(e){for(;!Xi(ir());)xe();return Ms(e,ce)}function VS(e){return YS(Po("",null,null,null,[""],e=HS(e),0,[0],e))}function Po(e,t,r,i,o,s,a,n,l){for(var c=0,h=0,d=a,f=0,u=0,g=0,m=1,y=1,C=1,b=0,k=0,T="",S=o,_=s,L=i,v=T;y;)switch(g=k,k=xe()){case 40:g!=108&&Zr(v,d-1)==58?(b++,v+="("):v+=ga(k);break;case 41:b--,v+=")";break;case 34:case 39:case 91:v+=ga(k);break;case 9:case 10:case 13:case 32:if(b>0){v+=Di(k);break}v+=US(g);break;case 92:v+=jS(Do()-1,7);continue;case 47:switch(ir()){case 42:case 47:To(ZS(GS(xe(),Do()),t,r,l),l),(Xi(g||1)==5||Xi(ir()||1)==5)&&Fe(v)&&ii(v,-1,void 0)!==" "&&(v+=" ");break;default:v+="/"}break;case 123*m:n[c++]=Fe(v)*C;case 125*m:case 59:case 0:if(b>0&&k){v+=Di(k);break}switch(k){case 0:case 125:y=0;case 59+h:C==-1&&(v=fn(v,/\f/g,"")),u>0&&(Fe(v)-d||m===0)&&To(u>32?bc(v+";",i,r,d-1,l):bc(fn(v," ","")+";",i,r,d-2,l),l);break;case 59:v+=";";default:if(To(L=xc(v,t,r,c,h,o,n,T,S=[],_=[],d,s),s),k===123)if(h===0)Po(v,t,L,L,S,s,d,n,_);else{switch(f){case 99:if(Zr(v,3)===110)break;case 108:if(Zr(v,2)===97)break;default:h=0;case 100:case 109:case 115:}h?Po(e,L,L,i&&To(xc(e,L,L,0,0,o,n,T,o,S=[],d,_),_),o,_,d,n,i?S:_):Po(v,L,L,L,[""],_,0,n,_)}}c=h=u=0,m=C=1,T=v="",d=a;break;case 58:d=1+Fe(v),u=g;default:if(m<1){if(k==123)--m;else if(k==125&&m++==0&&zS()==125)continue}switch(v+=Di(k),k*m){case 38:C=h>0?1:(v+="\f",-1);break;case 44:if(b>0)break;n[c++]=(Fe(v)-1)*C,C=1;break;case 64:ir()===45&&(v+=ga(xe())),f=ir(),h=d=Fe(T=v+=XS(Do())),k++;break;case 45:g===45&&Fe(v)==2&&(m=0)}}return s}function xc(e,t,r,i,o,s,a,n,l,c,h,d){for(var f=o-1,u=o===0?s:[""],g=Qg(u),m=0,y=0,C=0;m0?u[b]+" "+k:fn(k,/&\f/g,u[b])))&&(l[C++]=T);return yl(e,t,r,o===0?Xg:n,l,c,h,d)}function ZS(e,t,r,i){return yl(e,t,r,ml,Di(WS()),ii(e,2,-2),0,i)}function bc(e,t,r,i,o){return yl(e,t,r,Vg,ii(e,0,i),ii(e,i+1,-1),i,o)}function gn(e,t){for(var r="",i=0;i/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),t_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./c4Diagram-LMCZKHZV-BAAq1RMs.js");return{diagram:t}},__vite__mapDeps([11,12,5,6,7]));return{id:tm,diagram:e}},"loader"),e_={id:tm,detector:JS,loader:t_},r_=e_,em="flowchart",i_=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),o_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./flowDiagram-23GEKE2U-eOlMNTnl.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17]));return{id:em,diagram:e}},"loader"),s_={id:em,detector:i_,loader:o_},a_=s_,rm="flowchart-v2",n_=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),l_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./flowDiagram-23GEKE2U-eOlMNTnl.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17]));return{id:rm,diagram:e}},"loader"),h_={id:rm,detector:n_,loader:l_},c_=h_,im="swimlane",d_=p(e=>/^\s*swimlane-beta\b/.test(e),"detector"),u_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./swimlanesDiagram-G3AALYLV-KUKTzqZ9.js");return{diagram:t}},__vite__mapDeps([18,13,14,15,16,12,17,5,6,7]));return{id:im,diagram:e}},"loader"),f_={id:im,detector:d_,loader:u_},p_=f_,om="er",g_=p(e=>/^\s*erDiagram/.test(e),"detector"),m_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./erDiagram-Q63AITRT-DPLVpHbv.js");return{diagram:t}},__vite__mapDeps([19,15,16,17,5,6,7]));return{id:om,diagram:e}},"loader"),y_={id:om,detector:g_,loader:m_},C_=y_,sm="gitGraph",x_=p(e=>/^\s*gitGraph/.test(e),"detector"),b_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./gitGraphDiagram-IHSO6WYX-B9_pldp9.js");return{diagram:t}},__vite__mapDeps([20,21,22,23,5,6,7]));return{id:sm,diagram:e}},"loader"),k_={id:sm,detector:x_,loader:b_},w_=k_,am="gantt",T_=p(e=>/^\s*gantt/.test(e),"detector"),S_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./ganttDiagram-NO4QXBWP-D1u5oYVA.js");return{diagram:t}},__vite__mapDeps([24,7,25,26,27,5,6]));return{id:am,diagram:e}},"loader"),__={id:am,detector:T_,loader:S_},B_=__,nm="info",v_=p(e=>/^\s*info/.test(e),"detector"),L_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./infoDiagram-FWYZ7A6U-CWqulOA1.js");return{diagram:t}},__vite__mapDeps([28,23,5,6,7]));return{id:nm,diagram:e}},"loader"),F_={id:nm,detector:v_,loader:L_},lm="pie",A_=p(e=>/^\s*pie/.test(e),"detector"),E_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./pieDiagram-ENE6RG2P-DLM5siGM.js");return{diagram:t}},__vite__mapDeps([29,22,23,5,6,30,31,26,7]));return{id:lm,diagram:e}},"loader"),M_={id:lm,detector:A_,loader:E_},hm="quadrantChart",$_=p(e=>/^\s*quadrantChart/.test(e),"detector"),O_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./quadrantDiagram-ABIIQ3AL-BccwcHoh.js");return{diagram:t}},__vite__mapDeps([32,25,26,27,5,6,7]));return{id:hm,diagram:e}},"loader"),I_={id:hm,detector:$_,loader:O_},D_=I_,cm="xychart",P_=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),R_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./xychartDiagram-FW5EYKEG-BfzaJ_HB.js");return{diagram:t}},__vite__mapDeps([33,26,31,25,27,5,6,7]));return{id:cm,diagram:e}},"loader"),N_={id:cm,detector:P_,loader:R_},q_=N_,dm="requirement",W_=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),z_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./requirementDiagram-TGXJPOKE-C-K62wRK.js");return{diagram:t}},__vite__mapDeps([34,15,16,5,6,7]));return{id:dm,diagram:e}},"loader"),H_={id:dm,detector:W_,loader:z_},Y_=H_,um="sequence",U_=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),j_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./sequenceDiagram-DBY2YBRQ-CY9lM-aK.js");return{diagram:t}},__vite__mapDeps([35,21,12,5,6,7]));return{id:um,diagram:e}},"loader"),G_={id:um,detector:U_,loader:j_},X_=G_,fm="class",V_=p((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),Z_=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./classDiagram-OUVF2IWQ-DLwxkoRX.js");return{diagram:t}},__vite__mapDeps([36,37,14,15,16,12,5,6,7]));return{id:fm,diagram:e}},"loader"),K_={id:fm,detector:V_,loader:Z_},Q_=K_,pm="classDiagram",J_=p((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),tB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./classDiagram-v2-EOCWNBFH-DLwxkoRX.js");return{diagram:t}},__vite__mapDeps([38,37,14,15,16,12,5,6,7]));return{id:pm,diagram:e}},"loader"),eB={id:pm,detector:J_,loader:tB},rB=eB,gm="state",iB=p((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),oB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./stateDiagram-2N3HPSRC-DOjvRzn-.js");return{diagram:t}},__vite__mapDeps([39,40,15,16,12,2,4,3,5,6,7]));return{id:gm,diagram:e}},"loader"),sB={id:gm,detector:iB,loader:oB},aB=sB,mm="stateDiagram",nB=p((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),lB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./stateDiagram-v2-6OUMAXLB-CZ3zMFoy.js");return{diagram:t}},__vite__mapDeps([41,40,15,16,12,5,6,7]));return{id:mm,diagram:e}},"loader"),hB={id:mm,detector:nB,loader:lB},cB=hB,ym="journey",dB=p(e=>/^\s*journey/.test(e),"detector"),uB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./journeyDiagram-5HDEW3XC-ddCIBdL-.js");return{diagram:t}},__vite__mapDeps([42,14,12,30,5,6,7]));return{id:ym,diagram:e}},"loader"),fB={id:ym,detector:dB,loader:uB},pB=fB,gB=p((e,t,r)=>{q.debug(`rendering svg for syntax error +`);const i=Yk(t),o=i.append("g");i.attr("viewBox","0 0 2412 512"),Gc(i,100,512,!0),o.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),o.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),o.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),o.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),o.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),o.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),o.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),Cm={draw:gB},mB=Cm,yB={db:{},renderer:Cm,parser:{parse:p(()=>{},"parse")}},CB=yB,xm="flowchart-elk",xB=p((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),bB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./flowDiagram-23GEKE2U-eOlMNTnl.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17]));return{id:xm,diagram:e}},"loader"),kB={id:xm,detector:xB,loader:bB},wB=kB,bm="timeline",TB=p(e=>/^\s*timeline/.test(e),"detector"),SB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./timeline-definition-FHXFAJF6-CkZhvGjX.js");return{diagram:t}},__vite__mapDeps([43,30,5,6,7]));return{id:bm,diagram:e}},"loader"),_B={id:bm,detector:TB,loader:SB},BB=_B,km="mindmap",vB=p(e=>/^\s*mindmap/.test(e),"detector"),LB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./mindmap-definition-LN4V7U3C-D4XmHVCu.js");return{diagram:t}},__vite__mapDeps([44,15,16,5,6,7]));return{id:km,diagram:e}},"loader"),FB={id:km,detector:vB,loader:LB},AB=FB,wm="kanban",EB=p(e=>/^\s*kanban/.test(e),"detector"),MB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./kanban-definition-HUTT4EX6-Bwd-QNyL.js");return{diagram:t}},__vite__mapDeps([45,14,5,6,7]));return{id:wm,diagram:e}},"loader"),$B={id:wm,detector:EB,loader:MB},OB=$B,Tm="sankey",IB=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),DB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./sankeyDiagram-HTMAVEWB-DvJqr3-o.js");return{diagram:t}},__vite__mapDeps([46,31,26,5,6,7]));return{id:Tm,diagram:e}},"loader"),PB={id:Tm,detector:IB,loader:DB},RB=PB,Sm="packet",NB=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),qB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./diagram-NH7WQ7WH-D0p601mB.js");return{diagram:t}},__vite__mapDeps([47,22,23,5,6,7]));return{id:Sm,diagram:e}},"loader"),WB={id:Sm,detector:NB,loader:qB},_m="radar",zB=p(e=>/^\s*radar-beta/.test(e),"detector"),HB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./diagram-WEI45ONY-DKRP3hVn.js");return{diagram:t}},__vite__mapDeps([48,22,23,5,6,7]));return{id:_m,diagram:e}},"loader"),YB={id:_m,detector:zB,loader:HB},Bm="block",UB=p(e=>/^\s*block(-beta)?/.test(e),"detector"),jB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./blockDiagram-677ZJIJ3-fPyJR28f.js");return{diagram:t}},__vite__mapDeps([49,14,2,17,5,6,7]));return{id:Bm,diagram:e}},"loader"),GB={id:Bm,detector:UB,loader:jB},XB=GB,vm="treeView",VB=p(e=>/^\s*treeView-beta/.test(e),"detector"),ZB=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./diagram-OA4YK3LP-BLpvk7p_.js");return{diagram:t}},__vite__mapDeps([50,21,22,23,5,6,7]));return{id:vm,diagram:e}},"loader"),KB={id:vm,detector:VB,loader:ZB},QB=KB,Lm="architecture",JB=p(e=>/^\s*architecture/.test(e),"detector"),tv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./architectureDiagram-ZJ3FMSHR-DGsFEfiM.js");return{diagram:t}},__vite__mapDeps([51,22,23,5,6,10,7]));return{id:Lm,diagram:e}},"loader"),ev={id:Lm,detector:JB,loader:tv},rv=ev,Fm="eventmodeling",iv=p(e=>/^\s*eventmodeling/.test(e),"detector"),ov=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./diagram-FQU43EPY-DlPR1W9u.js");return{diagram:t}},__vite__mapDeps([52,22,23,5,6,7]));return{id:Fm,diagram:e}},"loader"),sv={id:Fm,detector:iv,loader:ov},av=sv,Am="ishikawa",nv=p(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),lv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./ishikawaDiagram-FXEZZL3T-BGN-K46K.js");return{diagram:t}},__vite__mapDeps([53,5,6,7]));return{id:Am,diagram:e}},"loader"),hv={id:Am,detector:nv,loader:lv},Em="venn",cv=p(e=>/^\s*venn-beta/.test(e),"detector"),dv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./vennDiagram-L72KCM5P-BSODO45Y.js");return{diagram:t}},__vite__mapDeps([54,5,6,7]));return{id:Em,diagram:e}},"loader"),uv={id:Em,detector:cv,loader:dv},fv=uv,Mm="treemap",pv=p(e=>/^\s*treemap/.test(e),"detector"),gv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./diagram-G47NLZAW-Bj3iAwJq.js");return{diagram:t}},__vite__mapDeps([55,22,16,23,5,6,27,31,26,7]));return{id:Mm,diagram:e}},"loader"),mv={id:Mm,detector:pv,loader:gv},$m="wardley",yv=p(e=>/^\s*wardley-beta/i.test(e),"detector"),Cv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./wardleyDiagram-EHGQE667-DZMFMBx5.js");return{diagram:t}},__vite__mapDeps([56,22,23,5,6,7]));return{id:$m,diagram:e}},"loader"),xv={id:$m,detector:yv,loader:Cv},bv=xv,Om="cynefin",kv=p(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),wv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./cynefinDiagram-TSTJHNR4-DLqJ7d9z.js");return{diagram:t}},__vite__mapDeps([57,22,23,5,6,7]));return{id:Om,diagram:e}},"loader"),Tv={id:Om,detector:kv,loader:wv},Im="railroad",Sv=p(e=>/^\s*railroad-beta/i.test(e),"detector"),_v=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./railroadDiagram-RFXS5EU6-DNsbCVtY.js");return{diagram:t}},__vite__mapDeps([58,59,22,23,5,6,7]));return{id:Im,diagram:e}},"loader"),Bv={id:Im,detector:Sv,loader:_v},Dm="railroadEbnf",vv=p(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),Lv=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./ebnfDiagram-CCIWWBDH-CdaRbvzq.js");return{diagram:t}},__vite__mapDeps([60,59,22,23,5,6,7]));return{id:Dm,diagram:e}},"loader"),Fv={id:Dm,detector:vv,loader:Lv},Pm="railroadAbnf",Av=p(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),Ev=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./abnfDiagram-VRR7QNED-C6R_sAbc.js");return{diagram:t}},__vite__mapDeps([61,59,22,23,5,6,7]));return{id:Pm,diagram:e}},"loader"),Mv={id:Pm,detector:Av,loader:Ev},Rm="railroadPeg",$v=p(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),Ov=p(async()=>{const{diagram:e}=await nt(async()=>{const{diagram:t}=await import("./pegDiagram-2B236MQR-B81as5U1.js");return{diagram:t}},__vite__mapDeps([62,59,22,23,5,6,7]));return{id:Rm,diagram:e}},"loader"),Iv={id:Rm,detector:$v,loader:Ov},kc=!1,$s=p(()=>{kc||(kc=!0,zo("error",CB,e=>e.toLowerCase().trim()==="error"),zo("---",{db:{clear:p(()=>{},"clear")},styles:{},renderer:{draw:p(()=>{},"draw")},parser:{parse:p(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:p(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),ba(wB,AB,rv),ba(r_,OB,rB,Q_,C_,B_,F_,M_,Y_,X_,p_,c_,a_,BB,w_,cB,aB,pB,D_,RB,WB,q_,XB,av,QB,YB,hv,mv,Bv,Fv,Mv,Iv,fv,bv,Tv))},"addDiagrams"),Dv=p(async()=>{q.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Sr).map(async([r,{detector:i,loader:o}])=>{if(o)try{Sa(r)}catch{try{const{diagram:s,id:a}=await o();zo(a,s,i)}catch(s){throw q.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Sr[r],s}}}))).filter(r=>r.status==="rejected");if(t.length>0){q.error(`Failed to load ${t.length} external diagrams`);for(const r of t)q.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),Pv="graphics-document document";function Nm(e,t){e.attr("role",Pv),t!==""&&e.attr("aria-roledescription",t)}p(Nm,"setA11yDiagramInfo");function qm(e,t,r,i){if(e.insert!==void 0){if(r){const o=`chart-desc-${i}`;e.attr("aria-describedby",o),e.insert("desc",":first-child").attr("id",o).text(r)}if(t){const o=`chart-title-${i}`;e.attr("aria-labelledby",o),e.insert("title",":first-child").attr("id",o).text(t)}}}p(qm,"addSVGa11yTitleDescription");var mn=class Wm{constructor(t,r,i,o,s){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=s}static{p(this,"Diagram")}static async fromText(t,r={}){const i=vt(),o=xn(t,i);t=Z2(t)+` +`;try{Sa(o)}catch{const c=R0(o);if(!c)throw new Wc(`Diagram ${o} not found.`);const{id:h,diagram:d}=await c();zo(h,d)}const{db:s,parser:a,renderer:n,init:l}=Sa(o);return a.parser&&(a.parser.yy=s),s.clear?.(),l?.(i),r.title&&s.setDiagramTitle?.(r.title),await a.parse(t),new Wm(o,t,s,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},wc=[],Rv=p(()=>{wc.forEach(e=>{e()}),wc=[]},"attachFunctions"),Nv=p(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function zm(e){const t=e.match(qc);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(` +`).map(a=>a.startsWith(r)?a.slice(r.length):a).join(` +`):t[2];let o=K1(i,{schema:Z1})??{};o=typeof o=="object"&&!Array.isArray(o)?o:{};const s={};return o.displayMode&&(s.displayMode=o.displayMode.toString()),o.title&&(s.title=o.title.toString()),o.config&&(s.config=o.config),{text:e.slice(t[0].length),metadata:s}}p(zm,"extractFrontMatter");var qv=p(e=>e.replace(/\r\n?/g,` +`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),Wv=p(e=>{const{text:t,metadata:r}=zm(e),{displayMode:i,title:o,config:s={}}=r;return i&&(s.gantt||(s.gantt={}),s.gantt.displayMode=i),{title:o,config:s,text:t}},"processFrontmatter"),zv=p(e=>{const t=ye.detectInit(e)??{},r=ye.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:P2(e),directive:t}},"processDirectives");function Cl(e){const t=qv(e),r=Wv(t),i=zv(r.text),o=tl(r.config,i.directive);return e=Nv(i.text),{code:e,title:r.title,config:o}}p(Cl,"preprocessDiagram");function Hm(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}p(Hm,"toBase64");var Hv=5e4,Yv="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",Uv="sandbox",jv="loose",Gv="http://www.w3.org/2000/svg",Xv="http://www.w3.org/1999/xlink",Vv="http://www.w3.org/1999/xhtml",Zv="100%",Kv="100%",Qv="border:0;margin:0;",Jv="margin:0",tL="allow-top-navigation-by-user-activation allow-popups",eL='The "iframe" tag is not supported by your browser.',rL=["foreignobject"],iL=["dominant-baseline"];function xl(e){const t=Cl(e);return qo(),I0(t.config??{}),t}p(xl,"processAndSetConfigs");async function Ym(e,t){$s();try{const{code:r,config:i}=xl(e);return{diagramType:(await jm(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}p(Ym,"parse");var Tc=p((e,t,r=[])=>{const i=Oc(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),oL=p((e,t=new Map)=>{const r=new CSSStyleSheet;if(e.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),e.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){const n=ee(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{Dh(l.styles)||n.forEach(c=>{r.insertRule(Tc(l.id,c,l.styles),r.cssRules.length)}),Dh(l.textStyles)||r.insertRule(Tc(l.id,"tspan",(l?.textStyles||[]).map(c=>c.replace("color","fill"))),r.cssRules.length)})}let i="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const o=new CSSStyleSheet;o.replaceSync(e.themeCSS),i=Ta(o)+` +`}else i+=`${e.themeCSS} +`;return i+Ta(r)},"createCssStyles"),sL=p((e,t)=>gn(VS(`${e}{${t}}`),QS([p(function(i,o,s,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===un)return;i.props=i.props.map(n=>n.startsWith(e)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[IS,PS,Zg,NS,"@container","@starting-style"],un].includes(i.type)||(q.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=ml))},"addNamespace"),KS])),"compileCSS"),aL=p((e,t,r,i)=>{const o=oL(e,r),s=rC(t,o,{...e.themeVariables,theme:e.theme,look:e.look},i);return sL(i,s)},"createUserStyles"),nL=p((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=vr(i),i=i.replace(/
      /g,"
      "),i},"cleanUpSvgCode"),lL=p((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":Kv,i=Hm(`${e}`);return``},"putIntoIFrame"),Sc=p((e,t,r,i,o)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const a=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",Gv);return o&&a.attr("xmlns:xlink",o),a.append("g"),e},"appendDivSvgG");function yn(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}p(yn,"sandboxedIframe");var hL=p((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),cL=p(async function(e,t,r){$s();const i=xl(t);t=i.code;const o=vt();q.debug(o),t.length>(o?.maxTextSize??Hv)&&(t=Yv);const s=`#${e}`,a="i"+e,n="#"+a,l="d"+e,c="#"+l,h=p(()=>{const W=ct(f?n:c).node();W&&"remove"in W&&W.remove()},"removeTempElements");let d=ct(document.body);const f=o.securityLevel===Uv,u=o.securityLevel===jv,g=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const z=yn(ct(r),a);d=ct(z.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=ct(r);Sc(d,e,l,`font-family: ${g}`,Xv)}else{if(hL(document,e,l,a),f){const z=yn(ct(document.body),a);d=ct(z.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=ct("body");Sc(d,e,l)}let m,y;try{m=await mn.fromText(t,{title:i.title})}catch(z){if(o.suppressErrorRendering)throw h(),z;m=await mn.fromText("error"),y=z}const C=d.select(c).node(),b=m.type,k=C.firstChild,T=k.firstChild,S=m.renderer.getClasses?.(t,m),_=aL(o,b,S,s),L=document.createElement("style");L.innerHTML=_,k.insertBefore(L,T);try{await m.renderer.draw(t,e,"11.16.0",m)}catch(z){throw o.suppressErrorRendering?h():mB.draw(t,e,"11.16.0"),z}const v=d.select(`${c} svg`),N=m.db.getAccTitle?.(),R=m.db.getAccDescription?.();Gm(b,v,N,R),d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",Vv);let P=d.select(c).node().innerHTML;if(q.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),P=nL(P,f,Ie(o.arrowMarkerAbsolute)),f){const z=d.select(c+" svg").node();P=lL(P,z)}else u||(P=Kr.sanitize(P,{ADD_TAGS:rL,ADD_ATTR:iL,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(Rv(),y)throw y;return h(),{diagramType:b,svg:P,bindFunctions:m.db.bindFunctions}},"render");function Um(e={}){const t=Dt({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),$0(t),t?.theme&&t.theme in He?t.themeVariables=He[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=He.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?M0(t):Ic();Cn(r.logLevel),$s()}p(Um,"initialize");var jm=p((e,t={})=>{const{code:r}=Cl(e);return mn.fromText(r,t)},"getDiagramFromText");function Gm(e,t,r,i){Nm(t,e),qm(t,r,i,t.attr("id"))}p(Gm,"addA11yInfo");var Fr=Object.freeze({render:cL,parse:Ym,getDiagramFromText:jm,initialize:Um,getConfig:vt,setConfig:Dc,getSiteConfig:Ic,updateSiteConfig:O0,reset:p(()=>{qo()},"reset"),globalReset:p(()=>{qo(Qr)},"globalReset"),defaultConfig:Qr});Cn(vt().logLevel);qo(vt());var dL=p((e,t,r)=>{q.warn(e),Jn(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),Xm=p(async function(e={querySelector:".mermaid"}){try{await uL(e)}catch(t){if(Jn(t)&&q.error(t.str),Ge.parseError&&Ge.parseError(t),!e.suppressErrors)throw q.error("Use the suppressErrors option to suppress these errors"),t}},"run"),uL=p(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=Fr.getConfig();q.debug(`${e?"":"No "}Callback function found`);let o;if(r)o=r;else if(t)o=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");q.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(q.debug("Start On Load: "+i?.startOnLoad),Fr.updateSiteConfig({startOnLoad:i?.startOnLoad}));const s=new ye.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const l of Array.from(o)){if(q.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;a=l.innerHTML,a=ip(ye.entityDecode(a)).trim().replace(//gi,"
      ");const h=ye.detectInit(a);h&&q.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await Qm(c,a,l);l.innerHTML=d,e&&await e(c),f&&f(l)}catch(d){dL(d,n,Ge.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),Vm=p(function(e){Fr.initialize(e)},"initialize"),fL=p(async function(e,t,r){q.warn("mermaid.init is deprecated. Please use run instead."),e&&Vm(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await Xm(i)},"init"),pL=p(async(e,{lazyLoad:t=!0}={})=>{$s(),ba(...e),t===!1&&await Dv()},"registerExternalDiagrams"),Zm=p(function(){if(Ge.startOnLoad){const{startOnLoad:e}=Fr.getConfig();e&&Ge.run().catch(t=>q.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",Zm,!1);var gL=p(function(e){Ge.parseError=e},"setParseErrorHandler"),ps=[],ma=!1,Km=p(async()=>{if(!ma){for(ma=!0;ps.length>0;){const e=ps.shift();if(e)try{await e()}catch(t){q.error("Error executing queue",t)}}ma=!1}},"executeQueue"),mL=p(async(e,t)=>new Promise((r,i)=>{const o=p(()=>new Promise((s,a)=>{Fr.parse(e,t).then(n=>{s(n),r(n)},n=>{q.error("Error parsing",n),Ge.parseError?.(n),a(n),i(n)})}),"performCall");ps.push(o),Km().catch(i)}),"parse"),Qm=p((e,t,r)=>new Promise((i,o)=>{const s=p(()=>new Promise((a,n)=>{Fr.render(e,t,r).then(l=>{a(l),i(l)},l=>{q.error("Error parsing",l),Ge.parseError?.(l),n(l),o(l)})}),"performCall");ps.push(s),Km().catch(o)}),"render"),yL=p(()=>Object.keys(Sr).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),Ge={startOnLoad:!0,mermaidAPI:Fr,parse:mL,render:Qm,init:fL,run:Xm,registerExternalDiagrams:pL,registerLayoutLoaders:Gg,initialize:Vm,parseError:void 0,contentLoaded:Zm,setParseErrorHandler:gL,detectType:xn,registerIconPacks:yw,getRegisteredDiagramsMetadata:yL},CL=Ge;/*! Check if previously processed *//*! + * Wait for document loaded before starting the execution + */const VL=Object.freeze(Object.defineProperty({__proto__:null,default:CL},Symbol.toStringTag,{value:"Module"}));export{AL as $,tl as A,$c as B,z2 as C,Yk as D,u0 as E,TL as F,K1 as G,Pi as H,wL as I,Z1 as J,Ss as K,U0 as L,jc as M,Vi as N,Ee as O,Ek as P,Mn as Q,LL as R,EL as S,Nr as T,at as U,_h as V,Sh as W,$L as X,ML as Y,$2 as Z,p as _,sC as a,Pe as a$,BL as a0,vL as a1,FL as a2,IL as a3,OL as a4,Kr as a5,sh as a6,Ik as a7,Oa as a8,W2 as a9,Gn as aA,Un as aB,Mo as aC,y2 as aD,m2 as aE,g2 as aF,p2 as aG,a2 as aH,Lf as aI,h2 as aJ,s2 as aK,u2 as aL,Ff as aM,l2 as aN,b2 as aO,x2 as aP,C2 as aQ,w2 as aR,k2 as aS,n2 as aT,Af as aU,f2 as aV,d2 as aW,c2 as aX,Ef as aY,VT as aZ,ee as a_,ke as aa,O as ab,I as ac,J0 as ad,Xc as ae,LT as af,Hg as ag,UL as ah,eo as ai,yw as aj,Qn as ak,Z as al,MS as am,YL as an,jL as ao,zL as ap,Q as aq,HL as ar,el as as,nS as at,eS as au,tS as av,fs as aw,Yt as ax,Xt as ay,rT as az,oC as b,bi as b0,Rf as b1,vr as b2,zf as b3,vc as b4,Mk as b5,kL as b6,mw as b7,SL as b8,Ln as b9,tr as ba,qi as bb,Ch as bc,db as bd,K as be,Bf as bf,se as bg,ob as bh,vn as bi,ld as bj,Qi as bk,dd as bl,_L as bm,by as bn,XT as bo,VL as bp,Ct as c,ct as d,Gc as e,Dt as f,nC as g,je as h,be as i,i2 as j,Zi as k,q as l,qf as m,lC as n,hC as o,iC as p,DL as q,or as r,aC as s,my as t,XL as u,GL as v,U2 as w,ye as x,vt as y,dC as z}; diff --git a/apps/kimi-code/dist-web/assets/mindmap-definition-LN4V7U3C-D4XmHVCu.js b/apps/kimi-code/dist-web/assets/mindmap-definition-LN4V7U3C-D4XmHVCu.js new file mode 100644 index 00000000000..caa6a47e19e --- /dev/null +++ b/apps/kimi-code/dist-web/assets/mindmap-definition-LN4V7U3C-D4XmHVCu.js @@ -0,0 +1,96 @@ +import{g as oe}from"./chunk-XXDRQBXY-D_bv9kM4.js";import{s as ae}from"./chunk-VR4S4FIN-C_RujyXt.js";import{_ as l,l as C,u as ce,v as le,y as he,B as G,c as B,i as F,b6 as de,aa as ge,ab as ue,ac as pe}from"./mermaid.core-WW7RuneT.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";const E=[];for(let e=0;e<256;++e)E.push((e+256).toString(16).slice(1));function fe(e,n=0){return(E[e[n+0]]+E[e[n+1]]+E[e[n+2]]+E[e[n+3]]+"-"+E[e[n+4]]+E[e[n+5]]+"-"+E[e[n+6]]+E[e[n+7]]+"-"+E[e[n+8]]+E[e[n+9]]+"-"+E[e[n+10]]+E[e[n+11]]+E[e[n+12]]+E[e[n+13]]+E[e[n+14]]+E[e[n+15]]).toLowerCase()}const me=new Uint8Array(16);function ye(){return crypto.getRandomValues(me)}function Ee(e,n,g){return crypto.randomUUID?crypto.randomUUID():_e(e)}function _e(e,n,g){e=e||{};const a=e.random??e.rng?.()??ye();if(a.length<16)throw new Error("Random bytes length must be >= 16");return a[6]=a[6]&15|64,a[8]=a[8]&63|128,fe(a)}var Y=(function(){var e=l(function(D,s,i,o){for(i=i||{},o=D.length;o--;i[D[o]]=s);return i},"o"),n=[1,4],g=[1,13],a=[1,12],t=[1,15],h=[1,16],f=[1,20],m=[1,19],_=[6,7,8],T=[1,26],I=[1,24],w=[1,25],d=[6,7,11],R=[1,6,13,15,16,19,22],q=[1,33],J=[1,34],A=[1,6,7,11,13,15,16,19,22],j={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:l(function(s,i,o,c,p,r,$){var u=r.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[u].id),c.addNode(r[u-1].length,r[u].id,r[u].descr,r[u].type);break;case 16:c.getLogger().trace("Icon: ",r[u]),c.decorateNode({icon:r[u]});break;case 17:case 21:c.decorateNode({class:r[u]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[u].id),c.addNode(0,r[u].id,r[u].descr,r[u].type);break;case 20:c.decorateNode({icon:r[u]});break;case 25:c.getLogger().trace("node found ..",r[u-2]),this.$={id:r[u-1],descr:r[u-1],type:c.getType(r[u-2],r[u])};break;case 26:this.$={id:r[u],descr:r[u],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[u-3]),this.$={id:r[u-3],descr:r[u-1],type:c.getType(r[u-2],r[u])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:g,7:[1,10],9:9,12:11,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},e(_,[2,3]),{1:[2,2]},e(_,[2,4]),e(_,[2,5]),{1:[2,6],6:g,12:21,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},{6:g,9:22,12:11,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},{6:T,7:I,10:23,11:w},e(d,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:f,22:m}),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),e(d,[2,21]),e(d,[2,23]),e(d,[2,24]),e(d,[2,26],{19:[1,30]}),{20:[1,31]},{6:T,7:I,10:32,11:w},{1:[2,7],6:g,12:21,13:a,14:14,15:t,16:h,17:17,18:18,19:f,22:m},e(R,[2,14],{7:q,11:J}),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(d,[2,15]),e(d,[2,16]),e(d,[2,17]),{20:[1,35]},{21:[1,36]},e(R,[2,13],{7:q,11:J}),e(A,[2,11]),e(A,[2,12]),{21:[1,37]},e(d,[2,25]),e(d,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:l(function(s){var i=this,o=[0],c=[],p=[null],r=[],$=this.table,u="",M=0,K=0,ne=2,Q=1,ie=r.slice.call(arguments,1),y=Object.create(this.lexer),L={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(L.yy[H]=this.yy[H]);y.setInput(s,L.yy),L.yy.lexer=y,L.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var W=y.yylloc;r.push(W);var se=y.options&&y.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function re(k){o.length=o.length-2*k,p.length=p.length-k,r.length=r.length-k}l(re,"popStack");function Z(){var k;return k=c.pop()||y.lex()||Q,typeof k!="number"&&(k instanceof Array&&(c=k,k=c.pop()),k=i.symbols_[k]||k),k}l(Z,"lex");for(var b,v,S,z,O={},U,x,ee,V;;){if(v=o[o.length-1],this.defaultActions[v]?S=this.defaultActions[v]:((b===null||typeof b>"u")&&(b=Z()),S=$[v]&&$[v][b]),typeof S>"u"||!S.length||!S[0]){var X="";V=[];for(U in $[v])this.terminals_[U]&&U>ne&&V.push("'"+this.terminals_[U]+"'");y.showPosition?X="Parse error on line "+(M+1)+`: +`+y.showPosition()+` +Expecting `+V.join(", ")+", got '"+(this.terminals_[b]||b)+"'":X="Parse error on line "+(M+1)+": Unexpected "+(b==Q?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(X,{text:y.match,token:this.terminals_[b]||b,line:y.yylineno,loc:W,expected:V})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+b);switch(S[0]){case 1:o.push(b),p.push(y.yytext),r.push(y.yylloc),o.push(S[1]),b=null,K=y.yyleng,u=y.yytext,M=y.yylineno,W=y.yylloc;break;case 2:if(x=this.productions_[S[1]][1],O.$=p[p.length-x],O._$={first_line:r[r.length-(x||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(x||1)].first_column,last_column:r[r.length-1].last_column},se&&(O._$.range=[r[r.length-(x||1)].range[0],r[r.length-1].range[1]]),z=this.performAction.apply(O,[u,K,M,L.yy,S[1],p,r].concat(ie)),typeof z<"u")return z;x&&(o=o.slice(0,-1*x*2),p=p.slice(0,-1*x),r=r.slice(0,-1*x)),o.push(this.productions_[S[1]][0]),p.push(O.$),r.push(O._$),ee=$[o[o.length-2]][o[o.length-1]],o.push(ee);break;case 3:return!0}}return!0},"parse")},te=(function(){var D={EOF:1,parseError:l(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:l(function(s,i){return this.yy=i||this.yy||{},this._input=s,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 s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var i=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=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===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-i]),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(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+` +`+i+"^"},"showPosition"),test_match:l(function(s,i){var o,c,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),c=s[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],o=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var r in p)this[r]=p[r];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,i,o,c;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),r=0;ri[0].length)){if(i=o,c=r,this.options.backtrack_lexer){if(s=this.test_match(o,p[r]),s!==!1)return s;if(this._backtrack){i=!1;continue}else return!1}else if(!this.options.flex)break}return i?(s=this.test_match(i,p[c]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var i=this.next();return i||this.lex()},"lex"),begin:l(function(i){this.conditionStack.push(i)},"begin"),popState:l(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:l(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:l(function(i){this.begin(i)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(i,o,c,p){switch(c){case 0:return i.getLogger().trace("Found comment",o.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:i.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return i.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:i.getLogger().trace("end icon"),this.popState();break;case 10:return i.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return i.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return i.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return i.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:i.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return i.getLogger().trace("description:",o.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),i.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),i.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),i.getLogger().trace("node end ...",o.yytext),"NODE_DEND";case 30:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 35:return i.getLogger().trace("Long description:",o.yytext),20;case 36:return i.getLogger().trace("Long description:",o.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return D})();j.lexer=te;function P(){this.yy={}}return l(P,"Parser"),P.prototype=j,j.Parser=P,new P})();Y.parser=Y;var be=Y,ke=12,N={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Se=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=N,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{l(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let n=this.nodes.length-1;n>=0;n--)if(this.nodes[n].level0?this.nodes[0]:null}addNode(e,n,g,a){C.info("addNode",e,n,g,a);let t=!1;this.nodes.length===0?(this.baseLevel=e,e=0,t=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,t=!1);const h=B();let f=h.mindmap?.padding??G.mindmap.padding;switch(a){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:f*=2;break}const m={id:this.count++,nodeId:F(n,h),level:e,descr:F(g,h),type:a,children:[],width:h.mindmap?.maxNodeWidth??G.mindmap.maxNodeWidth,padding:f,isRoot:t},_=this.getParent(e);if(_)_.children.push(m),this.nodes.push(m);else if(t)this.nodes.push(m);else throw new Error(`There can be only one root. No parent could be found for ("${m.descr}")`)}getType(e,n){switch(C.debug("In get type",e,n),e){case"[":return this.nodeType.RECT;case"(":return n===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,n){this.elements[e]=n}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const n=B(),g=this.nodes[this.nodes.length-1];e.icon&&(g.icon=F(e.icon,n)),e.class&&(g.class=F(e.class,n))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,n){if(e.level===0?e.section=void 0:e.section=n,e.children)for(const[g,a]of e.children.entries()){const t=e.level===0?g%(ke-1):n;this.assignSections(a,t)}}flattenNodes(e,n){const g=B(),a=["mindmap-node"];e.isRoot===!0?a.push("section-root","section--1"):e.section!==void 0&&a.push(`section-${e.section}`),e.class&&a.push(e.class);const t=a.join(" "),h=l(m=>{const T=(g.theme?.toLowerCase()??"").includes("redux");switch(m){case N.CIRCLE:return"mindmapCircle";case N.RECT:return"rect";case N.ROUNDED_RECT:return"rounded";case N.CLOUD:return"cloud";case N.BANG:return"bang";case N.HEXAGON:return"hexagon";case N.DEFAULT:return T?"rounded":"defaultMindmapNode";case N.NO_BORDER:default:return"rect"}},"getShapeFromType"),f={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:h(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:t,cssStyles:[],look:g.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(n.push(f),e.children)for(const m of e.children)this.flattenNodes(m,n)}generateEdges(e,n){if(!e.children)return;const g=B();for(const a of e.children){let t="edge";a.section!==void 0&&(t+=` section-edge-${a.section}`);const h=e.level+1;t+=` edge-depth-${h}`;const f={id:`edge_${e.id}_${a.id}`,start:e.id.toString(),end:a.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:g.look,classes:t,depth:e.level,section:a.section};n.push(f),this.generateEdges(a,n)}}getData(){const e=this.getMindmap(),n=B(),a=de().layout!==void 0,t=n;if(a||(t.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:t};C.debug("getData: mindmapRoot",e,n),this.assignSections(e);const h=[],f=[];this.flattenNodes(e,h),this.generateEdges(e,f),C.debug(`getData: processed ${h.length} nodes and ${f.length} edges`);const m=new Map;for(const _ of h)m.set(_.id,{shape:_.shape,width:_.width,height:_.height,padding:_.padding});return{nodes:h,edges:f,config:t,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(m),type:"mindmap",diagramId:"mindmap-"+Ee()}}getLogger(){return C}},xe=l(async(e,n,g,a)=>{C.debug(`Rendering mindmap diagram +`+e);const t=a.db,h=t.getData(),f=oe(n,h.config.securityLevel);if(h.type=a.type,h.layoutAlgorithm=ce(h.config.layout,{fallback:"cose-bilkent"}),h.diagramId=n,!t.getMindmap())return;h.nodes.forEach(d=>{d.shape==="rounded"?(d.radius=15,d.taper=15,d.stroke="none",d.width=0,d.padding=15):d.shape==="circle"?d.padding=10:d.shape==="rect"?(d.width=0,d.padding=10):d.shape==="hexagon"&&(d.width=0,d.height=0)}),await le(h,f);const{themeVariables:_}=he(),{useGradient:T,gradientStart:I,gradientStop:w}=_;if(T&&I&&w){const d=f.attr("id"),R=f.append("defs").append("linearGradient").attr("id",`${d}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");R.append("stop").attr("offset","0%").attr("stop-color",I).attr("stop-opacity",1),R.append("stop").attr("offset","100%").attr("stop-color",w).attr("stop-opacity",1)}ae(f,h.config.mindmap?.padding??G.mindmap.padding,"mindmapDiagram",h.config.mindmap?.useMaxWidth??G.mindmap.useMaxWidth)},"draw"),Ne={draw:xe},De=l(e=>{const{theme:n,look:g}=e;let a="";for(let t=0;t{let a="";for(let t=0;t{const{theme:n}=e,g=e.svgId,a=e.dropShadow?e.dropShadow.replace("url(#drop-shadow)",`url(${g}-drop-shadow)`):"none";return` + .edge { + stroke-width: 3; + } + ${De(e)} + .section-root rect, .section-root path, .section-root circle, .section-root polygon { + fill: ${e.git0}; + } + .section-root text { + fill: ${e.gitBranchLabel0}; + } + .section-root span { + color: ${n?.includes("redux")?e.nodeBorder:e.gitBranchLabel0}; + } + .icon-container { + height:100%; + display: flex; + justify-content: center; + align-items: center; + } + .edge { + fill: none; + } + .mindmap-node-label { + dy: 1em; + alignment-baseline: middle; + text-anchor: middle; + dominant-baseline: middle; + text-align: center; + } + [data-look="neo"].mindmap-node { + filter: ${a}; + } + [data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon { + fill: ${n?.includes("redux")?e.mainBkg:e.git0}; + } + [data-look="neo"].mindmap-node.section-root .text-inner-tspan { + fill: ${n?.includes("redux")?e.nodeBorder:e["cScaleLabel"+(n==="neutral"?1:0)]}; + } + ${e.useGradient&&g&&e.mainBkg?Le(e.THEME_COLOR_LIMIT,g,e.mainBkg):""} +`},"getStyles"),Te=ve,Ae={get db(){return new Se},renderer:Ne,parser:be,styles:Te};export{Ae as diagram}; diff --git a/apps/kimi-code/dist-web/assets/pegDiagram-2B236MQR-B81as5U1.js b/apps/kimi-code/dist-web/assets/pegDiagram-2B236MQR-B81as5U1.js new file mode 100644 index 00000000000..03f62c49482 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/pegDiagram-2B236MQR-B81as5U1.js @@ -0,0 +1 @@ +import{g as l,r as m,d as a}from"./chunk-MOJQB5TN-DmVMZHwQ.js";import{p}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{_ as t,l as o}from"./mermaid.core-WW7RuneT.js";import{M as u,d as c}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},L={parser:b,db:a,renderer:m,styles:l};export{L as diagram}; diff --git a/apps/kimi-code/dist-web/assets/pieDiagram-ENE6RG2P-DLM5siGM.js b/apps/kimi-code/dist-web/assets/pieDiagram-ENE6RG2P-DLM5siGM.js new file mode 100644 index 00000000000..35a84633310 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/pieDiagram-ENE6RG2P-DLM5siGM.js @@ -0,0 +1,39 @@ +import{p as at}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{T,X as B,b5 as rt,g as nt,s as it,a as ot,b as st,o as lt,n as ct,_ as g,l as G,c as ut,A as dt,D as gt,K as pt,e as ht,p as ft,B as mt}from"./mermaid.core-WW7RuneT.js";import{p as vt}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import{d as Z}from"./arc-CPC2gY0w.js";import{o as xt}from"./ordinal-Cboi1Yqb.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function St(t,n){return nt?1:n>=t?0:NaN}function yt(t){return t}function wt(){var t=yt,n=St,y=null,b=T(0),l=T(B),p=T(0);function i(e){var r,s=(e=rt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),E=Math.min(B,Math.max(-B,l.apply(this,arguments)-D)),k,L=Math.min(Math.abs(E)/s,p.apply(this,arguments)),u=L*(E<0?-1:1),A;for(r=0;r0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(E-s*u)/$:0;r0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:L};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var At=mt.pie,I={sections:new Map,showData:!1},F=I.sections,V=I.showData,Ct=structuredClone(At),$t=g(()=>structuredClone(Ct),"getConfig"),Dt=g(()=>{F=new Map,V=I.showData,ft()},"clear"),Tt=g(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);F.has(t)||(F.set(t,n),G.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),bt=g(()=>F,"getSections"),kt=g(t=>{V=t},"setShowData"),zt=g(()=>V,"getShowData"),q={getConfig:$t,clear:Dt,setDiagramTitle:ct,getDiagramTitle:lt,setAccTitle:st,getAccTitle:ot,setAccDescription:it,getAccDescription:nt,addSection:Tt,getSections:bt,setShowData:kt,getShowData:zt},Et=g((t,n)=>{at(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Mt={parse:g(async t=>{const n=await vt("pie",t);G.debug(n),Et(n,q)},"parse")},Rt=g(t=>` + .pieCircle{ + stroke: ${t.pieStrokeColor}; + stroke-width : ${t.pieStrokeWidth}; + opacity : ${t.pieOpacity}; + } + .pieCircle.highlighted{ + scale: 1.05; + opacity: 1; + } + .pieCircle.highlightedOnHover:hover{ + transition-duration: 250ms; + scale: 1.05; + opacity: 1; + } + .pieOuterCircle{ + stroke: ${t.pieOuterStrokeColor}; + stroke-width: ${t.pieOuterStrokeWidth}; + fill: none; + } + .pieTitleText { + text-anchor: middle; + font-size: ${t.pieTitleTextSize}; + fill: ${t.pieTitleTextColor}; + font-family: ${t.fontFamily}; + } + .slice { + font-family: ${t.fontFamily}; + fill: ${t.pieSectionTextColor}; + font-size:${t.pieSectionTextSize}; + // fill: white; + } + .legend text { + fill: ${t.pieLegendTextColor}; + font-family: ${t.fontFamily}; + font-size: ${t.pieLegendTextSize}; + } +`,"getStyles"),Lt=Rt,Wt=g(t=>{const n=[...t.values()].reduce((l,p)=>l+p,0),y=[...t.entries()].map(([l,p])=>({label:l,value:p})).filter(l=>l.value/n*100>=1);return wt().value(l=>l.value).sort(null)(y)},"createPieArcs"),_t=g((t,n,y,b)=>{G.debug(`rendering pie chart +`+t);const l=b.db,p=ut(),i=dt(l.getConfig(),p.pie),e=40,r=18,s=4,h=450,w=h,$=gt(n),f=$.append("g");f.attr("transform","translate("+w/2+","+h/2+")");const{themeVariables:o}=p;let[D]=pt(o.pieOuterStrokeWidth);D??=2;const E=i.legendPosition,k=i.textPosition,L=i.donutHole>0&&i.donutHole<=.9?i.donutHole:0,u=Math.min(w,h)/2-e,A=Z().innerRadius(L*u).outerRadius(u),M=Z().innerRadius(u*k).outerRadius(u*k),m=f.append("g");m.append("circle").attr("cx",0).attr("cy",0).attr("r",u+D/2).attr("class","pieOuterCircle");const W=l.getSections(),J=Wt(W),Q=[o.pie1,o.pie2,o.pie3,o.pie4,o.pie5,o.pie6,o.pie7,o.pie8,o.pie9,o.pie10,o.pie11,o.pie12];let H=0;W.forEach(a=>{H+=a});const U=J.filter(a=>(a.data.value/H*100).toFixed(0)!=="0"),N=xt(Q).domain([...W.keys()]);m.selectAll("mySlices").data(U).enter().append("path").attr("d",A).attr("fill",a=>N(a.data.label)).attr("class",a=>{let c="pieCircle";return i.highlightSlice==="hover"?c+=" highlightedOnHover":i.highlightSlice===a.data.label&&(c+=" highlighted"),c}),m.selectAll("mySlices").data(U).enter().append("text").text(a=>(a.data.value/H*100).toFixed(0)+"%").attr("transform",a=>"translate("+M.centroid(a)+")").style("text-anchor","middle").attr("class","slice");const Y=f.append("text").text(l.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),R=[...W.entries()].map(([a,c])=>({label:a,value:c})),C=f.selectAll(".legend").data(R).enter().append("g").attr("class","legend");C.append("rect").attr("width",r).attr("height",r).style("fill",a=>N(a.label)).style("stroke",a=>N(a.label)),C.append("text").attr("x",r+s).attr("y",r-s).text(a=>l.getShowData()?`${a.label} [${a.value}]`:a.label);const z=Math.max(...C.selectAll("text").nodes().map(a=>a?.getBoundingClientRect().width??0));let _=h,O=w+e;const d=r+s,P=R.length*d;switch(E){case"center":C.attr("transform",(a,c)=>{const v=d*R.length/2,x=-z/2-(r+s),S=c*d-v;return"translate("+x+","+S+")"});break;case"top":_+=P,C.attr("transform",(a,c)=>{const v=u,x=-z/2-(r+s),S=c*d-v;return`translate(${x}, ${S})`}),m.attr("transform",()=>`translate(0, ${P+d})`);break;case"bottom":_+=P,C.attr("transform",(a,c)=>{const v=-u-d,x=-z/2-(r+s),S=c*d-v;return"translate("+x+","+S+")"});break;case"left":O+=r+s+z,C.attr("transform",(a,c)=>{const v=d*R.length/2,x=-u-(r+s),S=c*d-v;return"translate("+x+","+S+")"}),m.attr("transform",()=>`translate(${z+r+s}, 0)`);break;case"right":default:O+=r+s+z,C.attr("transform",(a,c)=>{const v=d*R.length/2,x=12*r,S=c*d-v;return"translate("+x+","+S+")"});break}const X=Y.node()?.getBoundingClientRect().width??0,tt=w/2-X/2,et=w/2+X/2,j=Math.min(0,tt),K=Math.max(O,et)-j;$.attr("viewBox",`${j} 0 ${K} ${_}`),ht($,_,K,i.useMaxWidth)},"draw"),Ft={draw:_t},Xt={parser:Mt,db:q,renderer:Ft,styles:Lt};export{Xt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/quadrantDiagram-ABIIQ3AL-BccwcHoh.js b/apps/kimi-code/dist-web/assets/quadrantDiagram-ABIIQ3AL-BccwcHoh.js new file mode 100644 index 00000000000..fdbbf7e2786 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/quadrantDiagram-ABIIQ3AL-BccwcHoh.js @@ -0,0 +1,7 @@ +import{s as Se,g as _e,o as ee,n as Ae,a as ke,b as Fe,_ as r,c as Et,l as mt,d as vt,e as Pe,p as ve,B as z,i as Ce,E as Le}from"./mermaid.core-WW7RuneT.js";import{l as te}from"./linear-UIDPGx_K.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-DX6XiGOO.js";var Ct=(function(){var t=r(function(Y,s,l,u){for(l=l||{},u=Y.length;u--;l[Y[u]]=s);return l},"o"),a=[1,3],p=[1,4],f=[1,5],o=[1,6],x=[1,7],_=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],h=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],c=[55,56,57],S=[2,36],q=[1,37],b=[1,36],y=[1,38],T=[1,35],m=[1,43],g=[1,41],k=[1,45],ct=[1,14],dt=[1,23],ut=[1,18],xt=[1,19],ot=[1,20],bt=[1,21],lt=[1,22],i=[1,24],Dt=[1,25],zt=[1,26],Vt=[1,27],It=[1,28],wt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Bt=[1,66],Rt=[1,67],Nt=[1,68],Wt=[1,69],Ut=[1,70],Qt=[1,71],Ot=[1,72],Ht=[1,73],Xt=[1,74],Mt=[1,75],Yt=[1,76],jt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],St=[1,103],Gt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],_t={trace:r(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:r(function(s,l,u,d,A,e,ht){var n=e.length-1;switch(A){case 23:this.$=e[n];break;case 24:this.$=e[n-1]+""+e[n];break;case 26:this.$=e[n-1]+e[n];break;case 27:this.$=[e[n].trim()];break;case 28:e[n-2].push(e[n].trim()),this.$=e[n-2];break;case 29:this.$=e[n-4],d.addClass(e[n-2],e[n]);break;case 37:this.$=[];break;case 42:this.$=e[n].trim(),d.setDiagramTitle(this.$);break;case 43:this.$=e[n].trim(),d.setAccTitle(this.$);break;case 44:case 45:this.$=e[n].trim(),d.setAccDescription(this.$);break;case 46:d.addSection(e[n].substr(8)),this.$=e[n].substr(8);break;case 47:d.addPoint(e[n-3],"",e[n-1],e[n],[]);break;case 48:d.addPoint(e[n-4],e[n-3],e[n-1],e[n],[]);break;case 49:d.addPoint(e[n-4],"",e[n-2],e[n-1],e[n]);break;case 50:d.addPoint(e[n-5],e[n-4],e[n-2],e[n-1],e[n]);break;case 51:d.setXAxisLeftText(e[n-2]),d.setXAxisRightText(e[n]);break;case 52:e[n-1].text+=" ⟶ ",d.setXAxisLeftText(e[n-1]);break;case 53:d.setXAxisLeftText(e[n]);break;case 54:d.setYAxisBottomText(e[n-2]),d.setYAxisTopText(e[n]);break;case 55:e[n-1].text+=" ⟶ ",d.setYAxisBottomText(e[n-1]);break;case 56:d.setYAxisBottomText(e[n]);break;case 57:d.setQuadrant1Text(e[n]);break;case 58:d.setQuadrant2Text(e[n]);break;case 59:d.setQuadrant3Text(e[n]);break;case 60:d.setQuadrant4Text(e[n]);break;case 64:this.$={text:e[n],type:"text"};break;case 65:this.$={text:e[n-1].text+""+e[n],type:e[n-1].type};break;case 66:this.$={text:e[n],type:"text"};break;case 67:this.$={text:e[n],type:"markdown"};break;case 68:this.$=e[n];break;case 69:this.$=e[n-1]+""+e[n];break}},"anonymous"),table:[{18:a,26:1,27:2,28:p,55:f,56:o,57:x},{1:[3]},{18:a,26:8,27:2,28:p,55:f,56:o,57:x},{18:a,26:9,27:2,28:p,55:f,56:o,57:x},t(_,[2,33],{29:10}),t(h,[2,61]),t(h,[2,62]),t(h,[2,63]),{1:[2,30]},{1:[2,31]},t(c,S,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:q,5:b,10:y,12:T,13:m,14:g,15:k,18:ct,25:dt,35:ut,37:xt,39:ot,41:bt,42:lt,48:i,50:Dt,51:zt,52:Vt,53:It,54:wt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(_,[2,34]),{27:46,55:f,56:o,57:x},t(c,[2,37]),t(c,S,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:q,5:b,10:y,12:T,13:m,14:g,15:k,18:ct,25:dt,35:ut,37:xt,39:ot,41:bt,42:lt,48:i,50:Dt,51:zt,52:Vt,53:It,54:wt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(c,[2,39]),t(c,[2,40]),t(c,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(c,[2,45]),t(c,[2,46]),{18:[1,51]},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,10:y,12:T,13:m,14:g,15:k,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(_,[2,35]),t(c,[2,38]),t(c,[2,42]),t(c,[2,43]),t(c,[2,44]),{3:65,4:Bt,5:Rt,6:Nt,7:Wt,8:Ut,9:Qt,10:Ot,11:Ht,12:Xt,13:Mt,14:Yt,15:jt,21:64},t(c,[2,53],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(c,[2,56],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(c,[2,57],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,58],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,59],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,60],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Bt,5:Rt,6:Nt,7:Wt,8:Ut,9:Qt,10:Ot,11:Ht,12:Xt,13:Mt,14:Yt,15:jt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(c,[2,52],{58:31,43:84,4:q,5:b,10:y,12:T,13:m,14:g,15:k,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(c,[2,55],{58:31,43:85,4:q,5:b,10:y,12:T,13:m,14:g,15:k,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:89,23:88},t(w,[2,24]),t(c,[2,51],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,54],{59:60,58:61,4:q,5:b,8:H,10:y,12:T,13:m,14:g,15:k,18:X,63:F,64:P,65:v,66:C,67:L}),t(c,[2,47],{22:89,16:90,23:101,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{46:[1,102]},t(c,[2,29],{10:St}),t(Gt,[2,27],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(c,[2,49],{10:St}),t(c,[2,48],{22:89,16:90,23:105,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:106},t(N,[2,26]),t(c,[2,50],{10:St}),t(Gt,[2,28],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st})],defaultActions:{8:[2,30],9:[2,31]},parseError:r(function(s,l){if(l.recoverable)this.trace(s);else{var u=new Error(s);throw u.hash=l,u}},"parseError"),parse:r(function(s){var l=this,u=[0],d=[],A=[null],e=[],ht=this.table,n="",gt=0,Kt=0,Te=2,Zt=1,me=e.slice.call(arguments,1),D=Object.create(this.lexer),j={yy:{}};for(var At in this.yy)Object.prototype.hasOwnProperty.call(this.yy,At)&&(j.yy[At]=this.yy[At]);D.setInput(s,j.yy),j.yy.lexer=D,j.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var kt=D.yylloc;e.push(kt);var qe=D.options&&D.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function be(R){u.length=u.length-2*R,A.length=A.length-R,e.length=e.length-R}r(be,"popStack");function Jt(){var R;return R=d.pop()||D.lex()||Zt,typeof R!="number"&&(R instanceof Array&&(d=R,R=d.pop()),R=l.symbols_[R]||R),R}r(Jt,"lex");for(var B,G,W,Ft,rt={},pt,M,$t,yt;;){if(G=u[u.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=Jt()),W=ht[G]&&ht[G][B]),typeof W>"u"||!W.length||!W[0]){var Pt="";yt=[];for(pt in ht[G])this.terminals_[pt]&&pt>Te&&yt.push("'"+this.terminals_[pt]+"'");D.showPosition?Pt="Parse error on line "+(gt+1)+`: +`+D.showPosition()+` +Expecting `+yt.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Pt="Parse error on line "+(gt+1)+": Unexpected "+(B==Zt?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Pt,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:kt,expected:yt})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+B);switch(W[0]){case 1:u.push(B),A.push(D.yytext),e.push(D.yylloc),u.push(W[1]),B=null,Kt=D.yyleng,n=D.yytext,gt=D.yylineno,kt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],rt.$=A[A.length-M],rt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},qe&&(rt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),Ft=this.performAction.apply(rt,[n,Kt,gt,j.yy,W[1],A,e].concat(me)),typeof Ft<"u")return Ft;M&&(u=u.slice(0,-1*M*2),A=A.slice(0,-1*M),e=e.slice(0,-1*M)),u.push(this.productions_[W[1]][0]),A.push(rt.$),e.push(rt._$),$t=ht[u[u.length-2]][u[u.length-1]],u.push($t);break;case 3:return!0}}return!0},"parse")},ye=(function(){var Y={EOF:1,parseError:r(function(l,u){if(this.yy.parser)this.yy.parser.parseError(l,u);else throw new Error(l)},"parseError"),setInput:r(function(s,l){return this.yy=l||this.yy||{},this._input=s,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:r(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var l=s.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:r(function(s){var l=s.length,u=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var d=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),u.length-1&&(this.yylineno-=u.length-1);var A=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:u?(u.length===d.length?this.yylloc.first_column:0)+d[d.length-u.length].length-u[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:r(function(){return this._more=!0,this},"more"),reject:r(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:r(function(s){this.unput(this.match.slice(s))},"less"),pastInput:r(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:r(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:r(function(){var s=this.pastInput(),l=new Array(s.length+1).join("-");return s+this.upcomingInput()+` +`+l+"^"},"showPosition"),test_match:r(function(s,l){var u,d,A;if(this.options.backtrack_lexer&&(A={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(A.yylloc.range=this.yylloc.range.slice(0))),d=s[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],u=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),u)return u;if(this._backtrack){for(var e in A)this[e]=A[e];return!1}return!1},"test_match"),next:r(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,l,u,d;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),e=0;el[0].length)){if(l=u,d=e,this.options.backtrack_lexer){if(s=this.test_match(u,A[e]),s!==!1)return s;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(s=this.test_match(l,A[d]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:r(function(){var l=this.next();return l||this.lex()},"lex"),begin:r(function(l){this.conditionStack.push(l)},"begin"),popState:r(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:r(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:r(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:r(function(l){this.begin(l)},"pushState"),stateStackSize:r(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:r(function(l,u,d,A){switch(d){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return Y})();_t.lexer=ye;function ft(){this.yy={}}return r(ft,"Parser"),ft.prototype=_t,_t.Parser=ft,new ft})();Ct.parser=Ct;var Ee=Ct,I=Le(),De=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}static{r(this,"QuadrantBuilder")}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:z.quadrantChart?.chartWidth||500,chartWidth:z.quadrantChart?.chartHeight||500,titlePadding:z.quadrantChart?.titlePadding||10,titleFontSize:z.quadrantChart?.titleFontSize||20,quadrantPadding:z.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:z.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:z.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:z.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:z.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:z.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:z.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:z.quadrantChart?.pointTextPadding||5,pointLabelFontSize:z.quadrantChart?.pointLabelFontSize||12,pointRadius:z.quadrantChart?.pointRadius||5,xAxisPosition:z.quadrantChart?.xAxisPosition||"top",yAxisPosition:z.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:z.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:z.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:I.quadrant1Fill,quadrant2Fill:I.quadrant2Fill,quadrant3Fill:I.quadrant3Fill,quadrant4Fill:I.quadrant4Fill,quadrant1TextFill:I.quadrant1TextFill,quadrant2TextFill:I.quadrant2TextFill,quadrant3TextFill:I.quadrant3TextFill,quadrant4TextFill:I.quadrant4TextFill,quadrantPointFill:I.quadrantPointFill,quadrantPointTextFill:I.quadrantPointTextFill,quadrantXAxisTextFill:I.quadrantXAxisTextFill,quadrantYAxisTextFill:I.quadrantYAxisTextFill,quadrantTitleFill:I.quadrantTitleFill,quadrantInternalBorderStrokeFill:I.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:I.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,mt.info("clear called")}setData(t){this.data={...this.data,...t}}addPoints(t){this.data.points=[...t,...this.data.points]}addClass(t,a){this.classes.set(t,a)}setConfig(t){mt.trace("setConfig called with: ",t),this.config={...this.config,...t}}setThemeConfig(t){mt.trace("setThemeConfig called with: ",t),this.themeConfig={...this.themeConfig,...t}}calculateSpace(t,a,p,f){const o=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,x={top:t==="top"&&a?o:0,bottom:t==="bottom"&&a?o:0},_=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,h={left:this.config.yAxisPosition==="left"&&p?_:0,right:this.config.yAxisPosition==="right"&&p?_:0},c=this.config.titleFontSize+this.config.titlePadding*2,S={top:f?c:0},q=this.config.quadrantPadding+h.left,b=this.config.quadrantPadding+x.top+S.top,y=this.config.chartWidth-this.config.quadrantPadding*2-h.left-h.right,T=this.config.chartHeight-this.config.quadrantPadding*2-x.top-x.bottom-S.top,m=y/2,g=T/2;return{xAxisSpace:x,yAxisSpace:h,titleSpace:S,quadrantSpace:{quadrantLeft:q,quadrantTop:b,quadrantWidth:y,quadrantHalfWidth:m,quadrantHeight:T,quadrantHalfHeight:g}}}getAxisLabels(t,a,p,f){const{quadrantSpace:o,titleSpace:x}=f,{quadrantHalfHeight:_,quadrantHeight:h,quadrantLeft:c,quadrantHalfWidth:S,quadrantTop:q,quadrantWidth:b}=o,y=!!this.data.xAxisRightText,T=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&a&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:c+(y?S/2:0),y:t==="top"?this.config.xAxisLabelPadding+x.top:this.config.xAxisLabelPadding+q+h+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:y?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&a&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:c+S+(y?S/2:0),y:t==="top"?this.config.xAxisLabelPadding+x.top:this.config.xAxisLabelPadding+q+h+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:y?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&p&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+c+b+this.config.quadrantPadding,y:q+h-(T?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:T?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&p&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+c+b+this.config.quadrantPadding,y:q+_-(T?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:T?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(t){const{quadrantSpace:a}=t,{quadrantHalfHeight:p,quadrantLeft:f,quadrantHalfWidth:o,quadrantTop:x}=a,_=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f+o,y:x,width:o,height:p,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f,y:x,width:o,height:p,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f,y:x+p,width:o,height:p,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:f+o,y:x+p,width:o,height:p,fill:this.themeConfig.quadrant4Fill}];for(const h of _)h.text.x=h.x+h.width/2,this.data.points.length===0?(h.text.y=h.y+h.height/2,h.text.horizontalPos="middle"):(h.text.y=h.y+this.config.quadrantTextTopPadding,h.text.horizontalPos="top");return _}getQuadrantPoints(t){const{quadrantSpace:a}=t,{quadrantHeight:p,quadrantLeft:f,quadrantTop:o,quadrantWidth:x}=a,_=te().domain([0,1]).range([f,x+f]),h=te().domain([0,1]).range([p+o,o]);return this.data.points.map(S=>{const q=this.classes.get(S.className);return q&&(S={...q,...S}),{x:_(S.x),y:h(S.y),fill:S.color??this.themeConfig.quadrantPointFill,radius:S.radius??this.config.pointRadius,text:{text:S.text,fill:this.themeConfig.quadrantPointTextFill,x:_(S.x),y:h(S.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:S.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:S.strokeWidth??"0px"}})}getBorders(t){const a=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:p}=t,{quadrantHalfHeight:f,quadrantHeight:o,quadrantLeft:x,quadrantHalfWidth:_,quadrantTop:h,quadrantWidth:c}=p;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x-a,y1:h,x2:x+c+a,y2:h},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x+c,y1:h+a,x2:x+c,y2:h+o-a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x-a,y1:h+o,x2:x+c+a,y2:h+o},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:x,y1:h+a,x2:x,y2:h+o-a},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:x+_,y1:h+a,x2:x+_,y2:h+o-a},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:x+a,y1:h+f,x2:x+c-a,y2:h+f}]}getTitle(t){if(t)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const t=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),a=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),p=this.config.showTitle&&!!this.data.titleText,f=this.data.points.length>0?"bottom":this.config.xAxisPosition,o=this.calculateSpace(f,t,a,p);return{points:this.getQuadrantPoints(o),quadrants:this.getQuadrants(o),axisLabels:this.getAxisLabels(f,t,a,o),borderLines:this.getBorders(o),title:this.getTitle(p)}}},Tt=class extends Error{static{r(this,"InvalidStyleError")}constructor(t,a,p){super(`value for ${t} ${a} is invalid, please use a valid ${p}`),this.name="InvalidStyleError"}};function Lt(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}r(Lt,"validateHexCode");function ie(t){return!/^\d+$/.test(t)}r(ie,"validateNumber");function ae(t){return!/^\d+px$/.test(t)}r(ae,"validateSizeInPixels");function O(t){return Ce(t.trim(),Et())}r(O,"textSanitizer");var V=new De;function ne(t){V.setData({quadrant1Text:O(t.text)})}r(ne,"setQuadrant1Text");function se(t){V.setData({quadrant2Text:O(t.text)})}r(se,"setQuadrant2Text");function re(t){V.setData({quadrant3Text:O(t.text)})}r(re,"setQuadrant3Text");function oe(t){V.setData({quadrant4Text:O(t.text)})}r(oe,"setQuadrant4Text");function le(t){V.setData({xAxisLeftText:O(t.text)})}r(le,"setXAxisLeftText");function he(t){V.setData({xAxisRightText:O(t.text)})}r(he,"setXAxisRightText");function ce(t){V.setData({yAxisTopText:O(t.text)})}r(ce,"setYAxisTopText");function de(t){V.setData({yAxisBottomText:O(t.text)})}r(de,"setYAxisBottomText");function qt(t){const a={};for(const p of t){const[f,o]=p.trim().split(/\s*:\s*/);if(f==="radius"){if(ie(o))throw new Tt(f,o,"number");a.radius=parseInt(o)}else if(f==="color"){if(Lt(o))throw new Tt(f,o,"hex code");a.color=o}else if(f==="stroke-color"){if(Lt(o))throw new Tt(f,o,"hex code");a.strokeColor=o}else if(f==="stroke-width"){if(ae(o))throw new Tt(f,o,"number of pixels (eg. 10px)");a.strokeWidth=o}else throw new Error(`style named ${f} is not supported.`)}return a}r(qt,"parseStyles");function ue(t,a,p,f,o){const x=qt(o);V.addPoints([{x:p,y:f,text:O(t.text),className:a,...x}])}r(ue,"addPoint");function xe(t,a){V.addClass(t,qt(a))}r(xe,"addClass");function fe(t){V.setConfig({chartWidth:t})}r(fe,"setWidth");function ge(t){V.setConfig({chartHeight:t})}r(ge,"setHeight");function pe(){const t=Et(),{themeVariables:a,quadrantChart:p}=t;return p&&V.setConfig(p),V.setThemeConfig({quadrant1Fill:a.quadrant1Fill,quadrant2Fill:a.quadrant2Fill,quadrant3Fill:a.quadrant3Fill,quadrant4Fill:a.quadrant4Fill,quadrant1TextFill:a.quadrant1TextFill,quadrant2TextFill:a.quadrant2TextFill,quadrant3TextFill:a.quadrant3TextFill,quadrant4TextFill:a.quadrant4TextFill,quadrantPointFill:a.quadrantPointFill,quadrantPointTextFill:a.quadrantPointTextFill,quadrantXAxisTextFill:a.quadrantXAxisTextFill,quadrantYAxisTextFill:a.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:a.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:a.quadrantInternalBorderStrokeFill,quadrantTitleFill:a.quadrantTitleFill}),V.setData({titleText:ee()}),V.build()}r(pe,"getQuadrantData");var ze=r(function(){V.clear(),ve()},"clear"),Ve={setWidth:fe,setHeight:ge,setQuadrant1Text:ne,setQuadrant2Text:se,setQuadrant3Text:re,setQuadrant4Text:oe,setXAxisLeftText:le,setXAxisRightText:he,setYAxisTopText:ce,setYAxisBottomText:de,parseStyles:qt,addPoint:ue,addClass:xe,getQuadrantData:pe,clear:ze,setAccTitle:Fe,getAccTitle:ke,setDiagramTitle:Ae,getDiagramTitle:ee,getAccDescription:_e,setAccDescription:Se},Ie=r((t,a,p,f)=>{function o(i){return i==="top"?"hanging":"middle"}r(o,"getDominantBaseLine");function x(i){return i==="left"?"start":"middle"}r(x,"getTextAnchor");function _(i){return`translate(${i.x}, ${i.y}) rotate(${i.rotation||0})`}r(_,"getTransformation");const h=Et();mt.debug(`Rendering quadrant chart +`+t);const c=h.securityLevel;let S;c==="sandbox"&&(S=vt("#i"+a));const b=(c==="sandbox"?vt(S.nodes()[0].contentDocument.body):vt("body")).select(`[id="${a}"]`),y=b.append("g").attr("class","main"),T=h.quadrantChart?.chartWidth??500,m=h.quadrantChart?.chartHeight??500;Pe(b,m,T,h.quadrantChart?.useMaxWidth??!0),b.attr("viewBox","0 0 "+T+" "+m),f.db.setHeight(m),f.db.setWidth(T);const g=f.db.getQuadrantData(),k=y.append("g").attr("class","quadrants"),ct=y.append("g").attr("class","border"),dt=y.append("g").attr("class","data-points"),ut=y.append("g").attr("class","labels"),xt=y.append("g").attr("class","title");g.title&&xt.append("text").attr("x",0).attr("y",0).attr("fill",g.title.fill).attr("font-size",g.title.fontSize).attr("dominant-baseline",o(g.title.horizontalPos)).attr("text-anchor",x(g.title.verticalPos)).attr("transform",_(g.title)).text(g.title.text),g.borderLines&&ct.selectAll("line").data(g.borderLines).enter().append("line").attr("x1",i=>i.x1).attr("y1",i=>i.y1).attr("x2",i=>i.x2).attr("y2",i=>i.y2).style("stroke",i=>i.strokeFill).style("stroke-width",i=>i.strokeWidth);const ot=k.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class","quadrant");ot.append("rect").attr("x",i=>i.x).attr("y",i=>i.y).attr("width",i=>i.width).attr("height",i=>i.height).attr("fill",i=>i.fill),ot.append("text").attr("x",0).attr("y",0).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>o(i.text.horizontalPos)).attr("text-anchor",i=>x(i.text.verticalPos)).attr("transform",i=>_(i.text)).text(i=>i.text.text),ut.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(i=>i.text).attr("fill",i=>i.fill).attr("font-size",i=>i.fontSize).attr("dominant-baseline",i=>o(i.horizontalPos)).attr("text-anchor",i=>x(i.verticalPos)).attr("transform",i=>_(i));const lt=dt.selectAll("g.data-point").data(g.points).enter().append("g").attr("class","data-point");lt.append("circle").attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius).attr("fill",i=>i.fill).attr("stroke",i=>i.strokeColor).attr("stroke-width",i=>i.strokeWidth),lt.append("text").attr("x",0).attr("y",0).text(i=>i.text.text).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>o(i.text.horizontalPos)).attr("text-anchor",i=>x(i.text.verticalPos)).attr("transform",i=>_(i.text))},"draw"),we={draw:Ie},Oe={parser:Ee,db:Ve,renderer:we,styles:r(()=>"","styles")};export{Oe as diagram}; diff --git a/apps/kimi-code/dist-web/assets/railroadDiagram-RFXS5EU6-DNsbCVtY.js b/apps/kimi-code/dist-web/assets/railroadDiagram-RFXS5EU6-DNsbCVtY.js new file mode 100644 index 00000000000..9fab9e316a1 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/railroadDiagram-RFXS5EU6-DNsbCVtY.js @@ -0,0 +1 @@ +import{g as s,r as l,d as t}from"./chunk-MOJQB5TN-DmVMZHwQ.js";import{p as m}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{_ as n,l as i}from"./mermaid.core-WW7RuneT.js";import{M as p,c as u}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},P={parser:y,db:t,renderer:l,styles:s};export{P as diagram}; diff --git a/apps/kimi-code/dist-web/assets/requirementDiagram-TGXJPOKE-C-K62wRK.js b/apps/kimi-code/dist-web/assets/requirementDiagram-TGXJPOKE-C-K62wRK.js new file mode 100644 index 00000000000..bb1f3ed4c52 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/requirementDiagram-TGXJPOKE-C-K62wRK.js @@ -0,0 +1,84 @@ +import{g as Ge}from"./chunk-XXDRQBXY-D_bv9kM4.js";import{s as ze}from"./chunk-VR4S4FIN-C_RujyXt.js";import{_ as h,y as Ye,b as Xe,a as Je,s as Ze,g as et,n as tt,o as st,c as Te,l as Ne,p as it,t as rt,u as nt,v as at,x as lt}from"./mermaid.core-WW7RuneT.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var qe=(function(){var e=h(function($,r,a,c){for(a=a||{},c=$.length;c--;a[$[c]]=r);return a},"o"),u=[1,3],o=[1,4],n=[1,5],i=[1,6],f=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],_=[1,22],E=[2,7],g=[1,26],S=[1,27],k=[1,28],q=[1,29],C=[1,33],A=[1,34],V=[1,35],v=[1,36],L=[1,37],x=[1,38],O=[1,24],w=[1,31],D=[1,32],M=[1,30],p=[1,39],R=[1,40],d=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],P=[1,61],X=[89,90],Ce=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],de=[27,29],Ae=[1,70],Ve=[1,71],ve=[1,72],Le=[1,73],xe=[1,74],Oe=[1,75],we=[1,76],Z=[1,83],U=[1,80],ee=[1,84],te=[1,85],se=[1,86],ie=[1,87],re=[1,88],ne=[1,89],ae=[1,90],le=[1,91],ce=[1,92],Ee=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],De=[1,101],Me=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],oe=[1,116],he=[1,117],ue=[1,114],fe=[1,115],_e={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:h(function(r,a,c,s,m,t,me){var l=t.length-1;switch(m){case 4:this.$=t[l].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[l].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[l-3],t[l-4]);break;case 22:s.addRequirement(t[l-5],t[l-6]),s.setClass([t[l-5]],t[l-3]);break;case 23:s.setNewReqId(t[l-2]);break;case 24:s.setNewReqText(t[l-2]);break;case 25:s.setNewReqRisk(t[l-2]);break;case 26:s.setNewReqVerifyMethod(t[l-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[l-3]);break;case 43:s.addElement(t[l-5]),s.setClass([t[l-5]],t[l-3]);break;case 44:s.setNewElementType(t[l-2]);break;case 45:s.setNewElementDocRef(t[l-2]);break;case 48:s.addRelationship(t[l-2],t[l],t[l-4]);break;case 49:s.addRelationship(t[l-2],t[l-4],t[l]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[l-2],s.defineClass(t[l-1],t[l]);break;case 58:s.setClass(t[l-1],t[l]);break;case 59:s.setClass([t[l-2]],t[l]);break;case 60:case 62:this.$=[t[l]];break;case 61:case 63:this.$=t[l-2].concat([t[l]]);break;case 64:this.$=t[l-2],s.setCssStyle(t[l-1],t[l]);break;case 65:this.$=[t[l]];break;case 66:t[l-2].push(t[l]),this.$=t[l-2];break;case 68:this.$=t[l-1]+t[l];break}},"anonymous"),table:[{3:1,4:2,6:u,9:o,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:u,9:o,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(f,[2,6]),{3:12,4:2,6:u,9:o,11:n,13:i},{1:[2,2]},{4:17,5:_,7:13,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},e(f,[2,4]),e(f,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:_,7:42,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:43,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:44,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:45,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:46,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:47,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:48,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:49,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{4:17,5:_,7:50,8:E,9:o,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:g,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:p,90:R},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(d,[2,17]),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),{30:60,33:62,75:P,89:p,90:R},{30:63,33:62,75:P,89:p,90:R},{30:64,33:62,75:P,89:p,90:R},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ce,[2,81]),e(Ce,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(de,[2,79]),e(de,[2,80]),{27:[1,67],29:[1,68]},e(de,[2,85]),e(de,[2,86]),{62:69,65:Ae,66:Ve,67:ve,68:Le,69:xe,70:Oe,71:we},{62:77,65:Ae,66:Ve,67:ve,68:Le,69:xe,70:Oe,71:we},{30:78,33:62,75:P,89:p,90:R},{73:79,75:Z,76:U,78:81,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},e(Ee,[2,60]),e(Ee,[2,62]),{73:93,75:Z,76:U,78:81,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},{30:94,33:62,75:P,76:U,89:p,90:R},{5:[1,95]},{30:96,33:62,75:P,89:p,90:R},{5:[1,97]},{30:98,33:62,75:P,89:p,90:R},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(d,[2,59],{76:U}),e(d,[2,64],{76:De}),{33:103,75:[1,102],89:p,90:R},e(Me,[2,65],{79:104,75:Z,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce}),e(T,[2,67]),e(T,[2,69]),e(T,[2,70]),e(T,[2,71]),e(T,[2,72]),e(T,[2,73]),e(T,[2,74]),e(T,[2,75]),e(T,[2,76]),e(T,[2,77]),e(T,[2,78]),e(d,[2,57],{76:De}),e(d,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:oe,40:he,56:113,57:ue,59:fe},{27:[1,118],76:U},{33:119,89:p,90:R},{33:120,89:p,90:R},{75:Z,78:121,79:82,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce},e(Ee,[2,61]),e(Ee,[2,63]),e(T,[2,68]),e(d,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(d,[2,28]),{5:[1,127]},e(d,[2,42]),{32:[1,128]},{32:[1,129]},{5:oe,40:he,56:130,57:ue,59:fe},e(d,[2,47]),{5:[1,131]},e(d,[2,48]),e(d,[2,49]),e(Me,[2,66],{79:104,75:Z,80:ee,81:te,82:se,83:ie,84:re,85:ne,86:ae,87:le,88:ce}),{33:132,89:p,90:R},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(d,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(d,[2,46]),{5:oe,40:he,56:152,57:ue,59:fe},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(d,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(d,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:oe,40:he,56:163,57:ue,59:fe},{5:oe,40:he,56:164,57:ue,59:fe},e(d,[2,23]),e(d,[2,24]),e(d,[2,25]),e(d,[2,26]),e(d,[2,44]),e(d,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:h(function(r,a){if(a.recoverable)this.trace(r);else{var c=new Error(r);throw c.hash=a,c}},"parseError"),parse:h(function(r){var a=this,c=[0],s=[],m=[null],t=[],me=this.table,l="",Re=0,Fe=0,He=2,$e=1,Ke=t.slice.call(arguments,1),y=Object.create(this.lexer),G={yy:{}};for(var Se in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Se)&&(G.yy[Se]=this.yy[Se]);y.setInput(r,G.yy),G.yy.lexer=y,G.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var be=y.yylloc;t.push(be);var We=y.options&&y.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function je(I){c.length=c.length-2*I,m.length=m.length-I,t.length=t.length-I}h(je,"popStack");function Pe(){var I;return I=s.pop()||y.lex()||$e,typeof I!="number"&&(I instanceof Array&&(s=I,I=s.pop()),I=a.symbols_[I]||I),I}h(Pe,"lex");for(var b,z,N,Ie,J={},ge,F,Ue,ye;;){if(z=c[c.length-1],this.defaultActions[z]?N=this.defaultActions[z]:((b===null||typeof b>"u")&&(b=Pe()),N=me[z]&&me[z][b]),typeof N>"u"||!N.length||!N[0]){var ke="";ye=[];for(ge in me[z])this.terminals_[ge]&&ge>He&&ye.push("'"+this.terminals_[ge]+"'");y.showPosition?ke="Parse error on line "+(Re+1)+`: +`+y.showPosition()+` +Expecting `+ye.join(", ")+", got '"+(this.terminals_[b]||b)+"'":ke="Parse error on line "+(Re+1)+": Unexpected "+(b==$e?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(ke,{text:y.match,token:this.terminals_[b]||b,line:y.yylineno,loc:be,expected:ye})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+b);switch(N[0]){case 1:c.push(b),m.push(y.yytext),t.push(y.yylloc),c.push(N[1]),b=null,Fe=y.yyleng,l=y.yytext,Re=y.yylineno,be=y.yylloc;break;case 2:if(F=this.productions_[N[1]][1],J.$=m[m.length-F],J._$={first_line:t[t.length-(F||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(F||1)].first_column,last_column:t[t.length-1].last_column},We&&(J._$.range=[t[t.length-(F||1)].range[0],t[t.length-1].range[1]]),Ie=this.performAction.apply(J,[l,Fe,Re,G.yy,N[1],m,t].concat(Ke)),typeof Ie<"u")return Ie;F&&(c=c.slice(0,-1*F*2),m=m.slice(0,-1*F),t=t.slice(0,-1*F)),c.push(this.productions_[N[1]][0]),m.push(J.$),t.push(J._$),Ue=me[c[c.length-2]][c[c.length-1]],c.push(Ue);break;case 3:return!0}}return!0},"parse")},Qe=(function(){var $={EOF:1,parseError:h(function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},"parseError"),setInput:h(function(r,a){return this.yy=a||this.yy||{},this._input=r,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:h(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var a=r.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:h(function(r){var a=r.length,c=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var s=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),c.length-1&&(this.yylineno-=c.length-1);var m=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:c?(c.length===s.length?this.yylloc.first_column:0)+s[s.length-c.length].length-c[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(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:h(function(r){this.unput(this.match.slice(r))},"less"),pastInput:h(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var r=this.pastInput(),a=new Array(r.length+1).join("-");return r+this.upcomingInput()+` +`+a+"^"},"showPosition"),test_match:h(function(r,a){var c,s,m;if(this.options.backtrack_lexer&&(m={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(m.yylloc.range=this.yylloc.range.slice(0))),s=r[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],c=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var t in m)this[t]=m[t];return!1}return!1},"test_match"),next:h(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,a,c,s;this._more||(this.yytext="",this.match="");for(var m=this._currentRules(),t=0;ta[0].length)){if(a=c,s=t,this.options.backtrack_lexer){if(r=this.test_match(c,m[t]),r!==!1)return r;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(r=this.test_match(a,m[s]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:h(function(){var a=this.next();return a||this.lex()},"lex"),begin:h(function(a){this.conditionStack.push(a)},"begin"),popState:h(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:h(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:h(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:h(function(a){this.begin(a)},"pushState"),stateStackSize:h(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:h(function(a,c,s,m){switch(s){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return c.yytext=c.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return $})();_e.lexer=Qe;function pe(){this.yy={}}return h(pe,"Parser"),pe.prototype=_e,_e.Parser=pe,new pe})();qe.parser=qe;var ct=qe,ot=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Xe,this.getAccTitle=Je,this.setAccDescription=Ze,this.getAccDescription=et,this.setDiagramTitle=tt,this.getDiagramTitle=st,this.getConfig=h(()=>Te().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{h(this,"RequirementDB")}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,u){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:u,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),Ne.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,u,o){this.relations.push({type:e,src:u,dst:o})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,it()}setCssStyle(e,u){for(const o of e){const n=this.requirements.get(o)??this.elements.get(o);if(!u||!n)return;for(const i of u)i.includes(",")?n.cssStyles.push(...i.split(",")):n.cssStyles.push(i)}}setClass(e,u){for(const o of e){const n=this.requirements.get(o)??this.elements.get(o);if(n)for(const i of u){n.classes.push(i);const f=this.classes.get(i)?.styles;f&&n.cssStyles.push(...f)}}}defineClass(e,u){for(const o of e){let n=this.classes.get(o);n===void 0&&(n={id:o,styles:[],textStyles:[]},this.classes.set(o,n)),u&&u.forEach(function(i){if(/color/.exec(i)){const f=i.replace("fill","bgFill");n.textStyles.push(f)}n.styles.push(i)}),this.requirements.forEach(i=>{i.classes.includes(o)&&i.cssStyles.push(...u.flatMap(f=>f.split(",")))}),this.elements.forEach(i=>{i.classes.includes(o)&&i.cssStyles.push(...u.flatMap(f=>f.split(",")))})}}getClasses(){return this.classes}getData(){const e=Te(),u=[],o=[];for(const n of this.requirements.values()){const i=n;i.id=n.name,i.cssStyles=n.cssStyles,i.cssClasses=n.classes.join(" "),i.shape="requirementBox",i.look=e.look,i.colorIndex=u.length,u.push(i)}for(const n of this.elements.values()){const i=n;i.shape="requirementBox",i.look=e.look,i.id=n.name,i.cssStyles=n.cssStyles,i.cssClasses=n.classes.join(" "),i.colorIndex=u.length,u.push(i)}for(const n of this.relations){let i=0;const f=n.type===this.Relationships.CONTAINS,_={id:`${n.src}-${n.dst}-${i}`,start:this.requirements.get(n.src)?.name??this.elements.get(n.src)?.name,end:this.requirements.get(n.dst)?.name??this.elements.get(n.dst)?.name,label:`<<${n.type}>>`,classes:"relationshipLine",style:["fill:none",f?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:f?"normal":"dashed",arrowTypeStart:f?"requirement_contains":"",arrowTypeEnd:f?"":"requirement_arrow",look:e.look,labelType:"markdown"};o.push(_),i++}return{nodes:u,edges:o,other:{},config:e,direction:this.getDirection()}}},ht=h(e=>{const u=Ye(),{themeVariables:o,look:n}=u,{bkgColorArray:i,borderColorArray:f}=o;if(!f?.length)return"";let _="";for(let E=0;E{const u=Ye(),{look:o,themeVariables:n}=u,{requirementEdgeLabelBackground:i}=n;return` + ${ht(e)} + marker { + fill: ${e.relationColor}; + stroke: ${e.relationColor}; + } + + marker.cross { + stroke: ${e.lineColor}; + } + + svg { + font-family: ${e.fontFamily}; + font-size: ${e.fontSize}; + } + + .reqBox { + fill: ${e.requirementBackground}; + fill-opacity: 1.0; + stroke: ${e.requirementBorderColor}; + stroke-width: ${e.requirementBorderSize}; + } + + .reqTitle, .reqLabel{ + fill: ${e.requirementTextColor}; + } + .reqLabelBox { + fill: ${e.relationLabelBackground}; + fill-opacity: 1.0; + } + + .req-title-line { + stroke: ${e.requirementBorderColor}; + stroke-width: ${e.requirementBorderSize}; + } + .relationshipLine { + stroke: ${e.relationColor}; + stroke-width: ${o==="neo"?e.strokeWidth:"1px"}; + } + .relationshipLabel { + fill: ${e.relationLabelColor}; + } + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + } + .edgeLabel .label rect { + fill: ${e.edgeLabelBackground}; + } + .edgeLabel .label text { + fill: ${e.relationLabelColor}; + } + .divider { + stroke: ${e.nodeBorder}; + stroke-width: 1; + } + .label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .label text,span { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + .labelBkg { + background-color: ${i??e.edgeLabelBackground}; + } + +`},"getStyles"),ft=ut,Be={};rt(Be,{draw:()=>mt});var mt=h(async function(e,u,o,n){Ne.info("REF0:"),Ne.info("Drawing requirement diagram (unified)",u);const{securityLevel:i,state:f,layout:_,look:E}=Te(),g=n.db.getData(),S=Ge(u,i);g.type=n.type,g.layoutAlgorithm=nt(_),g.nodeSpacing=f?.nodeSpacing??50,g.rankSpacing=f?.rankSpacing??50,g.markers=E==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],g.diagramId=u,await at(g,S);const k=8;lt.insertTitle(S,"requirementDiagramTitleText",f?.titleTopMargin??25,n.db.getDiagramTitle()),ze(S,k,"requirementDiagram",f?.useMaxWidth??!0)},"draw"),yt={parser:ct,get db(){return new ot},renderer:Be,styles:ft};export{yt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/sankeyDiagram-HTMAVEWB-DvJqr3-o.js b/apps/kimi-code/dist-web/assets/sankeyDiagram-HTMAVEWB-DvJqr3-o.js new file mode 100644 index 00000000000..6d06df01791 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/sankeyDiagram-HTMAVEWB-DvJqr3-o.js @@ -0,0 +1,40 @@ +import{n as kt,o as mt,s as xt,g as _t,b as vt,a as bt,_ as y,c as ot,b8 as St,d as G,ad as wt,p as Lt,k as Et}from"./mermaid.core-WW7RuneT.js";import{o as At}from"./ordinal-Cboi1Yqb.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function Tt(t){for(var i=t.length/6|0,s=new Array(i),l=0;l=l)&&(s=l);else{let l=-1;for(let u of t)(u=i(u,++l,t))!=null&&(s=u)&&(s=u)}return s}function dt(t,i){let s;if(i===void 0)for(const l of t)l!=null&&(s>l||s===void 0&&l>=l)&&(s=l);else{let l=-1;for(let u of t)(u=i(u,++l,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function J(t,i){let s=0;if(i===void 0)for(let l of t)(l=+l)&&(s+=l);else{let l=-1;for(let u of t)(u=+i(u,++l,t))&&(s+=u)}return s}function Nt(t){return t.target.depth}function Ct(t){return t.depth}function Pt(t,i){return i-1-t.height}function gt(t,i){return t.sourceLinks.length?t.depth:i-1}function It(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?dt(t.sourceLinks,Nt)-1:0}function Y(t){return function(){return t}}function lt(t,i){return H(t.source,i.source)||t.index-i.index}function ct(t,i){return H(t.target,i.target)||t.index-i.index}function H(t,i){return t.y0-i.y0}function tt(t){return t.value}function Ot(t){return t.index}function $t(t){return t.nodes}function Dt(t){return t.links}function ut(t,i){const s=t.get(i);if(!s)throw new Error("missing: "+i);return s}function ht({nodes:t}){for(const i of t){let s=i.y0,l=s;for(const u of i.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of i.targetLinks)u.y1=l+u.width/2,l+=u.width}}function jt(){let t=0,i=0,s=1,l=1,u=24,x=8,g,k=Ot,o=gt,a,h,m=$t,_=Dt,d=6;function v(){const n={nodes:m.apply(null,arguments),links:_.apply(null,arguments)};return T(n),A(n),M(n),I(n),S(n),ht(n),n}v.update=function(n){return ht(n),n},v.nodeId=function(n){return arguments.length?(k=typeof n=="function"?n:Y(n),v):k},v.nodeAlign=function(n){return arguments.length?(o=typeof n=="function"?n:Y(n),v):o},v.nodeSort=function(n){return arguments.length?(a=n,v):a},v.nodeWidth=function(n){return arguments.length?(u=+n,v):u},v.nodePadding=function(n){return arguments.length?(x=g=+n,v):x},v.nodes=function(n){return arguments.length?(m=typeof n=="function"?n:Y(n),v):m},v.links=function(n){return arguments.length?(_=typeof n=="function"?n:Y(n),v):_},v.linkSort=function(n){return arguments.length?(h=n,v):h},v.size=function(n){return arguments.length?(t=i=0,s=+n[0],l=+n[1],v):[s-t,l-i]},v.extent=function(n){return arguments.length?(t=+n[0][0],s=+n[1][0],i=+n[0][1],l=+n[1][1],v):[[t,i],[s,l]]},v.iterations=function(n){return arguments.length?(d=+n,v):d};function T({nodes:n,links:f}){for(const[e,r]of n.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const c=new Map(n.map((e,r)=>[k(e,r,n),e]));for(const[e,r]of f.entries()){r.index=e;let{source:p,target:b}=r;typeof p!="object"&&(p=r.source=ut(c,p)),typeof b!="object"&&(b=r.target=ut(c,b)),p.sourceLinks.push(r),b.targetLinks.push(r)}if(h!=null)for(const{sourceLinks:e,targetLinks:r}of n)e.sort(h),r.sort(h)}function A({nodes:n}){for(const f of n)f.value=f.fixedValue===void 0?Math.max(J(f.sourceLinks,tt),J(f.targetLinks,tt)):f.fixedValue}function M({nodes:n}){const f=n.length;let c=new Set(n),e=new Set,r=0;for(;c.size;){for(const p of c){p.depth=r;for(const{target:b}of p.sourceLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function I({nodes:n}){const f=n.length;let c=new Set(n),e=new Set,r=0;for(;c.size;){for(const p of c){p.height=r;for(const{source:b}of p.targetLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function N({nodes:n}){const f=at(n,r=>r.depth)+1,c=(s-t-u)/(f-1),e=new Array(f);for(const r of n){const p=Math.max(0,Math.min(f-1,Math.floor(o.call(null,r,f))));r.layer=p,r.x0=t+p*c,r.x1=r.x0+u,e[p]?e[p].push(r):e[p]=[r]}if(a)for(const r of e)r.sort(a);return e}function $(n){const f=dt(n,c=>(l-i-(c.length-1)*g)/J(c,tt));for(const c of n){let e=i;for(const r of c){r.y0=e,r.y1=e+r.value*f,e=r.y1+g;for(const p of r.sourceLinks)p.width=p.value*f}e=(l-e+g)/(c.length+1);for(let r=0;rc.length)-1)),$(f);for(let c=0;c0))continue;let V=(L/z-b.y0)*f;b.y0+=V,b.y1+=V,j(b)}a===void 0&&p.sort(H),D(p,c)}}function F(n,f,c){for(let e=n.length,r=e-2;r>=0;--r){const p=n[r];for(const b of p){let L=0,z=0;for(const{target:W,value:Z}of b.sourceLinks){let U=Z*(W.layer-b.layer);L+=E(b,W)*U,z+=U}if(!(z>0))continue;let V=(L/z-b.y0)*f;b.y0+=V,b.y1+=V,j(b)}a===void 0&&p.sort(H),D(p,c)}}function D(n,f){const c=n.length>>1,e=n[c];O(n,e.y0-g,c-1,f),R(n,e.y1+g,c+1,f),O(n,l,n.length-1,f),R(n,i,0,f)}function R(n,f,c,e){for(;c1e-6&&(r.y0+=p,r.y1+=p),f=r.y1+g}}function O(n,f,c,e){for(;c>=0;--c){const r=n[c],p=(r.y1-f)*e;p>1e-6&&(r.y0-=p,r.y1-=p),f=r.y0-g}}function j({sourceLinks:n,targetLinks:f}){if(h===void 0){for(const{source:{sourceLinks:c}}of f)c.sort(ct);for(const{target:{targetLinks:c}}of n)c.sort(lt)}}function w(n){if(h===void 0)for(const{sourceLinks:f,targetLinks:c}of n)f.sort(ct),c.sort(lt)}function P(n,f){let c=n.y0-(n.sourceLinks.length-1)*g/2;for(const{target:e,width:r}of n.sourceLinks){if(e===f)break;c+=r+g}for(const{source:e,width:r}of f.targetLinks){if(e===n)break;c-=r}return c}function E(n,f){let c=f.y0-(f.targetLinks.length-1)*g/2;for(const{source:e,width:r}of f.targetLinks){if(e===n)break;c+=r+g}for(const{target:e,width:r}of n.sourceLinks){if(e===f)break;c-=r}return c}return v}var et=Math.PI,nt=2*et,B=1e-6,zt=nt-B;function it(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function pt(){return new it}it.prototype=pt.prototype={constructor:it,moveTo:function(t,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,i){this._+="L"+(this._x1=+t)+","+(this._y1=+i)},quadraticCurveTo:function(t,i,s,l){this._+="Q"+ +t+","+ +i+","+(this._x1=+s)+","+(this._y1=+l)},bezierCurveTo:function(t,i,s,l,u,x){this._+="C"+ +t+","+ +i+","+ +s+","+ +l+","+(this._x1=+u)+","+(this._y1=+x)},arcTo:function(t,i,s,l,u){t=+t,i=+i,s=+s,l=+l,u=+u;var x=this._x1,g=this._y1,k=s-t,o=l-i,a=x-t,h=g-i,m=a*a+h*h;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=i);else if(m>B)if(!(Math.abs(h*k-o*a)>B)||!u)this._+="L"+(this._x1=t)+","+(this._y1=i);else{var _=s-x,d=l-g,v=k*k+o*o,T=_*_+d*d,A=Math.sqrt(v),M=Math.sqrt(m),I=u*Math.tan((et-Math.acos((v+m-T)/(2*A*M)))/2),N=I/M,$=I/A;Math.abs(N-1)>B&&(this._+="L"+(t+N*a)+","+(i+N*h)),this._+="A"+u+","+u+",0,0,"+ +(h*_>a*d)+","+(this._x1=t+$*k)+","+(this._y1=i+$*o)}},arc:function(t,i,s,l,u,x){t=+t,i=+i,s=+s,x=!!x;var g=s*Math.cos(l),k=s*Math.sin(l),o=t+g,a=i+k,h=1^x,m=x?l-u:u-l;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+o+","+a:(Math.abs(this._x1-o)>B||Math.abs(this._y1-a)>B)&&(this._+="L"+o+","+a),s&&(m<0&&(m=m%nt+nt),m>zt?this._+="A"+s+","+s+",0,1,"+h+","+(t-g)+","+(i-k)+"A"+s+","+s+",0,1,"+h+","+(this._x1=o)+","+(this._y1=a):m>B&&(this._+="A"+s+","+s+",0,"+ +(m>=et)+","+h+","+(this._x1=t+s*Math.cos(u))+","+(this._y1=i+s*Math.sin(u))))},rect:function(t,i,s,l){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)+"h"+ +s+"v"+ +l+"h"+-s+"Z"},toString:function(){return this._}};function ft(t){return function(){return t}}function Bt(t){return t[0]}function Ft(t){return t[1]}var Rt=Array.prototype.slice;function Vt(t){return t.source}function Wt(t){return t.target}function Ut(t){var i=Vt,s=Wt,l=Bt,u=Ft,x=null;function g(){var k,o=Rt.call(arguments),a=i.apply(this,o),h=s.apply(this,o);if(x||(x=k=pt()),t(x,+l.apply(this,(o[0]=a,o)),+u.apply(this,o),+l.apply(this,(o[0]=h,o)),+u.apply(this,o)),k)return x=null,k+""||null}return g.source=function(k){return arguments.length?(i=k,g):i},g.target=function(k){return arguments.length?(s=k,g):s},g.x=function(k){return arguments.length?(l=typeof k=="function"?k:ft(+k),g):l},g.y=function(k){return arguments.length?(u=typeof k=="function"?k:ft(+k),g):u},g.context=function(k){return arguments.length?(x=k??null,g):x},g}function Gt(t,i,s,l,u){t.moveTo(i,s),t.bezierCurveTo(i=(i+l)/2,s,i,u,l,u)}function Yt(){return Ut(Gt)}function Ht(t){return[t.source.x1,t.y0]}function Xt(t){return[t.target.x0,t.y1]}function qt(){return Yt().source(Ht).target(Xt)}var rt=(function(){var t=y(function(k,o,a,h){for(a=a||{},h=k.length;h--;a[k[h]]=o);return a},"o"),i=[1,9],s=[1,10],l=[1,5,10,12],u={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:y(function(o,a,h,m,_,d,v){var T=d.length-1;switch(_){case 7:const A=m.findOrCreateNode(d[T-4].trim().replaceAll('""','"')),M=m.findOrCreateNode(d[T-2].trim().replaceAll('""','"')),I=parseFloat(d[T].trim());m.addLink(A,M,I);break;case 8:case 9:case 11:this.$=d[T];break;case 10:this.$=d[T-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:i,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(l,[2,8]),t(l,[2,9]),{19:[1,16]},t(l,[2,11]),{1:[2,1]},{1:[2,5]},t(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:i,20:s},{15:18,16:7,17:8,18:i,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(l,[2,10]),{15:21,16:7,17:8,18:i,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:y(function(o,a){if(a.recoverable)this.trace(o);else{var h=new Error(o);throw h.hash=a,h}},"parseError"),parse:y(function(o){var a=this,h=[0],m=[],_=[null],d=[],v=this.table,T="",A=0,M=0,I=2,N=1,$=d.slice.call(arguments,1),S=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);S.setInput(o,C.yy),C.yy.lexer=S,C.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var D=S.yylloc;d.push(D);var R=S.options&&S.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(L){h.length=h.length-2*L,_.length=_.length-L,d.length=d.length-L}y(O,"popStack");function j(){var L;return L=m.pop()||S.lex()||N,typeof L!="number"&&(L instanceof Array&&(m=L,L=m.pop()),L=a.symbols_[L]||L),L}y(j,"lex");for(var w,P,E,n,f={},c,e,r,p;;){if(P=h[h.length-1],this.defaultActions[P]?E=this.defaultActions[P]:((w===null||typeof w>"u")&&(w=j()),E=v[P]&&v[P][w]),typeof E>"u"||!E.length||!E[0]){var b="";p=[];for(c in v[P])this.terminals_[c]&&c>I&&p.push("'"+this.terminals_[c]+"'");S.showPosition?b="Parse error on line "+(A+1)+`: +`+S.showPosition()+` +Expecting `+p.join(", ")+", got '"+(this.terminals_[w]||w)+"'":b="Parse error on line "+(A+1)+": Unexpected "+(w==N?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(b,{text:S.match,token:this.terminals_[w]||w,line:S.yylineno,loc:D,expected:p})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+w);switch(E[0]){case 1:h.push(w),_.push(S.yytext),d.push(S.yylloc),h.push(E[1]),w=null,M=S.yyleng,T=S.yytext,A=S.yylineno,D=S.yylloc;break;case 2:if(e=this.productions_[E[1]][1],f.$=_[_.length-e],f._$={first_line:d[d.length-(e||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(e||1)].first_column,last_column:d[d.length-1].last_column},R&&(f._$.range=[d[d.length-(e||1)].range[0],d[d.length-1].range[1]]),n=this.performAction.apply(f,[T,M,A,C.yy,E[1],_,d].concat($)),typeof n<"u")return n;e&&(h=h.slice(0,-1*e*2),_=_.slice(0,-1*e),d=d.slice(0,-1*e)),h.push(this.productions_[E[1]][0]),_.push(f.$),d.push(f._$),r=v[h[h.length-2]][h[h.length-1]],h.push(r);break;case 3:return!0}}return!0},"parse")},x=(function(){var k={EOF:1,parseError:y(function(a,h){if(this.yy.parser)this.yy.parser.parseError(a,h);else throw new Error(a)},"parseError"),setInput:y(function(o,a){return this.yy=a||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:y(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var a=o.match(/(?:\r\n?|\n).*/g);return a?(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:y(function(o){var a=o.length,h=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;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),h.length-1&&(this.yylineno-=h.length-1);var _=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:h?(h.length===m.length?this.yylloc.first_column:0)+m[m.length-h.length].length-h[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-a]),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(o){this.unput(this.match.slice(o))},"less"),pastInput:y(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:y(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:y(function(){var o=this.pastInput(),a=new Array(o.length+1).join("-");return o+this.upcomingInput()+` +`+a+"^"},"showPosition"),test_match:y(function(o,a){var h,m,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),m=o[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],h=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var d in _)this[d]=_[d];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,a,h,m;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),d=0;d<_.length;d++)if(h=this._input.match(this.rules[_[d]]),h&&(!a||h[0].length>a[0].length)){if(a=h,m=d,this.options.backtrack_lexer){if(o=this.test_match(h,_[d]),o!==!1)return o;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(o=this.test_match(a,_[m]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:y(function(){var a=this.next();return a||this.lex()},"lex"),begin:y(function(a){this.conditionStack.push(a)},"begin"),popState:y(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:y(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:y(function(a){this.begin(a)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:y(function(a,h,m,_){switch(m){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return k})();u.lexer=x;function g(){this.yy={}}return y(g,"Parser"),g.prototype=u,u.Parser=g,new g})();rt.parser=rt;var X=rt,Q=[],K=[],q=new Map,Qt=y(()=>{Q=[],K=[],q=new Map,Lt()},"clear"),Kt=class{constructor(t,i,s=0){this.source=t,this.target=i,this.value=s}static{y(this,"SankeyLink")}},Zt=y((t,i,s)=>{Q.push(new Kt(t,i,s))},"addLink"),Jt=class{constructor(t){this.ID=t}static{y(this,"SankeyNode")}},te=y(t=>{t=Et.sanitizeText(t,ot());let i=q.get(t);return i===void 0&&(i=new Jt(t),q.set(t,i),K.push(i)),i},"findOrCreateNode"),ee=y(()=>K,"getNodes"),ne=y(()=>Q,"getLinks"),ie=y(()=>({nodes:K.map(t=>({id:t.ID})),links:Q.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),re={nodesMap:q,getConfig:y(()=>ot().sankey,"getConfig"),getNodes:ee,getLinks:ne,getGraph:ie,addLink:Zt,findOrCreateNode:te,getAccTitle:bt,setAccTitle:vt,getAccDescription:_t,setAccDescription:xt,getDiagramTitle:mt,setDiagramTitle:kt,clear:Qt},yt=class st{static{y(this,"Uid")}static{this.count=0}static next(i){return new st(i+ ++st.count)}constructor(i){this.id=i,this.href=`#${i}`}toString(){return"url("+this.href+")"}},se={left:Ct,right:Pt,center:It,justify:gt},oe=y(t=>{let i=0,s=0;for(const l of t){const u=l.value??0;u>i&&(i=u,s=l.layer??0)}return s},"findCentralNodeLayer"),ae=y(function(t,i,s,l){const{securityLevel:u,sankey:x}=ot(),g=St.sankey;let k;u==="sandbox"&&(k=G("#i"+i));const o=u==="sandbox"?G(k.nodes()[0].contentDocument.body):G("body"),a=u==="sandbox"?o.select(`[id="${i}"]`):G(`[id="${i}"]`),h=x?.width??g.width,m=x?.height??g.width,_=x?.useMaxWidth??g.useMaxWidth,d=x?.nodeAlignment??g.nodeAlignment,v=x?.prefix??g.prefix,T=x?.suffix??g.suffix,A=x?.showValues??g.showValues,M=x?.nodeWidth??g.nodeWidth??10,I=x?.nodePadding??g.nodePadding??12,N=x?.labelStyle??g.labelStyle??"legacy",$=x?.nodeColors??{},S=l.db.getGraph(),C=se[d];jt().nodeId(e=>e.id).nodeWidth(M).nodePadding(I+(A?15:0)).nodeAlign(C).extent([[0,0],[h,m]])(S);const D=oe(S.nodes),R=At(Mt),O=y(e=>$[e]??R(e),"getNodeColor");a.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",e=>(e.uid=yt.next("node-")).id).attr("transform",function(e){return"translate("+e.x0+","+e.y0+")"}).attr("x",e=>e.x0).attr("y",e=>e.y0).append("rect").attr("height",e=>e.y1-e.y0).attr("width",e=>e.x1-e.x0).attr("fill",e=>O(e.id));const j=y(({id:e,value:r})=>A?`${e} +${v}${Math.round(r*100)/100}${T}`:e,"getText"),w=y(e=>N==="outlined"?(e.layer??0)P.selectAll(e?`.${e}`:"text").data(S.nodes).join("text").attr("class",e??null).attr("x",r=>w(r).x).attr("y",r=>(r.y1+r.y0)/2).attr("dy",`${A?"0":"0.35"}em`).attr("text-anchor",r=>w(r).anchor).text(j),"appendLabel");N==="outlined"?(E("sankey-label-bg"),E("sankey-label-fg")):E();const n=a.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),f=x?.linkColor??"gradient";if(f==="gradient"){const e=n.append("linearGradient").attr("id",r=>(r.uid=yt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",r=>r.source.x1).attr("x2",r=>r.target.x0);e.append("stop").attr("offset","0%").attr("stop-color",r=>O(r.source.id)),e.append("stop").attr("offset","100%").attr("stop-color",r=>O(r.target.id))}let c;switch(f){case"gradient":c=y(e=>e.uid,"coloring");break;case"source":c=y(e=>O(e.source.id),"coloring");break;case"target":c=y(e=>O(e.target.id),"coloring");break;default:c=f}n.append("path").attr("d",qt()).attr("stroke",c).attr("stroke-width",e=>Math.max(1,e.width)),wt(void 0,a,0,_)},"draw"),le={draw:ae},ce=y(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` +`).trim(),"prepareTextForParsing"),ue=y(t=>`.label { + font-family: ${t.fontFamily}; + } + + .node-labels { + font-family: ${t.fontFamily}; + } + + /* Outlined label style - background stroke for better readability */ + .sankey-label-bg { + stroke: ${t.mainBkg||t.background||"#fff"}; + stroke-width: 4px; + stroke-linejoin: round; + paint-order: stroke; + } + + /* Foreground label text */ + .sankey-label-fg { + fill: ${t.textColor}; + } + + /* Node styling */ + .node rect { + shape-rendering: crispEdges; + } + + /* Link styling */ + .link { + fill: none; + stroke-opacity: 0.5; + mix-blend-mode: multiply; + } +`,"getStyles"),he=ue,fe=X.parse.bind(X);X.parse=t=>fe(ce(t));var me={styles:he,parser:X,db:re,renderer:le};export{me as diagram}; diff --git a/apps/kimi-code/dist-web/assets/sequenceDiagram-DBY2YBRQ-CY9lM-aK.js b/apps/kimi-code/dist-web/assets/sequenceDiagram-DBY2YBRQ-CY9lM-aK.js new file mode 100644 index 00000000000..21ec914564d --- /dev/null +++ b/apps/kimi-code/dist-web/assets/sequenceDiagram-DBY2YBRQ-CY9lM-aK.js @@ -0,0 +1,162 @@ +import{I as tr}from"./chunk-2Q5K7J3B-NzojNxDT.js";import{_ as x,F as er,c as $,d as Vt,l as at,j as Ce,e as rr,f as ar,k as N,b as ke,s as sr,n as ir,a as nr,g as or,o as cr,G as lr,J as hr,p as dr,i as Yt,x as Z,H as Q,I as Pt,K as Me,Z as Tr,y as Kt,L as pr,M as Be}from"./mermaid.core-WW7RuneT.js";import{a as Er,b as ae,g as dt,d as ur,c as se,e as ie}from"./chunk-32BRIVSS-CRTrWqUr.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var te=(function(){var e=x(function(ut,S,v,P){for(v=v||{},P=ut.length;P--;v[ut[P]]=S);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],n=[1,9],s=[1,11],o=[1,12],u=[1,14],d=[1,15],p=[1,17],_=[1,18],E=[1,19],O=[1,25],T=[1,26],g=[1,27],f=[1,28],I=[1,29],L=[1,30],b=[1,31],w=[1,32],A=[1,33],D=[1,34],M=[1,35],V=[1,36],W=[1,37],U=[1,38],G=[1,39],X=[1,40],nt=[1,42],j=[1,43],q=[1,44],st=[1,45],tt=[1,46],Y=[1,47],C=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],At=[1,74],kt=[1,80],m=[1,81],k=[1,82],lt=[1,83],et=[1,84],K=[1,85],Ot=[1,86],ne=[1,87],oe=[1,88],ce=[1,89],le=[1,90],he=[1,91],de=[1,92],Te=[1,93],pe=[1,94],Ee=[1,95],ue=[1,96],fe=[1,97],_e=[1,98],ge=[1,99],xe=[1,100],Ie=[1,101],ye=[1,102],Re=[1,103],Oe=[1,104],Le=[1,105],be=[2,78],St=[4,5,17,51,53,54],Dt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],me=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Ut=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Ae=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Gt=[5,52],F=[70,71,72,73],ot=[1,151],Xt={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:x(function(S,v,P,y,z,c,wt){var h=c.length-1;switch(z){case 3:return y.apply(c[h]),c[h];case 4:case 10:this.$=[];break;case 5:case 11:c[h-1].push(c[h]),this.$=c[h-1];break;case 6:case 7:case 12:case 13:this.$=c[h];break;case 8:case 9:case 14:this.$=[];break;case 16:c[h].type="createParticipant",this.$=c[h];break;case 17:c[h-1].unshift({type:"boxStart",boxData:y.parseBoxData(c[h-2])}),c[h-1].push({type:"boxEnd",boxText:c[h-2]}),this.$=c[h-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(c[h-2]),sequenceIndexStep:Number(c[h-1]),sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(c[h-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:y.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:y.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[h-1].actor};break;case 24:this.$={type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[h-1].actor};break;case 30:y.setDiagramTitle(c[h].substring(6)),this.$=c[h].substring(6);break;case 31:y.setDiagramTitle(c[h].substring(7)),this.$=c[h].substring(7);break;case 32:this.$=c[h].trim(),y.setAccTitle(this.$);break;case 33:case 34:this.$=c[h].trim(),y.setAccDescription(this.$);break;case 35:c[h-1].unshift({type:"loopStart",loopText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.LOOP_START}),c[h-1].push({type:"loopEnd",loopText:c[h-2],signalType:y.LINETYPE.LOOP_END}),this.$=c[h-1];break;case 36:c[h-1].unshift({type:"rectStart",color:y.parseMessage(c[h-2]),signalType:y.LINETYPE.RECT_START}),c[h-1].push({type:"rectEnd",color:y.parseMessage(c[h-2]),signalType:y.LINETYPE.RECT_END}),this.$=c[h-1];break;case 37:c[h-1].unshift({type:"optStart",optText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.OPT_START}),c[h-1].push({type:"optEnd",optText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.OPT_END}),this.$=c[h-1];break;case 38:c[h-1].unshift({type:"altStart",altText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.ALT_START}),c[h-1].push({type:"altEnd",signalType:y.LINETYPE.ALT_END}),this.$=c[h-1];break;case 39:c[h-1].unshift({type:"parStart",parText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.PAR_START}),c[h-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[h-1];break;case 40:c[h-1].unshift({type:"parStart",parText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.PAR_OVER_START}),c[h-1].push({type:"parEnd",signalType:y.LINETYPE.PAR_END}),this.$=c[h-1];break;case 41:c[h-1].unshift({type:"criticalStart",criticalText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.CRITICAL_START}),c[h-1].push({type:"criticalEnd",signalType:y.LINETYPE.CRITICAL_END}),this.$=c[h-1];break;case 42:c[h-1].unshift({type:"breakStart",breakText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.BREAK_START}),c[h-1].push({type:"breakEnd",optText:y.parseMessage(c[h-2]),signalType:y.LINETYPE.BREAK_END}),this.$=c[h-1];break;case 44:this.$=c[h-3].concat([{type:"option",optionText:y.parseMessage(c[h-1]),signalType:y.LINETYPE.CRITICAL_OPTION},c[h]]);break;case 46:this.$=c[h-3].concat([{type:"and",parText:y.parseMessage(c[h-1]),signalType:y.LINETYPE.PAR_AND},c[h]]);break;case 48:this.$=c[h-3].concat([{type:"else",altText:y.parseMessage(c[h-1]),signalType:y.LINETYPE.ALT_ELSE},c[h]]);break;case 49:c[h-3].draw="participant",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 50:c[h-1].draw="participant",c[h-1].type="addParticipant",this.$=c[h-1];break;case 51:c[h-3].draw="actor",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 52:case 57:c[h-1].draw="actor",c[h-1].type="addParticipant",this.$=c[h-1];break;case 53:c[h-1].type="destroyParticipant",this.$=c[h-1];break;case 54:c[h-3].draw="participant",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 55:c[h-1].draw="participant",c[h-1].type="addParticipant",this.$=c[h-1];break;case 56:c[h-3].draw="actor",c[h-3].type="addParticipant",c[h-3].description=y.parseMessage(c[h-1]),this.$=c[h-3];break;case 58:this.$=[c[h-1],{type:"addNote",placement:c[h-2],actor:c[h-1].actor,text:c[h]}];break;case 59:c[h-2]=[].concat(c[h-1],c[h-1]).slice(0,2),c[h-2][0]=c[h-2][0].actor,c[h-2][1]=c[h-2][1].actor,this.$=[c[h-1],{type:"addNote",placement:y.PLACEMENT.OVER,actor:c[h-2].slice(0,2),text:c[h]}];break;case 60:this.$=[c[h-1],{type:"addLinks",actor:c[h-1].actor,text:c[h]}];break;case 61:this.$=[c[h-1],{type:"addALink",actor:c[h-1].actor,text:c[h]}];break;case 62:this.$=[c[h-1],{type:"addProperties",actor:c[h-1].actor,text:c[h]}];break;case 63:this.$=[c[h-1],{type:"addDetails",actor:c[h-1].actor,text:c[h]}];break;case 66:this.$=[c[h-2],c[h]];break;case 67:this.$=c[h];break;case 68:this.$=y.PLACEMENT.LEFTOF;break;case 69:this.$=y.PLACEMENT.RIGHTOF;break;case 70:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h],activate:!0},{type:"activeStart",signalType:y.LINETYPE.ACTIVE_START,actor:c[h-1].actor}];break;case 71:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h]},{type:"activeEnd",signalType:y.LINETYPE.ACTIVE_END,actor:c[h-4].actor}];break;case 72:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[h-1].actor}];break;case 73:this.$=[c[h-4],c[h-1],{type:"addMessage",from:c[h-4].actor,to:c[h-1].actor,signalType:c[h-2],msg:c[h],activate:!1,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[h-4].actor}];break;case 74:this.$=[c[h-5],c[h-1],{type:"addMessage",from:c[h-5].actor,to:c[h-1].actor,signalType:c[h-3],msg:c[h],activate:!0,centralConnection:y.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:y.LINETYPE.CENTRAL_CONNECTION,actor:c[h-1].actor},{type:"centralConnectionReverse",signalType:y.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:c[h-5].actor}];break;case 75:this.$=[c[h-3],c[h-1],{type:"addMessage",from:c[h-3].actor,to:c[h-1].actor,signalType:c[h-2],msg:c[h]}];break;case 76:this.$={type:"addParticipant",actor:c[h-1],config:c[h]};break;case 77:this.$=c[h-1].trim();break;case 78:this.$={type:"addParticipant",actor:c[h]};break;case 79:this.$=y.LINETYPE.SOLID_OPEN;break;case 80:this.$=y.LINETYPE.DOTTED_OPEN;break;case 81:this.$=y.LINETYPE.SOLID;break;case 82:this.$=y.LINETYPE.SOLID_TOP;break;case 83:this.$=y.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=y.LINETYPE.STICK_TOP;break;case 85:this.$=y.LINETYPE.STICK_BOTTOM;break;case 86:this.$=y.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=y.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=y.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=y.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=y.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=y.LINETYPE.DOTTED;break;case 100:this.$=y.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=y.LINETYPE.SOLID_CROSS;break;case 102:this.$=y.LINETYPE.DOTTED_CROSS;break;case 103:this.$=y.LINETYPE.SOLID_POINT;break;case 104:this.$=y.LINETYPE.DOTTED_POINT;break;case 105:this.$=y.parseMessage(c[h].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:a,6:r},{1:[3]},{3:5,4:t,5:a,6:r},{3:6,4:t,5:a,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},e(C,[2,5]),{9:48,13:13,14:u,15:d,18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},e(C,[2,7]),e(C,[2,8]),e(C,[2,9]),e(C,[2,15]),{13:49,51:U,53:G,54:X},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:Y},{23:56,73:Y},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(C,[2,30]),e(C,[2,31]),{33:[1,62]},{35:[1,63]},e(C,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:At},{23:75,55:76,73:At},{23:77,73:Y},{69:78,72:[1,79],78:kt,79:m,80:k,81:lt,82:et,83:K,84:Ot,85:ne,86:oe,87:ce,88:le,89:he,90:de,91:Te,92:pe,93:Ee,94:ue,95:fe,96:_e,97:ge,98:xe,99:Ie,100:ye,101:Re,102:Oe,103:Le},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:Y},{23:111,73:Y},{23:112,73:Y},{23:113,73:Y},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],be),e(C,[2,6]),e(C,[2,16]),e(St,[2,10],{11:114}),e(C,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(C,[2,22]),{5:[1,118]},{5:[1,119]},e(C,[2,25]),e(C,[2,26]),e(C,[2,27]),e(C,[2,28]),e(C,[2,29]),e(C,[2,32]),e(C,[2,33]),e(Dt,i,{7:120}),e(Dt,i,{7:121}),e(Dt,i,{7:122}),e(me,i,{41:123,7:124}),e(Ut,i,{43:125,7:126}),e(Ut,i,{7:126,43:127}),e(Ae,i,{46:128,7:129}),e(Dt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Gt,be,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:Y},{69:146,78:kt,79:m,80:k,81:lt,82:et,83:K,84:Ot,85:ne,86:oe,87:ce,88:le,89:he,90:de,91:Te,92:pe,93:Ee,94:ue,95:fe,96:_e,97:ge,98:xe,99:Ie,100:ye,101:Re,102:Oe,103:Le},e(F,[2,79]),e(F,[2,80]),e(F,[2,81]),e(F,[2,82]),e(F,[2,83]),e(F,[2,84]),e(F,[2,85]),e(F,[2,86]),e(F,[2,87]),e(F,[2,88]),e(F,[2,89]),e(F,[2,90]),e(F,[2,91]),e(F,[2,92]),e(F,[2,93]),e(F,[2,94]),e(F,[2,95]),e(F,[2,96]),e(F,[2,97]),e(F,[2,98]),e(F,[2,99]),e(F,[2,100]),e(F,[2,101]),e(F,[2,102]),e(F,[2,103]),e(F,[2,104]),{23:147,73:Y},{23:149,60:148,73:Y},{73:[2,68]},{73:[2,69]},{58:150,104:ot},{58:152,104:ot},{58:153,104:ot},{58:154,104:ot},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:U,53:G,54:X},{5:[1,160]},e(C,[2,20]),e(C,[2,21]),e(C,[2,23]),e(C,[2,24]),{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,161],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,162],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,163],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{17:[1,164]},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[2,47],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,50:[1,165],51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{17:[1,166]},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[2,45],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,49:[1,167],51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{17:[1,168]},{17:[1,169]},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[2,43],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,48:[1,170],51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{4:n,5:s,8:8,9:10,10:o,13:13,14:u,15:d,17:[1,171],18:16,19:p,22:_,23:41,24:E,25:20,26:21,27:22,28:23,29:24,30:O,31:T,32:g,34:f,36:I,37:L,38:b,39:w,40:A,42:D,44:M,45:V,47:W,51:U,53:G,54:X,56:nt,61:j,62:q,63:st,64:tt,73:Y},{16:[1,172]},e(C,[2,50]),{16:[1,173]},e(C,[2,55]),e(Gt,[2,76]),{76:[1,174]},{16:[1,175]},e(C,[2,52]),{16:[1,176]},e(C,[2,57]),e(C,[2,53]),{23:177,73:Y},{23:178,73:Y},{23:179,73:Y},{58:180,104:ot},{23:181,72:[1,182],73:Y},{58:183,104:ot},{58:184,104:ot},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(C,[2,17]),e(St,[2,11]),{13:186,51:U,53:G,54:X},e(St,[2,13]),e(St,[2,14]),e(C,[2,19]),e(C,[2,35]),e(C,[2,36]),e(C,[2,37]),e(C,[2,38]),{16:[1,187]},e(C,[2,39]),{16:[1,188]},e(C,[2,40]),e(C,[2,41]),{16:[1,189]},e(C,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:ot},{58:196,104:ot},{58:197,104:ot},{5:[2,75]},{58:198,104:ot},{23:199,73:Y},{5:[2,58]},{5:[2,59]},{23:200,73:Y},e(St,[2,12]),e(me,i,{7:124,41:201}),e(Ut,i,{7:126,43:202}),e(Ae,i,{7:129,46:203}),e(C,[2,49]),e(C,[2,54]),e(Gt,[2,77]),e(C,[2,51]),e(C,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:ot},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:x(function(S,v){if(v.recoverable)this.trace(S);else{var P=new Error(S);throw P.hash=v,P}},"parseError"),parse:x(function(S){var v=this,P=[0],y=[],z=[null],c=[],wt=this.table,h="",Ct=0,Se=0,Ze=2,we=1,Qe=c.slice.call(arguments,1),J=Object.create(this.lexer),gt={yy:{}};for(var Jt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Jt)&&(gt.yy[Jt]=this.yy[Jt]);J.setInput(S,gt.yy),gt.yy.lexer=J,gt.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var Zt=J.yylloc;c.push(Zt);var $e=J.options&&J.options.ranges;typeof gt.yy.parseError=="function"?this.parseError=gt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function je(it){P.length=P.length-2*it,z.length=z.length-it,c.length=c.length-it}x(je,"popStack");function Ne(){var it;return it=y.pop()||J.lex()||we,typeof it!="number"&&(it instanceof Array&&(y=it,it=y.pop()),it=v.symbols_[it]||it),it}x(Ne,"lex");for(var rt,xt,ct,Qt,Lt={},Mt,Tt,Pe,Bt;;){if(xt=P[P.length-1],this.defaultActions[xt]?ct=this.defaultActions[xt]:((rt===null||typeof rt>"u")&&(rt=Ne()),ct=wt[xt]&&wt[xt][rt]),typeof ct>"u"||!ct.length||!ct[0]){var $t="";Bt=[];for(Mt in wt[xt])this.terminals_[Mt]&&Mt>Ze&&Bt.push("'"+this.terminals_[Mt]+"'");J.showPosition?$t="Parse error on line "+(Ct+1)+`: +`+J.showPosition()+` +Expecting `+Bt.join(", ")+", got '"+(this.terminals_[rt]||rt)+"'":$t="Parse error on line "+(Ct+1)+": Unexpected "+(rt==we?"end of input":"'"+(this.terminals_[rt]||rt)+"'"),this.parseError($t,{text:J.match,token:this.terminals_[rt]||rt,line:J.yylineno,loc:Zt,expected:Bt})}if(ct[0]instanceof Array&&ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xt+", token: "+rt);switch(ct[0]){case 1:P.push(rt),z.push(J.yytext),c.push(J.yylloc),P.push(ct[1]),rt=null,Se=J.yyleng,h=J.yytext,Ct=J.yylineno,Zt=J.yylloc;break;case 2:if(Tt=this.productions_[ct[1]][1],Lt.$=z[z.length-Tt],Lt._$={first_line:c[c.length-(Tt||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(Tt||1)].first_column,last_column:c[c.length-1].last_column},$e&&(Lt._$.range=[c[c.length-(Tt||1)].range[0],c[c.length-1].range[1]]),Qt=this.performAction.apply(Lt,[h,Se,Ct,gt.yy,ct[1],z,c].concat(Qe)),typeof Qt<"u")return Qt;Tt&&(P=P.slice(0,-1*Tt*2),z=z.slice(0,-1*Tt),c=c.slice(0,-1*Tt)),P.push(this.productions_[ct[1]][0]),z.push(Lt.$),c.push(Lt._$),Pe=wt[P[P.length-2]][P[P.length-1]],P.push(Pe);break;case 3:return!0}}return!0},"parse")},Je=(function(){var ut={EOF:1,parseError:x(function(v,P){if(this.yy.parser)this.yy.parser.parseError(v,P);else throw new Error(v)},"parseError"),setInput:x(function(S,v){return this.yy=v||this.yy||{},this._input=S,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:x(function(){var S=this._input[0];this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S;var v=S.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),S},"input"),unput:x(function(S){var v=S.length,P=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var y=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 z=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===y.length?this.yylloc.first_column:0)+y[y.length-P.length].length-P[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[z[0],z[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(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:x(function(S){this.unput(this.match.slice(S))},"less"),pastInput:x(function(){var S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var S=this.match;return S.length<20&&(S+=this._input.substr(0,20-S.length)),(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var S=this.pastInput(),v=new Array(S.length+1).join("-");return S+this.upcomingInput()+` +`+v+"^"},"showPosition"),test_match:x(function(S,v){var P,y,z;if(this.options.backtrack_lexer&&(z={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(z.yylloc.range=this.yylloc.range.slice(0))),y=S[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+S[0].length},this.yytext+=S[0],this.match+=S[0],this.matches=S,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(S[0].length),this.matched+=S[0],P=this.performAction.call(this,this.yy,this,v,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),P)return P;if(this._backtrack){for(var c in z)this[c]=z[c];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var S,v,P,y;this._more||(this.yytext="",this.match="");for(var z=this._currentRules(),c=0;cv[0].length)){if(v=P,y=c,this.options.backtrack_lexer){if(S=this.test_match(P,z[c]),S!==!1)return S;if(this._backtrack){v=!1;continue}else return!1}else if(!this.options.flex)break}return v?(S=this.test_match(v,z[y]),S!==!1?S:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var v=this.next();return v||this.lex()},"lex"),begin:x(function(v){this.conditionStack.push(v)},"begin"),popState:x(function(){var v=this.conditionStack.length-1;return v>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(v){return v=this.conditionStack.length-1-Math.abs(v||0),v>=0?this.conditionStack[v]:"INITIAL"},"topState"),pushState:x(function(v){this.begin(v)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(v,P,y,z){switch(y){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return P.yytext=P.yytext.trim(),73;case 12:return P.yytext=P.yytext.trim(),this.begin("ALIAS"),73;case 13:return P.yytext=P.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return P.yytext=P.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return P.yytext=P.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return ut})();Xt.lexer=Je;function vt(){this.yy={}}return x(vt,"Parser"),vt.prototype=Xt,Xt.Parser=vt,new vt})();te.parser=te;var fr=te,_r={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},gr={FILLED:0,OPEN:1},xr={LEFTOF:0,RIGHTOF:1,OVER:2},Wt={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},Ir=class{constructor(){this.state=new tr(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=ke,this.setAccDescription=sr,this.setDiagramTitle=ir,this.getAccTitle=nr,this.getAccDescription=or,this.getDiagramTitle=cr,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap($().wrap),this.LINETYPE=_r,this.ARROWTYPE=gr,this.PLACEMENT=xr}static{x(this,"SequenceDB")}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,t,a,r,i){let n=this.state.records.currentBox,s;if(i!==void 0){let u;i.includes(` +`)?u=i+` +`:u=`{ +`+i+` +}`,s=lr(u,{schema:hr})}r=s?.type??r,s?.alias&&(!a||a.text===t)&&(a={text:s.alias,wrap:a?.wrap,type:r});const o=this.state.records.actors.get(e);if(o){if(this.state.records.currentBox&&o.box&&this.state.records.currentBox!==o.box)throw new Error(`A same participant should only be defined in one Box: ${o.name} can't be in '${o.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(n=o.box?o.box:this.state.records.currentBox,o.box=n,o&&t===o.name&&a==null)return}if(a?.text==null&&(a={text:t,type:r}),(r==null||a.text==null)&&(a={text:t,type:r}),this.state.records.actors.set(e,{box:n,name:t,description:a.text,wrap:a.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"}),this.state.records.prevActor){const u=this.state.records.actors.get(this.state.records.prevActor);u&&(u.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let t,a=0;if(!e)return 0;for(t=0;t>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},o}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:a?.text??"",wrap:a?.wrap??this.autoWrap(),type:r,activate:i,centralConnection:n??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const t=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(t===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:t}}autoWrap(){return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:$().sequence?.wrap??!1}clear(){this.state.reset(),dr()}parseMessage(e){const t=e.trim(),{wrap:a,cleanedText:r}=this.extractWrap(t),i={text:r,wrap:a};return at.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(e){const t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let a=t?.[1]?t[1].trim():"transparent",r=t?.[2]?t[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",a)||(a="transparent",r=e.trim());else{const s=new Option().style;s.color=a,s.color!==a&&(a="transparent",r=e.trim())}const{wrap:i,cleanedText:n}=this.extractWrap(r);return{text:n?Yt(n,$()):void 0,color:a,wrap:i}}addNote(e,t,a){const r={actor:e,placement:t,message:a.text,wrap:a.wrap??this.autoWrap()},i=[].concat(e,e);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:a.text,wrap:a.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,t){const a=this.getActor(e);try{let r=Yt(t.text,$());r=r.replace(/=/g,"="),r=r.replace(/&/g,"&");const i=JSON.parse(r);this.insertLinks(a,i)}catch(r){at.error("error while parsing actor link text",r)}}addALink(e,t){const a=this.getActor(e);try{const r={};let i=Yt(t.text,$());const n=i.indexOf("@");i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const s=i.slice(0,n-1).trim(),o=i.slice(n+1).trim();r[s]=o,this.insertLinks(a,r)}catch(r){at.error("error while parsing actor link text",r)}}insertLinks(e,t){if(e.links==null)e.links=t;else for(const a in t)e.links[a]=t[a]}addProperties(e,t){const a=this.getActor(e);try{const r=Yt(t.text,$()),i=JSON.parse(r);this.insertProperties(a,i)}catch(r){at.error("error while parsing actor properties text",r)}}insertProperties(e,t){if(e.properties==null)e.properties=t;else for(const a in t)e.properties[a]=t[a]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,t){const a=this.getActor(e),r=document.getElementById(t.text);try{const i=r.innerHTML,n=JSON.parse(i);n.properties&&this.insertProperties(a,n.properties),n.links&&this.insertLinks(a,n.links)}catch(i){at.error("error while parsing actor details text",i)}}getActorProperty(e,t){if(e?.properties!==void 0)return e.properties[t]}apply(e){if(Array.isArray(e))e.forEach(t=>{this.apply(t)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":ke(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return $().sequence}},yr=x(e=>{const t=e.dropShadow??"none",{look:a}=$();return`.actor { + stroke: ${e.actorBorder}; + fill: ${e.actorBkg}; + stroke-width: ${e.strokeWidth??1}; + } + + rect.actor.outer-path[data-look="neo"] { + filter: ${t}; + } + + rect.note[data-look="neo"] { + stroke:${e.noteBorderColor}; + fill:${e.noteBkgColor}; + filter: ${t}; + } + + text.actor > tspan { + fill: ${e.actorTextColor}; + stroke: none; + } + + .actor-line { + stroke: ${e.actorLineColor}; + } + + .innerArc { + stroke-width: 1.5; + stroke-dasharray: none; + } + + .messageLine0 { + stroke-width: 1.5; + stroke-dasharray: none; + stroke: ${e.signalColor}; + } + + .messageLine1 { + stroke-width: 1.5; + stroke-dasharray: 2, 2; + stroke: ${e.signalColor}; + } + + [id$="-arrowhead"] path { + fill: ${e.signalColor}; + stroke: ${e.signalColor}; + } + + .sequenceNumber { + fill: ${e.sequenceNumberColor}; + } + + [id$="-sequencenumber"] { + fill: ${e.signalColor}; + } + + [id$="-crosshead"] path { + fill: ${e.signalColor}; + stroke: ${e.signalColor}; + } + + .messageText { + fill: ${e.signalTextColor}; + stroke: none; + } + + .labelBox { + stroke: ${e.labelBoxBorderColor}; + fill: ${e.labelBoxBkgColor}; + filter: ${a==="neo"?t:"none"}; + } + + .labelText, .labelText > tspan { + fill: ${e.labelTextColor}; + stroke: none; + } + + .loopText, .loopText > tspan { + fill: ${e.loopTextColor}; + stroke: none; + } + + .sectionTitle, .sectionTitle > tspan { + fill: ${e.loopTextColor}; + stroke: none; + } + + .loopLine { + stroke-width: 2px; + stroke-dasharray: 2, 2; + stroke: ${e.labelBoxBorderColor}; + fill: ${e.labelBoxBorderColor}; + } + + .note { + //stroke: #decc93; + stroke: ${e.noteBorderColor}; + fill: ${e.noteBkgColor}; + } + + .noteText, .noteText > tspan { + fill: ${e.noteTextColor}; + stroke: none; + ${e.noteFontWeight?`font-weight: ${e.noteFontWeight};`:""} + } + + .activation0 { + fill: ${e.activationBkgColor}; + stroke: ${e.activationBorderColor}; + } + + .activation1 { + fill: ${e.activationBkgColor}; + stroke: ${e.activationBorderColor}; + } + + .activation2 { + fill: ${e.activationBkgColor}; + stroke: ${e.activationBorderColor}; + } + + .actorPopupMenu { + position: absolute; + } + + .actorPopupMenuPanel { + position: absolute; + fill: ${e.actorBkg}; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4)); +} + .actor-man circle, line { + fill: ${e.actorBkg}; + stroke-width: 2px; + } + + g rect.rect { + filter: ${t}; + stroke: ${e.nodeBorder}; + } +`},"getStyles"),Rr=yr,It=36,ft="actor-top",_t="actor-bottom",Ht="actor-box",yt="actor-man",pt=new Set(["redux-color","redux-dark-color"]),Nt=x(function(e,t){const a=ur(e,t);return Kt().look==="neo"&&a.attr("data-look","neo"),a},"drawRect"),Or=x(function(e,t,a,r,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};const n=t.links,s=t.actorCnt,o=t.rectData;var u="none";i&&(u="block !important");const d=e.append("g");d.attr("id","actor"+s+"_popup"),d.attr("class","actorPopupMenu"),d.attr("display",u);var p="";o.class!==void 0&&(p=" "+o.class);let _=o.width>a?o.width:a;const E=d.append("rect");if(E.attr("class","actorPopupMenuPanel"+p),E.attr("x",o.x),E.attr("y",o.height),E.attr("fill",o.fill),E.attr("stroke",o.stroke),E.attr("width",_),E.attr("height",o.height),E.attr("rx",o.rx),E.attr("ry",o.ry),n!=null){var O=20;for(let f in n){var T=d.append("a"),g=Ce.sanitizeUrl(n[f]);T.attr("xlink:href",g),T.attr("target","_blank"),Ur(r)(f,T,o.x+10,o.height+O,_,20,{class:"actor"},r),O+=30}}return E.attr("height",O),{height:o.height+O,width:_}},"drawPopup"),qt=x(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Ft=x(async function(e,t,a=null){let r=e.append("foreignObject");const i=await Be(t.text,Kt()),s=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(r.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),t.class==="noteText"){const o=e.node().firstChild;o.setAttribute("height",s.height+2*t.textMargin);const u=o.getBBox();r.attr("x",Math.round(u.x+u.width/2-s.width/2)).attr("y",Math.round(u.y+u.height/2-s.height/2))}else if(a){let{startx:o,stopx:u,starty:d}=a;if(o>u){const p=o;o=u,u=p}r.attr("x",Math.round(o+Math.abs(o-u)/2-s.width/2)),t.class==="loopText"?r.attr("y",Math.round(d)):r.attr("y",Math.round(d-s.height))}return[r]},"drawKatex"),mt=x(function(e,t){let a=0,r=0;const i=t.text.split(N.lineBreakRegex),[n,s]=Me(t.fontSize);let o=[],u=0,d=x(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":d=x(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":d=x(()=>Math.round(t.y+(a+r+t.textMargin)/2),"yfunc");break;case"bottom":case"end":d=x(()=>Math.round(t.y+(a+r+2*t.textMargin)-t.textMargin),"yfunc");break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin),t.anchor="start",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2),t.anchor="middle",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin),t.anchor="end",t.dominantBaseline="middle",t.alignmentBaseline="middle";break}for(let[p,_]of i.entries()){t.textMargin!==void 0&&t.textMargin===0&&n!==void 0&&(u=p*n);const E=e.append("text");E.attr("x",t.x),E.attr("y",d()),t.anchor!==void 0&&E.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&E.style("font-family",t.fontFamily),s!==void 0&&E.style("font-size",s),t.fontWeight!==void 0&&E.style("font-weight",t.fontWeight),t.fill!==void 0&&E.attr("fill",t.fill),t.class!==void 0&&E.attr("class",t.class),t.dy!==void 0?E.attr("dy",t.dy):u!==0&&E.attr("dy",u);const O=_||Tr;if(t.tspan){const T=E.append("tspan");T.attr("x",t.x),t.fill!==void 0&&T.attr("fill",t.fill),T.text(O)}else E.text(O);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(r+=(E._groups||E)[0][0].getBBox().height,a=r),o.push(E)}return o},"drawText"),Ve=x(function(e,t){function a(i,n,s,o,u){return i+","+n+" "+(i+s)+","+n+" "+(i+s)+","+(n+o-u)+" "+(i+s-u*1.2)+","+(n+o)+" "+i+","+(n+o)}x(a,"genPoints");const r=e.append("polygon");return r.attr("points",a(t.x,t.y,t.width,t.height,7)),r.attr("class","labelBox"),t.y=t.y+t.height/2,mt(e,t),r},"drawLabel"),B=-1,Ye=x((e,t,a,r)=>{e.select&&a.forEach(i=>{const n=t.get(i),s=e.select("#actor"+n.actorCnt);!r.mirrorActors&&n.stopy?s.attr("y2",n.stopy+n.height/2):r.mirrorActors&&s.attr("y2",n.stopy)})},"fixLifeLineHeights"),Lr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,o=n+t.height,{look:u,theme:d,themeVariables:p}=a,{bkgColorArray:_,borderColorArray:E}=p,O=e.append("g").lower();var T=O;r||(B++,Object.keys(t.links||{}).length&&!a.forceMenus&&T.attr("onclick",qt(`actor${B}_popup`)).attr("cursor","pointer"),T.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),T=O.append("g"),t.actorCnt=B,t.links!=null&&T.attr("id","root-"+B),u==="neo"&&T.attr("data-look","neo"));const g=dt();var f="actor";t.properties?.class?f=t.properties.class:g.fill="#eaeaea",r?f+=` ${_t}`:f+=` ${ft}`,g.x=t.x,g.y=n,g.width=t.width,g.height=t.height,g.class=f,g.rx=3,g.ry=3,g.name=t.name,u==="neo"&&(g.rx=6,g.ry=6);const I=Nt(T,g),L=i.get(t.name)??0;if(pt.has(d)&&(I.style("stroke",E[L%E.length]),I.style("fill",_[L%E.length])),u==="neo"&&I.attr("filter","url(#drop-shadow)"),t.rectData=g,t.properties?.icon){const w=t.properties.icon.trim();w.charAt(0)==="@"?se(T,g.x+g.width-20,g.y+10,w.substr(1)):ie(T,g.x+g.width-20,g.y+10,w)}r||(T.attr("data-et","participant"),T.attr("data-type","participant"),T.attr("data-id",t.name)),Et(a,Q(t.description))(t.description,T,g.x,g.y,g.width,g.height,{class:`actor ${Ht}`},a);let b=t.height;if(I.node){const w=I.node().getBBox();t.height=w.height,b=w.height}return b},"drawActorTypeParticipant"),br=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,o=n+t.height,{look:u,theme:d,themeVariables:p}=a,{bkgColorArray:_,borderColorArray:E}=p,O=e.append("g").lower();var T=O;r||(B++,Object.keys(t.links||{}).length&&!a.forceMenus&&T.attr("onclick",qt(`actor${B}_popup`)).attr("cursor","pointer"),T.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),T=O.append("g"),t.actorCnt=B,t.links!=null&&T.attr("id","root-"+B),u==="neo"&&T.attr("data-look","neo"));const g=dt();var f="actor";t.properties?.class?f=t.properties.class:g.fill="#eaeaea",r?f+=` ${_t}`:f+=` ${ft}`,g.x=t.x,g.y=n,g.width=t.width,g.height=t.height,g.class=f,g.name=t.name;const I=6,L={...g,x:g.x+-I,y:g.y+ +I,class:"actor"},b=Nt(T,g),w=Nt(T,L);t.rectData=g,u==="neo"&&T.attr("filter","url(#drop-shadow)");const A=i.get(t.name)??0;if(pt.has(d)&&(b.style("stroke",E[A%E.length]),b.style("fill",_[A%E.length]),w.style("stroke",E[A%E.length]),w.style("fill",_[A%E.length])),t.properties?.icon){const M=t.properties.icon.trim();M.charAt(0)==="@"?se(T,g.x+g.width-20,g.y+10,M.substr(1)):ie(T,g.x+g.width-20,g.y+10,M)}Et(a,Q(t.description))(t.description,T,g.x-I,g.y+I,g.width,g.height,{class:`actor ${Ht}`},a);let D=t.height;if(b.node){const M=b.node().getBBox();t.height=M.height,D=M.height}return r||(T.attr("data-et","participant"),T.attr("data-type","collections"),T.attr("data-id",t.name)),D},"drawActorTypeCollections"),mr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,o=n+t.height,{look:u,theme:d,themeVariables:p}=a,{bkgColorArray:_,borderColorArray:E}=p,O=e.append("g").lower();let T=O;r||(B++,Object.keys(t.links||{}).length&&!a.forceMenus&&T.attr("onclick",qt(`actor${B}_popup`)).attr("cursor","pointer"),T.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),T=O.append("g"),t.actorCnt=B,t.links!=null&&T.attr("id","root-"+B),u==="neo"&&T.attr("data-look","neo"));const g=dt();let f="actor";t.properties?.class?f=t.properties.class:g.fill="#eaeaea",r?f+=` ${_t}`:f+=` ${ft}`,T.attr("class",f),g.x=t.x,g.y=n,g.width=t.width,g.height=t.height,g.name=t.name;const I=g.height/2,L=I/(2.5+g.height/50),b=T.append("g"),w=T.append("g"),A=`M ${g.x},${g.y+I} + a ${L},${I} 0 0 0 0,${g.height} + h ${g.width-2*L} + a ${L},${I} 0 0 0 0,-${g.height} + Z + `;b.append("path").attr("d",A),w.append("path").attr("d",`M ${g.x},${g.y+I} + a ${L},${I} 0 0 0 0,${g.height}`),b.attr("transform",`translate(${L}, ${-(g.height/2)})`),w.attr("transform",`translate(${g.width-L}, ${-g.height/2})`),t.rectData=g,u==="neo"&&b.attr("filter","url(#drop-shadow)");const D=i.get(t.name)??0;if(pt.has(d)&&(b.style("stroke",E[D%E.length]),b.style("fill",_[D%E.length]),w.style("stroke",E[D%E.length]),w.style("fill",_[D%E.length])),t.properties?.icon){const W=t.properties.icon.trim(),U=g.x+g.width-20,G=g.y+10;W.charAt(0)==="@"?se(T,U,G,W.substr(1)):ie(T,U,G,W)}Et(a,Q(t.description))(t.description,T,g.x,g.y,g.width,g.height,{class:`actor ${Ht}`},a);let M=t.height;const V=b.select("path:last-child");if(V.node()){const W=V.node().getBBox();t.height=W.height,M=W.height}return r||(T.attr("data-et","participant"),T.attr("data-type","queue"),T.attr("data-id",t.name)),M},"drawActorTypeQueue"),Ar=x(function(e,t,a,r,i,n){const s=r?t.stopy:t.starty,o=t.x+t.width/2,u=s+75,{look:d,theme:p,themeVariables:_}=a,{bkgColorArray:E,borderColorArray:O,actorBorder:T,actorBkg:g}=_,f=e.append("g").lower();r||(B++,f.append("line").attr("id","actor"+B).attr("x1",o).attr("y1",u).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);const I=e.append("g");let L=yt;r?L+=` ${_t}`:L+=` ${ft}`,I.attr("class",L),I.attr("name",t.name);const b=dt();b.x=t.x,b.y=s,b.fill="#eaeaea",b.width=t.width,b.height=t.height,b.class="actor";const w=t.x+t.width/2,A=s+32,D=22;I.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),I.append("circle").attr("cx",w).attr("cy",A).attr("r",D).attr("filter",`${d==="neo"?"url(#drop-shadow)":""}`),I.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${w}, ${A-D})`);const M=n.get(t.name)??0;pt.has(p)?(I.style("stroke",O[M%O.length]),I.style("fill",E[M%O.length])):(I.style("stroke",T),I.style("fill",g));const V=I.node().getBBox();return t.height=V.height+2*(a?.sequence?.labelBoxHeight??0),Et(a,Q(t.description))(t.description,I,b.x,b.y+D+(r?5:12),b.width,b.height,{class:`actor ${yt}`},a),r||(I.attr("data-et","participant"),I.attr("data-type","control"),I.attr("data-id",t.name)),t.height},"drawActorTypeControl"),Sr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,o=n+75,{look:u,theme:d,themeVariables:p}=a,{bkgColorArray:_,borderColorArray:E}=p,O=e.append("g").lower(),T=e.append("g");let g="actor";r?g+=` ${_t}`:g+=` ${ft}`,T.attr("class",g),T.attr("name",t.name);const f=dt();f.x=t.x,f.y=n,f.fill="#eaeaea",f.width=t.width,f.height=t.height,f.class="actor";const I=t.x+t.width/2,L=n+(r?10:25),b=22;T.append("circle").attr("cx",I).attr("cy",L).attr("r",b).attr("width",t.width).attr("height",t.height),T.append("line").attr("x1",I-b).attr("x2",I+b).attr("y1",L+b).attr("y2",L+b).attr("stroke-width",2),u==="neo"&&T.attr("filter","url(#drop-shadow)");const w=i.get(t.name)??0;pt.has(d)&&(T.style("stroke",E[w%E.length]),T.style("fill",_[w%E.length]));const A=T.node().getBBox();return t.height=A.height+(a?.sequence?.labelBoxHeight??0),r||(B++,O.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B),Et(a,Q(t.description))(t.description,T,f.x,f.y+(r?15:30),f.width,f.height,{class:`actor ${yt}`},a),r?T.attr("transform",`translate(0, ${b})`):(T.attr("transform",`translate(0, ${b/2-5})`),T.attr("data-et","participant"),T.attr("data-type","entity"),T.attr("data-id",t.name)),t.height},"drawActorTypeEntity"),wr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,o=n+t.height+2*a.boxTextMargin,{theme:u,themeVariables:d,look:p}=a,{bkgColorArray:_,borderColorArray:E,actorBorder:O}=d,T=e.append("g").lower();let g=T;r||(B++,Object.keys(t.links||{}).length&&!a.forceMenus&&g.attr("onclick",qt(`actor${B}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),g=T.append("g"),t.actorCnt=B,t.links!=null&&g.attr("id","root-"+B),p==="neo"&&g.attr("data-look","neo"));const f=dt();let I="actor";t.properties?.class?I=t.properties.class:f.fill="#eaeaea",r?I+=` ${_t}`:I+=` ${ft}`,f.x=t.x,f.y=n,f.width=t.width,f.height=t.height,f.class=I,f.name=t.name,f.x=t.x,f.y=n;const L=f.width/3,b=f.width/3,w=L/2,A=w/(2.5+L/50),D=g.append("g");D.attr("class",I);const M=` + M ${f.x},${f.y+A} + a ${w},${A} 0 0 0 ${L},0 + a ${w},${A} 0 0 0 -${L},0 + l 0,${b-2*A} + a ${w},${A} 0 0 0 ${L},0 + l 0,-${b-2*A} +`;D.append("path").attr("d",M),p==="neo"&&D.attr("filter","url(#drop-shadow)");const V=i.get(t.name)??0;pt.has(u)?(D.style("stroke",E[V%E.length]),D.style("fill",_[V%E.length])):D.style("stroke",O),D.attr("transform",`translate(${L}, ${A})`),t.rectData=f,Et(a,Q(t.description))(t.description,g,f.x,f.y+35,f.width,f.height,{class:`actor ${Ht}`},a);const W=D.select("path:last-child");if(W.node()){const U=W.node().getBBox();t.height=U.height+(a.sequence.labelBoxHeight??0)}return r||(g.attr("data-et","participant"),g.attr("data-type","database"),g.attr("data-id",t.name)),t.height},"drawActorTypeDatabase"),Nr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,o=n+80,u=22,d=e.append("g").lower(),{look:p,theme:_,themeVariables:E}=a,{bkgColorArray:O,borderColorArray:T,actorBorder:g}=E;r||(B++,d.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);const f=e.append("g");let I=yt;r?I+=` ${_t}`:I+=` ${ft}`,f.attr("class",I),f.attr("name",t.name);const L=dt();L.x=t.x,L.y=n,L.fill="#eaeaea",L.width=t.width,L.height=t.height,L.class="actor",f.append("line").attr("id","actor-man-torso"+B).attr("x1",t.x+t.width/2-u*2.5).attr("y1",n+12).attr("x2",t.x+t.width/2-15).attr("y2",n+12),f.append("line").attr("id","actor-man-arms"+B).attr("x1",t.x+t.width/2-u*2.5).attr("y1",n+2).attr("x2",t.x+t.width/2-u*2.5).attr("y2",n+22),f.append("circle").attr("cx",t.x+t.width/2).attr("cy",n+12).attr("r",u),p==="neo"&&f.attr("filter","url(#drop-shadow)");const b=i.get(t.name)??0;pt.has(_)?(f.style("stroke",T[b%T.length]),f.style("fill",O[b%T.length])):f.style("stroke",g);const w=f.node().getBBox();return t.height=w.height+(a.sequence.labelBoxHeight??0),Et(a,Q(t.description))(t.description,f,L.x,L.y+15,L.width,L.height,{class:`actor ${yt}`},a),f.attr("transform",`translate(0,${u/2+10})`),r||(f.attr("data-et","participant"),f.attr("data-type","boundary"),f.attr("data-id",t.name)),t.height},"drawActorTypeBoundary"),Pr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,o=n+80,{look:u,theme:d,themeVariables:p}=a,{bkgColorArray:_,borderColorArray:E,actorBorder:O}=p,T=e.append("g").lower();r||(B++,T.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);const g=e.append("g");let f=yt;r?f+=` ${_t}`:f+=` ${ft}`,g.attr("class",f),g.attr("name",t.name),r||g.attr("data-et","participant").attr("data-type","actor").attr("data-id",t.name);const I=u==="neo"?.5:1,L=u==="neo"?n+(1-I)*30:n;g.append("line").attr("id","actor-man-torso"+B).attr("x1",s).attr("y1",L+25*I).attr("x2",s).attr("y2",L+45*I),g.append("line").attr("id","actor-man-arms"+B).attr("x1",s-It/2*I).attr("y1",L+33*I).attr("x2",s+It/2*I).attr("y2",L+33*I),g.append("line").attr("x1",s-It/2*I).attr("y1",L+60*I).attr("x2",s).attr("y2",L+45*I),g.append("line").attr("x1",s).attr("y1",L+45*I).attr("x2",s+(It/2-2)*I).attr("y2",L+60*I);const b=g.append("circle");b.attr("cx",t.x+t.width/2),b.attr("cy",L+10*I),b.attr("r",15*I),b.attr("width",t.width*I),b.attr("height",t.height*I);const w=g.node().getBBox();t.height=w.height;const A=dt();A.x=t.x,A.y=L,A.fill="#eaeaea",A.width=t.width,A.height=t.height/I,A.class="actor",A.rx=3,A.ry=3;const D=i.get(t.name)??0;return pt.has(d)?(g.style("stroke",E[D%E.length]),g.style("fill",_[D%E.length])):g.style("stroke",O),Et(a,Q(t.description))(t.description,g,A.x,L+35*I-(u==="neo"?10:0),A.width,A.height,{class:`actor ${yt}`},a),t.height},"drawActorTypeActor"),kr=x(async function(e,t,a,r,i,n,s){const o=s??new Map([...n.db.getActors().values()].map((u,d)=>[u.name,d]));switch(t.type){case"actor":return await Pr(e,t,a,r,o);case"participant":return await Lr(e,t,a,r,o);case"boundary":return await Nr(e,t,a,r,o);case"control":return await Ar(e,t,a,r,i,o);case"entity":return await Sr(e,t,a,r,o);case"database":return await wr(e,t,a,r,o);case"collections":return await br(e,t,a,r,o);case"queue":return await mr(e,t,a,r,o)}},"drawActor"),Dr=x(function(e,t,a){const i=e.append("g");We(i,t),t.name&&Et(a)(t.name,i,t.x,t.y+a.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},a),i.lower()},"drawBox"),vr=x(function(e){return e.append("g")},"anchorElement"),Cr=x(function(e,t,a,r,i,n,s){const{theme:o,themeVariables:u}=r,{bkgColorArray:d,borderColorArray:p,mainBkg:_}=u,E=dt(),O=t.anchored,T=t.actor;E.x=t.startx,E.y=t.starty,E.class="activation"+i%3,E.width=t.stopx-t.startx,E.height=a-t.starty;const g=Nt(O,E),I=(s??new Map([...n.db.getActors().values()].map((L,b)=>[L.name,b]))).get(T)??0;pt.has(o)&&(g.style("stroke",p[I%p.length]),g.style("fill",d[I%p.length]??_))},"drawActivation"),Mr=x(async function(e,t,a,r,i){const{boxMargin:n,boxTextMargin:s,labelBoxHeight:o,labelBoxWidth:u,messageFontFamily:d,messageFontSize:p,messageFontWeight:_}=r,E=e.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),O=x(function(f,I,L,b){return E.append("line").attr("x1",f).attr("y1",I).attr("x2",L).attr("y2",b).attr("class","loopLine")},"drawLoopLine");O(t.startx,t.starty,t.stopx,t.starty),O(t.stopx,t.starty,t.stopx,t.stopy),O(t.startx,t.stopy,t.stopx,t.stopy),O(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(f){O(t.startx,f.y,t.stopx,f.y).style("stroke-dasharray","3, 3")});let T=ae();T.text=a,T.x=t.startx,T.y=t.starty,T.fontFamily=d,T.fontSize=p,T.fontWeight=_,T.anchor="middle",T.valign="middle",T.tspan=!1,T.width=Math.max(u??0,50),T.height=o+(r.look==="neo"?15:0)||20,T.textMargin=s,T.class="labelText",Ve(E,T),T=Ke(),T.text=t.title,T.x=t.startx+u/2+(t.stopx-t.startx)/2,T.y=t.starty+n+s,T.anchor="middle",T.valign="middle",T.textMargin=s,T.class="loopText",T.fontFamily=d,T.fontSize=p,T.fontWeight=_,T.wrap=!0;let g=Q(T.text)?await Ft(E,T,t):mt(E,T);if(t.sectionTitles!==void 0){for(const[f,I]of Object.entries(t.sectionTitles))if(I.message){T.text=I.message,T.x=t.startx+(t.stopx-t.startx)/2,T.y=t.sections[f].y+n+s,T.class="sectionTitle",T.anchor="middle",T.valign="middle",T.tspan=!1,T.fontFamily=d,T.fontSize=p,T.fontWeight=_,T.wrap=t.wrap,Q(T.text)?(t.starty=t.sections[f].y,await Ft(E,T,t)):mt(E,T);let L=Math.round(g.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,w)=>b+w));t.sections[f].height+=L-(n+s)}}return t.height=Math.round(t.stopy-t.starty),E},"drawLoop"),We=x(function(e,t){Er(e,t)},"drawBackgroundRect"),Br=x(function(e,t){e.append("defs").append("symbol").attr("id",t+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Vr=x(function(e,t){e.append("defs").append("symbol").attr("id",t+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),Yr=x(function(e,t){e.append("defs").append("symbol").attr("id",t+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),Wr=x(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),Kr=x(function(e,t){e.append("defs").append("marker").attr("id",t+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),Fr=x(function(e,t){e.append("defs").append("marker").attr("id",t+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),Hr=x(function(e,t){e.append("defs").append("marker").attr("id",t+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),qr=x(function(e,t){const{theme:a}=t;e.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a==="redux"||a==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),Ke=x(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),zr=x(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Et=(function(){function e(n,s,o,u,d,p,_){const E=s.append("text").attr("x",o+d/2).attr("y",u+p/2+5).style("text-anchor","middle").text(n);i(E,_)}x(e,"byText");function t(n,s,o,u,d,p,_,E){const{actorFontSize:O,actorFontFamily:T,actorFontWeight:g}=E,[f,I]=Me(O),L=n.split(N.lineBreakRegex);for(let b=0;be.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:x(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:x(function(e){this.boxes.push(e)},"addBox"),addActor:x(function(e){this.actors.push(e)},"addActor"),addLoop:x(function(e){this.loops.push(e)},"addLoop"),addMessage:x(function(e){this.messages.push(e)},"addMessage"),addNote:x(function(e){this.notes.push(e)},"addNote"),lastActor:x(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:x(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:x(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:x(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:x(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,qe($())},"init"),updateVal:x(function(e,t,a,r){e[t]===void 0?e[t]=a:e[t]=r(a,e[t])},"updateVal"),updateBounds:x(function(e,t,a,r){const i=this;let n=0;function s(o){return x(function(d){n++;const p=i.sequenceItems.length-n+1;i.updateVal(d,"starty",t-p*l.boxMargin,Math.min),i.updateVal(d,"stopy",r+p*l.boxMargin,Math.max),i.updateVal(R.data,"startx",e-p*l.boxMargin,Math.min),i.updateVal(R.data,"stopx",a+p*l.boxMargin,Math.max),o!=="activation"&&(i.updateVal(d,"startx",e-p*l.boxMargin,Math.min),i.updateVal(d,"stopx",a+p*l.boxMargin,Math.max),i.updateVal(R.data,"starty",t-p*l.boxMargin,Math.min),i.updateVal(R.data,"stopy",r+p*l.boxMargin,Math.max))},"updateItemBounds")}x(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:x(function(e,t,a,r){const i=N.getMin(e,a),n=N.getMax(e,a),s=N.getMin(t,r),o=N.getMax(t,r);this.updateVal(R.data,"startx",i,Math.min),this.updateVal(R.data,"starty",s,Math.min),this.updateVal(R.data,"stopx",n,Math.max),this.updateVal(R.data,"stopy",o,Math.max),this.updateBounds(i,s,n,o)},"insert"),newActivation:x(function(e,t,a){const r=a.get(e.from),i=zt(e.from).length||0,n=r.x+r.width/2+(i-1)*l.activationWidth/2;this.activations.push({startx:n,starty:this.verticalPos+2,stopx:n+l.activationWidth,stopy:void 0,actor:e.from,anchored:H.anchorElement(t)})},"newActivation"),endActivation:x(function(e){const t=this.activations.map(function(a){return a.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:x(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},"createLoop"),newLoop:x(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:x(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:x(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:x(function(e){const t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:R.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:x(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:x(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:x(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=N.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return{bounds:this.data,models:this.models}},"getBounds")},Qr=x(async function(e,t,a){R.bumpVerticalPos(l.boxMargin),t.height=l.boxMargin,t.starty=R.getVerticalPos();const r=dt();r.x=t.startx,r.y=t.starty,r.width=t.width||l.width,r.class="note";const i=e.append("g");i.attr("data-et","note"),i.attr("data-id","i"+a);const n=H.drawRect(i,r),s=ae();s.x=t.startx,s.y=t.starty,s.width=r.width,s.dy="1em",s.text=t.message,s.class="noteText",s.fontFamily=l.noteFontFamily,s.fontSize=l.noteFontSize,s.fontWeight=l.noteFontWeight,s.anchor=l.noteAlign,s.textMargin=l.noteMargin,s.valign="center";const o=Q(s.text)?await Ft(i,s):mt(i,s),u=Math.round(o.map(d=>(d._groups||d)[0][0].getBBox().height).reduce((d,p)=>d+p));n.attr("height",u+2*l.noteMargin),t.height+=u+2*l.noteMargin,R.bumpVerticalPos(u+2*l.noteMargin),t.stopy=t.starty+u+2*l.noteMargin,t.stopx=t.startx+r.width,R.insert(t.startx,t.starty,t.stopx,t.stopy),R.models.addNote(t)},"drawNote"),De=x(function(e,t,a,r,i,n,s){const o=r.db.getActors(),u=o.get(t.from),d=o.get(t.to),p=a.sequenceVisible;let _=u.x+u.width/2,E=d.x+d.width/2;const O=_<=E,T=Xe(t,r),g=e.append("g"),f=16.5,I=x((D,M)=>{const V=D?f:-f;return M?-V:V},"getCircleOffset"),L=x(D=>{g.append("circle").attr("cx",D).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:w,CENTRAL_CONNECTION_DUAL:A}=r.db.LINETYPE;if(p)switch(t.centralConnection){case b:T&&(E+=I(O,!0));break;case w:T||(_+=I(O,!1));break;case A:T?E+=I(O,!0):_+=I(O,!1);break}switch(t.centralConnection){case b:L(E);break;case w:L(_);break;case A:L(_),L(E);break}},"drawCentralConnection"),Rt=x(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),bt=x(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),ee=x(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function Fe(e,t){R.bumpVerticalPos(10);const{startx:a,stopx:r,message:i}=t,n=N.splitBreaks(i).length,s=Q(i),o=s?await Pt(i,$()):Z.calculateTextDimensions(i,Rt(l));if(!s){const _=o.height/n;t.height+=_,R.bumpVerticalPos(_)}let u,d=o.height-10;const p=o.width;if(a===r){u=R.getVerticalPos()+d,l.rightAngles||(d+=l.boxMargin,u=R.getVerticalPos()+d),d+=30;const _=N.getMax(p/2,l.width/2);R.insert(a-_,R.getVerticalPos()-10+d,r+_,R.getVerticalPos()+30+d)}else d+=l.boxMargin,u=R.getVerticalPos()+d,R.insert(a,u-10,r,u);return R.bumpVerticalPos(d),t.height+=d,t.stopy=t.starty+t.height,R.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),u}x(Fe,"boundMessage");var $r=x(async function(e,t,a,r,i,n){const{startx:s,stopx:o,starty:u,message:d,type:p,sequenceIndex:_,sequenceVisible:E}=t,O=Z.calculateTextDimensions(d,Rt(l)),T=ae();T.x=Math.min(s,o),T.y=u+10,T.width=Math.abs(o-s),T.class="messageText",T.dy="1em",T.text=d,T.fontFamily=l.messageFontFamily,T.fontSize=l.messageFontSize,T.fontWeight=l.messageFontWeight,T.anchor=l.messageAlign,T.valign="center",T.textMargin=l.wrapPadding,T.tspan=!1,Q(T.text)?await Ft(e,T,{startx:s,stopx:o,starty:a}):mt(e,T);const g=O.width;let f;if(s===o){const L=E||l.showSequenceNumbers,b=Xe(i,r),w=ia(i,r),A=s+(L&&(b||w)?10:0);l.rightAngles?f=e.append("path").attr("d",`M ${A},${a} H ${s+N.getMax(l.width/2,g/2)} V ${a+25} H ${s}`):f=e.append("path").attr("d","M "+A+","+a+" C "+(A+60)+","+(a-10)+" "+(s+60)+","+(a+30)+" "+s+","+(a+20)),jt(i,r)&&De(e,i,t,r,s,o,a)}else f=e.append("line"),f.attr("x1",s),f.attr("y1",a),f.attr("x2",o),f.attr("y2",a),jt(i,r)&&De(e,i,t,r,s,o,a);p===r.db.LINETYPE.DOTTED||p===r.db.LINETYPE.DOTTED_CROSS||p===r.db.LINETYPE.DOTTED_POINT||p===r.db.LINETYPE.DOTTED_OPEN||p===r.db.LINETYPE.BIDIRECTIONAL_DOTTED||p===r.db.LINETYPE.SOLID_TOP_DOTTED||p===r.db.LINETYPE.SOLID_BOTTOM_DOTTED||p===r.db.LINETYPE.STICK_TOP_DOTTED||p===r.db.LINETYPE.STICK_BOTTOM_DOTTED||p===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||p===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||p===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||p===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(f.style("stroke-dasharray","3, 3"),f.attr("class","messageLine1")):f.attr("class","messageLine0"),f.attr("data-et","message"),f.attr("data-id","i"+t.id),f.attr("data-from",t.from),f.attr("data-to",t.to);let I="";if(l.arrowMarkerAbsolute&&(I=pr(!0)),f.attr("stroke-width",2),f.attr("stroke","none"),f.style("fill","none"),(p===r.db.LINETYPE.SOLID_TOP||p===r.db.LINETYPE.SOLID_TOP_DOTTED)&&f.attr("marker-end","url("+I+"#"+n+"-solidTopArrowHead)"),(p===r.db.LINETYPE.SOLID_BOTTOM||p===r.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&f.attr("marker-end","url("+I+"#"+n+"-solidBottomArrowHead)"),(p===r.db.LINETYPE.STICK_TOP||p===r.db.LINETYPE.STICK_TOP_DOTTED)&&f.attr("marker-end","url("+I+"#"+n+"-stickTopArrowHead)"),(p===r.db.LINETYPE.STICK_BOTTOM||p===r.db.LINETYPE.STICK_BOTTOM_DOTTED)&&f.attr("marker-end","url("+I+"#"+n+"-stickBottomArrowHead)"),(p===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||p===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&f.attr("marker-start","url("+I+"#"+n+"-solidBottomArrowHead)"),(p===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||p===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&f.attr("marker-start","url("+I+"#"+n+"-solidTopArrowHead)"),(p===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||p===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&f.attr("marker-start","url("+I+"#"+n+"-stickBottomArrowHead)"),(p===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||p===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&f.attr("marker-start","url("+I+"#"+n+"-stickTopArrowHead)"),(p===r.db.LINETYPE.SOLID||p===r.db.LINETYPE.DOTTED)&&f.attr("marker-end","url("+I+"#"+n+"-arrowhead)"),(p===r.db.LINETYPE.BIDIRECTIONAL_SOLID||p===r.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(f.attr("marker-start","url("+I+"#"+n+"-arrowhead)"),f.attr("marker-end","url("+I+"#"+n+"-arrowhead)")),(p===r.db.LINETYPE.SOLID_POINT||p===r.db.LINETYPE.DOTTED_POINT)&&f.attr("marker-end","url("+I+"#"+n+"-filled-head)"),(p===r.db.LINETYPE.SOLID_CROSS||p===r.db.LINETYPE.DOTTED_CROSS)&&f.attr("marker-end","url("+I+"#"+n+"-crosshead)"),E||l.showSequenceNumbers){const L=p===r.db.LINETYPE.BIDIRECTIONAL_SOLID||p===r.db.LINETYPE.BIDIRECTIONAL_DOTTED,b=p===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||p===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||p===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||p===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||p===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||p===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||p===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||p===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,w=6,A=jt(i,r);let D=s,M=o;L?(ss?M=o-2*w:(M=o-w,D+=i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),M+=A?15:0,f.attr("x2",M),f.attr("x1",D)):f.attr("x1",s+w);let V=0;const W=s===o,U=s<=o;W?V=t.fromBounds+1:b?V=U?t.toBounds-1:t.fromBounds+1:V=U?t.fromBounds+1:t.toBounds-1;let G="12px";const X=_.toString().length;X>5?G="7px":X>3&&(G="9px"),e.append("line").attr("x1",V).attr("y1",a).attr("x2",V).attr("y2",a).attr("stroke-width",0).attr("marker-start","url("+I+"#"+n+"-sequencenumber)"),e.append("text").attr("x",V).attr("y",a+4).attr("font-family","sans-serif").attr("font-size",G).attr("text-anchor","middle").attr("class","sequenceNumber").text(_)}},"drawMessage"),jr=x(function(e,t,a,r,i,n,s){let o=0,u=0,d,p=0;for(const _ of r){const E=t.get(_),O=E.box;d&&d!=O&&(s||R.models.addBox(d),u+=l.boxMargin+d.margin),O&&O!=d&&(s||(O.x=o+u,O.y=i),u+=O.margin),E.width=N.getMax(E.width||l.width,l.width),E.height=N.getMax(E.height||l.height,l.height),E.margin=E.margin||l.actorMargin,p=N.getMax(p,E.height),a.get(E.name)&&(u+=E.width/2),E.x=o+u,E.starty=R.getVerticalPos(),R.insert(E.x,i,E.x+E.width,E.height),o+=E.width+u,E.box&&(E.box.width=o+O.margin-E.box.x),u=E.margin,d=E.box,R.models.addActor(E)}d&&!s&&R.models.addBox(d),R.bumpVerticalPos(p)},"addActorRenderingData"),re=x(async function(e,t,a,r,i,n,s){if(r){let o=0;R.bumpVerticalPos(l.boxMargin*2);for(const u of a){const d=t.get(u);d.stopy||(d.stopy=R.getVerticalPos());const p=await H.drawActor(e,d,l,!0,i,n,s);o=N.getMax(o,p)}R.bumpVerticalPos(o+l.boxMargin)}else for(const o of a){const u=t.get(o);await H.drawActor(e,u,l,!1,i,n,s)}},"drawActors"),He=x(function(e,t,a,r){let i=0,n=0;for(const s of a){const o=t.get(s),u=ea(o),d=H.drawPopup(e,o,u,l,l.forceMenus,r);d.height>i&&(i=d.height),d.width+o.x>n&&(n=d.width+o.x)}return{maxHeight:i,maxWidth:n}},"drawActorsPopup"),qe=x(function(e){ar(l,e),e.fontFamily&&(l.actorFontFamily=l.noteFontFamily=l.messageFontFamily=e.fontFamily),e.fontSize&&(l.actorFontSize=l.noteFontSize=l.messageFontSize=e.fontSize),e.fontWeight&&(l.actorFontWeight=l.noteFontWeight=l.messageFontWeight=e.fontWeight)},"setConf"),zt=x(function(e){return R.activations.filter(function(t){return t.actor===e})},"actorActivations"),ve=x(function(e,t){const a=t.get(e),r=zt(e),i=r.reduce(function(s,o){return N.getMin(s,o.startx)},a.x+a.width/2-1),n=r.reduce(function(s,o){return N.getMax(s,o.stopx)},a.x+a.width/2+1);return[i,n]},"activationBounds");function ht(e,t,a,r,i){R.bumpVerticalPos(a);let n=r;if(t.id&&t.message&&e[t.id]){const s=e[t.id].width,o=Rt(l);t.message=Z.wrapLabel(`[${t.message}]`,s-2*l.wrapPadding,o),t.width=s,t.wrap=!0;const u=Z.calculateTextDimensions(t.message,o),d=N.getMax(u.height,l.labelBoxHeight);n=r+d,at.debug(`${d} - ${t.message}`)}i(t),R.bumpVerticalPos(n)}x(ht,"adjustLoopHeightForWrap");function ze(e,t,a,r,i,n,s){function o(p,_){p.x{m.add(k.from),m.add(k.to)}),f=f.filter(k=>m.has(k))}const D=new Map(f.map((m,k)=>[E.get(m)?.name??m,k]));jr(_,E,O,f,0,I,!1);const M=await oa(I,E,A,r);H.insertArrowHead(_,t),H.insertArrowCrossHead(_,t),H.insertArrowFilledHead(_,t),H.insertSequenceNumber(_,t),H.insertSolidTopArrowHead(_,t),H.insertSolidBottomArrowHead(_,t),H.insertStickTopArrowHead(_,t),H.insertStickBottomArrowHead(_,t),s==="neo"&&H.insertDropShadow(_,l);function V(m,k){const lt=R.endActivation(m);lt.starty+18>k&&(lt.starty=k-6,k+=12),H.drawActivation(_,lt,k,l,zt(m.from).length,r,D),R.insert(lt.startx,k-10,lt.stopx,k)}x(V,"activeEnd");let W=1,U=1;const G=[],X=[];let nt=0;for(const m of I){let k,lt,et;switch(m.type){case r.db.LINETYPE.NOTE:R.resetVerticalPos(),lt=m.noteModel,await Qr(_,lt,m.id);break;case r.db.LINETYPE.ACTIVE_START:R.newActivation(m,_,E);break;case r.db.LINETYPE.CENTRAL_CONNECTION:R.newActivation(m,_,E);break;case r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:R.newActivation(m,_,E);break;case r.db.LINETYPE.ACTIVE_END:V(m,R.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:ht(M,m,l.boxMargin,l.boxMargin+l.boxTextMargin,K=>R.newLoop(K));break;case r.db.LINETYPE.LOOP_END:k=R.endLoop(),await H.drawLoop(_,k,"loop",l,m),R.bumpVerticalPos(k.stopy-R.getVerticalPos()),R.models.addLoop(k);break;case r.db.LINETYPE.RECT_START:ht(M,m,l.boxMargin,l.boxMargin,K=>{let Ot=K.message;Ot||(Ot=o?.rectBkgColor||o?.actorBkg||"rgba(128, 128, 128, 0.5)"),R.newLoop(void 0,Ot)});break;case r.db.LINETYPE.RECT_END:k=R.endLoop(),X.push(k),R.models.addLoop(k),R.bumpVerticalPos(k.stopy-R.getVerticalPos());break;case r.db.LINETYPE.OPT_START:ht(M,m,l.boxMargin,l.boxMargin+l.boxTextMargin,K=>R.newLoop(K));break;case r.db.LINETYPE.OPT_END:k=R.endLoop(),await H.drawLoop(_,k,"opt",l,m),R.bumpVerticalPos(k.stopy-R.getVerticalPos()),R.models.addLoop(k);break;case r.db.LINETYPE.ALT_START:ht(M,m,l.boxMargin,l.boxMargin+l.boxTextMargin,K=>R.newLoop(K));break;case r.db.LINETYPE.ALT_ELSE:ht(M,m,l.boxMargin+l.boxTextMargin,l.boxMargin,K=>R.addSectionToLoop(K));break;case r.db.LINETYPE.ALT_END:k=R.endLoop(),await H.drawLoop(_,k,"alt",l,m),R.bumpVerticalPos(k.stopy-R.getVerticalPos()),R.models.addLoop(k);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:ht(M,m,l.boxMargin,l.boxMargin+l.boxTextMargin,K=>R.newLoop(K)),R.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:ht(M,m,l.boxMargin+l.boxTextMargin,l.boxMargin,K=>R.addSectionToLoop(K));break;case r.db.LINETYPE.PAR_END:k=R.endLoop(),await H.drawLoop(_,k,"par",l,m),R.bumpVerticalPos(k.stopy-R.getVerticalPos()),R.models.addLoop(k);break;case r.db.LINETYPE.AUTONUMBER:W=m.message.start||W,U=m.message.step||U,m.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:ht(M,m,l.boxMargin,l.boxMargin+l.boxTextMargin,K=>R.newLoop(K));break;case r.db.LINETYPE.CRITICAL_OPTION:ht(M,m,l.boxMargin+l.boxTextMargin,l.boxMargin,K=>R.addSectionToLoop(K));break;case r.db.LINETYPE.CRITICAL_END:k=R.endLoop(),await H.drawLoop(_,k,"critical",l,m),R.bumpVerticalPos(k.stopy-R.getVerticalPos()),R.models.addLoop(k);break;case r.db.LINETYPE.BREAK_START:ht(M,m,l.boxMargin,l.boxMargin+l.boxTextMargin,K=>R.newLoop(K));break;case r.db.LINETYPE.BREAK_END:k=R.endLoop(),await H.drawLoop(_,k,"break",l,m),R.bumpVerticalPos(k.stopy-R.getVerticalPos()),R.models.addLoop(k);break;default:try{et=m.msgModel,et.starty=R.getVerticalPos(),et.sequenceIndex=W,et.sequenceVisible=r.db.showSequenceNumbers(),et.id=m.id,et.from=m.from,et.to=m.to;const K=await Fe(_,et);ze(m,et,K,nt,E,O,T),G.push({messageModel:et,lineStartY:K,msg:m}),R.models.addMessage(et)}catch(K){at.error("error while drawing message",K)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.SOLID_TOP,r.db.LINETYPE.SOLID_BOTTOM,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.SOLID_TOP_DOTTED,r.db.LINETYPE.SOLID_BOTTOM_DOTTED,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(m.type)&&(W=Math.round((W+U)*100)/100),nt++}at.debug("createdActors",O),at.debug("destroyedActors",T),await re(_,E,f,!1,t,r,D);for(const m of G)await $r(_,m.messageModel,m.lineStartY,r,m.msg,t);l.mirrorActors&&await re(_,E,f,!0,t,r,D),X.forEach(m=>H.drawBackgroundRect(_,m)),Ye(_,E,f,l);for(const m of R.models.boxes){m.height=R.getVerticalPos()-m.y,R.insert(m.x,m.y,m.x+m.width,m.height);const k=l.boxMargin*2;m.startx=m.x-k,m.starty=m.y-k*.25,m.stopx=m.startx+m.width+2*k,m.stopy=m.starty+m.height+k*.75,m.stroke="rgb(0,0,0, 0.5)",H.drawBox(_,m,l)}b&&R.bumpVerticalPos(l.boxMargin);const j=He(_,E,f,p),{bounds:q}=R.getBounds();q.startx===void 0&&(q.startx=0),q.starty===void 0&&(q.starty=0),q.stopx===void 0&&(q.stopx=0),q.stopy===void 0&&(q.stopy=0);let st=q.stopy-q.starty;st{const s=Rt(l);let o=n.actorKeys.reduce((_,E)=>_+=e.get(E).width+(e.get(E).margin||0),0);const u=l.boxMargin*8;o+=u,o-=2*l.boxTextMargin,n.wrap&&(n.name=Z.wrapLabel(n.name,o-2*l.wrapPadding,s));const d=Z.calculateTextDimensions(n.name,s);i=N.getMax(d.height,i);const p=N.getMax(o,d.width+2*l.wrapPadding);if(n.margin=l.boxTextMargin,on.textMaxHeight=i),N.getMax(r,l.height)}x(Ge,"calculateActorMargins");var ra=x(async function(e,t,a){const r=t.get(e.from),i=t.get(e.to),n=r.x,s=i.x,o=e.wrap&&e.message;let u=Q(e.message)?await Pt(e.message,$()):Z.calculateTextDimensions(o?Z.wrapLabel(e.message,l.width,bt(l)):e.message,bt(l));const d={width:o?l.width:N.getMax(l.width,u.width+2*l.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===a.db.PLACEMENT.RIGHTOF?(d.width=o?N.getMax(l.width,u.width):N.getMax(r.width/2+i.width/2,u.width+2*l.noteMargin),d.startx=n+(r.width+l.actorMargin)/2):e.placement===a.db.PLACEMENT.LEFTOF?(d.width=o?N.getMax(l.width,u.width+2*l.noteMargin):N.getMax(r.width/2+i.width/2,u.width+2*l.noteMargin),d.startx=n-d.width+(r.width-l.actorMargin)/2):e.to===e.from?(u=Z.calculateTextDimensions(o?Z.wrapLabel(e.message,N.getMax(l.width,r.width),bt(l)):e.message,bt(l)),d.width=o?N.getMax(l.width,r.width):N.getMax(r.width,l.width,u.width+2*l.noteMargin),d.startx=n+(r.width-d.width)/2):(d.width=Math.abs(n+r.width/2-(s+i.width/2))+l.actorMargin,d.startx=n2,E=x(f=>u?-f:f,"adjustValue");e.from===e.to?p=d:(e.activate&&!_&&(p+=E(l.activationWidth/2-1)),[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.STICK_TOP,a.db.LINETYPE.STICK_BOTTOM,a.db.LINETYPE.STICK_TOP_DOTTED,a.db.LINETYPE.STICK_BOTTOM_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)||(p+=E(3)),[a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)&&(d-=E(3)));const O=[i,n,s,o],T=Math.abs(d-p);e.wrap&&e.message&&(e.message=Z.wrapLabel(e.message,N.getMax(T+2*l.wrapPadding,l.width),Rt(l)));const g=Z.calculateTextDimensions(e.message,Rt(l));return{width:N.getMax(e.wrap?0:g.width+2*l.wrapPadding,T+2*l.wrapPadding,l.width),height:0,startx:d,stopx:p,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,O),toBounds:Math.max.apply(null,O)}},"buildMessageModel"),oa=x(async function(e,t,a,r){const i={},n=[];let s,o,u;for(const d of e){switch(d.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:n.push({id:d.id,msg:d.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:d.message&&(s=n.pop(),i[s.id]=s,i[d.id]=s,n.push(s));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:s=n.pop(),i[s.id]=s;break;case r.db.LINETYPE.ACTIVE_START:{const _=t.get(d.from?d.from:d.to.actor),E=zt(d.from?d.from:d.to.actor).length,O=_.x+_.width/2+(E-1)*l.activationWidth/2,T={startx:O,stopx:O+l.activationWidth,actor:d.from,enabled:!0};R.activations.push(T)}break;case r.db.LINETYPE.ACTIVE_END:{const _=R.activations.map(E=>E.actor).lastIndexOf(d.from);R.activations.splice(_,1).splice(0,1)}break}d.placement!==void 0?(o=await ra(d,t,r),d.noteModel=o,n.forEach(_=>{s=_,s.from=N.getMin(s.from,o.startx),s.to=N.getMax(s.to,o.startx+o.width),s.width=N.getMax(s.width,Math.abs(s.from-s.to))-l.labelBoxWidth})):(u=na(d,t,r),d.msgModel=u,u.startx&&u.stopx&&n.length>0&&n.forEach(_=>{if(s=_,u.startx===u.stopx){const E=t.get(d.from),O=t.get(d.to);s.from=N.getMin(E.x-u.width/2,E.x-E.width/2,s.from),s.to=N.getMax(O.x+u.width/2,O.x+E.width/2,s.to),s.width=N.getMax(s.width,Math.abs(s.to-s.from))-l.labelBoxWidth}else s.from=N.getMin(u.startx,s.from),s.to=N.getMax(u.stopx,s.to),s.width=N.getMax(s.width,u.width)-l.labelBoxWidth}))}return R.activations=[],at.debug("Loop type widths:",i),i},"calculateLoopBounds"),ca={bounds:R,drawActors:re,drawActorsPopup:He,setConf:qe,draw:ta},Ea={parser:fr,get db(){return new Ir},renderer:ca,styles:Rr,init:x(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,er({sequence:{wrap:e.wrap}}))},"init")};export{Ea as diagram}; diff --git a/apps/kimi-code/dist-web/assets/sizeCapture-X5ZJPWSS-D_wNrXBO.js b/apps/kimi-code/dist-web/assets/sizeCapture-X5ZJPWSS-D_wNrXBO.js new file mode 100644 index 00000000000..cc53213db25 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/sizeCapture-X5ZJPWSS-D_wNrXBO.js @@ -0,0 +1 @@ +import{_ as o}from"./mermaid.core-WW7RuneT.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var p=1;function i(){if(!(typeof globalThis>"u"))return globalThis}o(i,"getCaptureGlobal");function c(){return!!i()?.mermaidCaptureSizes}o(c,"shouldCaptureSizes");function u(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}o(u,"capturedFromLocation");function d(n,r){const t=i();if(!t)return;const e=r.node(),s=((e&&"ownerSVGElement"in e?e.ownerSVGElement:null)??e)?.id??"(unknown)";t.mermaidCapturedSizes??=[];const a={svgId:s,sizes:n};t.mermaidCapturedSizes.push(a),t.mermaidLastCapturedSizes=a}o(d,"emitCapturedSizes");function m(n,r){const t=[];for(const e of r.nodes)e.isGroup||t.push({id:e.id,width:e.width??0,height:e.height??0});t.length!==0&&d({metadata:{captureVersion:p,capturedAt:new Date().toISOString(),capturedFrom:u()},nodes:t},n)}o(m,"captureNodeSizes");export{m as captureNodeSizes,c as shouldCaptureSizes}; diff --git a/apps/kimi-code/dist-web/assets/stateDiagram-2N3HPSRC-DOjvRzn-.js b/apps/kimi-code/dist-web/assets/stateDiagram-2N3HPSRC-DOjvRzn-.js new file mode 100644 index 00000000000..c7694df1b97 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/stateDiagram-2N3HPSRC-DOjvRzn-.js @@ -0,0 +1 @@ +import{s as R,a as W,S as N}from"./chunk-EX3LRPZG-B-vU1qLF.js";import{_ as f,c as t,d as H,l as S,e as P,k as z,a7 as _,a8 as U,L as C,x as F}from"./mermaid.core-WW7RuneT.js";import{G as O}from"./graph-DOmOIIwC.js";import{l as J}from"./layout-D-LzfAck.js";import"./chunk-XXDRQBXY-D_bv9kM4.js";import"./chunk-VR4S4FIN-C_RujyXt.js";import"./chunk-32BRIVSS-CRTrWqUr.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";import"./map-DxJ2ADlA.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"
      ");p=p.replace(/\n/g,"
      ");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=_().x(function(s){return s.x}).y(function(s){return s.y}).curve(U),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:m,y:x}=F.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const B=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",m).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,m,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),B.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;B.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",m-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const m=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(m,x,void 0,!1,p,a,c);const g=b.padding,o=s.node().getBBox(),B=o.width+g*2,y=o.height+g*2,v=B*1.75;P(s,y,v,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+B+" "+y)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new O({compound:!0,multigraph:!0});let s,m=!0;for(s=0;s{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*b.padding,k.height=v.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},xt={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{xt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/stateDiagram-v2-6OUMAXLB-CZ3zMFoy.js b/apps/kimi-code/dist-web/assets/stateDiagram-v2-6OUMAXLB-CZ3zMFoy.js new file mode 100644 index 00000000000..db24f05c51a --- /dev/null +++ b/apps/kimi-code/dist-web/assets/stateDiagram-v2-6OUMAXLB-CZ3zMFoy.js @@ -0,0 +1 @@ +import{s as r,b as e,a,S as s}from"./chunk-EX3LRPZG-B-vU1qLF.js";import{_ as i}from"./mermaid.core-WW7RuneT.js";import"./chunk-XXDRQBXY-D_bv9kM4.js";import"./chunk-VR4S4FIN-C_RujyXt.js";import"./chunk-32BRIVSS-CRTrWqUr.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var n={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{n as diagram}; diff --git a/apps/kimi-code/dist-web/assets/swimlanes-5IMT3BWC-DiBNZxJI.js b/apps/kimi-code/dist-web/assets/swimlanes-5IMT3BWC-DiBNZxJI.js new file mode 100644 index 00000000000..eec04cf5da0 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/swimlanes-5IMT3BWC-DiBNZxJI.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sizeCapture-X5ZJPWSS-D_wNrXBO.js","assets/mermaid.core-WW7RuneT.js","assets/index-CiHMlsuo.js","assets/index-CqjkU7Bl.css","assets/_commonjsHelpers-CqkleIqs.js"])))=>i.map(i=>d[i]); +import{bR as Er}from"./index-CiHMlsuo.js";import{c as Tr}from"./chunk-RYQCIY6F-LhAgalr3.js";import{am as wr,an as Ar,ao as Rr,ap as Nr,l as Ke,c as Or,ag as Pr,af as Br,ah as kr,at as _r,av as Fr,y as Dr,as as Hr,aw as Xr,x as Oe,ax as Ye,_ as d,ay as Ao}from"./mermaid.core-WW7RuneT.js";import{G as Yr}from"./graph-DOmOIIwC.js";import"./map-DxJ2ADlA.js";import"./_commonjsHelpers-CqkleIqs.js";async function _o(t,e){const n=new Yr({multigraph:!0,compound:!0}),o=[...e.edges],s=Or(),r=t.insert("g").attr("class","root"),i=r.insert("g").attr("class","clusters"),c=r.insert("g").attr("class","edges edgePath"),a=r.insert("g").attr("class","edgeLabels"),l=r.insert("g").attr("class","nodes"),g=new Map,x=t.node()!=null;await Promise.all(e.nodes.map(async I=>{if(I.isGroup)n.setNode(I.id,{...I});else{if(x){const u=await Pr(l,I,{config:s,dir:I.dir}),p=u.node()?.getBBox()??{width:0,height:0};g.set(I.id,u),I.width=p.width,I.height=p.height}n.setNode(I.id,{...I})}}));for(const I of o)n.setEdge(I.start,I.end,{...I},I.id),e.edges.some(p=>p.id===I.id)||e.edges.push(I);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:I}=await Er(async()=>{const{captureNodeSizes:u}=await import("./sizeCapture-X5ZJPWSS-D_wNrXBO.js");return{captureNodeSizes:u}},__vite__mapDeps([0,1,2,3,4]));I(t,e)}return{graph:n,groups:{clusters:i,edgePaths:c,edgeLabels:a,nodes:l,rootGroups:r},nodeElements:g}}d(_o,"createGraphWithElements");var Ro=5,Ge=1e-5,$e=1e-6;function qe(t){const e=[];for(let n=0;n=1-$e||I<=$e||I>=1-$e?null:{point:{x:t.x+x*s,y:t.y+x*r},tA:x,tB:I}}d(Fo,"segmentIntersection");function vn(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}d(vn,"isHorizontalSeg");function Do(t){const e=[];for(let n=0;n=Math.abs(n)?e>=0?1:0:n>=0?1:0}d(Ho,"getArcSweepFlag");var Gr=.001;function Xo(t,e){if(t.length<2)return t.map(r=>({...r}));const n=t.map(r=>({...r})),o=e.arrowTypeStart&&Ao[e.arrowTypeStart];if(o){const r=t[0],i=t[1],c=Math.atan2(i.y-r.y,i.x-r.x);n[0].x=r.x+o*Math.cos(c),n[0].y=r.y+o*Math.sin(c)}const s=e.arrowTypeEnd&&Ao[e.arrowTypeEnd];if(s){const r=t.length,i=t[r-2],c=t[r-1],a=Math.atan2(c.y-i.y,c.x-i.x);n[r-1].x=c.x-s*Math.cos(a),n[r-1].y=c.y-s*Math.sin(a)}return n}d(Xo,"applyMarkerOffsets");function Yo(t,e,n,o,s){const r=t.point.x,i=t.point.y,c={x:r-e*t.r,y:i-n*t.r},a={x:r+e*t.r,y:i+n*t.r},l=[`L${we(c)}`];return s==="arc"?l.push(`A${re(t.r)},${re(t.r)} 0 0 ${o} ${we(a)}`):l.push(`M${we(a)}`),l}d(Yo,"emitJump");function Ln(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=n.x-e.x,c=n.y-e.y,a=Math.hypot(s,r),l=Math.hypot(i,c);if(a0){const E=Ln(s[l-1],s[l],s[l+1]??s[l],Ro);E&&(f=E.cutLen)}let y=x,v=null;r&&lE.t-T.t);for(const E of M)E.r=Math.min(E.r,E.d-f,y-E.d);for(let E=0;ET){const m=T/2;M[E].r=Math.min(M[E].r,m),M[E+1].r=Math.min(M[E+1].r,m)}}for(const E of M)E.r=2?o:null}catch{return null}}d(Vo,"decodeDataPoints");function jo(t,e,n){if(!n.enabled)return;const o=t.node();if(!o)return;const s=new Map;for(const l of e)s.set(l.id,l);const r=[],i=new Map;for(const l of e){const g=typeof CSS<"u"&&CSS.escape?CSS.escape(l.id):l.id,x=o.querySelector(`path[data-id="${g}"]`);if(!x)continue;i.set(l.id,x);const u=Vo(x.getAttribute("data-points"))??l.points;r.push({...l,points:u})}const c=Do(r);if(c.length===0)return;const a=new Map;for(const l of c){const g=a.get(l.jumpEdgeId)??[];g.push(l),a.set(l.jumpEdgeId,g)}for(const l of r){const g=a.get(l.id);if(!g||g.length===0)continue;const I=s.get(l.id)?.curve;if(I!==void 0&&!zo(I))continue;const u=i.get(l.id);if(!u)continue;if(I===void 0){const E=u.getAttribute("d")??"";if(!$o(E))continue}const p=u.getAttribute("style")??"",f=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(p),y=f?Number.parseFloat(f[1]):null,v=f?Number.parseFloat(f[2]):null,M=Go(l,g,n);if(u.setAttribute("d",M),y!==null&&v!==null&&typeof u.getTotalLength=="function"){const E=u.getTotalLength(),T=Math.max(0,E-y-v),m=`0 ${y} ${T} ${v}`,S=p.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${m};`).replace(/;\s*;+/g,";");u.setAttribute("style",S)}}}d(jo,"applyLineJumpsToSvg");async function Uo(t,e){for(const s of t.nodes)s.isGroup?await Br(e.clusters,s):kr(s);const n=new Map;for(const s of t.nodes)s?.id&&n.set(s.id,s);for(const s of t.edges){const r=s.start?n.get(s.start)??{}:{},i=s.end?n.get(s.end)??{}:{},c=_r(e.edgePaths,{...s},{},t.type,r,i,t.diagramId);s.label&&await Fr(e.rootGroups,s),s.label&&Wo(s,c)}const o=t.config?.swimlane?.lineHops;if(o!==!1){const s=o==="gap"?"gap":"arc",r=t.edges.filter(i=>Array.isArray(i.points)&&i.points.length>=2).map(i=>({id:i.id,points:i.points,curve:i.curve,arrowTypeStart:i.arrowTypeStart,arrowTypeEnd:i.arrowTypeEnd}));jo(e.edgePaths,r,{enabled:!0,jumpRadius:6,jumpStyle:s})}}d(Uo,"adjustLayout");function Wo(t,e){const n=e?.updatedPath??e?.originalPath,o=Dr(),{subGraphTitleTotalMargin:s}=Hr({flowchart:o.flowchart??{}});if(t.label){const r=Xr.get(t.id);let i=t.x,c=t.y;if(n){const a=Oe.calcLabelPosition(n);Ke.debug("Moving label "+t.label+" from (",i,",",c,") to (",a.x,",",a.y,") abc88"),e&&(i=a.x,c=a.y)}r.attr("transform",`translate(${i}, ${c+s/2})`)}if(t?.startLabelLeft){const r=Ye.get(t.id).startLeft;let i=t?.x,c=t?.y;if(n){const a=Oe.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",n);i=a.x,c=a.y}r.attr("transform",`translate(${i}, ${c})`)}if(t.startLabelRight){const r=Ye.get(t.id).startRight;let i=t.x,c=t.y;if(n){const a=Oe.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",n);i=a.x,c=a.y}r.attr("transform",`translate(${i}, ${c})`)}if(t.endLabelLeft){const r=Ye.get(t.id).endLeft;let i=t.x,c=t.y;if(n){const a=Oe.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",n);i=a.x,c=a.y}r.attr("transform",`translate(${i}, ${c})`)}if(t.endLabelRight){const r=Ye.get(t.id).endRight;let i=t.x,c=t.y;if(n){const a=Oe.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",n);i=a.x,c=a.y}r.attr("transform",`translate(${i}, ${c})`)}}d(Wo,"positionEdgeLabel");var Mn="__swimlane_default__",$r=21,No=20;function En(t){return Math.max(t.padding??No,No)}d(En,"topLaneHorizontalPadding");function Ko(t){const{x:e,y:n,width:o,height:s}=t,r=t.swimlaneContentTop;if(typeof e!="number"||typeof n!="number"||typeof o!="number"||typeof s!="number"||typeof r!="number"||!Number.isFinite(e)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(r)||o<=0||s<=0){delete t.groupTitleRect;return}const i=n-s/2,c=Math.min(r,n+s/2),a=Math.min($r,Math.max(0,c-i)),l=i+a;if(l<=i){delete t.groupTitleRect;return}t.groupTitleRect={left:e-o/2,right:e+o/2,top:i,bottom:l}}d(Ko,"assignTopLaneTitleRect");function qo(t){const e=t.direction,n=t.nodes??=[];for(const r of t.nodes??[])r.isGroup&&!r.parentId&&(r.shape="swimlane",e&&(r.direction=e));const o=n.filter(r=>!r.isGroup&&!r.parentId);if(o.length===0)return;let s=n.find(r=>r.id===Mn);s?s.isGroup&&(s.shape="swimlane",e&&(s.direction=e)):(s={id:Mn,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},n.push(s));for(const r of o)r.parentId=Mn}d(qo,"prepareLayoutForSwimlanes");function Jo(t){const e=new Map;for(const a of t.nodes??[])e.set(a.id,a);const n=[];for(const a of t.edges??[]){const l=typeof a.start=="string"?a.start:void 0,g=typeof a.end=="string"?a.end:void 0;!l||!g||a.labelNodeId||n.push({id:a.id,src:l,dst:g,ref:a})}const o=t.nodes??[],s=o.filter(a=>a.isGroup),r=o.filter(a=>!a.isGroup);return{nodes:[...[...s].reverse(),...r].map(a=>a.id),edges:n,layout:t,nodeById:e}}d(Jo,"toGraphView");function Zo(t,e,n,o){const{layout:s}=t,r=t.nodeById,i=o?.layerGap??100,c=o?.nodeGap??40;let a=0;for(const I of e.layers){let u=0;for(const p of I){const f=r.get(p);if(!f){u++;continue}f.layer=a,f.order=u;const y=n.x[p]??u*c,v=n.y[p]??a*i;f.x=y,f.y=v,u++}a++}const l=s.nodes??[],g=new Map,x=[];for(const I of l){if(!I?.isGroup)continue;I.parentId||x.push(I);const u=l.filter(M=>M.parentId===I.id);let p=1/0,f=-1/0,y=1/0,v=-1/0;for(const M of u){const E=M.x??n.x[M.id],T=M.y??n.y[M.id],m=M.width??0,S=M.height??0;E!=null&&T!=null&&(p=Math.min(p,E-m/2),f=Math.max(f,E+m/2),y=Math.min(y,T-S/2),v=Math.max(v,T+S/2))}if(p===1/0||y===1/0)I.x=I.x??0,I.y=I.y??0,I.width=I.width??0,I.height=I.height??0;else{const M=I.padding??20,E=I.parentId?M:2*En(I),T=M,m=Math.max(0,f-p)+E,S=Math.max(0,v-y)+T,A=(p+f)/2,R=(y+v)/2;I.x=A,I.y=R,I.width=m,I.height=S,g.set(I.id,{minX:p,maxX:f,minY:y,maxY:v})}}if(x.length>0&&g.size>0){let I=1/0,u=-1/0,p=0;for(const f of x){const y=f.padding??20;y>p&&(p=y);const v=g.get(f.id);v&&(I=Math.min(I,v.minY),u=Math.max(u,v.maxY))}if(I!==1/0&&u!==-1/0){const f=Math.max(0,u-I),v=Math.max(p,36),M=f+2*v,E=(I+u)/2;for(const k of x)k.y=E,k.height=M,k.swimlaneContentTop=I;const T=[...x].sort((k,O)=>{const _=k.x??0,H=O.x??0;return _-H}),m=[],S=[],A=[];for(const k of T){const O=g.get(k.id);if(!O)continue;const _=Math.max(0,O.maxX-O.minX)+2*En(k),H=(O.minX+O.maxX)/2;m.push(k.id),S.push(H),A.push(_)}const R=m.length;if(R>0){const k=new Map;if(R===1)k.set(m[0],A[0]);else{const O=[];for(let j=0;j0&&s>0?{cx:e,cy:n,rect:Ae(e,n,o,s)}:void 0}d(oo,"measuredNodeRect");function so(t){if(t.isGroup)return;const e=oo(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}d(so,"nodeBoundsInfoFor");function oe(t,e,n=Ft){return Math.abs(t.x-e.x)n}d(Tt,"isHorizontalSegment");function wt(t,e,n=Ft){return ft(t,e,n)&&Math.abs(t.y-e.y)>n}d(wt,"isVerticalSegment");function zt(t,e,n,o){return Math.max(0,Math.min(Math.max(t,e),Math.max(n,o))-Math.max(Math.min(t,e),Math.min(n,o)))}d(zt,"overlapLength");function ce(t,e,n=Ft){return t.horizontal&&e.horizontal&&ht(t.a,e.a,n)?zt(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&ft(t.a,e.a,n)?zt(t.a.y,t.b.y,e.a.y,e.b.y):0}d(ce,"sameAxisSegmentOverlapLength");function Re(t,e=Ft){const n=[];for(let o=0;o0?n[n.length-1]:void 0;(!s||!oe(s,o,e))&&n.push({x:o.x,y:o.y})}return n}d(pt,"dedupeConsecutivePoints");function ro(t,e=Ft){if(!t||t.length!==4)return;const[n,o,s,r]=t;return Tt(n,o,e)&&wt(o,s,e)&&Tt(s,r,e)?{kind:"HVH",p0:n,p1:o,p2:s,p3:r}:wt(n,o,e)&&Tt(o,s,e)&&wt(s,r,e)?{kind:"VHV",p0:n,p1:o,p2:s,p3:r}:void 0}d(ro,"classifyThreeSegmentRoute");function cn(t,e,n,o=0){const s=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),c=Math.max(t.y,e.y);return r>n.left-o&&sn.top-o&&ie.left+n&&t.xe.top+n&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}d(ts,"rectContainsRect");function Je(t,e){return t.lefte.left&&t.tope.top}d(Je,"rectsOverlap");function Tn(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}d(Tn,"inflateRect");function Ae(t,e,n,o){return{left:t-n/2,right:t+n/2,top:e-o/2,bottom:e+o/2}}d(Ae,"rectFromCenterSize");function qt(t){return oo(t)?.rect}d(qt,"rectOfNodeBounds");function Ie(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}d(Ie,"portForRectSide");function co(t,e,n,o,s,r=Ft){const i=e==="left"||e==="right",c=o==="left"||o==="right";if(i&&c){if(e==="right"&&o==="left"&&t.xn.x){if(ht(t,n,r))return[t,n];const x=(t.x+n.x)/2;return[t,{x,y:t.y},{x,y:n.y},n]}if(e===o){if(ht(t,n,r))return;const x=e==="left"?Math.min(t.x,n.x)-s:Math.max(t.x,n.x)+s;return[t,{x,y:t.y},{x,y:n.y},n]}return}if(!i&&!c){if(e===o){if(ft(t,n,r))return;const I=e==="top"?Math.min(t.y,n.y)-s:Math.max(t.y,n.y)+s;return[t,{x:t.x,y:I},{x:n.x,y:I},n]}if(!(e==="bottom"&&o==="top"&&t.yn.y))return;if(ft(t,n,r))return[t,n];const x=(t.y+n.y)/2;return[t,{x:t.x,y:x},{x:n.x,y:x},n]}if(i&&!c){const g=e==="right"&&n.x>t.x||e==="left"&&n.xn.y;return g&&x?[t,{x:n.x,y:t.y},n]:void 0}const a=e==="bottom"&&n.y>t.y||e==="top"&&n.yn.x;return a&&l?[t,{x:t.x,y:n.y},n]:void 0}d(co,"buildOrthogonalPortPath");function ao(t,e,n,o){return e==="left"||e==="right"?[t,{x:o,y:t.y},{x:o,y:n.y},n]:[t,{x:t.x,y:o},{x:n.x,y:o},n]}d(ao,"buildSameSideTrackPath");function an(t){const e=new Map,n=[];for(const o of t){if(o.isEdgeLabel)continue;const s=so(o);s&&(e.set(s.id,s),n.push({id:s.id,rect:s.rect}))}return{nodeInfoById:e,realNodeRects:n}}d(an,"collectRealNodeBounds");function me(t){const e=[],n=[];for(const o of t){const s=so(o);if(!s)continue;const r={id:s.id,rect:s.rect};o.isEdgeLabel?n.push(r):e.push(r)}return{realNodeRects:e,labelNodeRects:n}}d(me,"collectNodeRectEntries");function es(t,{includeEdgeLabels:e=!0}={}){const n=[];for(const o of t){if(o.isGroup||!e&&o.isEdgeLabel)continue;const s=o.x??0,r=o.y??0,i=o.width??0,c=o.height??0;n.push({nodeId:o.id,...Ae(s,r,i,c)})}return n}d(es,"collectLayoutNodeRects");function lo(t,e,n=Ft){const o=t.start,s=t.end;if(!o||!s)return;const r=e.get(o),i=e.get(s);if(!(!r||!i))return{srcId:o,dstId:s,srcInfo:r,dstInfo:i,collinearX:Math.abs(r.cx-i.cx)p||Iv)return!1;const M=Math.abs(f-g.a.x)s:r&&c&&ht(t,n,s)?zt(t.x,e.x,n.x,o.x)>s:!1}d(ns,"sameAxisSegmentsOverlap");function Ze(t,e,n,o,{epsilon:s=Ft,skipDegenerateOther:r=!1}={}){for(const i of n){if(i===o||i.isLayoutOnly)continue;const c=i.points;if(!(!c||c.length<2))for(let a=0;aI+s&&pf+s&&xo+Ft&&t=2?e[e.length-2]:void 0,a=(i?ft(i,s):!1)?{x:s.x,y:r.y}:{x:r.x,y:s.y};e.push(a)}e.push(r)}const n=[];for(const o of e){const s=n[n.length-1];(!s||!oe(s,o))&&n.push(o)}return n}d(Qe,"orthogonalizePolyline");function ae(t){if(t.length<3)return t;let e=[...t];for(let n=0;n<32;n++){const o=ss(e);if(e=o.points,!o.changed)break}return e}d(ae,"simplifyPolyline");var nt=.001,Vr=.5,Oo=4;function uo(t,e,n){const o=t;if(o.isLayoutOnly||!o.points||o.points.length=0&&s=t.length)return t;const r=s-o;if(r<0||r>=t.length)return t;const i=rs(t[s],t[r],e);return n?[i,...t.slice(s)]:[...t.slice(0,s+1),i]}d(An,"clipEndpoint");function is(t,e){for(const n of t){const o=uo(n,e,2);if(!o)continue;let s=[...o.points];o.srcRect&&(s=An(s,o.srcRect,!0)),o.dstRect&&(s=An(s,o.dstRect,!1)),s=ae(Qe(s)),s=ho(s,o.srcRect,o.dstRect),o.edge.points=ae(Qe(s))}}d(is,"clipEdgeEndpointsToNodeBoundaries");function Rn(t,e,n,o=!1){if(ht(t,e,nt)){if(e.yn.bottom+nt)return e;if(o){if(t.xn.right+nt)return{x:n.right,y:t.y}}return{x:Math.abs(e.x-n.left)<=Math.abs(e.x-n.right)?n.left:n.right,y:t.y}}if(ft(t,e,nt)){if(e.xn.right+nt)return e;if(o){if(t.yn.bottom+nt)return{x:t.x,y:n.bottom}}const s=Math.abs(e.y-n.top)<=Math.abs(e.y-n.bottom);return{x:t.x,y:s?n.top:n.bottom}}return e}d(Rn,"snapEndpointToBoundary");function tn(t,e,n){const o=t[e];for(let s=e+n;s>=0&&so.lo)),n=Math.min(...t.map(o=>o.hi));if(!(e>n))return{lo:e,hi:n}}d(cs,"intersectRanges");function On(t,e){return e==="left"||e==="right"?en(t.top,t.bottom):en(t.left,t.right)}d(On,"clearanceRangeForSide");function nn(t,e,n){const o=t.y>=n.top-nt&&t.y<=n.bottom+nt,s=t.x>=n.left-nt&&t.x<=n.right+nt;if(ht(t,e,nt)&&o){if(Math.abs(t.x-n.left)0?cs(r):void 0}d(as,"straightClearanceRange");function Pn(t,e,n,o,s){const r=as(t,e,n,o,s);if(!r)return;const i=s?t.y:t.x,c=Math.min(r.hi,Math.max(r.lo,i));if(!(Math.abs(c-i)({...c}));for(let c=e;c>=0&&c=n.left-nt&&Math.max(t.x,e.x)<=n.right+nt,s=Math.min(t.y,e.y)>=n.top-nt&&Math.max(t.y,e.y)<=n.bottom+nt;if(Math.abs(t.y-n.top)o.bottom+nt;case"left":return ht(e,n,nt)&&n.xo.right+nt}}d(_n,"leavesOutward");function Fn(t,e,n){if(t.length<3)return t;if(n){const r=kn(t[0],t[1],e);return r&&_n(r,t[1],t[2],e)?t.slice(1):t}const o=t.length-1,s=kn(t[o-1],t[o],e);return s&&_n(s,t[o-1],t[o-2],e)?t.slice(0,o):t}d(Fn,"collapseOwnBorderStub");function ds(t,e,n){let o=t;if(e){const r=tn(o,0,1);if(r){const i=Rn(r,o[0],e);i!==o[0]&&(o=[i,...o.slice(1)])}o=Fn(o,e,!0)}if(n){const r=o.length-1,i=tn(o,r,-1);if(i){const c=Rn(i,o[r],n,!0);c!==o[r]&&(o=[...o.slice(0,r),c])}o=Fn(o,n,!1)}const s=ho(o,e,n);return s!==o||o.length===2?s:(e&&(o=Bn(o,e,!0)),n&&(o=Bn(o,n,!1)),o)}d(ds,"snapAndCollapseEndpoints");function Dn(t,e){for(const n of t){const o=uo(n,e,2);if(!o)continue;const s=pt(o.points,nt),r=ds(s,o.srcRect,o.dstRect);if(r.length<3){o.edge.points=r;continue}const i=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];o.edge.points=i}}d(Dn,"prepareEdgeEndpointsForRenderer");function go(t){return new Map(t.map(e=>[e.id,e]))}d(go,"buildNodeMap");function us(t,e){let n=t.parentId,o=null;for(;n;){const s=e.get(n);if(!s?.isGroup)break;o=s.id,n=s.parentId}return o}d(us,"resolveTopLevelGroupId");function Hn(t,e){let n=0,o=t.parentId;for(;o;){const s=e.get(o);if(!s?.isGroup)break;n++,o=s.parentId}return n}d(Hn,"groupDepth");function po(t){let e=1/0,n=-1/0,o=1/0,s=-1/0;for(const r of t){const i=r.x,c=r.y;if(typeof i!="number"||typeof c!="number")continue;const a=r.width??0,l=r.height??0;e=Math.min(e,i-a/2),n=Math.max(n,i+a/2),o=Math.min(o,c-l/2),s=Math.max(s,c+l/2)}return e===1/0||o===1/0?null:{minX:e,maxX:n,minY:o,maxY:s}}d(po,"boundsForChildren");function hs(t,e){const n=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+n,t.height=Math.max(0,e.maxY-e.minY)+n}d(hs,"applyGroupBounds");function gs(t){const e=go(t),n=t.filter(o=>o.isGroup&&o.parentId).sort((o,s)=>Hn(s,e)-Hn(o,e));for(const o of n){const s=t.filter(i=>i.parentId===o.id),r=po(s);r&&hs(o,r)}}d(gs,"recomputeNestedGroupBounds");function on(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(a=>!a.isGroup);let r=1/0,i=-1/0;for(const a of s){const l=a[e];typeof l=="number"&&(r=Math.min(r,l),i=Math.max(i,l))}if(!Number.isFinite(r)||!Number.isFinite(i))return!1;const c=d(a=>r+i-a,"mirror");for(const a of n){const l=a[e];typeof l=="number"&&(a[e]=c(l));const g=a.groupTitleRect;g&&(a.groupTitleRect=e==="x"?{...g,left:c(g.right),right:c(g.left)}:{...g,top:c(g.bottom),bottom:c(g.top)})}for(const a of o)for(const l of a.points??[])l[e]=c(l[e]);return!0}d(on,"mirrorAxis");function ps(t){return(t.nodes??[]).some(n=>!n.isGroup)?on(t,"y"):!0}d(ps,"applyBtDirectionTransform");function ms(t,e="LR"){const n=t.nodes??[],o=t.edges??[],s=n.filter(P=>!P.isGroup);let r=1/0,i=1/0;for(const P of s){const G=P.x??0,j=P.y??0;G0?Math.max(1,g/x):1;for(const P of s){const G=P.x??0,J=((P.y??0)-i)*I+c,dt=G-r;P.x=J,P.y=dt}for(const P of o)if(P.points)for(const G of P.points){const j=G.x,dt=(G.y-i)*I+c,mt=j-r;G.x=dt,G.y=mt}gs(n);const u=n.filter(P=>P.isGroup&&!P.parentId);if(u.length===0)return e==="RL"&&on(t,"x"),!0;const p=go(n),f=new Map;for(const P of n){if(P.isGroup)continue;const G=us(P,p);if(!G)continue;const j=f.get(G)??[];j.push(P),f.set(G,j)}let y=0;for(const P of u){const G=P.padding??0;G>y&&(y=G)}const v=[];let M=1/0,E=-1/0;for(const P of u){const G=f.get(P.id)??[],j=po(G);j&&(M=Math.min(M,j.minX),E=Math.max(E,j.maxX),v.push({lane:P,contentTop:j.minY,contentBottom:j.maxY,centerY:(j.minY+j.maxY)/2}))}if(M===1/0||E===-1/0)return!0;const T=Math.max(0,E-M),m=Math.max(y,10),S=T+2*m,A=c+S,O=(M+E)/2-S/2-c,_=O+A/2,H=Math.max(y,c);v.sort((P,G)=>P.centerY-G.centerY);for(let P=0;PI.cy?v.bottom:v.top,H=I.cx+M;if(H<=v.left+se||H>=v.right-se)continue;E={x:H,y:_},T={x:H,y:c.y},m={x:c.x,y:c.y}}else{const _=u.cx>I.cx?v.right:v.left,H=I.cy+M;if(H<=v.top+se||H>=v.bottom-se)continue;E={x:_,y:H},T={x:c.x,y:H},m={x:c.x,y:c.y}}const S=oe(E,T,se),A=oe(T,m,se);if(S&&A||!S&&At(E,T,o,[g],1)||!A&&At(T,m,o,[x],1))continue;const R=!S&&Ze(E,T,t,s,{epsilon:se,skipDegenerateOther:!0}),k=!A&&Ze(T,m,t,s,{epsilon:se,skipDegenerateOther:!0});if(!(R||k)){S?y=[T,m]:A?y=[E,T]:y=[E,T,m];break}}y&&(s.points=y)}}d(ys,"portSwapToLShape");function xs(t,e){const{realNodeRects:r,labelNodeRects:i}=me(e.values());for(const c of t){if(c.isLayoutOnly)continue;const a=c.points;if(!a||a.length<4)continue;const l=pt(a,.001);if(l.length<4)continue;const g=l.length-1,x=l[g],I=l[g-1],u=l[g-2],p=x.x-I.x,f=x.y-I.y,y=Math.hypot(p,f);if(y>=10||y<.001)continue;const v=I.x-u.x,M=I.y-u.y;if(Math.hypot(v,M)<.001)continue;const T=Tt(I,x,.001),m=wt(I,x,.001),S=Tt(u,I,.001),A=wt(u,I,.001);if(!(T&&A||m&&S))continue;const R=c.end,k=c.start,O=R?e.get(R):void 0;if(!O)continue;const _=O.x??0,H=O.y??0,P=qt(O);if(!P)continue;let G,j;if(A){const W=M<0;G={x:_,y:u.y},j={x:_,y:W?P.bottom:P.top}}else{const W=v>0;G={x:u.x,y:H},j={x:W?P.right:P.left,y:H}}if(At(G,j,r,R?[R]:[],-2)||At(G,j,i,[],-2))continue;if(k){const W=e.get(k),et=W?qt(W):void 0;if(et&&io(G,et,2))continue}const J=d((W,et)=>`${W.x.toFixed(3)},${W.y.toFixed(3)}|${et.x.toFixed(3)},${et.y.toFixed(3)}`,"ownSegmentKey"),dt=new Set;for(let W=0;W{for(const at of t){if(at===c||at.isLayoutOnly)continue;const gt=at.points;if(!(!gt||gt.length<2))for(let xt=0;xt=0){const W=l[g-3],et=[k,R].filter(at=>!!at);if(At(W,G,r,et,-2)||mt(W,G))continue}const Pt=[...l.slice(0,g-2),G,j];c.points=Pt;const Q=c.labelNodeId;if(Q){const W=e.get(Q);if(W){const et=W.width??0,at=W.height??0;if(et>0&&at>0){let gt,xt,vt=-1;for(let Vt=0;Vt=et+2||de&&te>=at+2)&&te>vt&&(vt=te,gt=(jt.x+Ut.x)/2,xt=(jt.y+Ut.y)/2)}gt!==void 0&&xt!==void 0&&(W.x=gt,W.y=xt)}}}}}d(xs,"collapseShortTerminalStub");var Z=.001,_t=8,it=Re,In=d((t,e)=>ft(t,e,Z)||ht(t,e,Z),"orthogonallyAligned");function bs(t,e){const s=d((u,p)=>{const f=u.x??0,y=u.y??0,v=p.x-f,M=p.y-y;let E=(u.width??0)/2,T=(u.height??0)/2;return Math.abs(M)*E>Math.abs(v)*T?(M<0&&(T=-T),{x:f+(M===0?0:T*v/M),y:y+T}):(v<0&&(E=-E),{x:f+E,y:y+(v===0?0:E*M/v)})},"rectIntersect"),r=d((u,p)=>{const f=pt(u.points??[]);if(f.length<2)return;const y=p?u.start:u.end,v=y?e.get(y):void 0,M=v?qt(v):void 0;if(!v||!y||!M)return;const E=p?f[0]:f[f.length-1],T=p?f[1]:f[f.length-2],m=s(v,E);let S=E;if(In(T,m)&&(S=T),ft(m,S,Z))return{edge:u,edgeId:String(u.id??""),nodeId:y,atStart:p,orientation:"V",coord:m.x,min:Math.min(m.y,S.y),max:Math.max(m.y,S.y),boundary:m,railEnd:S,rect:M};if(ht(m,S,Z))return{edge:u,edgeId:String(u.id??""),nodeId:y,atStart:p,orientation:"H",coord:m.y,min:Math.min(m.x,S.x),max:Math.max(m.x,S.x),boundary:m,railEnd:S,rect:M}},"terminalLaneFor"),i=d((u,p)=>Math.max(0,Math.min(u.max,p.max)-Math.max(u.min,p.min)),"projectedOverlapLength"),c=d((u,p)=>u.nodeId!==p.nodeId||u.orientation!==p.orientation?!1:u.orientation==="H"?(Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1)&&ft(u.boundary,p.boundary,1):(Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1)&&ht(u.boundary,p.boundary,1),"sameTerminalFace"),a=d((u,p)=>u.nodeId!==p.nodeId||u.orientation!==p.orientation?!1:i(u,p)>=_t&&Math.abs(u.coord-p.coord)<.5,"exactTerminalLaneConflict"),l=d((u,p)=>{if(u.nodeId!==p.nodeId||u.orientation!==p.orientation||u.orientation!=="H"||u.atStart===p.atStart)return!1;const f=i(u,p);if(f<_t)return!1;const y=u.rect.bottom-u.rect.top;return f2*y?!1:c(u,p)&&Math.abs(u.coord-p.coord)<16},"nearTerminalLaneConflict"),g=d((u,p)=>{const f=pt(u.edge.points??[]);if(f.length<2)return;const y=u.orientation==="V"?{x:u.boundary.x+p,y:u.boundary.y}:{x:u.boundary.x,y:u.boundary.y+p},v=u.orientation==="V"?{x:u.railEnd.x+p,y:u.railEnd.y}:{x:u.railEnd.x,y:u.railEnd.y+p};if(!d(()=>Math.abs(u.boundary.y-u.rect.top)<1||Math.abs(u.boundary.y-u.rect.bottom)<1?ht(y,u.boundary,Z)&&y.x>=u.rect.left+1&&y.x<=u.rect.right-1:Math.abs(u.boundary.x-u.rect.left)<1||Math.abs(u.boundary.x-u.rect.right)<1?ft(y,u.boundary,Z)&&y.y>=u.rect.top+1&&y.y<=u.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(u.atStart){const S=f.length>1&&oe(f[1],u.railEnd,Z),A=f.slice(S?2:1),R=A[0];return R&&!In(R,v)?void 0:[y,v,...A]}const E=f.length>1&&oe(f[f.length-2],u.railEnd,Z),T=f.slice(0,E?-2:-1),m=T[T.length-1];if(!(m&&!In(m,v)))return[...T,v,y]},"shiftedCandidate"),x=d(u=>{const p=u.edge,f=pt(p.points??[]);if(f.length!==2)return!1;const y=p.start,v=p.end,M=y?e.get(y):void 0,E=v?e.get(v):void 0;if(!M||!E)return!1;const T=M.x??0,m=M.y??0,S=E.x??0,A=E.y??0,[R,k]=f;return ht(R,k,Z)&&Math.abs(m-A)<1&&Math.abs(T-S)>1||ft(R,k,Z)&&Math.abs(T-S)<1&&Math.abs(m-A)>1},"laneIsStraightCollinearConnector"),I=[-7,7,-14,14,-21,21];for(let u=0;u<8;u++){const p=t.filter(y=>!y.isLayoutOnly).flatMap(y=>[r(y,!0),r(y,!1)]).filter(y=>!!y);let f=!1;for(let y=0;y{const R=x(S),k=x(A);return R!==k?Number(R)-Number(k):+!A.atStart-+!S.atStart});for(const S of m){for(const A of I){const R=g(S,A);if(!R)continue;const k=r({...S.edge,points:R},S.atStart);if(!(!k||p.some(O=>O.edge!==S.edge&&(a(k,O)||T&&l(k,O))))){S.edge.points=R,f=!0;break}}if(f)break}}if(!f)return}}d(bs,"separateSharedRenderedTerminalLanes");function Ms(t,e){const{realNodeRects:o,labelNodeRects:s}=me(e.values()),r=d((c,a)=>{const l=c.start,g=c.end,x=it(a);if(x.length!==a.length-1)return!1;const I=[l,g].filter(u=>!!u);for(const u of x)if(At(u.a,u.b,o,I,-2)||At(u.a,u.b,s,[],-2))return!1;for(const u of t){if(u===c||u.isLayoutOnly)continue;const p=u.points;if(!(!p||p.length<2)){for(const f of x)for(const y of it(pt(p)))if(ce(f,y,.5)>=_t||le(f.a,f.b,y.a,y.b,Z))return!1}}return!0},"candidateIsSafe"),i=d((c,a)=>{if(a+4>=c.length)return;const l=c[a],g=c[a+1],x=c[a+2],I=c[a+3],u=c[a+4],p=Tt(l,g)&&wt(g,x)&&Tt(x,I)&&wt(I,u)&&ft(l,I,Z)&&ft(l,u,Z)&&ft(g,x,Z)&&(g.x-l.x)*(I.x-x.x)<0,f=wt(l,g)&&Tt(g,x)&&wt(x,I)&&Tt(I,u)&&ht(l,I,Z)&&ht(l,u,Z)&&ht(g,x,Z)&&(g.y-l.y)*(I.y-x.y)<0;if(p||f)return pt([...c.slice(0,a+1),u,...c.slice(a+5)]);if(a+5>=c.length)return;const y=c[a+5],v=wt(l,g)&&Tt(g,x)&&wt(x,I)&&Tt(I,u)&&wt(u,y)&&ft(l,u,Z)&&ft(l,y,Z)&&ft(x,I,Z)&&(x.x-g.x)*(u.x-I.x)<0,M=Tt(l,g)&&wt(g,x)&&Tt(x,I)&&wt(I,u)&&Tt(u,y)&&ht(l,u,Z)&&ht(l,y,Z)&&ht(x,I,Z)&&(x.y-g.y)*(u.y-I.y)<0;if(!(!v&&!M))return pt([...c.slice(0,a+1),y,...c.slice(a+6)])},"withoutDogleg");for(let c=0;c<8;c++){let a=!1;for(const l of t){if(l.isLayoutOnly)continue;const g=pt(l.points??[]);for(let x=0;x<=g.length-5;x++){const I=i(g,x);if(!(!I||!r(l,I))){l.points=I,a=!0;break}}if(a)break}if(!a)return}}d(Ms,"collapseRedundantRectangularDoglegs");function Xn(t,e){const{realNodeRects:r,labelNodeRects:i}=me(e.values()),c=t.filter(p=>!p.isLayoutOnly),a=d((p,f,y)=>pt(p===f?y??[]:p.points??[]),"pointsFor"),l=d((p,f)=>{let y=0;for(let v=0;v{const f=it(p);if(f.length!==3)return;const y=f[1];if(!(f[0].horizontal===y.horizontal||f[2].horizontal===y.horizontal))return{index:y.index,horizontal:y.horizontal,vertical:y.vertical,segment:y}},"middleRail"),x=d((p,f)=>{const y=[p.start,p.end].filter(v=>!!v);return r.filter(v=>{if(y.includes(v.id))return!1;const M=v.rect;return f.horizontal?zt(f.a.x,f.b.x,M.left,M.right)>=_t&&f.a.y>=M.top-2&&f.a.y<=M.bottom+2:zt(f.a.y,f.b.y,M.top,M.bottom)>=_t&&f.a.x>=M.left-2&&f.a.x<=M.right+2})},"blockingRectsFor"),I=d((p,f,y)=>{const v=p.map(E=>({...E}));if(f.horizontal)v[f.index].y=y,v[f.index+1].y=y;else if(f.vertical)v[f.index].x=y,v[f.index+1].x=y;else return;const M=ae(pt(v));return it(M).length===M.length-1?M:void 0},"candidateByMovingRail"),u=d((p,f,y)=>{const v=[p.start,p.end].filter(E=>!!E),M=it(f);if(M.length!==f.length-1)return!1;for(const E of M)if(At(E.a,E.b,r,v,-2)||At(E.a,E.b,i,[],-2))return!1;for(const E of c)if(E!==p){for(const T of M)for(const m of it(a(E)))if(ce(T,m,.5)>=_t)return!1}return l(p,f)<=y},"candidateIsSafe");for(let p=0;p<8;p++){const f=l();let y=!1;for(const v of c){const M=a(v),E=g(M);if(!E)continue;const T=x(v,E.segment);if(T.length===0)continue;const m=E.horizontal?[Math.min(...T.map(S=>S.rect.top))-20,Math.max(...T.map(S=>S.rect.bottom))+20]:[Math.min(...T.map(S=>S.rect.left))-20,Math.max(...T.map(S=>S.rect.right))+20];for(const S of m){const A=I(M,E.segment,S);if(!(!A||!u(v,A,f))){v.points=A,y=!0;break}}if(y)break}if(!y)return}}d(Xn,"liftObstacleHuggingSameSideRails");function Yn(t,e){const o=d(a=>{const l=a.groupTitleRect;if(!(!l||typeof l.left!="number"||typeof l.right!="number"||typeof l.top!="number"||typeof l.bottom!="number"||!Number.isFinite(l.left)||!Number.isFinite(l.right)||!Number.isFinite(l.top)||!Number.isFinite(l.bottom)||l.right<=l.left||l.bottom<=l.top))return{left:l.left,right:l.right,top:l.top,bottom:l.bottom}},"validTitleRect"),s=d(a=>{if(!a.isGroup||a.parentId)return;const l=a.direction,g=typeof l=="string"?l.toUpperCase():"";if(g==="LR"||g==="RL"||g==="BT")return;const x=o(a),I=a.y,u=a.height;if(!x||typeof I!="number"||typeof u!="number"||!Number.isFinite(I)||!Number.isFinite(u)||u<=0)return;const p=x.right-x.left,f=x.bottom-x.top;if(!(f<=0||p{if(!a.horizontal)return!1;const g=a.a.y;return g<=l.top+Z||g>=l.bottom-Z?!1:zt(a.a.x,a.b.x,l.left,l.right)>=_t},"horizontalSegmentIntersectsTitle"),i=[...e.values()].map(s).filter(a=>!!a);if(i.length===0)return;let c=0;for(const a of t){if(a.isLayoutOnly)continue;const l=pt(a.points??[]);for(const g of it(l))for(const x of i)r(g,x.rect)&&(c=Math.max(c,x.rect.bottom-g.a.y+4))}if(!(c<=Z))for(const a of i){const l=a.node.y,g=a.node.height;typeof l!="number"||typeof g!="number"||!Number.isFinite(l)||!Number.isFinite(g)||g<=0||(a.node.y=l-c/2,a.node.height=g+c,a.node.groupTitleRect={...a.rect,top:a.rect.top-c,bottom:a.rect.bottom-c})}}d(Yn,"liftTopLaneTitleBandsAboveRails");function Gn(t,e){const o=d(l=>{const g=l.groupTitleRect;if(!(!g||typeof g.left!="number"||typeof g.right!="number"||typeof g.top!="number"||typeof g.bottom!="number"||!Number.isFinite(g.left)||!Number.isFinite(g.right)||!Number.isFinite(g.top)||!Number.isFinite(g.bottom)||g.right<=g.left||g.bottom<=g.top))return{left:g.left,right:g.right,top:g.top,bottom:g.bottom}},"validTitleRect"),s=d(l=>{if(!l.isGroup||l.parentId||l.direction!=="LR")return;const x=o(l),I=l.x,u=l.width;if(!x||typeof I!="number"||typeof u!="number"||!Number.isFinite(I)||!Number.isFinite(u)||u<=0)return;const p=x.right-x.left,f=x.bottom-x.top;if(!(p<=0||f{if(!l.vertical)return!1;const x=l.a.x;return x<=g.left+Z||x>=g.right-Z?!1:zt(l.a.y,l.b.y,g.top,g.bottom)>=_t},"verticalSegmentIntersectsTitle"),i=d((l,g)=>{if(!l.horizontal)return!1;const x=l.a.y;return x<=g.top+Z||x>=g.bottom-Z?!1:zt(l.a.x,l.b.x,g.left,g.right)>=_t},"horizontalSegmentIntersectsTitle"),c=[...e.values()].map(s).filter(l=>!!l);if(c.length===0)return;let a=0;for(const l of t){if(l.isLayoutOnly)continue;const g=pt(l.points??[]);for(const x of it(g))for(const I of c)if(r(x,I.rect))a=Math.max(a,I.rect.right-x.a.x+4);else if(i(x,I.rect)){const u=Math.min(x.a.x,x.b.x);a=Math.max(a,I.rect.right-u+4)}}if(!(a<=Z))for(const l of c){const g=l.node.x,x=l.node.width;typeof g!="number"||typeof x!="number"||!Number.isFinite(g)||!Number.isFinite(x)||x<=0||(l.node.x=g-a/2,l.node.width=x+a,l.node.groupTitleRect={...l.rect,left:l.rect.left-a,right:l.rect.right-a})}}d(Gn,"shiftLeftLaneTitleBandsLeftOfRails");function Is(t,e){const{realNodeRects:o}=me(e.values()),s=t.filter(p=>!p.isLayoutOnly),r=d((p,f=new Map)=>pt(f.get(p)??p.points??[]),"replacementPointsFor"),i=d((p=new Map)=>{let f=0;for(let y=0;ys.reduce((f,y)=>f+Qt(r(y,p)),0),"totalBends"),a=d(p=>{const f=r(p);if(f.length<4)return;const y=f[f.length-2],v=f[f.length-1];if(!(!Tt(y,v,Z)&&!wt(y,v,Z)))return{tailStart:y,terminal:v}},"terminalTailFor"),l=d((p,f)=>{const y=r(p);if(y.length<3)return;const v=y[0],M=y[1];let E;if(Tt(v,M,Z))E={x:M.x,y:f.tailStart.y};else if(wt(v,M,Z))E={x:f.tailStart.x,y:M.y};else return;const T=ae(pt([v,M,E,f.tailStart,f.terminal]));return it(T).length===T.length-1?T:void 0},"candidateWithDestinationTail"),g=d((p,f)=>{const y=[p.start,p.end].filter(v=>!!v);for(const v of it(f))if(At(v.a,v.b,o,y,-2))return!0;return!1},"pathHasNodeHit"),x=d((p,f,y)=>{for(const v of s)if(v!==p){for(const M of it(f))for(const E of it(r(v,y)))if(ce(M,E,.5)>=_t)return!0}return!1},"pathHasSharedTrack"),I=d((p,f,y)=>!g(p,f)&&!x(p,f,y),"candidateIsSafe"),u=d(()=>{const p=new Map;for(const f of s){const y=f.end;if(!y||!e.has(y)||r(f).length<4)continue;const M=p.get(y)??[];M.push(f),p.set(y,M)}return p},"edgesByDestination");for(let p=0;p<4;p++){const f=i();if(f===0)return;const y=c();let v,M=f,E=y;for(const T of u().values())for(let m=0;m=f||G>M||G===M&&j>=E||(v=P,M=G,E=j)}if(!v)return;for(const[T,m]of v)T.points=m}}d(Is,"swapDestinationTerminalTailsToReduceCrossings");function Ss(t,e){const{realNodeRects:r,labelNodeRects:i}=me(e.values()),c=t.filter(T=>!T.isLayoutOnly),a=d((T,m=new Map)=>pt(m.get(T)??T.points??[]),"replacementPointsFor"),l=d((T=new Map)=>{let m=0;for(let S=0;Sc.reduce((m,S)=>m+Qt(a(S,T)),0),"totalBends"),x=d(T=>{const m=T.start,S=T.end,A=m?e.get(m):void 0,R=S?e.get(S):void 0,k=A?qt(A):void 0,O=R?qt(R):void 0;return k&&O?{src:k,dst:O}:void 0},"endpointRectsFor"),I=d((T,m,S)=>{if(S.index<=0||S.index+1>=m.length-1)return;const A=x(T);if(A){if(S.vertical){const R=S.a.x,k=Math.min(A.src.left,A.dst.left),O=Math.max(A.src.right,A.dst.right),_=RO+Z?"right":void 0;return _?{edge:T,points:m,segmentIndex:S.index,axis:"vertical",side:_,coord:R,min:Math.min(S.a.y,S.b.y),max:Math.max(S.a.y,S.b.y)}:void 0}if(S.horizontal){const R=S.a.y,k=Math.min(A.src.top,A.dst.top),O=Math.max(A.src.bottom,A.dst.bottom),_=RO+Z?"bottom":void 0;return _?{edge:T,points:m,segmentIndex:S.index,axis:"horizontal",side:_,coord:R,min:Math.min(S.a.x,S.b.x),max:Math.max(S.a.x,S.b.x)}:void 0}}},"externalRailForSegment"),u=d(()=>{const T=[];for(const m of c){const S=a(m);for(const A of it(S)){const R=I(m,S,A);R&&T.push(R)}}return T},"collectExternalRails"),p=d((T,m)=>T.edge!==m.edge&&T.axis===m.axis&&T.side===m.side&&zt(T.min,T.max,m.min,m.max)>=_t,"railsInteract"),f=d(T=>{const m=[],S=new Set;for(const A of T){if(S.has(A))continue;const R=[A],k=[];for(S.add(A);R.length>0;){const O=R.pop();k.push(O);for(const _ of T)!S.has(_)&&p(O,_)&&(S.add(_),R.push(_))}k.length>1&&m.push(k)}return m},"connectedComponents"),y=d(T=>{const m=[];for(const S of T)m.some(A=>Math.abs(A-S.coord){const m=T.map(R=>R.coord),S=y(T),A=[];if(T.length<=6){const R=new Array(S.length).fill(!1),k=[],O=d(()=>{if(k.length===T.length){k.some((_,H)=>Math.abs(_-m[H])>=Z)&&A.push([...k]);return}for(const[_,H]of S.entries())R[_]||(R[_]=!0,k.push(H),O(),k.pop(),R[_]=!1)},"visit");return O(),A}for(let R=0;R{const S=new Map;for(const[R,k]of T.entries()){const O=m[R],_=S.get(k.edge)??k.points.map(H=>({x:H.x,y:H.y}));k.axis==="vertical"?(_[k.segmentIndex].x=O,_[k.segmentIndex+1].x=O):(_[k.segmentIndex].y=O,_[k.segmentIndex+1].y=O),S.set(k.edge,_)}const A=new Map;for(const[R,k]of S){const O=ae(pt(k));if(it(O).length!==O.length-1)return;A.set(R,O)}return A},"replacementsForAssignment"),E=d(T=>{for(const[m,S]of T){const A=[m.start,m.end].filter(R=>!!R);for(const R of it(S))if(At(R.a,R.b,r,A,-2)||At(R.a,R.b,i,[],-2))return!1}for(let m=0;m=_t)return!1}}return!0},"candidateIsSafe");for(let T=0;T<4;T++){const m=l();if(m===0)return;let S,A=m,R=g(),k=Number.POSITIVE_INFINITY;for(const O of f(u()))for(const _ of v(O)){const H=M(O,_);if(!H||!E(H))continue;const P=l(H);if(P>=m)continue;const G=g(H),j=O.reduce((J,dt,mt)=>J+Math.abs(_[mt]-dt.coord),0);P>A||P===A&&(G>R||G===R&&j>=k)||(S=H,A=P,R=G,k=j)}if(!S)return;for(const[O,_]of S)O.points=_}}d(Ss,"reassignCrossingExternalRailChannels");function Cs(t,e){const{realNodeRects:o,labelNodeRects:s}=me(e.values()),r=t.filter(u=>!u.isLayoutOnly),i=d((u,p,f)=>pt(u===p?f??[]:u.points??[]),"pointsFor"),c=d(u=>it(u).reduce((p,f)=>{const y=f.a.x-f.b.x,v=f.a.y-f.b.y;return p+Math.hypot(y,v)},0),"pathLength"),a=d((u,p)=>{let f=0;for(let y=0;y{if(u.horizontal){const f=u.a.y;return(Math.abs(f-p.top)<1||Math.abs(f-p.bottom)<1)&&zt(u.a.x,u.b.x,p.left,p.right)>=_t}if(u.vertical){const f=u.a.x;return(Math.abs(f-p.left)<1||Math.abs(f-p.right)<1)&&zt(u.a.y,u.b.y,p.top,p.bottom)>=_t}return!1},"segmentRunsAlongRectBorder"),g=d(u=>{const p=[u.start,u.end].filter(y=>!!y),f=[];for(const y of p){const v=e.get(y),M=v?qt(v):void 0;M&&f.push(M)}return f},"endpointRectsFor"),x=d((u,p)=>{if(p+3>=u.length)return[];const f=u[p],y=u[p+1],v=u[p+2],M=u[p+3],E=Tt(f,y,Z)&&wt(y,v,Z)&&Tt(v,M,Z),T=wt(f,y,Z)&&Tt(y,v,Z)&&wt(v,M,Z);if(!E&&!T)return[];if(!(E?Math.sign(y.x-f.x)!==Math.sign(M.x-v.x):Math.sign(y.y-f.y)!==Math.sign(M.y-v.y)))return[];const S=ft(f,M,Z)||ht(f,M,Z)?[]:[{x:f.x,y:M.y},{x:M.x,y:f.y}],A=S.length===0?[[...u.slice(0,p+1),...u.slice(p+3)]]:S.map(k=>[...u.slice(0,p+1),k,...u.slice(p+3)]),R=new Set;return A.map(k=>ae(pt(k))).filter(k=>{if(it(k).length!==k.length-1||!k.some(_=>oe(_,M,Z)))return!1;const O=k.map(_=>`${_.x.toFixed(3)},${_.y.toFixed(3)}`).join("|");return R.has(O)?!1:(R.add(O),!0)})},"shortcutCandidatesAt"),I=d((u,p,f)=>{const y=[u.start,u.end].filter(M=>!!M),v=g(u);for(const M of it(p))if(At(M.a,M.b,o,y,-2)||At(M.a,M.b,s,[],-2)||v.some(E=>l(M,E)))return!1;for(const M of r)if(M!==u){for(const E of it(p))for(const T of it(i(M)))if(ce(E,T,.5)>=_t)return!1}return a(u,p)<=f},"candidateIsSafe");for(let u=0;u<8;u++){const p=a();let f,y,v=p,M=Number.POSITIVE_INFINITY,E=Number.POSITIVE_INFINITY;for(const T of r){const m=i(T),S=Qt(m,Z),A=c(m);for(let R=0;R<=m.length-4;R++)for(const k of x(m,R)){const O=Qt(k,Z),_=c(k);if(!(Ov||P===v&&(O>M||O===M&&_>=E)||(f=T,y=k,v=P,M=O,E=_)}}if(!f||!y)return;f.points=y}}d(Cs,"shortcutRedundantOrthogonalJogs");function vs(t,e){const i=[];for(const N of e.values()){if(N.isGroup||N.isEdgeLabel)continue;const F=N.x??0,D=N.y??0,V=qt(N);V&&i.push({id:String(N.id??""),cx:F,cy:D,rect:V})}if(i.length===0)return;const c=new Map(i.map(N=>[N.id,N])),a=i.map(N=>({id:N.id,rect:N.rect})),l=["top","bottom","left","right"],g={top:Math.min(...i.map(N=>N.rect.top))-20,bottom:Math.max(...i.map(N=>N.rect.bottom))+20,left:Math.min(...i.map(N=>N.rect.left))-20,right:Math.max(...i.map(N=>N.rect.right))+20},x=t.filter(N=>!N.isLayoutOnly),I=new Map(x.map((N,F)=>[N,F])),u=d(N=>{const F=N==="left"||N==="top"?-1:1,D=[];for(let V=0;V<=2;V++)D.push(g[N]+F*20*V);return D},"outwardTracksForSide"),p=d((N,F=new Map)=>pt(F.get(N)??N.points??[]),"replacementPointsFor"),f=d((N,F)=>{let D=0;for(const V of N)for(const h of F)le(V.a,V.b,h.a,h.b,Z)&&D++;return D},"crossingCountBetweenSegments"),y=d((N,F)=>f(it(N),it(F)),"crossingCountBetweenPaths"),v=d((N=new Map)=>{let F=0;const D=[],V=new Set,h=[],b=d(C=>{V.has(C)||(V.add(C),h.push(C))},"addEdge");for(let C=0;C0&&(F+=q,D.push({first:L,second:U,count:q}),b(L),b(U))}}return h.sort((C,L)=>(I.get(C)??0)-(I.get(L)??0)),{count:F,pairs:D,edgeSet:V,edges:h}},"crossingSnapshot"),M=d((N,F)=>{const D=new Set(F.keys());if(D.size===0)return N.count;let V=0;for(const b of N.pairs)(D.has(b.first)||D.has(b.second))&&(V+=b.count);let h=0;for(let b=0;b{const F=new Map;for(const h of N.pairs){const b=F.get(h.first)??new Set;b.add(h.second),F.set(h.first,b);const C=F.get(h.second)??new Set;C.add(h.first),F.set(h.second,C)}const D=[],V=new Set;for(const h of N.edges){if(V.has(h))continue;const b=[h],C=[];for(V.add(h);b.length>0;){const L=b.pop();C.push(L);for(const w of F.get(L)??[])V.has(w)||(V.add(w),b.push(w))}C.sort((L,w)=>(I.get(L)??0)-(I.get(w)??0)),C.length>1&&D.push(C)}return D},"crossingComponents"),T=d(N=>[N.start,N.end].filter(F=>!!F),"endpointIdsFor"),m=d(N=>{const F=[];for(const D of E(N)){const V=new Set(D),h=new Set(D.flatMap(C=>T(C))),b=[...D];for(const C of x)V.has(C)||T(C).some(L=>h.has(L))&&b.push(C);b.sort((C,L)=>(I.get(C)??0)-(I.get(L)??0)),F.push(b)}return F},"pairSearchGroups"),S=d((N,F,D)=>M(N,new Map([[F,D]])),"crossingCountWithSingleReplacement"),A=d(N=>{const F=new Map;for(const D of N.pairs)F.set(D.first,(F.get(D.first)??0)+D.count),F.set(D.second,(F.get(D.second)??0)+D.count);return F},"currentCrossingsByEdge"),R=d(N=>N.slice(1).reduce((F,D,V)=>{const h=N[V];return F+Math.abs(D.x-h.x)+Math.abs(D.y-h.y)},0),"pathLength"),k=d((N=new Map)=>x.reduce((F,D)=>F+Qt(p(D,N)),0),"totalBends"),O=d((N=new Map)=>x.reduce((F,D)=>F+R(p(D,N)),0),"totalLength"),_=d((N,F,D=new Map)=>{const V=it(F);for(const h of x)if(h!==N){for(const b of V)for(const C of it(p(h,D)))if(ce(b,C,.5)>=_t)return!0}return!1},"pathHasSegmentConflict"),H=d((N,F)=>{const D=[N.start,N.end].filter(V=>!!V);for(const V of it(F))if(At(V.a,V.b,a,D,-2))return!0;return!1},"pathHitsNode"),P=d((N,F)=>{const D=ae(pt(F));it(D).length===D.length-1&&N.push(D)},"pushOrthogonalCandidate"),G=d(N=>N==="left"||N==="right","sideIsHorizontal"),j=d((N,F,D)=>{switch(F){case"left":return Math.min(N.x,D.x)-20;case"right":return Math.max(N.x,D.x)+20;case"top":return Math.min(N.y,D.y)-20;case"bottom":return Math.max(N.y,D.y)+20}},"localTrackForSameSide"),J=d((N,F,D,V)=>{const h=D==="left"||D==="top"?-1:1,b=[j(F,D,V),g[D]];for(const C of b)for(let L=0;L<=2;L++)P(N,ao(F,D,V,C+h*20*L))},"addSameSideCandidates"),dt=d((N,F,D,V,h)=>{for(const b of u(D))for(const C of u(h))P(N,[F,{x:b,y:F.y},{x:b,y:C},{x:V.x,y:C},V])},"addHorizontalToVerticalCandidates"),mt=d((N,F,D,V,h)=>{for(const b of u(D))for(const C of u(h))P(N,[F,{x:F.x,y:b},{x:C,y:b},{x:C,y:V.y},V])},"addVerticalToHorizontalCandidates"),kt=d((N,F,D,V,h)=>{const b=[...u("top"),...u("bottom")];for(const C of u(D))for(const L of u(h))for(const w of b)P(N,[F,{x:C,y:F.y},{x:C,y:w},{x:L,y:w},{x:L,y:V.y},V])},"addHorizontalPairCandidates"),Pt=d((N,F,D,V,h)=>{const b=[...u("left"),...u("right")];for(const C of u(D))for(const L of u(h))for(const w of b)P(N,[F,{x:F.x,y:C},{x:w,y:C},{x:w,y:L},{x:V.x,y:L},V])},"addVerticalPairCandidates"),Q=d(N=>{const F=new Set;return N.map(D=>pt(D)).filter(D=>{const V=D.map(h=>`${h.x.toFixed(3)},${h.y.toFixed(3)}`).join("|");return F.has(V)||D.length<2?!1:(F.add(V),!0)})},"dedupeCandidatePaths"),W=d((N,F,D,V)=>{const h=[],b=co(N,F,D,V,20,Z);b&&P(h,b),F===V&&J(h,N,F,D);const C=G(F),L=G(V);return C&&!L?dt(h,N,F,D,V):!C&&L?mt(h,N,F,D,V):C?kt(h,N,F,D,V):Pt(h,N,F,D,V),Q(h)},"buildCandidatesForSides"),et=d((N,F,D,V)=>{const h=[...u("left"),...u("right")],b=[...u("top"),...u("bottom")];for(const C of l){const L=Ie(V,C),w=C==="top"||C==="bottom"?u(C):b;for(const B of h){P(N,[F,D,{x:B,y:D.y},{x:B,y:L.y},L]);for(const U of w)P(N,[F,D,{x:B,y:D.y},{x:B,y:U},{x:L.x,y:U},L])}}},"addVerticalDepartureOuterTrackCandidates"),at=d((N,F,D,V)=>{const h=[...u("left"),...u("right")],b=[...u("top"),...u("bottom")];for(const C of l){const L=Ie(V,C),w=C==="left"||C==="right"?u(C):h;for(const B of b){P(N,[F,D,{x:D.x,y:B},{x:L.x,y:B},L]);for(const U of w)P(N,[F,D,{x:D.x,y:B},{x:U,y:B},{x:U,y:L.y},L])}}},"addHorizontalDepartureOuterTrackCandidates"),gt=d(N=>{const F=N.start,D=N.end,V=D?c.get(D):void 0;if(!F||!V)return[];const h=pt(N.points??[]);if(h.length<4)return[];const b=h[0],C=h[1],L=[];return wt(b,C,Z)?et(L,b,C,V):Tt(b,C,Z)&&at(L,b,C,V),L},"terminalPreservingOuterTrackCandidates"),xt=d(N=>{const F=N.start,D=N.end,V=F?c.get(F):void 0,h=D?c.get(D):void 0;if(!V||!h)return[];const b=[];for(const C of l){const L=Ie(V,C);for(const w of l)b.push(...W(L,C,Ie(h,w),w))}return b.push(...gt(N)),b},"candidatePathsFor"),vt=d(()=>new Map(x.map(N=>[N,it(p(N))])),"currentSegmentsByEdge"),Vt=d((N,F,D)=>{const V=new Set;for(const h of x){if(h===N)continue;const b=D.get(h)??it(p(h));F.some(C=>b.some(L=>ce(C,L,.5)>=_t))&&V.add(h)}return V},"sharedTrackConflictsFor"),jt=d((N,F,D,V)=>{const h=new Set;return xt(N).map(C=>ae(pt(C))).filter(C=>{if(H(N,C))return!1;const L=C.map(w=>`${w.x.toFixed(3)},${w.y.toFixed(3)}`).join("|");return h.has(L)||C.length<2?!1:(h.add(L),!0)}).map(C=>{const L=it(C);let w=0;for(const B of x)B!==N&&(w+=f(L,D.get(B)??it(p(B))));return{candidate:C,candidateSegments:L,crossings:F.count-(V.get(N)??0)+w,bends:Qt(C,Z),totalBends:Qt(C),length:R(C)}}).filter(({crossings:C})=>C<=F.count).sort((C,L)=>C.crossings-L.crossings||C.bends-L.bends||C.length-L.length).slice(0,48).map(C=>({path:C.candidate,segments:C.candidateSegments,sharedTrackConflicts:Vt(N,C.candidateSegments,D),totalBends:C.totalBends,length:C.length}))},"pairCandidatesFor"),Ut=d((N,F,D,V,h,b)=>{let C=0;for(const w of N.pairs)(w.first===F||w.second===F||w.first===V||w.second===V)&&(C+=w.count);let L=f(D.segments,h.segments);for(const w of x){if(w===F||w===V)continue;const B=b.get(w)??it(p(w));L+=f(D.segments,B)+f(h.segments,B)}return N.count-C+L},"pairCrossingCount"),te=d((N,F)=>{for(const D of N.sharedTrackConflicts)if(D!==F)return!1;return!0},"conflictsOnlyWith"),Se=d((N,F)=>N.segments.some(D=>F.segments.some(V=>ce(D,V,.5)>=_t)),"candidatesShareTrack"),de=d((N,F,D,V)=>te(F,D.edge)&&te(V,N.edge)&&!Se(F,V),"pairCandidatesAreCompatible"),Ce=d((N,F,D,V,h)=>{const b=Ut(N.current,F.edge,D,V.edge,h,N.baseSegments);if(!(b>=N.current.count))return{replacements:new Map([[F.edge,D.path],[V.edge,h.path]]),crossings:b,bends:N.currentBends-(N.baseBendsByEdge.get(F.edge)??0)-(N.baseBendsByEdge.get(V.edge)??0)+D.totalBends+h.totalBends,length:N.currentLength-(N.baseLengthByEdge.get(F.edge)??0)-(N.baseLengthByEdge.get(V.edge)??0)+D.length+h.length}},"scorePairReplacement"),dn=d((N,F)=>N.crossings{let h=V;for(const b of F.candidates)for(const C of D.candidates){if(!de(F,b,D,C))continue;const L=Ce(N,F,b,D,C);L&&dn(L,h)&&(h=L)}return h},"bestScoreForOptionPair"),hn=d(N=>{const F=k(),D=O(),V=vt(),h=A(N),b=new Map(x.map(q=>[q,Qt(p(q))])),C=new Map(x.map(q=>[q,R(p(q))])),L=new Map,w=m(N);for(const q of w)for(const z of q){if(L.has(z))continue;const Y=jt(z,N,V,h);Y.length>0&&L.set(z,{edge:z,candidates:Y})}let B={replacements:new Map,crossings:N.count,bends:F,length:D};const U={current:N,currentBends:F,currentLength:D,baseBendsByEdge:b,baseLengthByEdge:C,baseSegments:V};for(const q of w){const z=new Set(q.filter(ot=>N.edgeSet.has(ot))),Y=q.map(ot=>L.get(ot)).filter(ot=>!!ot);for(let ot=0;ot0?B.replacements:void 0},"bestPairedReplacement");for(let N=0;N<4;N++){const F=v(),D=F.count;if(D===0)return;let V,h,b=D,C=Number.POSITIVE_INFINITY;for(const w of F.edges){const B=Qt(p(w),Z);for(const U of xt(w)){const q=H(w,U),z=!q&&_(w,U),Y=S(F,w,U),ot=Qt(U,Z);q||z||!(Yb||Y===b&&ot>=C||(V=w,h=U,b=Y,C=ot)}}if(V&&h){V.points=h;continue}const L=hn(F);if(!L)return;for(const[w,B]of L)w.points=B}}d(vs,"resolveRenderedOrthogonalCrossings");var pe=.001,Wr=8;function Ls(t,e){const{nodeInfoById:n,realNodeRects:o}=an(e),s=["top","bottom","left","right"],r=20,i={top:Math.min(...o.map(f=>f.rect.top))-r,bottom:Math.max(...o.map(f=>f.rect.bottom))+r,left:Math.min(...o.map(f=>f.rect.left))-r,right:Math.max(...o.map(f=>f.rect.right))+r},c=d((f,y,v,M)=>{const E=[],T=co(f,y,v,M,r,pe);return T&&E.push(T),y===M&&E.push(ao(f,y,v,i[y])),E},"buildOrthogonalPathCandidates"),a=d((f,y)=>{for(let v=0;v{let M=0;const E=Re(f,pe),T=y.start,m=y.end;for(const S of t){if(S===y||S.isLayoutOnly)continue;const A=S.start,R=S.end;if(!v&&T&&m&&(A===T||A===m||R===T||R===m))continue;const k=S.points;if(!(!k||k.length<2))for(const O of E)for(const _ of Re(k,pe)){if(fo(O.a,O.b,_.a,_.b,pe,pe)){M++;continue}ce(O,_,pe)>=Wr&&M++}}return M},"pathConflictCount"),g=4,x=d((f,y)=>{const v=Math.abs(f.y-y.rect.top),M=Math.abs(f.y-y.rect.bottom),E=Math.abs(f.x-y.rect.left),T=Math.abs(f.x-y.rect.right);let m="top",S=v;return M{const M=I.get(f)??[];M.push({side:y,edgeId:v}),I.set(f,M)},"addFaceClaim");for(const f of t){if(f.isLayoutOnly)continue;const y=f.points??[];if(y.length<1)continue;const v=f.id??"",M=f.start,E=f.end;if(M){const T=n.get(M);T&&u(M,x(y[0],T),v)}if(E){const T=n.get(E);T&&u(E,x(y[y.length-1],T),v)}}const p=d((f,y,v)=>I.get(f)?.some(M=>M.edgeId!==v&&M.side===y)??!1,"faceIsClaimed");for(const f of t){if(f.isLayoutOnly)continue;const y=f.points;if(!y||y.length<2)continue;const v=Qt(y,pe);if(v0){const mt=l(J,f,!0);if(mt>O||mt===O&&dt>=_)continue;O=mt,_=dt,k=J;continue}l(J,f)>R||dt<_&&(_=dt,k=J)}}}if(k){f.points=k;const H=I.get(M);H&&I.set(M,H.filter(G=>G.edgeId!==S));const P=I.get(E);P&&I.set(E,P.filter(G=>G.edgeId!==S)),u(M,x(k[0],T),S),u(E,x(k[k.length-1],m),S)}}}d(Ls,"simplifyDetouredEdges");var Kt=.001,Po=10,Ve=7;function $n(t,e){const n=e?0:t.length-1,o=e?1:-1,s=t[n],r=t[n+o];if(!s||!r)return;const i=r.x-s.x,c=r.y-s.y;if(!(Math.abs(i)+Math.abs(c)r&&Je(t,Es(r)))}d(zn,"labelOverlapsOwnMarker");function Ue(t,e){const n=[];for(const p of t){if(p.isLayoutOnly)continue;const f=p.points;if(!(!f||f.length<2))for(let y=0;y{const y=Tn(f,r);for(const{nodeId:v,rect:M}of o)if(v!==p&&Je(y,M))return!0;return!1},"labelOverlapsForeignNode"),l=d((p,f)=>{const y=Tn(f,r);for(const v of n)if(v.edgeId!==p&&cn(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),g=d((p,f,y)=>a(p,y)||l(f,y),"labelOverlapsAnything"),x=[],I=d(p=>{for(const{id:f,rect:y}of s)if(ts(y,p))return f},"findContainingLane"),u=d((p,f)=>x.some(y=>y.labelId!==p&&Je(f,y.rect)),"overlapsPlacedLabel");for(const p of t){if(p.isLayoutOnly)continue;const f=p.labelNodeId;if(!f)continue;const y=e.get(f);if(!y)continue;const v=p.points;if(!v||v.length<2)continue;const M=y.width??0,E=y.height??0;if(M<=0||E<=0)continue;const T=[];for(let Q=0;Q=Kt&>>=Kt||T.push({idx:Q,length:at+gt,orientation:at>=Kt?"horizontal":"vertical",midX:(W.x+et.x)/2,midY:(W.y+et.y)/2})}if(T.length===0)continue;const m=T.length>=3?T.filter(Q=>Q.idx>0&&Q.idx0?m:T,A=M>=E?"horizontal":"vertical",R=d(Q=>[...Q].sort((W,et)=>{const at=W.orientation===A,gt=et.orientation===A;if(at!==gt)return at?-1:1;const xt=W.length>=(W.orientation==="horizontal"?M:E)+2,vt=et.length>=(et.orientation==="horizontal"?M:E)+2;return xt!==vt?xt?-1:1:et.length-W.length}),"rankSegments"),k=T[0],O=T[T.length-1],_=[.5,.25,.75,.05,.95,.15,.85,.1,.9],H=d((Q,W)=>{const et=v[Q.idx],at=v[Q.idx+1];return{midX:et.x+(at.x-et.x)*W,midY:et.y+(at.y-et.y)*W}},"anchorAtT"),P=d((Q,W,et)=>Math.min(et,Math.max(W,Q)),"clamp"),G=d((Q,W)=>Q.midX>=W.left-Kt&&Q.midX<=W.right+Kt&&Q.midY>=W.top-Kt&&Q.midY<=W.bottom+Kt,"pointInsideRectInclusive"),j=d(Q=>{const W=Ae(Q.midX,Q.midY,M,E),et=I(W);if(et)return{laneId:et,anchor:Q,rect:W};const at=s.find(({rect:te})=>G(Q,te));if(!at)return;const gt=at.rect.left+M/2+i,xt=at.rect.right-M/2-i,vt=at.rect.top+E/2+i,Vt=at.rect.bottom-E/2-i;if(gt>xt||vt>Vt)return;const jt={midX:P(Q.midX,gt,xt),midY:P(Q.midY,vt,Vt)},Ut=Ae(jt.midX,jt.midY,M,E);return G(Q,Ut)?{laneId:at.id,anchor:jt,rect:Ut}:void 0},"placementForAnchor"),J=d((Q,W,et)=>Q.orientation==="horizontal"?Math.abs(W.midX-et.x):Math.abs(W.midY-et.y),"distanceAlongSegment"),dt=d((Q,W)=>{const at=(Q.orientation==="horizontal"?M/2:E/2)+c;if(Q===k){const gt=v[Q.idx];if(J(Q,W,gt)+Kt{const W=R(Q);for(const et of W)for(const at of _){const gt=H(et,at);if(!dt(et,gt))continue;const xt=j(gt);if(xt&&!zn(xt.rect,v)&&!u(f,xt.rect)&&!g(f,p.id,xt.rect))return{laneId:xt.laneId,anchor:xt.anchor}}},"tryPool"),kt=d((Q,W,et=!1)=>{const at=R(Q);for(const gt of at){const xt={midX:gt.midX,midY:gt.midY};if(W&&!dt(gt,xt))continue;const vt=j(xt);if(vt&&!zn(vt.rect,v)&&!u(f,vt.rect)&&!a(f,vt.rect)&&(et||!l(p.id,vt.rect)))return{laneId:vt.laneId,anchor:vt.anchor}}},"findLaneContainingFallback"),Pt=mt(S)??(S.lengthet.labelId===f);W>=0?x[W]={labelId:f,rect:Q}:x.push({labelId:f,rect:Q})}}}d(Ue,"anchorLabelsToPolyline");var Sn=1e-6,Kr=8,Bo=Kr/2,qr=3;function Vn(t,e){return t{const g=Vn(c,a);let x=0;const I=d(u=>{if(!u)return;const p=s.get(u);if(!p)return;const f=l==="x"?p.w/2:p.h/2;f>x&&(x=f)},"consider");I(i.labelNodeId);for(const u of t){if(u===i||u.isLayoutOnly)continue;const p=u.start,f=u.end;!p||!f||Vn(p,f)===g&&I(u.labelNodeId)}return x>0?x+qr:0},"labelClearanceFor");for(const i of t){if(i.isLayoutOnly)continue;const c=i.points;if(!ro(c,Sn))continue;const a=lo(i,n,Sn);if(!a)continue;const{srcId:l,dstId:g,srcInfo:x,dstInfo:I,collinearX:u,collinearY:p}=a;if(u===p)continue;let f,y;if(u){const m=I.cy>x.cy;f={x:x.cx,y:m?x.rect.bottom:x.rect.top},y={x:I.cx,y:m?I.rect.top:I.rect.bottom}}else{const m=I.cx>x.cx;f={x:m?x.rect.right:x.rect.left,y:x.cy},y={x:m?I.rect.left:I.rect.right,y:I.cy}}if(At(f,y,o,[l,g],1))continue;const M=r(i,l,g,u?"x":"y"),E=M>Bo?M:Bo,T=[0,E,-E];for(const m of T){const S={...f},A={...y};if(u){if(S.x+=m,A.x+=m,S.x<=x.rect.left||S.x>=x.rect.right||A.x<=I.rect.left||A.x>=I.rect.right)continue}else if(S.y+=m,A.y+=m,S.y<=x.rect.top||S.y>=x.rect.bottom||A.y<=I.rect.top||A.y>=I.rect.bottom)continue;if(!At(S,A,o,[l,g],1)&&!Ze(S,A,t,i,{epsilon:Sn})){i.points=[S,A];break}}}}d(Ts,"straightenCollinearSiblingDetours");function jn(t,e){const{realNodeRects:a,labelNodeRects:l}=me(e.values()),g=d((m,S)=>Re(S,.001).map(A=>({...A,edge:m,interior:A.index>=1&&A.index<=S.length-3})),"segmentsFor"),x=d(()=>{const m=[];for(const S of t){if(S.isLayoutOnly)continue;const A=S.points;!A||A.length<2||m.push(...g(S,pt(A)))}return m},"allSegments"),I=d((m,S)=>m.horizontal&&S.horizontal?zt(m.a.x,m.b.x,S.a.x,S.b.x)>=8&&Math.abs(m.a.y-S.a.y)<7:m.vertical&&S.vertical?zt(m.a.y,m.b.y,S.a.y,S.b.y)>=8&&Math.abs(m.a.x-S.a.x)<7:!1,"hasCrowdedParallelTrack"),u=d((m,S)=>{const A=m.start,R=m.end,k=g(m,S);if(k.length!==S.length-1)return!1;const O=[A,R].filter(H=>!!H),_=m.labelNodeId?[m.labelNodeId]:[];for(const H of k)if(At(H.a,H.b,a,O,-2)||At(H.a,H.b,l,_,-2))return!1;for(const H of t){if(H===m||H.isLayoutOnly)continue;const P=H.points;if(!(!P||P.length<2)){for(const G of k)for(const j of g(H,pt(P)))if(I(G,j)||le(G.a,G.b,j.a,j.b,.001))return!1}}return!0},"candidateIsSafe"),p=d((m,S)=>{const A=pt(m.edge.points??[]);if(A.length<4||m.index>=A.length-1)return;const R=A.map(k=>({...k}));if(m.horizontal)R[m.index].y+=S,R[m.index+1].y+=S;else if(m.vertical)R[m.index].x+=S,R[m.index+1].x+=S;else return;return g(m.edge,R).length===R.length-1?R:void 0},"shiftedCandidate"),f=d((m,S)=>({x:m.x??(S.left+S.right)/2,y:m.y??(S.top+S.bottom)/2}),"nodeCenter"),y=d(m=>{const S=m.edge,A=pt(S.points??[]);if(A.length!==4||m.index!==1)return;const R=S.start?e.get(S.start):void 0,k=S.end?e.get(S.end):void 0,O=R?qt(R):void 0,_=k?qt(k):void 0,H=A.slice(m.index+2);if(!(!R||!k||!O||!_||H.length===0))return{sourceCenter:f(R,O),targetCenter:f(k,_),sourceRect:O,tail:H}},"sourceDetourContextFor"),v=d((m,S,A,R,k,O)=>{const _=R.y>=A.y,H=_?k.bottom:k.top,P=H+(_?20:-20);if(_&&m.b.y<=P+.001||!_&&m.b.y>=P-.001)return;const G=m.a.x+S;return pt([{x:A.x,y:H},{x:A.x,y:P},{x:G,y:P},{x:G,y:m.b.y},...O],.001)},"verticalSourceDetour"),M=d((m,S,A,R,k,O)=>{const _=R.x>=A.x,H=_?k.right:k.left,P=H+(_?20:-20);if(_&&m.b.x<=P+.001||!_&&m.b.x>=P-.001)return;const G=m.a.y+S;return pt([{x:H,y:A.y},{x:P,y:A.y},{x:P,y:G},{x:m.b.x,y:G},...O],.001)},"horizontalSourceDetour"),E=d((m,S)=>{const A=y(m);if(A){if(m.vertical)return v(m,S,A.sourceCenter,A.targetCenter,A.sourceRect,A.tail);if(m.horizontal)return M(m,S,A.sourceCenter,A.targetCenter,A.sourceRect,A.tail)}},"sourceDetourCandidate"),T=[-7,7,-14,14,-21,21];for(let m=0;m<12;m++){const S=x();let A=!1;for(let R=0;RP.interior);for(const P of H){for(const G of T){const j=p(P,G);if(j&&u(P.edge,j)){P.edge.points=j,A=!0;break}const J=E(P,G);if(J&&u(P.edge,J)){P.edge.points=J,A=!0;break}}if(A)break}}if(!A)return}}d(jn,"nudgeSharedInteriorSubpaths");function ws(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,i=o.x-n.x,c=o.y-n.y,a=s*c-r*i;if(Math.abs(a)<1e-10)return!1;const l=n.x-t.x,g=n.y-t.y,x=(l*c-g*i)/a,I=(l*r-g*s)/a,u=.01;return x>u&&x<1-u&&I>u&&I<1-u}d(ws,"segmentsIntersect");function As(t){const e=t.nodes??[],n=t.edges??[],o=[];if(!n.length||!e.length)return o;const s=es(e),r=[];for(const c of n){if(c.isLayoutOnly)continue;const a=c.points;if(!a||a.length<2)continue;const l=c.start,g=c.end,x=c.labelNodeId,I=c.id??`${l}->${g}`;for(const u of s)if(!(u.nodeId===l||u.nodeId===g)&&!(x&&u.nodeId===x)){for(let p=0;p0){const c=o.filter(l=>l.type==="edge-node-overlap").length,a=o.filter(l=>l.type==="edge-edge-crossing").length;Ke.warn(`[SWIMLANE_VALIDATE] ${o.length} issue(s) detected: ${c} edge-node overlap(s), ${a} edge crossing(s)`);for(const l of o)Ke.warn(`[SWIMLANE_VALIDATE] ${l.type}: ${l.detail}`)}return o}d(As,"validateSwimlanesLayout");function Rs(t,e){const n=t.nodes??[],o=t.edges??[],s=n.filter(c=>!c.isGroup);if((e==="LR"||e==="RL")&&s.length>0&&!ms(t,e)||e==="BT"&&s.length>0&&!ps(t))return;for(const c of o){if(c.isLayoutOnly)continue;const a=c.points;!a||a.length<2||(c.points=ae(Qe(a)))}Ls(o,n),Ts(o,n),ys(o,n);const r=new Map;for(const c of n)r.set(String(c.id),c);Ue(o,r),is(o,r),xs(o,r),jn(o,r),bs(o,r),Ms(o,r),Xn(o,r),Is(o,r);const i=d(()=>{vs(o,r),Ss(o,r),Cs(o,r),Ue(o,r),Dn(o,r),Xn(o,r),Ue(o,r),Dn(o,r)},"finalizeRenderedEdges");i(),jn(o,r),i(),Yn(o,r),Gn(o,r),Yn(o,r),Gn(o,r)}d(Rs,"postProcessSwimlaneLayout");function ye(t){const e=new Map(t.nodeById),n=new Set,o=[];for(const r of t.edges){if(!e.has(r.src)||!e.has(r.dst))continue;const i=`${r.id}:${r.src}->${r.dst}`;n.has(i)||(n.add(i),o.push(r))}return{nodes:[...e.keys()],edges:o,layout:t.layout,nodeById:e}}d(ye,"normalizeGraph");function mo(t,e){return t.edges.filter(n=>n.dst===e)}d(mo,"incoming");function Ns(t){const e=new Map;for(const n of t.nodes)e.set(n,[]);for(const n of t.edges)e.get(n.src).push(n.dst);return e}d(Ns,"buildSuccessorMap");function yo(t){const e=Ns(t);for(const n of e.values())n.sort((o,s)=>o.localeCompare(s));return e}d(yo,"buildSortedSuccessorMap");function xo(t){const e=new Map;for(const n of t.nodes)e.set(n,0);for(const n of t.edges)e.set(n.dst,(e.get(n.dst)??0)+1);return e}d(xo,"buildInDegreeMap");function bo(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,n)=>e.localeCompare(n))}d(bo,"sortedZeroInDegreeNodes");function ln(t,e=()=>!0){const n=new Map,o=new Map;for(const s of t.nodes)n.set(s,[]),o.set(s,[]);for(const s of t.edges)e(s)&&(o.get(s.src).push(s.dst),n.get(s.dst).push(s.src));return{preds:n,succs:o}}d(ln,"buildPredecessorSuccessorMaps");function Mo(t,e,n,o){let s=0;for(const i of t.nodes)o?.skipGroups&&t.nodeById.get(i)?.isGroup||(s=Math.max(s,n[i]??0));const r=Array.from({length:s+1},()=>[]);for(const i of e)o?.skipGroups&&t.nodeById.get(i)?.isGroup||r[Math.max(0,n[i]??0)].push(i);return r}d(Mo,"buildLayersFromRanks");function Be(t){const e=xo(t),n=bo(e),o=[],s=yo(t);for(;n.length;){const r=n.shift();o.push(r);for(const i of s.get(r)??[])if(e.set(i,(e.get(i)??0)-1),(e.get(i)??0)===0){let c=0;for(;c{if(s-o<=1)return 0;const r=o+s>>1;let i=n(o,r)+n(r,s),c=o,a=r,l=o;for(;c=s||cx.dst===I.dst?x.id.localeCompare(I.id):x.dst.localeCompare(I.dst));const o=Object.create(null);for(const g of e.nodes)o[g]=0;const s=[],r=d(g=>{o[g]=1;for(const x of n.get(g)??[]){const I=x.dst;o[I]===0?r(I):o[I]===1&&s.push(x)}o[g]=2},"dfs"),i=[...e.nodes].sort((g,x)=>g.localeCompare(x));for(const g of i)o[g]===0&&r(g);const c=new Set(s.map(g=>`${g.id}:${g.src}->${g.dst}`)),a=e.edges.map(g=>c.has(`${g.id}:${g.src}->${g.dst}`)?{id:g.id,src:g.dst,dst:g.src,weight:g.weight,ref:g.ref}:g);return{acyclic:{nodes:[...e.nodes],edges:a,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:s}}d(Os,"removeCycles_DFS");function Ps(t){const e=new Map,n=d(o=>{if(e.has(o))return e.get(o);const s=t.nodeById.get(o);if(!s)return e.set(o,null),null;const r=s.parentId;if(!r)return e.set(o,null),null;const c=n(r)??r;return e.set(o,c),c},"resolve");for(const o of t.nodes)n(o);return e}d(Ps,"buildTopLaneMap");function fe(t){const e=Ps(t);return n=>e.get(n)??null}d(fe,"createTopLaneResolver");function fn(t){const e=[];for(const n of t.layout.nodes??[])n.isGroup&&!n.parentId&&e.push(n.id);return[...new Set(e)].reverse()}d(fn,"buildTopLaneOrder");function So(t,e){const n=fn(t);if(!e||e.length===0)return n;const o=new Set(n),s=new Set,r=[];for(const i of e)!o.has(i)||s.has(i)||(s.add(i),r.push(i));for(const i of n)s.has(i)||r.push(i);return r}d(So,"resolveTopLaneOrder");var Jr={EPSILON:1e-6},sn={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},ko={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Bs(t,e){const n=ye(t),o=e?.laneOf??(()=>null),s=e?.rankHint,{preds:r}=ln(n);for(const m of r.values())m.sort((S,A)=>S.localeCompare(A));const i=Be(n)??[...n.nodes].sort((m,S)=>m.localeCompare(S)),c=new Map;for(const[m,S]of i.entries())c.set(S,m);const a=new Map,l=new Map;for(const m of n.nodes)l.set(m,[]);for(const m of i){const S=(r.get(m)??[]).filter(A=>a.has(A));if(S.length>0){const A=ks(m,S,{laneOf:o,rankHint:s,topoIndex:c});a.set(m,A),l.get(A).push(m)}else a.has(m)||a.set(m,null)}for(const m of n.nodes)a.has(m)||a.set(m,null);const g=new Set;for(const m of n.nodes)(a.get(m)??null)===null&&g.add(m);const x=[...g].sort((m,S)=>{const A=c.get(m)??0,R=c.get(S)??0;return A===R?m.localeCompare(S):A-R}),I=_s(n),u=new Map;for(const[m,S]of I.entries())u.set(m,[...S].sort((A,R)=>A.localeCompare(R)));const p=Fs(u),f=Ds(u),y=new Map;for(const m of n.nodes)y.set(m,[]);for(const m of f)for(const S of m.nodes){const A=y.get(S);A?A.push(m.id):y.set(S,[m.id])}const v=[],M=[],E=new Set,T=d(m=>{if(!E.has(m)){E.add(m),v.push(m);for(const S of l.get(m)??[])T(S);M.push(m)}},"walk");for(const m of x)T(m);for(const m of i)T(m);return{parent:a,children:l,roots:x,componentOf:p,blocks:f,nodeBlocks:y,adjacency:u,preorder:v,postorder:M,topologicalOrder:i}}d(Bs,"buildDrivingTree");function ks(t,e,n){const o=n.laneOf(t);return[...e].sort((r,i)=>{const c=n.laneOf(r),a=n.laneOf(i),l=c!=null&&c===o,g=a!=null&&a===o;if(l!==g)return l?-1:1;const x=n.rankHint?.[r],I=n.rankHint?.[i];if(x!=null&&I!=null&&x!==I)return I-x;const u=n.topoIndex.get(r)??0,p=n.topoIndex.get(i)??0;return u!==p?u-p:r.localeCompare(i)})[0]}d(ks,"chooseParent");function _s(t){const e=new Map;for(const n of t.nodes)e.set(n,new Set);for(const n of t.edges)e.get(n.src).add(n.dst),e.get(n.dst).add(n.src);return e}d(_s,"buildAdjacency");function Fs(t){const e=new Map;let n=0;for(const o of t.keys()){if(e.has(o))continue;const s=[o];for(;s.length>0;){const r=s.pop();if(!e.has(r)){e.set(r,n);for(const i of t.get(r)??[])e.has(i)||s.push(i)}}n++}return e}d(Fs,"assignComponents");function Ds(t){const e=new Map,n=new Map,o=[],s=[];let r=0;const i=d((c,a)=>{e.set(c,++r),n.set(c,r);for(const l of t.get(c)??[])l!==a&&(e.has(l)?(e.get(l)??0)<(e.get(c)??0)&&(o.push([c,l]),n.set(c,Math.min(n.get(c)??r,e.get(l)??r))):(o.push([c,l]),i(l,c),n.set(c,Math.min(n.get(c)??r,n.get(l)??r)),(n.get(l)??0)>=(e.get(c)??0)&&s.push(Hs(c,l,o,s.length))))},"visit");for(const c of t.keys())e.has(c)||i(c,null);return s}d(Ds,"computeBlocks");function Hs(t,e,n,o){const s=[],r=new Set;for(;n.length>0;){const i=n.pop();if(s.push(i),r.add(i[0]),r.add(i[1]),i[0]===t&&i[1]===e||i[0]===e&&i[1]===t)break}return{id:o,edges:s,nodes:[...r]}}d(Hs,"popBlock");function Xs(t,e,n){const o=[...t.nodes],s=new Map;for(const[M,E]of o.entries())s.set(E,M);const r=o.length,i=new Array(r).fill(-1),c=new Array(r).fill(0),a=[],l=new Set;for(const M of o){const E=n.parent.get(M)??null,T=s.get(M);T!=null&&E==null&&(i[T]=-1,c[T]=0,l.has(M)||(l.add(M),a.push(M)))}for(;a.length>0;){const M=a.shift(),E=s.get(M);if(E==null)continue;const T=n.children.get(M)??[];for(const m of T){if(l.has(m))continue;const S=s.get(m);S!=null&&(i[S]=E,c[S]=c[E]+1,l.add(m),a.push(m))}}for(const M of o){if(l.has(M))continue;const E=s.get(M);E!=null&&(i[E]=-1,c[E]=0,l.add(M))}const g=Math.max(1,Math.ceil(Math.log2(Math.max(1,r)))+1),x=Array.from({length:g},()=>new Array(r).fill(-1));for(let M=0;M{if(M===-1||E===-1)return-1;c[M]>m&1&&(M=x[m][M],M===-1))return-1;if(M===E)return M;for(let m=g-1;m>=0;m--){const S=x[m][M],A=x[m][E];S===-1||A===-1||S!==A&&(M=S,E=A)}return x[0][M]},"lcaIndex"),u=Array.from({length:r},()=>new Map);for(const M of t.edges){let E=M.src,T=M.dst,m=e[E],S=e[T];if(m==null||S==null||(m>S&&([E,T]=[T,E],[m,S]=[S,m]),m==null||S==null||m===S))continue;const A=s.get(E),R=s.get(T);if(A==null||R==null)continue;const k=I(A,R);if(k===-1)continue;const O=u[k];for(let _=m;_{if(E.size!==0)for(const[T,m]of E)M.set(T,(M.get(T)??0)+m)},"mergeInto"),y=new Set,v=d(M=>{const E=s.get(M);y.add(M);const T=E==null?void 0:u[E],m=T?new Map(T):new Map,S=n.children.get(M)??[];for(const A of S){const R=v(A),k=e[M];if(k!=null){let O=p.get(M);O||(O=new Map,p.set(M,O));let _=R.get(k)??0;const H=e[A];H!=null&&H>k&&(_+=1),O.set(A,_)}f(m,R)}return m},"dfs");for(const M of n.roots)y.has(M)||v(M);for(const M of o)y.has(M)||v(M);return p}d(Xs,"computeSubtreeCrossCounts");function Ys(t,e,n){const o=new Map,s=d(r=>{let i=n[r]??0;const c=[...e.get(r)??[]];c.sort(Co(n));for(const a of c){s(a);const l=o.get(a);l!=null&&(i=Math.min(i,l))}o.set(r,i)},"annotate");for(const r of t)s(r);return o}d(Ys,"annotateMinimumLayers");function Co(t){return(e,n)=>{const o=t[e]??0,s=t[n]??0;return o===s?e.localeCompare(n):o-s}}d(Co,"compareByRankThenId");function Gs(t,e,n,o){let s=0;for(const a of e){const l=n[a]??0;l>s&&(s=l)}const r=Array.from({length:s+1},()=>[]),i=new Set,c=d(a=>{if(i.has(a))return;i.add(a);const l=n[a]??0;r[l]||(r[l]=[]),r[l].push(a);for(const g of o(a))c(g)},"emit");for(const a of t)c(a);for(const a of e)if(!i.has(a)){const l=n[a]??0;r[l]||(r[l]=[]),r[l].push(a),i.add(a)}return r}d(Gs,"emitNodesInTreeOrder");function $s(t){const e=[];for(const n of t){const o=new Set,s=[];for(const r of n)o.has(r)||(o.add(r),s.push(r));e.push(s)}return e}d($s,"deduplicateLayers");function zs(t,e,n,o){return s=>{const r=t.get(s)??[];if(r.length===0)return[];const i=e[s]??0,c=[],a=[],l=n.get(s);for(const g of r){const x=o.get(g)??i;x>i?c.push({child:g,min:x}):a.push(g)}return c.sort((g,x)=>g.min===x.min?g.child.localeCompare(x.child):g.min-x.min),a.sort((g,x)=>{const I=l?.get(g)??0,u=l?.get(x)??0;if(I!==u)return I-u;const p=o.get(g)??i,f=o.get(x)??i;return p!==f?p-f:g.localeCompare(x)}),[...c.map(g=>g.child),...a]}}d(zs,"createChildOrderer");function rn(t,e,n){const o=Bs(t,{rankHint:e,laneOf:n}),{children:s,roots:r}=o;for(const x of t.nodes)s.has(x)||s.set(x,[]);const i=Xs(t,e,o),c=[...r].sort(Co(e)),a=Ys(c,s,e),l=zs(s,e,i,a);let g=Gs(c,t.nodes,e,l);return g=$s(g),g}d(rn,"buildMultitreeLayerOrder");function Vs(t,e,n){const o=new Set(t),s=new Set(e),r=Ne(e),i=[];for(const c of n)o.has(c.src)&&s.has(c.dst)&&i.push(r.get(c.dst));return Io(i)}d(Vs,"countCrossingsBetweenAdjacent");function Un(t,e,n){const o=[];for(const r of e){const i=n[r.src],c=n[r.dst];if(i==null||c==null||i===c)continue;let a=r.src,l=r.dst,g=i,x=c;i>c&&(a=r.dst,l=r.src,g=c,x=i);for(let I=g;I(n[I]??0)-(n[x]??0));for(const x of g){const I=n[x]??0;if(I===0)continue;let u=0;for(const v of o.get(x)??[])u=Math.max(u,(n[v]??0)+1);if(u>=I)continue;const p=I;n[x]=u;const f=rn(t,n,s),y=Un(f,t.edges,n);y(e[s]??0)-(e[r]??0)||s.localeCompare(r));for(const s of o){const r=n(s);if(!r)continue;const i=t.edges.filter(f=>f.src===s);if(i.length===0)continue;let c=!1,a=0;for(const f of i){const y=n(f.dst);y==null||y===r?c=!0:a++}if(a===0||c)continue;let l=0,g=!1;for(const f of t.edges){if(f.dst!==s)continue;const y=n(f.src);y&&(y===r?g=!0:l++)}if(l>0||!g)continue;const x=e[s]??0,I=x+a;let u=0;for(const f of t.edges)f.dst===s&&(u=Math.max(u,(e[f.src]??0)+1));const p=Math.max(x,u,I);p!==x&&(e[s]=p)}}d(Us,"adjustCrossLaneSources");function Ws(t,e){const n=ye(t),o=Be(n)??[...n.nodes].sort(),s=e?.compactSingleInput??!1,r=fe(n);let i=Object.create(null);for(const a of o){const l=mo(n,a),g=e?.ignoreCrossLaneEdges?l.filter(x=>{const I=r(x.src),u=r(a);return!I||!u?!0:I===u}):l;if(g.length===0)i[a]=0;else if(s&&g.length===1){const x=g[0].src,I=r(x),u=r(a);I!==u?i[a]=i[x]??0:i[a]=(i[x]??0)+1}else{let x=-1/0;for(const I of g)x=Math.max(x,(i[I.src]??0)+1);i[a]=x===-1/0?0:x}}return(e?.optimizeRanksByCrossings??!1)&&(i=js(n,i)),e?.ignoreCrossLaneEdges&&Us(n,i),{layers:rn(n,i,r),rankOf:i,dummy:new Set}}d(Ws,"assignLayers_LongestPath");function Ks(t,e){const n=ye(t),s={...Ws(n,{compactSingleInput:e?.compactSingleInput,ignoreCrossLaneEdges:e?.ignoreCrossLaneEdges,optimizeRanksByCrossings:e?.optimizeRanksByCrossings}).rankOf},r=fe(n),{preds:i,succs:c}=ln(n,p=>{if(e?.ignoreCrossLaneEdges){const f=r(p.src),y=r(p.dst);if(f&&y&&f!==y)return!1}return!0}),a=Be(n)??[...n.nodes],l=[...a].reverse(),g=d((p,f)=>{let y=0;for(const E of i.get(p)??[])y=Math.max(y,(s[E]??0)+1);let v=Number.POSITIVE_INFINITY;const M=c.get(p)??[];return M.length>0&&(v=Math.min(...M.map(E=>(s[E]??0)-1))),Number.isFinite(v)||(v=Math.max(y,f)),Math.min(Math.max(f,y),v)},"clampFeasible"),x=sn.GRAVITY_ITERATIONS,I=d(p=>{let f=!1;for(const y of p){const v=i.get(y)??[],M=c.get(y)??[];if(v.length===0&&M.length===0)continue;const E=v.length>0?v.reduce((A,R)=>A+(s[R]??0)+1,0)/v.length:s[y]??0,T=M.length>0?M.reduce((A,R)=>A+(s[R]??0)-1,0)/M.length:s[y]??0,m=Math.round((E+T)/2),S=g(y,m);S!==s[y]&&(s[y]=S,f=!0)}return f},"relaxOrder");for(let p=0;p0){const y=Math.min(...f.map(v=>(s[v]??0)-1));(s[p]??0)>y&&(s[p]=y)}}return{layers:Mo(n,a,s),rankOf:s,dummy:new Set}}d(Ks,"assignLayers_Gravity");function qs(t){const e=xo(t),n=yo(t);let o=bo(e);const s=[];for(;o.length>0;){const r=[];for(const i of o){s.push(i);for(const c of n.get(i)??[])e.set(c,(e.get(c)??0)-1),(e.get(c)??0)===0&&r.push(c)}o=r.sort((i,c)=>i.localeCompare(c))}return s.length===t.nodes.length?s:null}d(qs,"topoSortByGenerationIfAcyclic");function Js(t,e){const n=ye(t),o=e?.direction==="LR"?qs(n)??[...n.nodes].sort():Be(n)??[...n.nodes].sort(),s=fe(n),r=d(g=>s(g)??g,"laneOf"),i=Object.create(null),c=new Map,a=d((g,x)=>e?.ignoreCrossLaneEdges??!0?r(g)===r(x)?1:0:1,"edgeWeight");for(const g of o){if(n.nodeById.get(g)?.isGroup)continue;const I=mo(n,g);let u=0;if(I.length>0)for(const v of I){const M=v.src,E=i[M]??0;u=Math.max(u,E+a(M,g))}const p=r(g),f=c.get(p)??0,y=Math.max(u,f);i[g]=y,c.set(p,y+1)}return{layers:Mo(n,o,i,{skipGroups:!0}),rankOf:i,dummy:new Set}}d(Js,"assignLayers_LaneAwareCompact");function Zs(t,e){const n=ye(e),{rankOf:o}=t,s=t.layers.map(u=>[...u]),r=new Set(t.dummy?[...t.dummy]:[]);let i=0;const c=new Map(n.nodeById),a=d(u=>{const p=`placeholder-${i++}`,f={id:p,isGroup:!1,isDummy:!0,width:0,height:0};for(c.set(p,f),r.add(p);s.length<=u;)s.push([]);return s[u].push(p),o[p]=u,p},"addDummyAt"),l=[...n.edges].sort((u,p)=>u.id===p.id?u.src===p.src?u.dst.localeCompare(p.dst):u.src.localeCompare(p.src):u.id.localeCompare(p.id)),g=[];for(const u of l){const p=o[u.src]??0,f=o[u.dst]??0;if(f-p<=1){g.push(u);continue}let y=u.src;for(let M=p+1,E=0;M!n.nodes.includes(u))],edges:g,layout:n.layout,nodeById:c};return{layering:{layers:s,rankOf:o,dummy:r},graphWithDummies:I}}d(Zs,"makeProperLayering");function Wn(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const n=[...t].sort((o,s)=>o-s);return e%2===1?n[(e-1)/2]:.5*(n[e/2-1]+n[e/2])}d(Wn,"median");function Kn(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((n,o)=>n+o,0)/t.length}d(Kn,"barycenter");function Qs(t,e,n,o){const s=new Map;for(const r of t)s.set(r,[]);for(const r of n)o==="down"?e.has(r.src)&&s.has(r.dst)&&s.get(r.dst).push(e.get(r.src)):e.has(r.dst)&&s.has(r.src)&&s.get(r.src).push(e.get(r.dst));return s}d(Qs,"neighborPositionsFor");function tr(t,e,n){const o=n.get(t)??0,s=n.get(e)??0;return o!==s?o-s:t.localeCompare(e)}d(tr,"currentOrderTieBreak");function qn(t,e,n){const o=new Set(t),s=new Set(e),r=Ne(t),i=Ne(e),c=[];for(const l of n)o.has(l.src)&&s.has(l.dst)&&c.push({u:r.get(l.src),v:i.get(l.dst)});c.sort((l,g)=>l.u===g.u?l.v-g.v:l.u-g.u);const a=c.map(l=>l.v);return Io(a)}d(qn,"countCrossingsBetweenAdjacent");function We(t,e,n){return[...t].sort((o,s)=>{const r=Wn(e.get(o)??[]),i=Wn(e.get(s)??[]);return r===i?tr(o,s,n):isFinite(r)?isFinite(i)?r-i:-1:1})}d(We,"sortByHeuristic");function Jn(t,e,n,o,s,r){const i=Ne(t),c=Ne(e),a=Qs(e,i,n,o);if(!s||!r||r.length===0)return We(e,a,c);const l=new Map;for(const I of e){const u=s(I),p=l.get(u)??[];p.push(I),l.set(u,p)}const g=[];for(const I of r){const u=l.get(I);if(!u||u.length===0)continue;const p=We(u,a,c);g.push(...p)}const x=l.get(null);if(x&&x.length>0){const I=We(x,a,c);for(const u of I){const p=Kn(a.get(u)??[]);let f=g.length;if(isFinite(p))for(const[y,v]of g.entries()){const M=Kn(a.get(v)??[]);if(pi.has(f.src)&&c.has(f.dst)),g=a?n.filter(f=>c.has(f.src)&&a.has(f.dst)):void 0,x=d(f=>{let y=qn(t,f,l);return g&&o&&(y+=qn(f,o,g)),y},"crossingScore"),I=s?new Map:null;if(s&&I)for(const f of e)I.set(f,s(f));let u=!0,p=x(r);for(;u;){u=!1;for(let f=0;f+1[...c]),s=e.edges,r=fe(e),i=So(e,n?.laneOrder);for(let c=0;c<3;c++){for(let a=1;a=0;a--)o[a]=Jn(o[a+1],o[a],s,"up",r,i),o[a]=Zn(o[a+1],o[a],s,o[a-1],r)}return{layers:o}}d(er,"orderLayers");function nr(t,e,n){const o=n?.layerGap??ko.DEFAULT_LAYER_GAP,s=n?.nodeGap??ko.DEFAULT_NODE_GAP,r=n?.laneGap??s*2,i=n?.direction??"TB",c=i==="LR"||i==="RL",a=t.layers,l=Object.create(null),g=Object.create(null),x=d(O=>e.nodeById.get(O),"getNode"),I=d(O=>x(O)?.width??0,"getWidth"),u=d(O=>x(O)?.height??0,"getHeight"),p=fe(e),f=So(e,n?.laneOrder),y=a.map(O=>O.reduce((_,H)=>Math.max(_,u(H)),0)),v=[];if(c)for(let O=0;O+1Math.max(mt,I(kt)),0),H=a[O+1].reduce((mt,kt)=>Math.max(mt,I(kt)),0),P=y[O],G=y[O+1],j=P/2+G/2,J=(_+H)/2,dt=Math.max(0,J-j-o);v.push(dt)}const M=new Set;for(const O of a)for(const _ of O)M.add(p(_));const E=M.has(null),T=f.filter(O=>M.has(O)),m=[...E?[null]:[],...T],S=Object.create(null);for(const O of T)S[O]=0;E&&(S.null=0);for(const O of a){const _=Object.create(null),H=[];for(const P of O){const G=p(P);G===null?H.push(P):(_[G]||=[]).push(P)}for(const[P,G]of Object.entries(_)){const j=G.reduce((J,dt)=>J+I(dt),0)+s*Math.max(0,G.length-1);S[P]=Math.max(S[P]??0,j)}if(E&&H.length){const P=H.reduce((G,j)=>G+I(j),0)+s*Math.max(0,H.length-1);S.null=Math.max(S.null??0,P)}}const A=new Map;{const O=m.map(P=>(P===null?S.null:S[P])??0);let H=-(O.reduce((P,G)=>P+G,0)+r*Math.max(0,m.length-1))/2;for(let P=0;PI(Q)),kt=mt.reduce((Q,W)=>Q+W,0)+s*(J.length-1);let Pt=dt-kt/2;for(const[Q,W]of J.entries()){const et=mt[Q];l[W]=Pt+et/2,g[W]=R+H/2,Pt+=et+s}}}const G=v[O]??0;R+=H+o+G}const k=new Map;for(const O of e.edges){const _=O.ref.id;k.has(_)||k.set(_,[]),k.get(_).push(O)}for(const[,O]of k){if(O.length===0)continue;const _=O[0].ref,H=_.start,P=_.end;if(H==null||P==null)continue;const G=Math.round(((l[H]??0)+(l[P]??0))/2),j=new Set;for(const J of O)j.add(J.src),j.add(J.dst);for(const J of j){if(J===H||J===P)continue;e.nodeById.get(J)?.isDummy&&(l[J]=G)}}return{x:l,y:g}}d(nr,"assignCoordinates");var or=8;function sr(t){let e=2166136261;for(let n=0;n>>0}d(sr,"hashString");function rr(t){let e=t>>>0;return()=>{e+=1831565813;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}d(rr,"mulberry32");function ir(t,e){const n=[...t],o=rr(e);for(let s=n.length-1;s>0;s--){const r=Math.floor(o()*(s+1));[n[s],n[r]]=[n[r],n[s]]}return n}d(ir,"deterministicShuffle");function cr(t,e){let n=0;for(const[o,s]of t.entries())n+=Math.abs(o-(e.get(s)??o));return n}d(cr,"sourceDistance");function Qn(t,e){const n=new Map;for(const[s,r]of t.entries())n.set(r,s);let o=0;for(const{a:s,b:r,weight:i}of e){const c=n.get(s),a=n.get(r);c==null||a==null||(o+=i*Math.abs(c-a))}return o}d(Qn,"laneArrangementCost");function ar(t){const e=fn(t);if(e.length<2)return[];const n=new Map(e.map((r,i)=>[r,i])),o=fe(t),s=new Map;for(const r of t.layout.edges??[]){if(r.isLayoutOnly)continue;const i=typeof r.start=="string"?r.start:void 0,c=typeof r.end=="string"?r.end:void 0;if(!i||!c||!t.nodeById.has(i)||!t.nodeById.has(c))continue;const a=o(i),l=o(c);if(!a||!l||a===l)continue;const g=n.get(a),x=n.get(l);if(g==null||x==null)continue;const[I,u]=g<=x?[a,l]:[l,a],p=`${I}\0${u}`,f=s.get(p);f?f.weight++:s.set(p,{a:I,b:u,weight:1})}return[...s.values()]}d(ar,"buildWeightedLaneEdges");function to(t,e,n){const o=[...t];let s=Qn(o,e),r=!0,i=0;const c=Math.max(1,o.length);for(;r&&is.a===r.a?s.b.localeCompare(r.b):s.a.localeCompare(r.a)).map(({a:s,b:r,weight:i})=>`${s}:${r}:${i}`).join("|");return sr(`${t.join("|")}#${o}#${n}`)}d(fr,"seedForRestart");function dr(t,e={}){const n=fn(t);if(n.length<2)return n;const o=ar(t);if(o.length===0)return n;const s=new Map(n.map((c,a)=>[c,a]));let r=to(n,o,s);const i=Math.max(0,e.restarts??or);for(let c=0;cct&&a*3>=c?i>0?"bottom":"top":c>ct?r>0?"right":"left":n}d(eo,"chooseOrthogonalSide");function no(t,e){return Math.abs(t.to-e.from)h.isGroup&&!h.parentId);for(const h of l){const b={id:h.id},C=d(L=>{i.set(L.id,b),n.filter(w=>w.parentId===L.id).forEach(C)},"assignLane");C(h)}const g=n.filter(h=>!h.isGroup&&!h.isEdgeLabel).map(h=>{const b=h.width??10,C=h.height??10,L=h.x??0,w=h.y??0,B=Zr;return{nodeId:h.id,minX:L-b/2-B,maxX:L+b/2+B,minY:w-C/2-B,maxY:w+C/2+B,visualXHalfExtent:a?C/2+B:b/2+B}}),x=d((h,b,C,L)=>{let w=c.find(B=>B.orientation===h&&Math.abs(B.coord-b)<1);return w||(w={id:`pipe-${h}-${b.toFixed(0)}`,orientation:h,coord:b,spanMin:C,spanMax:L,tracks:[]},c.push(w)),w.spanMin=Math.min(w.spanMin,C),w.spanMax=Math.max(w.spanMax,L),w},"getOrAddPipe"),I=d((h,b)=>{const C=h.width??10,L=h.height??10,w=h.x??0,B=h.y??0;switch(b){case"top":return{x:w,y:B-L/2};case"bottom":return{x:w,y:B+L/2};case"left":return{x:w-C/2,y:B};case"right":return{x:w+C/2,y:B}}},"portForSide"),u=d((h,b,C)=>I(h,eo(h,b,C?"bottom":"top")),"getOrthogonalPort"),p=[],f=[],y=new Set,v=1e3,M=d((h,b,C)=>{if(p.length===0)return 0;const L=Math.abs(b.y-C.y)z||Y.from-ct<=U&&Y.to+ct>=U&&(B+=v)}else if(w){const U=b.x,q=Math.min(b.y,C.y)-ct,z=Math.max(b.y,C.y)+ct;if(z<=q)return 0;for(const Y of p)Y.edgeIndex===h||Y.orientation!=="horizontal"||Y.pipe.coordz||Y.from-ct<=U&&Y.to+ct>=U&&(B+=v)}return B},"crossingPenalty"),E=s.map((h,b)=>{if(!h.start||!h.end)return{idx:b,crossLane:0,dx:0,dy:0};const C=r.get(h.start),L=r.get(h.end),w=i.get(h.start),B=i.get(h.end),U=w&&B&&w.id!==B.id?1:0,q=C&&L?Math.abs((L.x??0)-(C.x??0)):0,z=C&&L?Math.abs((L.y??0)-(C.y??0)):0;return{idx:b,crossLane:U,dx:q,dy:z}}).sort((h,b)=>{if(h.crossLane!==b.crossLane)return b.crossLane-h.crossLane;const C=h.dx+h.dy,L=b.dx+b.dy;return Math.abs(C-L)>1?C-L:h.idx-b.idx}).map(h=>h.idx),T=d((h,b,C,L)=>{const w=Math.min(h.x,b.x),B=Math.max(h.x,b.x),U=Math.min(h.y,b.y),q=Math.max(h.y,b.y);return!!g.find(Y=>C&&Y.nodeId===C||L&&Y.nodeId===L?!1:Math.abs(h.x-b.x)>ct?Y.minYh.y&&Y.maxX>w&&Y.minXh.x&&Y.maxY>U&&Y.minYeo(h,b,"bottom"),"determineSide"),R=new Map;for(const[h,b]of s.entries()){if(!b.start||!b.end||b.start===b.end||b.points&&b.points.length>0)continue;const C=r.get(b.start),L=r.get(b.end);if(!C||!L)continue;const w=(L.x??0)-(C.x??0),B=(L.y??0)-(C.y??0);R.set(h,{edgeIdx:h,srcId:b.start,dstId:b.end,srcSide:A(C,{x:L.x??0,y:L.y??0}),dstSide:A(L,{x:C.x??0,y:C.y??0}),absDx:Math.abs(w),absDy:Math.abs(B),dxSign:Math.sign(w),dySign:Math.sign(B)})}const k=d(h=>h.srcSide==="top"||h.srcSide==="bottom"?h.absDx===0?1/0:h.absDy/h.absDx:h.absDy===0?1/0:h.absDx/h.absDy,"preferenceStrength"),O=d(h=>h.srcSide==="top"||h.srcSide==="bottom"?h.dxSign>=0?"right":"left":h.dySign>=0?"bottom":"top","secondarySide"),_=new Map;for(const h of R.values()){const b=`${h.srcId}:${h.srcSide}`;_.has(b)||_.set(b,[]),_.get(b).push(h)}const H=new Map,P=d((h,b)=>`${h}:${b}`,"loadKey");for(const h of R.values())H.set(P(h.srcId,h.srcSide),(H.get(P(h.srcId,h.srcSide))??0)+1),H.set(P(h.dstId,h.dstSide),(H.get(P(h.dstId,h.dstSide))??0)+1);for(const h of _.values())if(!(h.length<2)){h.sort((b,C)=>{const L=k(b),w=k(C);return Math.abs(L-w)>1e-9?w-L:b.edgeIdx-C.edgeIdx});for(let b=1;b=w||(H.set(P(C.srcId,C.srcSide),w-1),H.set(P(C.srcId,L),B+1),C.srcSide=L)}}const G=d(h=>{const b=h?.shape;return b==="question"||b==="diamond"},"isDiamondNode"),j=new Map;for(const h of R.values())j.has(h.dstId)||j.set(h.dstId,new Set),j.get(h.dstId).add(h.dstSide);for(const h of R.values()){if(!G(r.get(h.srcId)))continue;const b=j.get(h.srcId);if(!b?.has(h.srcSide))continue;const C=O(h);if(b.has(C)||(H.get(P(h.srcId,C))??0)>0)continue;const L=H.get(P(h.srcId,h.srcSide))??0;H.set(P(h.srcId,h.srcSide),Math.max(0,L-1)),H.set(P(h.srcId,C),1),h.srcSide=C}for(const h of R.values()){const{edgeIdx:b,srcId:C,dstId:L,srcSide:w,dstSide:B}=h,U=r.get(C),q=r.get(L),z=`${C}:${w}:src`,Y=w==="top"||w==="bottom"?q.x??0:q.y??0;m.has(z)||m.set(z,[]),m.get(z).push({edgeIdx:b,oppositeCoord:Y});const ot=`${L}:${B}:dst`,rt=B==="top"||B==="bottom"?U.x??0:U.y??0;m.has(ot)||m.set(ot,[]),m.get(ot).push({edgeIdx:b,oppositeCoord:rt})}const J=new Map,dt=8;for(const[h,b]of m){if(b.length<2)continue;b.sort((Lt,Dt)=>Lt.oppositeCoord-Dt.oppositeCoord);const C=h.split(":"),L=C.slice(0,-2).join(":"),w=C[C.length-2],B=C[C.length-1],U=r.get(L);if(!U)continue;const z=w==="left"||w==="right"?U.height??10:U.width??10,Y=U.shape,rt=Y==="question"||Y==="diamond"?z*.3:z,tt=Math.min(20,Math.max(dt,rt/(b.length+1))),Rt=-(tt*(b.length-1))/2;for(const[Lt,Dt]of b.entries()){const Jt=Rt+Lt*tt,gn=`${Dt.edgeIdx}:${B}`;J.set(gn,Jt)}}const mt=d(h=>!!s[h]?.labelNodeId,"edgeHasLabelNode"),kt=d((h,b)=>h?(m.get(`${h}:${b}:src`)??[]).some(({edgeIdx:C})=>mt(C))||(m.get(`${h}:${b}:dst`)??[]).some(({edgeIdx:C})=>mt(C)):!1,"faceHasLabelNode"),Pt=d((h,b,C)=>b==="top"||b==="bottom"?{x:h.x+C,y:h.y}:{x:h.x,y:h.y+C},"applyPortOffset"),Q=d((h,b,C)=>{const L=R.get(h),w={x:C.x??0,y:C.y??0},B={x:b.x??0,y:b.y??0},U=L?.srcSide??A(b,w),q=L?.dstSide??A(C,B);let z=L?I(b,L.srcSide):u(b,w,!0),Y=L?I(C,L.dstSide):u(C,B,!1);const ot=J.get(`${h}:src`),rt=J.get(`${h}:dst`);return ot!==void 0&&(z=Pt(z,U,ot)),rt!==void 0&&(Y=Pt(Y,q,rt)),{pSrcPort:z,pDstPort:Y,srcSide:U,dstSide:q}},"portsForEdge");for(const h of E){const b=s[h];if(f[h]=[],!b.start||!b.end||b.points&&b.points.length>0||b.start===b.end)continue;const C=r.get(b.start),L=r.get(b.end);if(!C||!L)continue;const{pSrcPort:w,pDstPort:B,srcSide:U,dstSide:q}=Q(h,C,L),z={...w},Y={...B},ot=U==="top"||U==="bottom",rt=q==="top"||q==="bottom";if(ot){const X=w.y>(C.y??0);z.y=X?w.y+ne:w.y-ne}else{const X=w.x>(C.x??0);z.x=X?w.x+ne:w.x-ne}if(rt){const X=B.y>(L.y??0);Y.y=X?B.y+ne:B.y-ne}else{const X=B.x>(L.x??0);Y.x=X?B.x+ne:B.x-ne}const st=d((X,$)=>{for(const K of g)if(!$.includes(K.nodeId)&&X.x>K.minX&&X.xK.minY&&X.y{if(Ct){const Nt=X.y>($.y??0);return{x:(K.x??0)>=X.x?lt.maxX+be:lt.minX-be,y:Nt?lt.maxY+Te:lt.minY-Te,leavesPositiveSide:Nt}}const bt=X.x>($.x??0),Et=(K.y??0)>=X.y;return{x:bt?lt.maxX+be:lt.minX-be,y:Et?lt.maxY+Te:lt.minY-Te,leavesPositiveSide:bt}},"obstacleDetour");let yt=[];const Rt=[b.start,b.end],Lt=st(z,Rt);if(Lt.inside&&Lt.obstacle){const X=Lt.obstacle;if(ot){const $=tt(w,C,L,X,!0);z.x=$.x,z.y=$.y;const K=$.leavesPositiveSide?Math.min(X.minY-2,w.y+ne):Math.max(X.maxY+2,w.y-ne);yt=[{x:w.x,y:K},{x:$.x,y:K},{x:$.x,y:$.y}]}else{const $=tt(w,C,L,X,!1),K=$.leavesPositiveSide?Math.min(X.minX-2,w.x+ne):Math.max(X.maxX+2,w.x-ne);z.x=$.x,z.y=$.y,yt=[{x:K,y:w.y},{x:K,y:$.y},{x:$.x,y:$.y}]}}let Dt=[];const Jt=st(Y,Rt);if(Jt.inside&&Jt.obstacle){const X=Jt.obstacle;if(rt){const $=tt(B,L,C,X,!0);Y.x=$.x,Y.y=$.y,Dt=[{x:$.x,y:$.y},{x:B.x,y:$.y}]}else{const $=tt(B,L,C,X,!1);Y.x=$.x,Y.y=$.y,Dt=[{x:$.x,y:$.y},{x:$.x,y:B.y}]}}if(yt.length===0&&Dt.length===0){const X=be,$=Math.abs(z.x-Y.x)1||bt>1,Nt=S.get(b.start??"")??0,ut=S.get(b.end??"")??0,Yt=Ct>1&&kt(b.start,U)||bt>1&&kt(b.end,q),ee=Ct<=1||Nt<=2,Bt=bt<=1||ut<=2;if(($||K)&&!lt&&(!Et||Et&&!Yt&&ee&&Bt)&&!T(w,B,b.start,b.end)){b.points=[{...w},{...z},{...Y},{...B}],y.add(h);const Mt=K?"horizontal":"vertical",$t=K?w.y:w.x,It=K?Math.min(w.x,B.x):Math.min(w.y,B.y),St=K?Math.max(w.x,B.x):Math.max(w.y,B.y),Wt={id:`fast-path-${Mt}-${$t.toFixed(0)}-${h}`,orientation:Mt,coord:$t,spanMin:It,spanMax:St,tracks:[]};p.push({edgeIndex:h,segmentIndex:0,orientation:Mt,pipe:Wt,trackIndex:0,from:It,to:St});continue}}const gn=x("vertical",z.x,z.y,z.y);z.x=gn.coord;const mr=x("vertical",Y.x,Y.y,Y.y);Y.x=mr.coord;let ue=Math.min(z.x,Y.x)-50,he=Math.max(z.x,Y.x)+50,ve=Math.min(z.y,Y.y)-50,Le=Math.max(z.y,Y.y)+50;for(const X of g){const $=Math.min(z.x,Y.x),K=Math.max(z.x,Y.x),lt=Math.min(z.y,Y.y),Ct=Math.max(z.y,Y.y);X.minX$&&X.minYlt&&(ue=Math.min(ue,X.minX-je),he=Math.max(he,X.maxX+je),ve=Math.min(ve,X.minY-je),Le=Math.max(Le,X.maxY+je))}for(const X of g){if(X.maxXhe||X.maxYLe)continue;const $=be;x("horizontal",X.minY-$,ue,he),x("horizontal",X.maxY+$,ue,he);const K=Te;x("vertical",X.minX-K,ve,Le),x("vertical",X.maxX+K,ve,Le)}x("horizontal",z.y,ue,he),x("horizontal",Y.y,ue,he);const yr=c.filter(X=>X.orientation==="horizontal"&&X.coord>=ve&&X.coord<=Le),xr=c.filter(X=>X.orientation==="vertical"&&X.coord>=ue&&X.coord<=he),ke=d((X,$)=>`${X.toFixed(1)},${$.toFixed(1)}`,"getKey"),_e=ke(z.x,z.y),vo=ke(Y.x,Y.y),Fe=new Map,pn=new Map,mn=new Map,De=new Set,xe=[];Fe.set(_e,0),mn.set(_e,"n"),xe.push({key:_e,f:Math.hypot(Y.x-z.x,Y.y-z.y),pt:z}),De.add(_e);let Ht=[];const ge=d((X,$)=>T(X,$,b.start,b.end),"checkSegmentBlocked"),yn={x:Y.x,y:z.y},br=ge(z,yn),Mr=ge(yn,Y),Ir=br||Mr,xn={x:z.x,y:Y.y},Sr=ge(z,xn),Cr=ge(xn,Y);if(Ir?Sr||Cr||(Math.abs(z.x-Y.x)0;){xe.sort((ut,Yt)=>ut.f-Yt.f);const X=xe.shift();if(De.delete(X.key),X.key===vo){let ut=vo,Yt=Y;for(Ht=[Yt];pn.has(ut);){const ee=pn.get(ut);Ht.unshift(ee),Yt=ee,ut=ke(ee.x,ee.y)}break}const $=X.pt.x,K=X.pt.y,lt=xr.sort((ut,Yt)=>ut.coord-Yt.coord),Ct=lt.findIndex(ut=>Math.abs(ut.coord-$)<1),bt=yr.sort((ut,Yt)=>ut.coord-Yt.coord),Et=bt.findIndex(ut=>Math.abs(ut.coord-K)<1),Nt=[];Ct>0&&Nt.push({x:lt[Ct-1].coord,y:K}),Ct>=0&&Ct0&&Nt.push({x:$,y:bt[Et-1].coord}),Et>=0&&EtZt.nodeId===b.start||Zt.nodeId===b.end?!1:Yt!==ee?Zt.minYK&&Zt.maxX>Yt&&Zt.minX$&&Zt.maxY>Bt&&Zt.minY10&&bn<-5||Ee<-10&&bn>5)&&(St=Math.abs(bn)*100),(Wt>10&&He<-5||Wt<-10&&He>5)&&(St+=Math.abs(He)*50);let Lo=0;const Eo=mn.get(X.key)??"n",To=Math.abs(He)>ct?"h":"v";Eo!=="n"&&Eo!==To&&(Lo=50);const vr=$t+It+St+Lo,Xe=(Fe.get(X.key)??1/0)+vr,wo=Math.abs(Y.x-ut.x)+Math.abs(Y.y-ut.y);if(Xe<(Fe.get(Mt)??1/0))if(pn.set(Mt,X.pt),Fe.set(Mt,Xe),mn.set(Mt,To),!De.has(Mt))xe.push({key:Mt,f:Xe+wo,pt:ut}),De.add(Mt);else{const Zt=xe.findIndex(Lr=>Lr.key===Mt);Zt!==-1&&(xe[Zt].f=Xe+wo)}}}if(Ht.length===0&&(Ht=[z,{x:z.x,y:Y.y},Y]),Ht.length>4){const X=Ht[0],$=Ht[Ht.length-1];let K=Math.min(X.x,$.x),lt=Math.max(X.x,$.x),Ct=Math.min(X.y,$.y),bt=Math.max(X.y,$.y);for(const Bt of Ht)K=Math.min(K,Bt.x),lt=Math.max(lt,Bt.x),Ct=Math.min(Ct,Bt.y),bt=Math.max(bt,Bt.y);const Et=lt>Math.max(X.x,$.x),Nt=KIt.minXGt&&It.minYOt);if($t.length>0){let It=Math.max(X.x,$.x);for(const St of $t){const Wt=(St.minX+St.maxX)/2;if(St.visualXHalfExtent===void 0||isNaN(St.visualXHalfExtent))continue;const Ee=Wt+St.visualXHalfExtent+Bt;It=Math.max(It,Ee)}isNaN(It)||(lt=It)}}if(Nt){const Gt=g.filter(Ot=>Ot.minXMath.min(X.y,$.y));if(Gt.length>0){let Ot=Math.min(X.x,$.x);for(const Mt of Gt){const It=(Mt.minX+Mt.maxX)/2-Mt.visualXHalfExtent-Bt;Ot=Math.min(Ot,It)}K=Ot}}}const ut=d(Bt=>{const Gt=$.y>X.y,Ot=g.filter(It=>{const St=Math.min(X.x,$.x)It.minX,Wt=Math.min(X.y,$.y)It.minY;return St&&Wt});let Mt=Ot;if(a&&Ot.length>0){const It=Ot.filter(St=>St.minXBt);It.length>0&&(Mt=It)}if(Mt.length===0)return $.y;const $t=be;if(Gt){const St=Math.max(...Mt.map(Wt=>Wt.maxY))+$t;if(St<$.y-ct)return St}else{const St=Math.min(...Mt.map(Wt=>Wt.minY))-$t;if(St>$.y+ct)return St}return $.y},"findBestReturnY"),Yt=d(Bt=>{const Gt=ut(Bt),Ot={x:Bt,y:X.y},Mt={x:Bt,y:Gt},$t={x:$.x,y:Gt},It=ge(X,Ot),St=ge(Ot,Mt),Wt=ge(Mt,$t),Ee=Gt!==$.y?ge($t,$):!1;return!It&&!St&&!Wt&&!Ee?Math.abs(Gt-$.y)=3){const X=Xt[Xt.length-1],$=Xt[Xt.length-2],K=Xt[Xt.length-3],lt=Math.abs(K.y-$.y)Math.abs(X.x-K.x)&&Xt.splice(-2,1)}else if(Ct){const bt=Math.sign($.y-K.y),Et=Math.sign(X.y-K.y);bt!==0&&bt===Et&&Math.abs($.y-K.y)>Math.abs(X.y-K.y)&&Xt.splice(-2,1)}}const ie=[Xt[0]];for(let X=1;X$.x,bt=lt.x>K.x;if(Ct!==bt){ie.push(K);continue}continue}if(Math.abs($.x-K.x)$.y,bt=lt.y>K.y;if(Ct!==bt){ie.push(K);continue}continue}ie.push(K)}ie.push(Xt[Xt.length-1]);for(let X=0;Xh.from{const w=!L.segments.some(U=>(U.edgeIndex!==b.edgeIndex||U.segmentIndex!==b.segmentIndex)&&W(U,h)),B=!C.segments.some(U=>(U.edgeIndex!==h.edgeIndex||U.segmentIndex!==h.segmentIndex)&&W(U,b));return w&&B?(h.trackIndex=L.index,b.trackIndex=C.index,C.segments=[...C.segments.filter(U=>U.edgeIndex!==h.edgeIndex||U.segmentIndex!==h.segmentIndex),{edgeIndex:b.edgeIndex,segmentIndex:b.segmentIndex,from:b.from,to:b.to}],L.segments=[...L.segments.filter(U=>U.edgeIndex!==b.edgeIndex||U.segmentIndex!==b.segmentIndex),{edgeIndex:h.edgeIndex,segmentIndex:h.segmentIndex,from:h.from,to:h.to}],!0):!1},"trySwapSegmentsAcrossTracks"),at=d(h=>{const b=h.tracks.length;return h.tracks[b]={index:b,coord:h.coord,segments:[]},b},"createNewTrack"),gt=d((h,b)=>{const C=h.pipe.tracks[h.trackIndex];C.segments=C.segments.filter(w=>w.edgeIndex!==h.edgeIndex||w.segmentIndex!==h.segmentIndex),h.trackIndex=b,h.pipe.tracks[b].segments.push({edgeIndex:h.edgeIndex,segmentIndex:h.segmentIndex,from:h.from,to:h.to})},"moveSegmentToTrack"),xt=d((h,b)=>{const C=f[h.edgeIndex];for(const L of C){const w=p[L];w.pipe===h.pipe&>(w,b)}},"moveSegmentChainToTrack"),vt=d(h=>{const b=f[h.edgeIndex],C=b.indexOf(p.indexOf(h)),L=[];return C>0&&L.push(p[b[C-1]]),C{if(h.orientation===b.orientation)return!1;const C=h.orientation==="horizontal"?h:b,L=h.orientation==="horizontal"?b:h;return L.pipe.coord>C.from&&L.pipe.coordL.from&&C.pipe.coord{for(const C of h.tracks)if(!C.segments.some(w=>(w.edgeIndex!==b.edgeIndex||w.segmentIndex!==b.segmentIndex)&&W(w,b)))return C.index;return-1},"findAvailableTrack"),Ut=d((h,b)=>{if(h.trackIndex===b.trackIndex)return W(h,b);const C=vt(h),L=vt(b);return C.some(w=>L.some(B=>Vt(w,B)))},"segmentsConflict"),te=d((h,b,C)=>{if(et(h,b,h.pipe.tracks[h.trackIndex],b.pipe.tracks[b.trackIndex]))return;const L=jt(h.pipe,b);C(b,L!==-1?L:at(h.pipe))},"resolveTrackConflict"),Se=d(h=>{let b=0;for(let C=0;C{if(de.has(h))return de.get(h);const b=f[h];if(b.length===0){const q={dest:0,deviation:0,base:0,delta:0};return de.set(h,q),q}const L=p[b[0]].pipe.coord;let w=L;for(let q=1;qMath.abs(ot-L)?Y:ot;break}}const B=Math.abs(w-L),U={dest:w,deviation:B,base:L,delta:w-L};return de.set(h,U),U},"getDestInfo"),dn=d(()=>{let h=0;const b=new Map;for(const[L,w]of s.entries())f[L].length!==0&&w.start&&(b.has(w.start)||b.set(w.start,[]),b.get(w.start).push(L));const C=d(L=>{const w=s[L];if(!w.start||!w.end)return 0;const B=r.get(w.start),U=r.get(w.end);if(!B||!U)return 0;const q=(U.x??0)-(B.x??0),z=(U.y??0)-(B.y??0);return Math.abs(q)+Math.abs(z)},"getEdgeDistance");for(const L of b.values()){L.sort((B,U)=>{const q=Ce(B),z=Ce(U);if(Math.abs(q.deviation-z.deviation)>1)return q.deviation-z.deviation;if(Math.abs(q.dest-z.dest)>1)return q.dest-z.dest;const Y=C(B),ot=C(U);if(Math.abs(Y-ot)>1)return ot-Y;const rt=f[B].length,st=f[U].length;if(rt!==st)return rt-st;if(rt===1){const tt=f[B][0],yt=f[U][0];if(p[tt]&&p[yt]){const Rt=p[tt],Lt=p[yt],Dt=Math.abs(Rt.to-Rt.from),Jt=Math.abs(Lt.to-Lt.from);if(Math.abs(Dt-Jt)>1)return Dt-Jt}}return 0});const w=L.map(B=>p[f[B][0]]);h+=Se(w)}return h},"fixSourceHandleCrossings"),un=d(()=>{let h=0;const b=new Map;for(const[C,L]of s.entries())f[C].length!==0&&L.end&&(b.has(L.end)||b.set(L.end,[]),b.get(L.end).push(C));for(const C of b.values()){C.sort((w,B)=>{const U=d(Y=>{const ot=f[Y];if(ot.length<2)return 0;const rt=p[ot[ot.length-2]];return Math.abs(rt.to-rt.from)},"getDist"),q=U(w),z=U(B);return Math.abs(q-z)>.1?q-z:w-B});const L=C.map(w=>p[f[w][f[w].length-1]]);h+=Se(L)}return h},"fixTargetHandleCrossings"),hn=d(()=>{let h=0;for(const b of c){const C=[];for(const L of b.tracks)for(const w of L.segments){const B=f[w.edgeIndex].find(U=>p[U].segmentIndex===w.segmentIndex);B!==void 0&&C.push(p[B])}C.sort((L,w)=>L.edgeIndex-w.edgeIndex||L.segmentIndex-w.segmentIndex);for(let L=0;L{L.segments.forEach(w=>{b.push({edgeIndex:w.edgeIndex,segmentIndex:w.segmentIndex,trackIndex:L.index,from:w.from,to:w.to})})}),b.sort((L,w)=>L.from-w.from);const C=[];if(b.length>0){let L=[b[0]],w=b[0].to;for(let B=1;Bw.add(tt.trackIndex));const B=new Map;L.forEach(tt=>{const yt=Ce(tt.edgeIndex);B.set(tt.trackIndex,(B.get(tt.trackIndex)??0)+yt.delta)});const U=[...w].filter(tt=>(B.get(tt)??0)<-1),q=[...w].filter(tt=>(B.get(tt)??0)>1),z=[...w].filter(tt=>Math.abs(B.get(tt)??0)<=1);U.sort((tt,yt)=>(B.get(yt)??0)-(B.get(tt)??0)),q.sort((tt,yt)=>(B.get(tt)??0)-(B.get(yt)??0));const Y=d((tt,yt)=>{L.filter(Rt=>Rt.trackIndex===tt).forEach(Rt=>{const Lt=y.has(Rt.edgeIndex)?h.coord:yt;D.set(`${Rt.edgeIndex}-${Rt.segmentIndex}`,Lt)})},"assignCoord");let ot=0;for(const tt of U)ot++,Y(tt,h.coord-ot*Cn);if(z.length===0&&w.size>0){const tt=[...w].sort((Lt,Dt)=>Math.abs(B.get(Lt)??0)-Math.abs(B.get(Dt)??0))[0],yt=U.indexOf(tt);yt!==-1&&U.splice(yt,1);const Rt=q.indexOf(tt);Rt!==-1&&q.splice(Rt,1),z.push(tt)}let rt=0;for(const tt of z){if(rt===0)Y(tt,h.coord);else{const yt=rt%2===1?1:-1,Rt=Math.ceil(rt/2);Y(tt,h.coord+yt*Rt*Cn*.5)}rt++}let st=0;for(const tt of q)st++,Y(tt,h.coord+st*Cn)}}for(const[h,b]of s.entries()){const C=f[h]??[];if(C.length===0)continue;const L=[],w=r.get(b.start),B=r.get(b.end),{pSrcPort:U,pDstPort:q}=Q(h,w,B),z=C.map(rt=>{const st=p[rt],tt=D.get(`${st.edgeIndex}-${st.segmentIndex}`)??st.pipe.coord;return{orient:st.orientation,coord:tt,from:st.from,to:st.to}});L.push(U);for(let rt=0;rtct&&L.push(Me(st,yt)),Dt&&Lt.orient===st.orient)if(Math.abs(st.coord-Lt.coord)>ct){const Jt=st.orient==="vertical"?(yt+Lt.from)/2:no(st,Lt);L.push(Me(st,Jt),Me(Lt,Jt))}else(rt===0||rt===z.length-2)&&L.push(Me(st,no(st,Lt)));else if(Dt)L.push(Me(st,Lt.coord));else{const Jt=Math.abs(st.from-yt)ct||Math.abs(Y.y-q.y)>ct)&&L.push(q);const ot=[];L.length>0&&ot.push(L[0]);for(let rt=1;rtct||Math.abs(st.y-tt.y)>ct)&&ot.push(st)}b.points=ot}for(const h of s){const b=h.__originalEdge;b&&h.points&&(b.points=h.points)}t.edges=(t.edges??[]).filter(h=>!h.isLayoutOnly);const V=d((h,b)=>{const C=b.x??0,L=b.y??0,w=b.width??0,B=b.height??0;if(w<=0||B<=0)return h;const U=C-w/2,q=C+w/2,z=L-B/2,Y=L+B/2;if(h.xq||h.yY)return h;const ot=h.x-U,rt=q-h.x,st=h.y-z,tt=Y-h.y,yt=Math.min(ot,rt,st,tt);return yt===ot?{x:U,y:h.y}:yt===rt?{x:q,y:h.y}:yt===st?{x:h.x,y:z}:{x:h.x,y:Y}},"nodeBoundaryClamp");for(const h of t.edges){const b=h.points;if(!b||b.length<2)continue;const C=h.start,L=h.end,w=C?r.get(C):void 0,B=L?r.get(L):void 0;w&&(b[0]=V(b[0],w)),B&&(b[b.length-1]=V(b[b.length-1],B))}return t}d(hr,"routeEdgesOrthogonal");function gr(t){return t.direction??"TB"}d(gr,"getSwimlaneDirection");function pr(t){const e=Jo(t),n=t.config.flowchart?.nodeSpacing??40,o=t.config.flowchart?.rankSpacing??100,s=t.config.swimlane?.ignoreCrossLaneEdges??!0,r=t.config.swimlane?.optimizeRanksByCrossings??!0,i=t.config.swimlane?.automaticLaneOrdering??!1,c=gr(t),{ordered:a,coordinates:l}=ur(e,{nodeGap:n,layerGap:o,ignoreCrossLaneEdges:s,optimizeRanksByCrossings:r,automaticLaneOrdering:i,direction:c});Zo(e,a,l,{nodeGap:n,layerGap:o});for(const g of t.edges??[])delete g.points;hr(t,c);for(const g of t.edges??[])(!g.curve||g.curve==="basis")&&(g.curve="rounded");return Rs(t,c),As(t),c}d(pr,"runSwimlaneLayoutCore");async function Qr(t,e){const n=e.select("g");wr(n,t.markers,t.type,t.diagramId),Ar(),Rr(),Nr(),Tr(),qo(t);const o=Qo(t);t.nodes=o.nodes,t.edges=o.edges;const{groups:s}=await _o(n,t);pr(t),await Uo(t,s)}d(Qr,"render");export{Qr as render}; diff --git a/apps/kimi-code/dist-web/assets/swimlanesDiagram-G3AALYLV-KUKTzqZ9.js b/apps/kimi-code/dist-web/assets/swimlanesDiagram-G3AALYLV-KUKTzqZ9.js new file mode 100644 index 00000000000..b4abc436c6c --- /dev/null +++ b/apps/kimi-code/dist-web/assets/swimlanesDiagram-G3AALYLV-KUKTzqZ9.js @@ -0,0 +1,8 @@ +import{c as r,s as e}from"./flowDiagram-23GEKE2U-eOlMNTnl.js";import{_ as a}from"./mermaid.core-WW7RuneT.js";import"./chunk-5VM5RSS4-BJR-VYAu.js";import"./chunk-XXDRQBXY-D_bv9kM4.js";import"./chunk-VR4S4FIN-C_RujyXt.js";import"./chunk-32BRIVSS-CRTrWqUr.js";import"./channel-8Bt6a0tz.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var o=a(t=>`${e(t)} + .swimlane.cluster rect { + stroke: ${t.clusterBorder} !important; + } + [data-look="neo"].cluster rect { + filter: none; + } +`,"getStyles"),m=o,y=r({defaultLayout:"swimlane",styles:m});export{y as diagram}; diff --git a/apps/kimi-code/dist-web/assets/timeline-definition-FHXFAJF6-CkZhvGjX.js b/apps/kimi-code/dist-web/assets/timeline-definition-FHXFAJF6-CkZhvGjX.js new file mode 100644 index 00000000000..98bb83897cf --- /dev/null +++ b/apps/kimi-code/dist-web/assets/timeline-definition-FHXFAJF6-CkZhvGjX.js @@ -0,0 +1,120 @@ +import{_ as o,y as pt,aa as Rt,ab as Ct,ac as Wt,c as gt,l as E,D as Pt,K as Bt,ad as ft,d as X,t as Vt,ae as Ft,p as zt}from"./mermaid.core-WW7RuneT.js";import{d as ot}from"./arc-CPC2gY0w.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var tt=(function(){var e=o(function(k,s,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],h=[1,15],c=[1,16],a=[1,19],f=[1,20],g={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:o(function(s,d,l,p,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:p.addTask(u[v],0,""),this.$=u[v];break;case 19:p.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(s,d){if(d.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=d,l}},"parseError"),parse:o(function(s){var d=this,l=[0],p=[],x=[null],u=[],S=this.table,v="",I=0,R=0,W=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(s,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var U=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=p.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(p=A,A=p.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,C={},G,B,Z,j;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";j=[];for(G in S[$])this.terminals_[G]&&G>W&&j.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`: +`+w.showPosition()+` +Expecting `+j.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Y="Parse error on line "+(I+1)+": Unexpected "+(_==O?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Y,{text:w.match,token:this.terminals_[_]||_,line:w.yylineno,loc:F,expected:j})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+_);switch(T[0]){case 1:l.push(_),x.push(w.yytext),u.push(w.yylloc),l.push(T[1]),_=null,R=w.yyleng,v=w.yytext,I=w.yylineno,F=w.yylloc;break;case 2:if(B=this.productions_[T[1]][1],C.$=x[x.length-B],C._$={first_line:u[u.length-(B||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(B||1)].first_column,last_column:u[u.length-1].last_column},U&&(C._$.range=[u[u.length-(B||1)].range[0],u[u.length-1].range[1]]),P=this.performAction.apply(C,[v,R,I,H.yy,T[1],x,u].concat(L)),typeof P<"u")return P;B&&(l=l.slice(0,-1*B*2),x=x.slice(0,-1*B),u=u.slice(0,-1*B)),l.push(this.productions_[T[1]][0]),x.push(C.$),u.push(C._$),Z=S[l[l.length-2]][l[l.length-1]],l.push(Z);break;case 3:return!0}}return!0},"parse")},m=(function(){var k={EOF:1,parseError:o(function(d,l){if(this.yy.parser)this.yy.parser.parseError(d,l);else throw new Error(d)},"parseError"),setInput:o(function(s,d){return this.yy=d||this.yy||{},this._input=s,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:o(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.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),s},"input"),unput:o(function(s){var d=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var p=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),l.length-1&&(this.yylineno-=l.length-1);var x=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:l?(l.length===p.length?this.yylloc.first_column:0)+p[p.length-l.length].length-l[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(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:o(function(s){this.unput(this.match.slice(s))},"less"),pastInput:o(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+` +`+d+"^"},"showPosition"),test_match:o(function(s,d){var l,p,x;if(this.options.backtrack_lexer&&(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(x.yylloc.range=this.yylloc.range.slice(0))),p=s[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],l=this.performAction.call(this,this.yy,this,d,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var u in x)this[u]=x[u];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,d,l,p;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),u=0;ud[0].length)){if(d=l,p=u,this.options.backtrack_lexer){if(s=this.test_match(l,x[u]),s!==!1)return s;if(this._backtrack){d=!1;continue}else return!1}else if(!this.options.flex)break}return d?(s=this.test_match(d,x[p]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var d=this.next();return d||this.lex()},"lex"),begin:o(function(d){this.conditionStack.push(d)},"begin"),popState:o(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:o(function(d){this.begin(d)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(d,l,p,x){switch(p){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return k})();g.lexer=m;function y(){this.yy={}}return o(y,"Parser"),y.prototype=g,g.Parser=y,new y})();tt.parser=tt;var Ot=tt,yt={};Vt(yt,{addEvent:()=>Tt,addSection:()=>_t,addTask:()=>Et,addTaskOrg:()=>$t,clear:()=>kt,default:()=>Gt,getCommonDb:()=>xt,getDirection:()=>bt,getSections:()=>wt,getTasks:()=>St,setDirection:()=>vt});var D="",mt=0,nt="LR",rt=[],q=[],K=[],xt=o(()=>Ft,"getCommonDb"),kt=o(function(){rt.length=0,q.length=0,D="",K.length=0,nt="LR",zt()},"clear"),vt=o(function(e){nt=e},"setDirection"),bt=o(function(){return nt},"getDirection"),_t=o(function(e){D=e,rt.push(e)},"addSection"),wt=o(function(){return rt},"getSections"),St=o(function(){let e=ct();const t=100;let n=0;for(;!e&&nn.id===mt-1).events.push(e)},"addEvent"),$t=o(function(e){const t={section:D,type:D,description:e,task:e,classes:[]};q.push(t)},"addTaskOrg"),ct=o(function(){const e=o(function(n){return K[n].processed},"compileTask");let t=!0;for(const[n,i]of K.entries())e(n),t=t&&i.processed;return t},"compileTasks"),Gt={clear:kt,getCommonDb:xt,getDirection:bt,setDirection:vt,addSection:_t,getSections:wt,getTasks:St,addTask:Et,addTaskOrg:$t,addEvent:Tt},Nt=0,J=o(function(e,t){const n=e.append("rect");return n.attr("x",t.x),n.attr("y",t.y),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("width",t.width),n.attr("height",t.height),n.attr("rx",t.rx),n.attr("ry",t.ry),t.class!==void 0&&n.attr("class",t.class),n},"drawRect"),Dt=o(function(e,t){const i=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),r=e.append("g");r.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function h(f){const g=ot().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",g).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}o(h,"smile");function c(f){const g=ot().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",g).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}o(c,"sad");function a(f){f.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return o(a,"ambivalent"),t.score>3?h(r):t.score<3?c(r):a(r),i},"drawFace"),Kt=o(function(e,t){const n=e.append("circle");return n.attr("cx",t.cx),n.attr("cy",t.cy),n.attr("class","actor-"+t.pos),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("r",t.r),n.class!==void 0&&n.attr("class",n.class),t.title!==void 0&&n.append("title").text(t.title),n},"drawCircle"),It=o(function(e,t){const n=t.text.replace(//gi," "),i=e.append("text");i.attr("x",t.x),i.attr("y",t.y),i.attr("class","legend"),i.style("text-anchor",t.anchor),t.class!==void 0&&i.attr("class",t.class);const r=i.append("tspan");return r.attr("x",t.x+t.textMargin*2),r.text(n),i},"drawText"),Ut=o(function(e,t){function n(r,h,c,a,f){return r+","+h+" "+(r+c)+","+h+" "+(r+c)+","+(h+a-f)+" "+(r+c-f*1.2)+","+(h+a)+" "+r+","+(h+a)}o(n,"genPoints");const i=e.append("polygon");i.attr("points",n(t.x,t.y,50,20,7)),i.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,It(e,t)},"drawLabel"),Xt=o(function(e,t,n){const i=e.append("g"),r=st();r.x=t.x,r.y=t.y,r.fill=t.fill,r.width=n.width,r.height=n.height,r.class="journey-section section-type-"+t.num,r.rx=3,r.ry=3,J(i,r),Ht(n)(t.text,i,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+t.num},n,t.colour)},"drawSection"),et=-1,Zt=o(function(e,t,n,i){const r=t.x+n.width/2,h=e.append("g");et++,h.append("line").attr("id",i+"-task"+et).attr("x1",r).attr("y1",t.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Dt(h,{cx:r,cy:300+(5-t.score)*30,score:t.score});const a=st();a.x=t.x,a.y=t.y,a.fill=t.fill,a.width=n.width,a.height=n.height,a.class="task task-type-"+t.num,a.rx=3,a.ry=3,J(h,a),Ht(n)(t.task,h,a.x,a.y,a.width,a.height,{class:"task"},n,t.colour)},"drawTask"),jt=o(function(e,t){J(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),qt=o(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),st=o(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Ht=(function(){function e(r,h,c,a,f,g,m,y){const k=h.append("text").attr("x",c+f/2).attr("y",a+g/2+5).style("font-color",y).style("text-anchor","middle").text(r);i(k,m)}o(e,"byText");function t(r,h,c,a,f,g,m,y,k){const{taskFontSize:s,taskFontFamily:d}=y,l=r.split(//gi);for(let p=0;p)/).reverse(),r,h=[],c=1.1,a=n.attr("y"),f=parseFloat(n.attr("dy")),g=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",f+"em");for(let m=0;mt||r==="
      ")&&(h.pop(),g.text(h.join(" ").trim()),r==="
      "?h=[""]:h=[r],g=n.append("tspan").attr("x",0).attr("y",a).attr("dy",c+"em").text(r))})}o(it,"wrap");var Qt=o(function(e,t,n,i,r,h=!1){const{theme:c,look:a}=i,f=c?.includes("redux"),g=i?.themeVariables?.THEME_COLOR_LIMIT??12,m=n%g-1,y=e.append("g");t.section=m,y.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+m));const k=y.append("g"),s=y.append("g"),l=s.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(it,t.width).node().getBBox(),p=i.fontSize?.replace?i.fontSize.replace("px",""):i.fontSize;if(t.height=l.height+p*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,s.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),f&&s.attr("transform",`translate(${t.width/2}, ${h?t.padding/2+3:t.padding})`),te(k,t,m,r,i),a==="neo"&&(y.attr("data-look","neo"),f)){const x=c.includes("dark"),u=e.node()?.ownerSVGElement??e.node(),S=X(u),v=S.attr("id")??"",I=v?`${v}-drop-shadow`:"drop-shadow";if(S.select(`#${I}`).empty()){const R=S.select("defs");(R.empty()?S.append("defs"):R).append("filter").attr("id",I).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",x?"0.2":"0.06").attr("flood-color",x?"#FFFFFF":"#000000")}}return t},"drawNode"),Yt=o(function(e,t,n){const i=e.append("g"),h=i.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(it,t.width).node().getBBox(),c=n.fontSize?.replace?n.fontSize.replace("px",""):n.fontSize;return i.remove(),h.height+c*1.1*.5+t.padding},"getVirtualNodeHeight"),te=o(function(e,t,n,i,r){const{theme:h}=r,c=h?.includes("redux")?0:5,a=5,f=c>0?`M0 ${t.height-a} v${-t.height+2*a} q0,-${c},${c},-${c} h${t.width-2*a} q${c},0,${c},${c} v${t.height-a} H0 Z`:`M0 ${t.height-a} v${-(t.height-a)} h${t.width} v${t.height} H0 Z`;e.append("path").attr("id",i+"-node-"+Nt++).attr("class","node-bkg node-"+t.type).attr("d",f),h?.includes("redux")||e.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),M={drawRect:J,drawCircle:Kt,drawSection:Xt,drawText:It,drawLabel:Ut,drawTask:Zt,drawBackgroundRect:jt,getTextObj:qt,getNoteRect:st,initGraphics:Jt,drawNode:Qt,getVirtualNodeHeight:Yt},ee=o(function(e,t,n,i){const r=gt(),{look:h,theme:c,themeVariables:a}=r,{useGradient:f,gradientStart:g,gradientStop:m}=a,y=r.timeline?.leftMargin??50;E.debug("timeline",i.db);const k=r.securityLevel;let s;k==="sandbox"&&(s=X("#i"+t));const l=(k==="sandbox"?X(s.nodes()[0].contentDocument.body):X("body")).select("#"+t);l.append("g");const p=i.db.getTasks(),x=i.db.getCommonDb().getDiagramTitle();E.debug("task",p),M.initGraphics(l,t);const u=i.db.getSections();E.debug("sections",u);let S=0,v=0,I=0,R=0,W=50+y,O=50;R=50;let L=0,w=!0;u.forEach(function(N){const b={number:L,descr:N,section:L,width:150,padding:20,maxHeight:S},_=M.getVirtualNodeHeight(l,b,r);E.debug("sectionHeight before draw",_),S=Math.max(S,_+20)});let H=0,V=0;E.debug("tasks.length",p.length);for(const[N,b]of p.entries()){const _={number:N,descr:b,section:b.section,width:150,padding:20,maxHeight:v},$=M.getVirtualNodeHeight(l,_,r);E.debug("taskHeight before draw",$),v=Math.max(v,$+20),H=Math.max(H,b.events.length);let T=0;for(const P of b.events){const C={descr:P,section:b.section,number:b.section,width:150,padding:20,maxHeight:50};T+=M.getVirtualNodeHeight(l,C,r)}b.events.length>0&&(T+=(b.events.length-1)*10),V=Math.max(V,T)}E.debug("maxSectionHeight before draw",S),E.debug("maxTaskHeight before draw",v),u&&u.length>0?u.forEach(N=>{const b=p.filter(P=>P.section===N),_={number:L,descr:N,section:L,width:200*Math.max(b.length,1)-50,padding:20,maxHeight:S};E.debug("sectionNode",_);const $=l.append("g"),T=M.drawNode($,_,L,r,t);E.debug("sectionNode output",T),$.attr("transform",`translate(${W}, ${R})`),O+=S+50,b.length>0&<(l,b,L,W,O,v,r,H,V,S,!1,t),W+=200*Math.max(b.length,1),O=R,L++}):(w=!1,lt(l,p,L,W,O,v,r,H,V,S,!0,t));const F=l.node().getBBox();if(E.debug("bounds",F),x&&l.append("text").text(x).attr("x",h==="neo"?F.x*2+y:F.width/2-y).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),I=w?S+v+150:v+100,l.append("g").attr("class","lineWrapper").append("line").attr("x1",y).attr("y1",I).attr("x2",F.width+3*y).attr("y2",I).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${t}-arrowhead)`),h==="neo"&&f&&c!=="neutral"){const N=l.select("defs"),_=(N.empty()?l.append("defs"):N).append("linearGradient").attr("id",l.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");_.append("stop").attr("offset","0%").attr("stop-color",g).attr("stop-opacity",1),_.append("stop").attr("offset","100%").attr("stop-color",m).attr("stop-opacity",1)}ft(void 0,l,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),lt=o(function(e,t,n,i,r,h,c,a,f,g,m,y){for(const k of t){const s={descr:k.task,section:n,number:n,width:150,padding:20,maxHeight:h};E.debug("taskNode",s);const d=e.append("g").attr("class","taskWrapper"),p=M.drawNode(d,s,n,c,y).height;if(E.debug("taskHeight after draw",p),d.attr("transform",`translate(${i}, ${r})`),h=Math.max(h,p),k.events){const x=e.append("g").attr("class","lineWrapper");let u=h;r+=100,u=u+ne(e,k.events,n,i,r,c,y),r-=100,x.append("line").attr("x1",i+190/2).attr("y1",r+h).attr("x2",i+190/2).attr("y2",r+h+100+f+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${y}-arrowhead)`).attr("stroke-dasharray","5,5")}i=i+200,m&&!c.timeline?.disableMulticolor&&n++}r=r-10},"drawTasks"),ne=o(function(e,t,n,i,r,h,c){let a=0;const f=r;r=r+100;for(const g of t){const m={descr:g,section:n,number:n,width:150,padding:20,maxHeight:50};E.debug("eventNode",m);const y=e.append("g").attr("class","eventWrapper"),s=M.drawNode(y,m,n,h,c,!0).height;a=a+s,y.attr("transform",`translate(${i}, ${r})`),r=r+10+s}return r=f,a},"drawEvents"),re={setConf:o(()=>{},"setConf"),draw:ee},Q=200,z=5,se=Q+z*2,at=Q+100,ie=at+z*2,Lt=10,ae=0,ht=20,Mt=20,dt=30,At=50,oe=o(function(e,t,n,i){const r=gt(),h=r.timeline?.leftMargin??50;E.debug("timeline",i.db);const c=Pt(t);c.append("g");const a=i.db.getTasks(),f=i.db.getCommonDb().getDiagramTitle();E.debug("task",a),M.initGraphics(c);const g=i.db.getSections();E.debug("sections",g);let m=0,y=0;const k=50+h;let s=50;const d=s,l=k,p=se+Mt,x=ie+At,u=l+p;let S=0;const v=g&&g.length>0,I=v?u:k+p,R=Math.max(50,p+x-z*2);g.forEach(function(N){const b={number:S,descr:N,section:S,width:R,padding:z,maxHeight:m},_=M.getVirtualNodeHeight(c,b,r);E.debug("sectionHeight before draw",_),m=Math.max(m,_)});let W=0;E.debug("tasks.length",a.length);for(const[N,b]of a.entries()){const _={number:N,descr:b,section:b.section,width:Q,padding:z,maxHeight:y},$=M.getVirtualNodeHeight(c,_,r);E.debug("taskHeight before draw",$),y=Math.max(y,$);let T=0;for(const P of b.events){const C={descr:P,section:b.section,number:b.section,width:at,padding:z,maxHeight:50};T+=M.getVirtualNodeHeight(c,C,r)}b.events.length>0&&(T+=(b.events.length-1)*Lt),W=Math.max(W,T)+ae}E.debug("maxSectionHeight before draw",m),E.debug("maxTaskHeight before draw",y);const L=Math.max(y,W)+dt;v?g.forEach(N=>{const b=a.filter(Z=>Z.section===N),_={number:S,descr:N,section:S,width:R,padding:z,maxHeight:m};E.debug("sectionNode",_);const $=c.append("g"),T=M.drawNode($,_,S,r);E.debug("sectionNode output",T);const P=I-p;$.attr("transform",`translate(${P}, ${s})`);const C=s+T.height+ht;b.length>0&&ut(c,b,S,I,C,y,r,L,!1);const G=b.length,B=T.height+ht+L*Math.max(G,1)-(G>0?dt*2:0);s+=B,S++}):ut(c,a,S,I,s,y,r,L,!0);let w=c.node()?.getBBox();if(!w)throw new Error("bbox not found");if(E.debug("bounds",w),f){if(c.append("text").text(f).attr("x",w.width/2-h).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),w=c.node()?.getBBox(),!w)throw new Error("bbox not found");E.debug("bounds after title",w)}const[H]=Bt(r.fontSize),V=(H??16)*2,F=(H??16)*.5+20,U=c.append("g").attr("class","lineWrapper");U.append("line").attr("x1",I).attr("y1",d-V).attr("x2",I).attr("y2",w.y+w.height+F).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),U.lower(),ft(void 0,c,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),ut=o(function(e,t,n,i,r,h,c,a,f){for(const g of t){const m={descr:g.task,section:n,number:n,width:Q,padding:z,maxHeight:h};E.debug("taskNode",m);const y=e.append("g").attr("class","taskWrapper"),k=M.drawNode(y,m,n,c),s=k.height;E.debug("taskHeight after draw",s);const d=i-Mt-k.width;if(y.attr("transform",`translate(${d}, ${r})`),h=Math.max(h,s),g.events&&g.events.length>0){const l=r,p=i+At;ce(e,g.events,n,i,p,l,c)}r=r+a,f&&!c.timeline?.disableMulticolor&&n++}},"drawTasks"),ce=o(function(e,t,n,i,r,h,c){let a=h;for(const f of t){const g={descr:f,section:n,number:n,width:at,padding:z,maxHeight:0};E.debug("eventNode",g);const m=e.append("g").attr("class","eventWrapper"),k=M.drawNode(m,g,n,c).height;m.attr("transform",`translate(${r}, ${a})`);const s=e.append("g").attr("class","lineWrapper"),d=a+k/2;s.append("line").attr("x1",i).attr("y1",d).attr("x2",r).attr("y2",d).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),a=a+k+Lt}return a-h},"drawEvents"),le={setConf:o(()=>{},"setConf"),draw:oe},he=o(e=>{const{theme:t}=pt(),n=t?.includes("dark"),i=t?.includes("color"),r=e.svgId?.replace(/^#/,"")??"",h=r?`url(#${r}-drop-shadow)`:e.dropShadow??"none";let c="";for(let a=0;a{let t="";for(let n=0;n{const{theme:t}=pt(),n=t?.includes("redux"),i=t==="neutral",r=e.svgId?.replace(/^#/,"")??"";let h="";if(e.useGradient&&r&&e.THEME_COLOR_LIMIT&&!i)for(let c=0;c{},"setConf"),draw:o((e,t,n,i)=>(i?.db?.getDirection?.()??"LR")==="TD"?le.draw(e,t,n,i):re.draw(e,t,n,i),"draw")},ke={db:yt,renderer:ge,parser:Ot,styles:pe};export{ke as diagram}; diff --git a/apps/kimi-code/dist-web/assets/vennDiagram-L72KCM5P-BSODO45Y.js b/apps/kimi-code/dist-web/assets/vennDiagram-L72KCM5P-BSODO45Y.js new file mode 100644 index 00000000000..3cd6b86ab92 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/vennDiagram-L72KCM5P-BSODO45Y.js @@ -0,0 +1,34 @@ +import{b4 as Wt,s as Kt,g as Ht,o as Yt,n as Xt,a as Zt,b as Jt,_ as w,y as wt,D as Qt,d as ot,al as $t,aa as te,ab as ee,ac as ne,e as se,p as ie,A as oe,B as re}from"./mermaid.core-WW7RuneT.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";const kt=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;ua.angle-u.angle);let f=e[e.length-1];for(let u=0;up.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;uMath.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u=0&&(n=a),Math.abs(f)ct(n))}function $(t,n){let s=0;for(let e=0;ev.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});x.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x=p[b-1].fx){let x=!1;if(S.fx>c.fx?(J(g,1+a,_,-a,c),g.fx=t(g),g.fx=1)break;for(let d=1;dl+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a{const y={};for(let h=0;hxt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;ul===f?0:lo.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;hy.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;bt[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in E)return E[x];var d=E[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const D=new Set;d.forEach(k=>{k.size==0&&k.sets.length==1&&D.add(k.sets[0])}),d=d.filter(k=>!k.sets.some(F=>D.has(F)));let I={},C={};if(d.length>0){let k=m(d,{lossFunction:v,distinct:b});l&&(k=Ct(k,r,h)),I=Nt(k,s,e,i,f),C=Lt(I,d,M)}const U={};d.forEach(k=>{k.label&&(U[k.sets]=k.label)});function V(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const O=x.select("svg");n?O.attr("viewBox",`0 0 ${s} ${e}`):O.attr("width",s).attr("height",e);const R={};let T=!1;O.selectAll(".venn-area path").each(function(k){const F=this.getAttribute("d");k.sets.length==1&&F&&!b&&(T=!0,R[k.sets[0]]=Me(F))});function A(k){return F=>{const H=k.sets.map(et=>{let Y=R[et],Z=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-F)+Z.x*F,y:Y.y*(1-F)+Z.y*F,radius:Y.radius*(1-F)+Z.radius*F}});return St(H,p)}}const G=O.selectAll(".venn-area").data(d,k=>k.sets),P=G.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=P.append("path"),L=P.append("text").attr("class","label").text(k=>V(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),L.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function K(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=x;T&&typeof z.transition=="function"?(z=K(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",k=>St(k.sets.map(F=>I[F])),p);const N=z.selectAll("text").filter(k=>k.sets in C).text(k=>V(k)).attr("x",k=>Math.floor(C[k.sets].x)).attr("y",k=>Math.floor(C[k.sets].y));u&&(T?"on"in N?N.on("end",rt(I,V)):N.each("end",rt(I,V)):N.each(rt(I,V)));const j=K(G.exit()).remove();typeof G.transition=="function"&&j.selectAll("path").attrTween("d",A);const X=j.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(L.style("font-size","0px"),N.style("font-size",y),X.style("font-size","0px")),{circles:I,textCentres:C,nodes:G,enter:P,update:z,exit:j}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Dt:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const E=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${E+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(` +M`,t,n),e.push(` +m`,-s,0),e.push(` +a`,s,s,0,1,0,s*2,0),e.push(` +a`,s,s,0,1,0,-s*2,0),e.join(" ")}function Me(t){const n=t.split(" ");return{x:Number.parseFloat(n[1]),y:Number.parseFloat(n[2]),radius:-Number.parseFloat(n[4])}}function Pt(t){if(t.length===0)return[];const n={};return st(t,n),n.arcs}function Bt(t,n){if(t.length===0)return"M 0 0";const s=Math.pow(10,n||0),e=n!=null?o=>Math.round(o*s)/s:o=>o;if(t.length==1){const o=t[0].circle;return ke(e(o.x),e(o.y),e(o.radius))}const i=[` +M`,e(t[0].p2.x),e(t[0].p2.y)];for(const o of t){const r=e(o.circle.radius);i.push(` +A`,r,r,0,o.large?1:0,o.sweep?1:0,e(o.p1.x),e(o.p1.y))}return i.join(" ")}function St(t,n){return Bt(Pt(t),n)}function Se(t,n={}){const{lossFunction:s,layoutFunction:e=At,normalize:i=!0,orientation:o=Math.PI/2,orientationOrder:r,width:l=600,height:f=350,padding:u=15,scaleToFit:a=!1,symmetricalTextCentre:y=!1,distinct:h,round:b=2}=n;let p=e(t,{lossFunction:s==="default"||!s?tt:s==="logRatio"?Dt:s,distinct:h});i&&(p=Ct(p,o,r));const M=Nt(p,l,f,u,a),E=Lt(M,t,y),_=new Map(Object.keys(M).map(m=>[m,{set:m,x:M[m].x,y:M[m].y,radius:M[m].radius}])),S=t.map(m=>{const v=m.sets.map(d=>_.get(d)),c=Pt(v),x=Bt(c,b);return{circles:v,arcs:c,path:x,area:m,has:new Set(m.sets)}});function g(m){let v="";for(const c of S)c.has.size>m.length&&m.every(x=>c.has.has(x))&&(v+=" "+c.path);return v}return S.map(({circles:m,arcs:v,path:c,area:x})=>({data:x,text:E[x.sets],circles:m,arcs:v,path:c,distinctPath:c+g(x.sets)}))}var gt=(function(){var t=w(function(S,g,m,v){for(m=m||{},v=S.length;v--;m[S[v]]=g);return m},"o"),n=[5,8],s=[7,8,11,12,17,19,22,24],e=[1,17],i=[1,18],o=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],r=[1,31],l=[1,39],f=[7,8,11,12,17,19,22,24,27],u=[1,57],a=[1,56],y=[1,58],h=[1,59],b=[1,60],p=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],M={trace:w(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:w(function(g,m,v,c,x,d,D){var I=d.length-1;switch(x){case 1:return d[I-1];case 2:case 3:case 4:this.$=[];break;case 5:d[I-1].push(d[I]),this.$=d[I-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=d[I];break;case 8:c.setDiagramTitle(d[I].substr(6)),this.$=d[I].substr(6);break;case 9:c.addSubsetData([d[I]],void 0,void 0),c.setIndentMode&&c.setIndentMode(!0);break;case 10:c.addSubsetData([d[I-1]],d[I],void 0),c.setIndentMode&&c.setIndentMode(!0);break;case 11:c.addSubsetData([d[I-2]],void 0,parseFloat(d[I])),c.setIndentMode&&c.setIndentMode(!0);break;case 12:c.addSubsetData([d[I-3]],d[I-2],parseFloat(d[I])),c.setIndentMode&&c.setIndentMode(!0);break;case 13:if(d[I].length<2)throw new Error("union requires multiple identifiers");c.validateUnionIdentifiers&&c.validateUnionIdentifiers(d[I]),c.addSubsetData(d[I],void 0,void 0),c.setIndentMode&&c.setIndentMode(!0);break;case 14:if(d[I-1].length<2)throw new Error("union requires multiple identifiers");c.validateUnionIdentifiers&&c.validateUnionIdentifiers(d[I-1]),c.addSubsetData(d[I-1],d[I],void 0),c.setIndentMode&&c.setIndentMode(!0);break;case 15:if(d[I-2].length<2)throw new Error("union requires multiple identifiers");c.validateUnionIdentifiers&&c.validateUnionIdentifiers(d[I-2]),c.addSubsetData(d[I-2],void 0,parseFloat(d[I])),c.setIndentMode&&c.setIndentMode(!0);break;case 16:if(d[I-3].length<2)throw new Error("union requires multiple identifiers");c.validateUnionIdentifiers&&c.validateUnionIdentifiers(d[I-3]),c.addSubsetData(d[I-3],d[I-2],parseFloat(d[I])),c.setIndentMode&&c.setIndentMode(!0);break;case 17:case 18:case 19:c.addTextData(d[I-1],d[I],void 0);break;case 20:case 21:c.addTextData(d[I-2],d[I-1],d[I]);break;case 23:c.addStyleData(d[I-1],d[I]);break;case 24:case 25:case 26:var C=c.getCurrentSets();if(!C)throw new Error("text requires set");c.addTextData(C,d[I],void 0);break;case 27:case 28:var C=c.getCurrentSets();if(!C)throw new Error("text requires set");c.addTextData(C,d[I-1],d[I]);break;case 29:case 41:this.$=[d[I]];break;case 30:case 42:this.$=[...d[I-2],d[I]];break;case 31:this.$=[d[I-2],d[I]];break;case 33:this.$=d[I].join(" ");break;case 34:this.$=[d[I]];break;case 35:d[I-1].push(d[I]),this.$=d[I-1];break;case 43:case 44:this.$=d[I];break}},"anonymous"),table:[t(n,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(s,[2,4],{6:5}),t(n,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(s,[2,5]),t(s,[2,6]),t(s,[2,7]),t(s,[2,8]),{13:16,20:e,21:i},{13:20,18:19,20:e,21:i},{13:20,18:21,20:e,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:e,21:i},t(s,[2,9],{14:[1,27],15:[1,28]}),t(o,[2,43]),t(o,[2,44]),t(s,[2,13],{14:[1,29],15:[1,30],27:r}),t(o,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:r},t(s,[2,22]),t(s,[2,24],{14:[1,35]}),t(s,[2,25],{14:[1,36]}),t(s,[2,26]),{20:l,25:37,26:38,27:r},t(s,[2,10],{15:[1,40]}),{16:[1,41]},t(s,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:e,21:i},t(s,[2,17],{14:[1,45]}),t(s,[2,18],{14:[1,46]}),t(s,[2,19]),t(s,[2,27]),t(s,[2,28]),t(s,[2,23],{27:[1,47]}),t(f,[2,29]),{15:[1,48]},{16:[1,49]},t(s,[2,11]),{16:[1,50]},t(s,[2,15]),t(o,[2,42]),t(s,[2,20]),t(s,[2,21]),{20:l,26:51},{16:u,20:a,21:[1,53],28:52,29:54,30:55,31:y,32:h,33:b},t(s,[2,12]),t(s,[2,16]),t(f,[2,30]),t(f,[2,31]),t(f,[2,32]),t(f,[2,33],{30:61,16:u,20:a,31:y,32:h,33:b}),t(p,[2,34]),t(p,[2,36]),t(p,[2,37]),t(p,[2,38]),t(p,[2,39]),t(p,[2,40]),t(p,[2,35])],defaultActions:{6:[2,1]},parseError:w(function(g,m){if(m.recoverable)this.trace(g);else{var v=new Error(g);throw v.hash=m,v}},"parseError"),parse:w(function(g){var m=this,v=[0],c=[],x=[null],d=[],D=this.table,I="",C=0,U=0,V=2,O=1,R=d.slice.call(arguments,1),T=Object.create(this.lexer),A={yy:{}};for(var G in this.yy)Object.prototype.hasOwnProperty.call(this.yy,G)&&(A.yy[G]=this.yy[G]);T.setInput(g,A.yy),A.yy.lexer=T,A.yy.parser=this,typeof T.yylloc>"u"&&(T.yylloc={});var P=T.yylloc;d.push(P);var B=T.options&&T.options.ranges;typeof A.yy.parseError=="function"?this.parseError=A.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function L(W){v.length=v.length-2*W,x.length=x.length-W,d.length=d.length-W}w(L,"popStack");function K(){var W;return W=c.pop()||T.lex()||O,typeof W!="number"&&(W instanceof Array&&(c=W,W=c.pop()),W=m.symbols_[W]||W),W}w(K,"lex");for(var z,N,j,X,k={},F,H,et,Y;;){if(N=v[v.length-1],this.defaultActions[N]?j=this.defaultActions[N]:((z===null||typeof z>"u")&&(z=K()),j=D[N]&&D[N][z]),typeof j>"u"||!j.length||!j[0]){var Z="";Y=[];for(F in D[N])this.terminals_[F]&&F>V&&Y.push("'"+this.terminals_[F]+"'");T.showPosition?Z="Parse error on line "+(C+1)+`: +`+T.showPosition()+` +Expecting `+Y.join(", ")+", got '"+(this.terminals_[z]||z)+"'":Z="Parse error on line "+(C+1)+": Unexpected "+(z==O?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(Z,{text:T.match,token:this.terminals_[z]||z,line:T.yylineno,loc:P,expected:Y})}if(j[0]instanceof Array&&j.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+z);switch(j[0]){case 1:v.push(z),x.push(T.yytext),d.push(T.yylloc),v.push(j[1]),z=null,U=T.yyleng,I=T.yytext,C=T.yylineno,P=T.yylloc;break;case 2:if(H=this.productions_[j[1]][1],k.$=x[x.length-H],k._$={first_line:d[d.length-(H||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(H||1)].first_column,last_column:d[d.length-1].last_column},B&&(k._$.range=[d[d.length-(H||1)].range[0],d[d.length-1].range[1]]),X=this.performAction.apply(k,[I,U,C,A.yy,j[1],x,d].concat(R)),typeof X<"u")return X;H&&(v=v.slice(0,-1*H*2),x=x.slice(0,-1*H),d=d.slice(0,-1*H)),v.push(this.productions_[j[1]][0]),x.push(k.$),d.push(k._$),et=D[v[v.length-2]][v[v.length-1]],v.push(et);break;case 3:return!0}}return!0},"parse")},E=(function(){var S={EOF:1,parseError:w(function(m,v){if(this.yy.parser)this.yy.parser.parseError(m,v);else throw new Error(m)},"parseError"),setInput:w(function(g,m){return this.yy=m||this.yy||{},this._input=g,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:w(function(){var g=this._input[0];this.yytext+=g,this.yyleng++,this.offset++,this.match+=g,this.matched+=g;var m=g.match(/(?:\r\n?|\n).*/g);return m?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),g},"input"),unput:w(function(g){var m=g.length,v=g.split(/(?:\r\n?|\n)/g);this._input=g+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-m),this.offset-=m;var c=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),v.length-1&&(this.yylineno-=v.length-1);var x=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:v?(v.length===c.length?this.yylloc.first_column:0)+c[c.length-v.length].length-v[0].length:this.yylloc.first_column-m},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-m]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(g){this.unput(this.match.slice(g))},"less"),pastInput:w(function(){var g=this.matched.substr(0,this.matched.length-this.match.length);return(g.length>20?"...":"")+g.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var g=this.match;return g.length<20&&(g+=this._input.substr(0,20-g.length)),(g.substr(0,20)+(g.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var g=this.pastInput(),m=new Array(g.length+1).join("-");return g+this.upcomingInput()+` +`+m+"^"},"showPosition"),test_match:w(function(g,m){var v,c,x;if(this.options.backtrack_lexer&&(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(x.yylloc.range=this.yylloc.range.slice(0))),c=g[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+g[0].length},this.yytext+=g[0],this.match+=g[0],this.matches=g,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(g[0].length),this.matched+=g[0],v=this.performAction.call(this,this.yy,this,m,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),v)return v;if(this._backtrack){for(var d in x)this[d]=x[d];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var g,m,v,c;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),d=0;dm[0].length)){if(m=v,c=d,this.options.backtrack_lexer){if(g=this.test_match(v,x[d]),g!==!1)return g;if(this._backtrack){m=!1;continue}else return!1}else if(!this.options.flex)break}return m?(g=this.test_match(m,x[c]),g!==!1?g:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:w(function(){var m=this.next();return m||this.lex()},"lex"),begin:w(function(m){this.conditionStack.push(m)},"begin"),popState:w(function(){var m=this.conditionStack.length-1;return m>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:w(function(m){return m=this.conditionStack.length-1-Math.abs(m||0),m>=0?this.conditionStack[m]:"INITIAL"},"topState"),pushState:w(function(m){this.begin(m)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(m,v,c,x){switch(c){case 0:break;case 1:break;case 2:break;case 3:if(m.getIndentMode&&m.getIndentMode())return m.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:m.setIndentMode&&m.setIndentMode(!1),this.begin("INITIAL"),this.unput(v.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(m.consumeIndentText)m.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return v.yytext=v.yytext.slice(2,-2),14;case 17:return v.yytext=v.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return S})();M.lexer=E;function _(){this.yy={}}return w(_,"Parser"),_.prototype=M,M.Parser=_,new _})();gt.parser=gt;var we=gt,yt=[],pt=[],mt=[],bt=new Set,vt,It=!1,_e=w((t,n,s)=>{const e=it(t).sort(),i=s??10/Math.pow(t.length,2);vt=e,e.length===1&&bt.add(e[0]),yt.push({sets:e,size:i,label:n?nt(n):void 0})},"addSubsetData"),Te=w(()=>yt,"getSubsetData"),nt=w(t=>{const n=t.trim();return n.length>=2&&n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):n},"normalizeText"),Ee=w(t=>t&&nt(t),"normalizeStyleValue"),ze=w((t,n,s)=>{const e=nt(n);pt.push({sets:it(t).sort(),id:e,label:s?nt(s):void 0})},"addTextData"),Ae=w((t,n)=>{const s=it(t).sort(),e={};for(const[i,o]of n)e[i]=Ee(o)??o;mt.push({targets:s,styles:e})},"addStyleData"),Re=w(()=>mt,"getStyleData"),it=w(t=>t.map(n=>nt(n)),"normalizeIdentifierList"),De=w(t=>{const s=it(t).filter(e=>!bt.has(e));if(s.length>0)throw new Error(`unknown set identifier: ${s.join(", ")}`)},"validateUnionIdentifiers"),Ce=w(()=>pt,"getTextData"),Ne=w(()=>vt,"getCurrentSets"),Oe=w(()=>It,"getIndentMode"),Fe=w(t=>{It=t},"setIndentMode"),je=re.venn;function Vt(){return oe(je,wt().venn)}w(Vt,"getConfig");var Le=w(()=>{ie(),yt.length=0,pt.length=0,mt.length=0,bt.clear(),vt=void 0,It=!1},"customClear"),Pe={getConfig:Vt,clear:Le,setAccTitle:Jt,getAccTitle:Zt,setDiagramTitle:Xt,getDiagramTitle:Yt,getAccDescription:Ht,setAccDescription:Kt,addSubsetData:_e,getSubsetData:Te,addTextData:ze,addStyleData:Ae,validateUnionIdentifiers:De,getTextData:Ce,getStyleData:Re,getCurrentSets:Ne,getIndentMode:Oe,setIndentMode:Fe},Be=w(t=>` + .venn-title { + font-size: 32px; + fill: ${t.vennTitleTextColor}; + font-family: ${t.fontFamily}; + } + + .venn-circle text { + font-size: 48px; + font-family: ${t.fontFamily}; + } + + .venn-intersection text { + font-size: 48px; + fill: ${t.vennSetTextColor}; + font-family: ${t.fontFamily}; + } + + .venn-text-node { + font-family: ${t.fontFamily}; + color: ${t.vennSetTextColor}; + } +`,"getStyles"),Ve=Be;function qt(t){const n=new Map;for(const s of t){const e=s.targets.join("|"),i=n.get(e);i?Object.assign(i,s.styles):n.set(e,{...s.styles})}return n}w(qt,"buildStyleByKey");var qe=w((t,n,s,e)=>{const i=e.db,o=i.getConfig?.(),{themeVariables:r,look:l,handDrawnSeed:f}=wt(),u=l==="handDrawn",a=[r.venn1,r.venn2,r.venn3,r.venn4,r.venn5,r.venn6,r.venn7,r.venn8].filter(Boolean),y=i.getDiagramTitle?.(),h=i.getSubsetData(),b=i.getTextData(),p=qt(i.getStyleData()),M=Gt(h),E=o?.width??800,_=o?.height??450,g=E/1600,m=y?48*g:0,v=r.primaryTextColor??r.textColor,c=Qt(n);c.attr("viewBox",`0 0 ${E} ${_}`),y&&c.append("text").text(y).attr("class","venn-title").attr("font-size",`${32*g}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*g).style("fill",r.vennTitleTextColor||r.titleColor);const x=ot(document.createElement("div")),d=ve().width(E).height(_-m);x.datum(M).call(d);const D=u?$t.svg(x.select("svg").node()):void 0,I=Se(M,{width:E,height:_-m,padding:o?.padding??15}),C=new Map;for(const R of I){const T=Q([...R.data.sets].sort());C.set(T,R)}b.length>0&&Ut(o,C,x,b,g,p);const U=te(r.background||"#f4f4f4");x.selectAll(".venn-circle").each(function(R,T){const A=ot(this),P=Q([...R.sets].sort()),B=p.get(P),L=B?.fill||a[T%a.length]||r.primaryColor;A.classed(`venn-set-${T%8}`,!0);const K=B?.["fill-opacity"]??.1,z=B?.stroke||L,N=B?.["stroke-width"]||`${5*g}`;if(u&&D){const X=C.get(P);if(X&&X.circles.length>0){const k=X.circles[0],F=D.circle(k.x,k.y,k.radius*2,{roughness:.7,seed:f,fill:kt(L,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+T*60,stroke:z,strokeWidth:parseFloat(String(N))});A.select("path").remove(),A.node()?.insertBefore(F,A.select("text").node())}}else A.select("path").style("fill",L).style("fill-opacity",K).style("stroke",z).style("stroke-width",N).style("stroke-opacity",.95);const j=B?.color||(U?ee(L,30):ne(L,30));A.select("text").style("font-size",`${48*g}px`).style("fill",j)}),u&&D?x.selectAll(".venn-intersection").each(function(R){const T=ot(this),G=Q([...R.sets].sort()),P=p.get(G),B=P?.fill;if(B){const L=T.select("path"),K=L.attr("d");if(K){const z=D.path(K,{roughness:.7,seed:f,fill:kt(B,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),N=L.node();N?.parentNode?.insertBefore(z,N),L.remove()}}else T.select("path").style("fill-opacity",0);T.select("text").style("font-size",`${48*g}px`).style("fill",P?.color??r.vennSetTextColor??v)}):(x.selectAll(".venn-intersection text").style("font-size",`${48*g}px`).style("fill",R=>{const A=Q([...R.sets].sort());return p.get(A)?.color??r.vennSetTextColor??v}),x.selectAll(".venn-intersection path").style("fill-opacity",R=>{const A=Q([...R.sets].sort());return p.get(A)?.fill?1:0}).style("fill",R=>{const A=Q([...R.sets].sort());return p.get(A)?.fill??"transparent"}));const V=c.append("g").attr("transform",`translate(0, ${m})`),O=x.select("svg").node();if(O&&"childNodes"in O)for(const R of[...O.childNodes])V.node()?.appendChild(R);se(c,_,E,o?.useMaxWidth??!0)},"draw");function Q(t){return t.join("|")}w(Q,"stableSetsKey");function Ut(t,n,s,e,i,o){const r=t?.useDebugLayout??!1,f=s.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const a of e){const y=Q(a.sets),h=u.get(y);h?h.push(a):u.set(y,[a])}for(const[a,y]of u.entries()){const h=n.get(a);if(!h?.text)continue;const b=h.text.x,p=h.text.y,M=Math.min(...h.circles.map(O=>O.radius)),E=Math.min(...h.circles.map(O=>O.radius-Math.hypot(b-O.x,p-O.y)));let _=Number.isFinite(E)?Math.max(0,E):0;_===0&&Number.isFinite(M)&&(_=M*.6);const S=f.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);r&&S.append("circle").attr("class","venn-text-debug-circle").attr("cx",b).attr("cy",p).attr("r",_).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const g=Math.max(80*i,_*2*.95),m=Math.max(60*i,_*2*.95),x=(h.data.label&&h.data.label.length>0?Math.min(32*i,_*.25):0)+(y.length<=2?30*i:0),d=b-g/2,D=p-m/2+x,I=Math.max(1,Math.ceil(Math.sqrt(y.length))),C=Math.max(1,Math.ceil(y.length/I)),U=g/I,V=m/C;for(const[O,R]of y.entries()){const T=O%I,A=Math.floor(O/I),G=d+U*(T+.5),P=D+V*(A+.5);r&&S.append("rect").attr("class","venn-text-debug-cell").attr("x",d+U*T).attr("y",D+V*A).attr("width",U).attr("height",V).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const B=U*.9,L=V*.9,K=S.append("foreignObject").attr("class","venn-text-node-fo").attr("width",B).attr("height",L).attr("x",G-B/2).attr("y",P-L/2).attr("overflow","visible"),z=o.get(R.id)?.color,N=K.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(R.label??R.id);z&&N.style("color",z)}}}w(Ut,"renderTextNodes");function Gt(t){const n=new Set(t.map(i=>[...i.sets].sort().join("|"))),s=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),e=[];for(const i of t){if(i.sets.length<3)continue;const o=[...i.sets].sort();for(let r=0;r0?[...t,...e]:t}w(Gt,"ensurePairwiseSubsets");var Ue={draw:qe},He={parser:we,db:Pe,renderer:Ue,styles:Ve};export{He as diagram}; diff --git a/apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-Dz1HMlA6.js b/apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-Dz1HMlA6.js new file mode 100644 index 00000000000..9d4b063b399 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-Dz1HMlA6.js @@ -0,0 +1,5 @@ +import{B as t,a as o,C as r,D as n,E as i,b as c,c as l,F as d,K as p,R as b,S as m,d as f,T as u,e as h,f as S,g as y,h as R,i as v,V as C,j as g,k as w,l as T,m as E,n as x,o as M,p as k,q as D,r as P,s as V,t as A,u as B,v as H,w as N,x as O,y as I,z,A as F,G as U,H as K,I as W,J as j,L as q,M as G,N as L,O as J,P as Q,Q as X,U as Y,W as Z,X as _,Y as $,Z as aa,_ as ea,$ as sa,a0 as ta,a1 as oa,a2 as ra,a3 as na,a4 as ia,a5 as ca,a6 as la,a7 as da,a8 as pa,a9 as ba,aa as ma,ab as fa,ac as ua,ad as ha,ae as Sa,af as ya,ag as Ra,ah as va,ai as Ca,aj as ga,ak as wa,al as Ta,am as Ea,an as xa,ao as Ma,ap as ka,aq as Da,ar as Pa,as as Va,at as Aa,au as Ba,av as Ha,aw as Na,ax as Oa,ay as Ia,az as za,aA as Fa,aB as Ua,aC as Ka,aD as Wa,aE as ja,aF as qa,aG as Ga,aH as La,aI as Ja,aJ as Qa,aK as Xa,aL as Ya,aM as Za,aN as _a,aO as $a,aP as ae,aQ as ee,aR as se,aS as te,aT as oe,aU as re,aV as ne,aW as ie,aX as ce,aY as le,aZ as de,a_ as pe,a$ as be,b0 as me,b1 as fe,b2 as ue,b3 as he,b4 as Se,b5 as ye,b6 as Re,b7 as ve,b8 as Ce,b9 as ge,ba as we,bb as Te,bc as Ee,bd as xe,be as Me,bf as ke,bg as De,bh as Pe,bi as Ve,bj as Ae,bk as Be,bl as He,bm as Ne,bn as Oe,bo as Ie,bp as ze,bq as Fe,br as Ue,bs as Ke,bt as We,bu as je,bv as qe,bw as Ge,bx as Le,by as Je,bz as Qe,bA as Xe,bB as Ye,bC as Ze,bD as _e,bE as $e,bF as as,bG as es,bH as ss,bI as ts,bJ as os,bK as rs,bL as ns,bM as is,bN as cs,bO as ls,bP as ds}from"./index-CiHMlsuo.js";/** +* vue v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const a=()=>{};export{t as BaseTransition,o as BaseTransitionPropsValidators,r as Comment,n as DeprecationTypes,i as EffectScope,c as ErrorCodes,l as ErrorTypeStrings,d as Fragment,p as KeepAlive,b as ReactiveEffect,m as Static,f as Suspense,u as Teleport,h as Text,S as TrackOpTypes,y as Transition,R as TransitionGroup,v as TriggerOpTypes,C as VueElement,g as assertNumber,w as callWithAsyncErrorHandling,T as callWithErrorHandling,E as camelize,x as capitalize,M as cloneVNode,k as compatUtils,a as compile,D as computed,P as createApp,V as createBlock,A as createCommentVNode,B as createElementBlock,H as createElementVNode,N as createHydrationRenderer,O as createPropsRestProxy,I as createRenderer,z as createSSRApp,F as createSlots,U as createStaticVNode,K as createTextVNode,W as createVNode,j as customRef,q as defineAsyncComponent,G as defineComponent,L as defineCustomElement,J as defineEmits,Q as defineExpose,X as defineModel,Y as defineOptions,Z as defineProps,_ as defineSSRCustomElement,$ as defineSlots,aa as devtools,ea as effect,sa as effectScope,ta as getCurrentInstance,oa as getCurrentScope,ra as getCurrentWatcher,na as getTransitionRawChildren,ia as guardReactiveProps,ca as h,la as handleError,da as hasInjectionContext,pa as hydrate,ba as hydrateOnIdle,ma as hydrateOnInteraction,fa as hydrateOnMediaQuery,ua as hydrateOnVisible,ha as initCustomFormatter,Sa as initDirectivesForSSR,ya as inject,Ra as isMemoSame,va as isProxy,Ca as isReactive,ga as isReadonly,wa as isRef,Ta as isRuntimeOnly,Ea as isShallow,xa as isVNode,Ma as markRaw,ka as mergeDefaults,Da as mergeModels,Pa as mergeProps,Va as nextTick,Aa as nodeOps,Ba as normalizeClass,Ha as normalizeProps,Na as normalizeStyle,Oa as onActivated,Ia as onBeforeMount,za as onBeforeUnmount,Fa as onBeforeUpdate,Ua as onDeactivated,Ka as onErrorCaptured,Wa as onMounted,ja as onRenderTracked,qa as onRenderTriggered,Ga as onScopeDispose,La as onServerPrefetch,Ja as onUnmounted,Qa as onUpdated,Xa as onWatcherCleanup,Ya as openBlock,Za as patchProp,_a as popScopeId,$a as provide,ae as proxyRefs,ee as pushScopeId,se as queuePostFlushCb,te as reactive,oe as readonly,re as ref,ne as registerRuntimeCompiler,ie as render,ce as renderList,le as renderSlot,de as resolveComponent,pe as resolveDirective,be as resolveDynamicComponent,me as resolveFilter,fe as resolveTransitionHooks,ue as setBlockTracking,he as setDevtoolsHook,Se as setTransitionHooks,ye as shallowReactive,Re as shallowReadonly,ve as shallowRef,Ce as ssrContextKey,ge as ssrUtils,we as stop,Te as toDisplayString,Ee as toHandlerKey,xe as toHandlers,Me as toRaw,ke as toRef,De as toRefs,Pe as toValue,Ve as transformVNodeArgs,Ae as triggerRef,Be as unref,He as useAttrs,Ne as useCssModule,Oe as useCssVars,Ie as useHost,ze as useId,Fe as useModel,Ue as useSSRContext,Ke as useShadowRoot,We as useSlots,je as useTemplateRef,qe as useTransitionState,Ge as vModelCheckbox,Le as vModelDynamic,Je as vModelRadio,Qe as vModelSelect,Xe as vModelText,Ye as vShow,Ze as version,_e as warn,$e as watch,as as watchEffect,es as watchPostEffect,ss as watchSyncEffect,ts as withAsyncContext,os as withCtx,rs as withDefaults,ns as withDirectives,is as withKeys,cs as withMemo,ls as withModifiers,ds as withScopeId}; diff --git a/apps/kimi-code/dist-web/assets/wardleyDiagram-EHGQE667-DZMFMBx5.js b/apps/kimi-code/dist-web/assets/wardleyDiagram-EHGQE667-DZMFMBx5.js new file mode 100644 index 00000000000..a9482fa2de2 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/wardleyDiagram-EHGQE667-DZMFMBx5.js @@ -0,0 +1,78 @@ +import{p as St}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{s as Mt,g as Nt,o as zt,n as Lt,a as Tt,b as At,_ as u,E as Xt,y as Et,A as U,l as K,D as Yt,e as It,p as Bt,c as j}from"./mermaid.core-WW7RuneT.js";import{p as Ft}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var D=u((e,n)=>{const r=e<=1?e*100:e;if(r<0||r>100)throw new Error(`${n} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return r},"toPercent"),A=u((e,n,r)=>({x:D(n,`${r} evolution`),y:D(e,`${r} visibility`)}),"toCoordinates"),J=u(e=>{if(e){if(e==="+<>")return"bidirectional";if(e==="+<")return"backward";if(e==="+>")return"forward"}},"getFlowFromPort"),Rt=u(e=>{if(!e?.startsWith("+"))return{};const r=/^\+'([^']*)'/.exec(e)?.[1];return e.includes("<>")?{flow:"bidirectional",label:r}:e.includes("<")?{flow:"backward",label:r}:e.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),Ot=u((e,n)=>{if(St(e,n),e.size&&n.setSize(e.size.width,e.size.height),e.evolution){const r=e.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),x=e.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);n.updateAxes({stages:r,stageBoundaries:x})}if(e.anchors.forEach(r=>{const x=A(r.visibility,r.evolution,`Anchor "${r.name}"`);n.addNode(r.name,r.name,x.x,x.y,"anchor")}),e.components.forEach(r=>{const x=A(r.visibility,r.evolution,`Component "${r.name}"`),a=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,d=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,w=r.decorator?.strategy;n.addNode(r.name,r.name,x.x,x.y,"component",a,d,r.inertia,w)}),e.notes.forEach(r=>{const x=A(r.visibility,r.evolution,`Note "${r.text}"`);n.addNote(r.text,x.x,x.y)}),e.pipelines.forEach(r=>{const x=n.getNode(r.parent);if(!x||typeof x.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const a=x.y;n.startPipeline(r.parent),r.components.forEach(d=>{const w=`${r.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,F=D(d.evolution,`Pipeline component "${d.name}" evolution`);n.addNode(w,d.name,F,a,"pipeline-component",C,g),n.addPipelineComponent(r.parent,w)})}),e.links.forEach(r=>{const x=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let a=J(r.fromPort)??J(r.toPort);const{flow:d,label:w}=Rt(r.arrow);!a&&d&&(a=d);const C=r.linkLabel,g=w??C;n.addLink(n.resolveNodeId(r.from),n.resolveNodeId(r.to),x,g,a)}),e.evolves.forEach(r=>{const x=n.getNode(r.component);if(x?.y!==void 0){const a=D(r.target,`Evolve target for "${r.component}"`);n.addTrend(r.component,a,x.y)}}),e.annotations.length>0){const r=e.annotations[0],x=A(r.x,r.y,"Annotations box");n.setAnnotationsBox(x.x,x.y)}e.annotation.forEach(r=>{const x=A(r.x,r.y,`Annotation ${r.number}`);n.addAnnotation(r.number,[{x:x.x,y:x.y}],r.text)}),e.accelerators.forEach(r=>{const x=A(r.x,r.y,`Accelerator "${r.name}"`);n.addAccelerator(r.name,x.x,x.y)}),e.deaccelerators.forEach(r=>{const x=A(r.x,r.y,`Deaccelerator "${r.name}"`);n.addDeaccelerator(r.name,x.x,x.y)})},"populateDb"),Q={parser:{yy:void 0},parse:u(async e=>{const n=await Ft("wardley",e);K.debug(n);const r=Q.parser?.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ot(n,r)},"parse")},Wt=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{u(this,"WardleyBuilder")}addNode(e){const n=this.nodes.get(e.id)??{id:e.id,label:e.label},r={...n,...e,className:e.className??n.className,labelOffsetX:e.labelOffsetX??n.labelOffsetX,labelOffsetY:e.labelOffsetY??n.labelOffsetY};this.nodes.set(e.id,r)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const n=this.nodes.get(e);n&&(n.isPipelineParent=!0)}addPipelineComponent(e,n){const r=this.pipelines.get(e);r&&r.componentIds.push(n);const x=this.nodes.get(n);x&&(x.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,n){this.annotationsBox={x:e,y:n}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,n){this.size={width:e,height:n}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[n,r]of this.nodes)if(r.label===e)return n;return e}build(){const e=[];for(const n of this.nodes.values()){if(typeof n.x!="number"||typeof n.y!="number")throw new Error(`Node "${n.label}" is missing coordinates`);e.push(n)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},k=new Wt;function tt(){return j()["wardley-beta"]}u(tt,"getConfig");function et(e,n,r,x,a,d,w,C,g){k.addNode({id:e,label:n,x:r,y:x,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(et,"addNode");function at(e,n,r=!1,x,a){k.addLink({source:e,target:n,dashed:r,label:x,flow:a})}u(at,"addLink");function rt(e,n,r){k.addTrend({nodeId:e,targetX:n,targetY:r})}u(rt,"addTrend");function ot(e,n,r){k.addAnnotation({number:e,coordinates:n,text:r})}u(ot,"addAnnotation");function nt(e,n,r){k.addNote({text:e,x:n,y:r})}u(nt,"addNote");function st(e,n,r){k.addAccelerator({name:e,x:n,y:r})}u(st,"addAccelerator");function it(e,n,r){k.addDeaccelerator({name:e,x:n,y:r})}u(it,"addDeaccelerator");function dt(e,n){k.setAnnotationsBox(e,n)}u(dt,"setAnnotationsBox");function lt(e,n){k.setSize(e,n)}u(lt,"setSize");function ct(e){k.startPipeline(e)}u(ct,"startPipeline");function pt(e,n){k.addPipelineComponent(e,n)}u(pt,"addPipelineComponent");function ft(e){k.setAxes(e)}u(ft,"updateAxes");function ht(e){return k.getNode(e)}u(ht,"getNode");function xt(e){return k.resolveNodeId(e)}u(xt,"resolveNodeId");function gt(){return k.build()}u(gt,"getWardleyData");function yt(){k.clear(),Bt()}u(yt,"clear");var Dt={getConfig:tt,addNode:et,addLink:at,addTrend:rt,addAnnotation:ot,addNote:nt,addAccelerator:st,addDeaccelerator:it,setAnnotationsBox:dt,setSize:lt,startPipeline:ct,addPipelineComponent:pt,updateAxes:ft,getNode:ht,resolveNodeId:xt,getWardleyData:gt,clear:yt,setAccTitle:At,getAccTitle:Tt,setDiagramTitle:Lt,getDiagramTitle:zt,getAccDescription:Nt,setAccDescription:Mt},Gt=["Genesis","Custom Built","Product","Commodity"],qt=u(()=>{const{themeVariables:e}=j();return{backgroundColor:e.wardley?.backgroundColor??e.background??"#fff",axisColor:e.wardley?.axisColor??"#000",axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??"#222",gridColor:e.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:e.wardley?.componentFill??"#fff",componentStroke:e.wardley?.componentStroke??"#000",componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??"#222",linkStroke:e.wardley?.linkStroke??"#000",evolutionStroke:e.wardley?.evolutionStroke??"#dc3545",annotationStroke:e.wardley?.annotationStroke??"#000",annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??"#222",annotationFill:e.wardley?.annotationFill??e.background??"#fff"}},"getTheme"),Ht=u(()=>{const e=j()["wardley-beta"];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},"getConfigValues"),jt=u((e,n,r,x)=>{K.debug(`Rendering Wardley map +`+e);const a=Ht(),d=qt(),w=a.nodeRadius*1.6,C=x.db,g=C.getWardleyData(),F=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,E=Yt(n);E.selectAll("*").remove(),It(E,b,S,a.useMaxWidth),E.attr("viewBox",`0 0 ${S} ${b}`);const v=E.append("g").attr("class","wardley-map"),G=E.append("defs");G.append("marker").attr("id",`arrow-${n}`).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("fill",d.evolutionStroke).attr("stroke","none"),G.append("marker").attr("id",`link-arrow-end-${n}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),G.append("marker").attr("id",`link-arrow-start-${n}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const Y=S-a.padding*2,I=b-a.padding*2;F&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(F);const z=u(t=>a.padding+t/100*Y,"projectX"),L=u(t=>b-a.padding-t/100*I,"projectY"),R=v.append("g").attr("class","wardley-axes");R.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),R.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const ut=g.axes.xLabel??"Evolution",wt=g.axes.yLabel??"Visibility";R.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+Y/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(ut),R.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+I/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+I/2})`).text(wt);const B=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:Gt;if(B.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,o=[];if(s&&s.length===B.length){let i=0;s.forEach(p=>{o.push({start:i,end:p}),i=p})}else{const i=1/B.length;B.forEach((p,l)=>{o.push({start:l*i,end:(l+1)*i})})}B.forEach((i,p)=>{const l=o[p],f=a.padding+l.start*Y,h=a.padding+l.end*Y,y=(f+h)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const o=s/4,i=a.padding+Y*o;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-I*o).attr("y2",b-a.padding-I*o).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(o=>{if(o.componentIds.length===0)return;const i=o.componentIds.map(h=>({id:h,pos:c.get(h),node:g.nodes.find(y=>y.id===h)})).filter(h=>h.pos&&h.node).sort((h,y)=>h.node.x-y.node.x);for(let h=0;h{const y=c.get(h);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,P=c.get(o.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const V=v.append("g").attr("class","wardley-links"),_=new Map;g.pipelines.forEach(t=>{_.set(t.nodeId,new Set(t.componentIds))});const Z=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||_.get(t.target)?.has(t.source)));V.selectAll("line").data(Z).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=o.x-s.x,f=o.y-s.y,h=Math.sqrt(l*l+f*f);return s.x+l/h*p}).attr("y1",t=>{const s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=o.x-s.x,f=o.y-s.y,h=Math.sqrt(l*l+f*f);return s.y+f/h*p}).attr("x2",t=>{const s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-o.x,f=s.y-o.y,h=Math.sqrt(l*l+f*f);return o.x+l/h*p}).attr("y2",t=>{const s=c.get(t.source),o=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-o.x,f=s.y-o.y,h=Math.sqrt(l*l+f*f);return o.y+f/h*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${n})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${n})`:null),V.selectAll("text").data(Z.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),o=c.get(t.target),i=(s.x+o.x)/2,p=o.y-s.y,l=o.x-s.x,f=Math.sqrt(l*l+p*p),h=8,y=p/f;return i+y*h}).attr("y",t=>{const s=c.get(t.source),o=c.get(t.target),i=(s.y+o.y)/2,p=o.x-s.x,l=o.y-s.y,f=Math.sqrt(p*p+l*l),h=8,y=-p/f;return i+y*h}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),o=c.get(t.target),i=(s.x+o.x)/2,p=(s.y+o.y)/2,l=o.x-s.x,f=o.y-s.y,h=Math.sqrt(l*l+f*f),y=8,m=f/h,P=-l/h,N=i+m*y,O=p+P*y;let X=Math.atan2(f,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${O})`}).text(t=>t.label);const mt=v.append("g").attr("class","wardley-trends"),kt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const o=z(t.targetX),i=L(t.targetY),p=o-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),h=a.nodeRadius+2,y=f>h?o-p/f*h:o,m=f>h?i-l/f*h:i;return{origin:s,targetX:o,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);mt.selectAll("line").data(kt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${n})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const q=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let o=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(o+=a.nodeRadius+10),s.x+o}).attr("y1",t=>{const s=c.get(t.id),o=t.isPipelineParent?w:a.nodeRadius*2;return s.y-o/2}).attr("x2",t=>{const s=c.get(t.id);let o=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(o+=a.nodeRadius+10),s.x+o}).attr("y2",t=>{const s=c.get(t.id),o=t.isPipelineParent?w:a.nodeRadius*2;return s.y+o/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let o=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(o+=10);const i=t.labelOffsetX??o;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let o=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(o-=10);const i=t.labelOffsetY??o;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const o=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(o.length>1)for(let i=0;i{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),o=L(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),h=[...g.annotations].filter(m=>m.text).sort((m,P)=>m.number-P.number),y=[];if(h.forEach((m,P)=>{const N=f.append("text").attr("x",s+i).attr("y",o+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(N)}),y.length>0){let m=0,P=0;y.forEach(H=>{const W=H.node(),Pt=W.getComputedTextLength();m=Math.max(m,Pt);const Ct=W.getBBox();P=Math.max(P,Ct.height)});const N=m+i*2+105,O=h.length*p+i*2+P/2,X=a.padding,bt=S-a.padding-N,$t=a.padding,vt=b-a.padding-O;s=Math.max(X,Math.min(s,bt)),o=Math.max($t,Math.min(o,vt)),y.forEach((H,W)=>{H.attr("x",s+i).attr("y",o+i+(W+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",o).attr("width",N).attr("height",O).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const o=z(s.x),i=L(s.y);t.append("text").attr("x",o).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const o=z(s.x),i=L(s.y),p=60,l=30,f=20,h=` + M ${o} ${i-l/2} + L ${o+p-f} ${i-l/2} + L ${o+p-f} ${i-l/2-8} + L ${o+p} ${i} + L ${o+p-f} ${i+l/2+8} + L ${o+p-f} ${i+l/2} + L ${o} ${i+l/2} + Z + `;t.append("path").attr("d",h).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",o+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}if(g.deaccelerators.length>0){const t=v.append("g").attr("class","wardley-deaccelerators");g.deaccelerators.forEach(s=>{const o=z(s.x),i=L(s.y),p=60,l=30,f=20,h=` + M ${o+p} ${i-l/2} + L ${o+f} ${i-l/2} + L ${o+f} ${i-l/2-8} + L ${o} ${i} + L ${o+f} ${i+l/2+8} + L ${o+f} ${i+l/2} + L ${o+p} ${i+l/2} + Z + `;t.append("path").attr("d",h).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",o+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}},"draw"),Vt={draw:jt},_t=u(({wardley:e}={})=>{const n=Xt(),r=Et(),x=U(n,r.themeVariables),a=U(x.wardley,e);return` + .wardley-background { + fill: ${a.backgroundColor}; + } + .wardley-axes line, .wardley-axes path { + stroke: ${a.axisColor}; + } + .wardley-axis-label { + fill: ${a.axisTextColor}; + } + .wardley-stage-label { + fill: ${a.axisTextColor}; + } + .wardley-grid line { + stroke: ${a.gridColor}; + } + .wardley-node circle { + fill: ${a.componentFill}; + stroke: ${a.componentStroke}; + } + .wardley-node-label { + fill: ${a.componentLabelColor}; + } + .wardley-link { + stroke: ${a.linkStroke}; + } + .wardley-link--dashed { + stroke-dasharray: 4 4; + } + .wardley-link-label { + fill: ${a.axisTextColor}; + } + .wardley-trend line { + stroke: ${a.evolutionStroke}; + } + .wardley-annotation-line { + stroke: ${a.annotationStroke}; + } + .wardley-annotation circle { + fill: ${a.annotationFill}; + stroke: ${a.annotationStroke}; + } + .wardley-annotation text { + fill: ${a.annotationTextColor}; + } + .wardley-annotations-box rect { + fill: ${a.annotationFill}; + stroke: ${a.annotationStroke}; + } + .wardley-annotations-box text { + fill: ${a.annotationTextColor}; + } + .wardley-pipeline-box { + stroke: ${a.componentStroke}; + } + .wardley-notes text { + fill: ${a.axisTextColor}; + } + `},"styles"),ee={parser:Q,db:Dt,renderer:Vt,styles:_t};export{ee as diagram}; diff --git a/apps/kimi-code/dist-web/assets/xychartDiagram-FW5EYKEG-BfzaJ_HB.js b/apps/kimi-code/dist-web/assets/xychartDiagram-FW5EYKEG-BfzaJ_HB.js new file mode 100644 index 00000000000..6d024c88dcb --- /dev/null +++ b/apps/kimi-code/dist-web/assets/xychartDiagram-FW5EYKEG-BfzaJ_HB.js @@ -0,0 +1,7 @@ +import{s as si,g as ai,o as Et,n as ni,a as oi,b as ri,_ as n,l as It,D as hi,e as li,p as ci,y as pt,i as ui,A as Mt,B as gi,E as xi,az as di,a7 as Dt}from"./mermaid.core-WW7RuneT.js";import{i as fi}from"./init-Gi6I4Gst.js";import{o as pi}from"./ordinal-Cboi1Yqb.js";import{l as vt}from"./linear-UIDPGx_K.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";import"./defaultLocale-DX6XiGOO.js";function mi(t,i,e){t=+t,i=+i,e=(a=arguments.length)<2?(i=t,t=0,1):a<3?1:+e;for(var s=-1,a=Math.max(0,Math.ceil((i-t)/e))|0,c=new Array(a);++s"u"&&(D.yylloc={});var ht=D.yylloc;o.push(ht);var ii=D.options&&D.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ei(z){g.length=g.length-2*z,w.length=w.length-z,o.length=o.length-z}n(ei,"popStack");function kt(){var z;return z=x.pop()||D.lex()||_t,typeof z!="number"&&(z instanceof Array&&(x=z,z=x.pop()),z=u.symbols_[z]||z),z}n(kt,"lex");for(var M,$,O,lt,G={},st,N,Tt,at;;){if($=g[g.length-1],this.defaultActions[$]?O=this.defaultActions[$]:((M===null||typeof M>"u")&&(M=kt()),O=K[$]&&K[$][M]),typeof O>"u"||!O.length||!O[0]){var ct="";at=[];for(st in K[$])this.terminals_[st]&&st>Jt&&at.push("'"+this.terminals_[st]+"'");D.showPosition?ct="Parse error on line "+(et+1)+`: +`+D.showPosition()+` +Expecting `+at.join(", ")+", got '"+(this.terminals_[M]||M)+"'":ct="Parse error on line "+(et+1)+": Unexpected "+(M==_t?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(ct,{text:D.match,token:this.terminals_[M]||M,line:D.yylineno,loc:ht,expected:at})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+M);switch(O[0]){case 1:g.push(M),w.push(D.yytext),o.push(D.yylloc),g.push(O[1]),M=null,Rt=D.yyleng,d=D.yytext,et=D.yylineno,ht=D.yylloc;break;case 2:if(N=this.productions_[O[1]][1],G.$=w[w.length-N],G._$={first_line:o[o.length-(N||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(N||1)].first_column,last_column:o[o.length-1].last_column},ii&&(G._$.range=[o[o.length-(N||1)].range[0],o[o.length-1].range[1]]),lt=this.performAction.apply(G,[d,Rt,et,U.yy,O[1],w,o].concat(ti)),typeof lt<"u")return lt;N&&(g=g.slice(0,-1*N*2),w=w.slice(0,-1*N),o=o.slice(0,-1*N)),g.push(this.productions_[O[1]][0]),w.push(G.$),o.push(G._$),Tt=K[g[g.length-2]][g[g.length-1]],g.push(Tt);break;case 3:return!0}}return!0},"parse")},Q=(function(){var F={EOF:1,parseError:n(function(u,g){if(this.yy.parser)this.yy.parser.parseError(u,g);else throw new Error(u)},"parseError"),setInput:n(function(r,u){return this.yy=u||this.yy||{},this._input=r,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:n(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var u=r.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:n(function(r){var u=r.length,g=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var x=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),g.length-1&&(this.yylineno-=g.length-1);var w=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:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[w[0],w[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(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:n(function(r){this.unput(this.match.slice(r))},"less"),pastInput:n(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var r=this.pastInput(),u=new Array(r.length+1).join("-");return r+this.upcomingInput()+` +`+u+"^"},"showPosition"),test_match:n(function(r,u){var g,x,w;if(this.options.backtrack_lexer&&(w={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(w.yylloc.range=this.yylloc.range.slice(0))),x=r[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],g=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var o in w)this[o]=w[o];return!1}return!1},"test_match"),next:n(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,u,g,x;this._more||(this.yytext="",this.match="");for(var w=this._currentRules(),o=0;ou[0].length)){if(u=g,x=o,this.options.backtrack_lexer){if(r=this.test_match(g,w[o]),r!==!1)return r;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(r=this.test_match(u,w[x]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:n(function(){var u=this.next();return u||this.lex()},"lex"),begin:n(function(u){this.conditionStack.push(u)},"begin"),popState:n(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:n(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:n(function(u){this.begin(u)},"pushState"),stateStackSize:n(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n(function(u,g,x,w){switch(x){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return F})();R.lexer=Q;function q(){this.yy={}}return n(q,"Parser"),q.prototype=R,R.Parser=q,new q})();gt.parser=gt;var yi=gt;function xt(t){return t.type==="bar"}n(xt,"isBarPlot");function nt(t){return t.type==="band"}n(nt,"isBandAxisData");function j(t){return t.type==="linear"}n(j,"isLinearAxisData");var zt=class{constructor(t){this.parentGroup=t}static{n(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((a,c)=>Math.max(c.length,a),0)*i,height:i};const e={width:0,height:0},s=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const a of t){const c=di(s,1,a),l=c?c.width:a.length*i,f=c?c.height:i;e.width=Math.max(e.width,l),e.height=Math.max(e.height,f)}return s.remove(),e}},Lt=.7,Pt=.2,Bt=class{constructor(t,i,e,s){this.axisConfig=t,this.title=i,this.textDimensionCalculator=e,this.axisThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{n(this,"BaseAxis")}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){Lt*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Lt*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=Pt*t.width;this.outerPadding=Math.min(e.width/2,s);let a=e.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*e.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*e.height))),a+=this.axisConfig.labelPadding*2,this.labelTextHeight=e.height,a<=i&&(i-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),s=Pt*t.height;this.outerPadding=Math.min(e.height/2,s);const a=e.width+this.axisConfig.labelPadding*2;a<=i&&(i-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateOffsetByRotation(t){const i=this.normalizedLabelRotationInRad;return i===0?0:Math.sin(i)*this.getLabelDimension()[t]/2}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${i},${this.getScaleValue(e)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i} L ${this.getScaleValue(e)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},bi=class extends Bt{static{n(this,"BandAxis")}constructor(t,i,e,s,a){super(t,s,a,i),this.categories=e,this.scale=ut().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=ut().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),It.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},Ai=class extends Bt{static{n(this,"LinearAxis")}constructor(t,i,e,s,a){super(t,s,a,i),this.domain=e,this.scale=vt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=vt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function dt(t,i,e,s){const a=new zt(s);return nt(t)?new bi(i,e,t.categories,t.title,a):new Ai(i,e,[t.min,t.max],t.title,a)}n(dt,"getAxis");var wi=class{constructor(t,i,e,s){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{n(this,"ChartTitle")}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),e=Math.max(i.width,t.width),s=i.height+2*this.chartConfig.titlePadding;return i.width<=e&&i.height<=s&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=e,this.boundingRect.height=s,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}};function Vt(t,i,e,s){const a=new zt(s);return new wi(a,t,i,e)}n(Vt,"getChartTitleComponent");var Ci=class{constructor(t,i,e,s,a){this.plotData=t,this.xAxis=i,this.yAxis=e,this.orientation=s,this.plotIndex=a}static{n(this,"LinePlot")}getDrawableElement(){const t=this.plotData.data.map(s=>[this.xAxis.getScaleValue(s[0]),this.yAxis.getScaleValue(s[1])]);let i;if(this.orientation==="horizontal"?i=Dt().y(s=>s[0]).x(s=>s[1])(t):i=Dt().x(s=>s[0]).y(s=>s[1])(t),!i)return[];const e=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const c=[];for(const[l,[f,S]]of t.entries()){const k=this.plotData.pointLabels[l];k&&(this.orientation==="horizontal"?c.push({x:S+10,y:f,text:k,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):c.push({x:f,y:S-10,text:k,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}c.length>0&&e.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:c})}return e}},Si=class{constructor(t,i,e,s,a,c){this.barData=t,this.boundingRect=i,this.xAxis=e,this.yAxis=s,this.orientation=a,this.plotIndex=c}static{n(this,"BarPlot")}getDrawableElement(){const t=this.barData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),e=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),s=e/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(a=>({x:this.boundingRect.x,y:a[0]-s,height:e,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(a=>({x:a[0]-s,y:a[1],width:e,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},Ri=class{constructor(t,i,e){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0}}static{n(this,"BasePlot")}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[i,e]of this.chartData.plots.entries())switch(e.type){case"line":{const s=new Ci(e,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break;case"bar":{const s=new Si(e,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break}return t}};function Ot(t,i,e){return new Ri(t,i,e)}n(Ot,"getPlotComponent");var _i=class{constructor(t,i,e,s){this.chartConfig=t,this.chartData=i,this.componentStore={title:Vt(t,i,e,s),plot:Ot(t,i,e),xAxis:dt(i.xAxis,t.xAxis,{titleColor:e.xAxisTitleColor,labelColor:e.xAxisLabelColor,tickColor:e.xAxisTickColor,axisLineColor:e.xAxisLineColor},s),yAxis:dt(i.yAxis,t.yAxis,{titleColor:e.yAxisTitleColor,labelColor:e.yAxisLabelColor,tickColor:e.yAxisTickColor,axisLineColor:e.yAxisLineColor},s)}}static{n(this,"Orchestrator")}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),c=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:a,height:c});t-=l.width,i-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=l.height,i-=l.height,this.componentStore.xAxis.setAxisPosition("bottom"),l=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=l.height,this.componentStore.yAxis.setAxisPosition("left"),l=this.componentStore.yAxis.calculateSpace({width:t,height:i}),e=l.width,t-=l.width,t>0&&(a+=t,t=0),i>0&&(c+=i,i=0),this.componentStore.plot.calculateSpace({width:a,height:c}),this.componentStore.plot.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([e,e+a]),this.componentStore.xAxis.setBoundingBoxXY({x:e,y:s+c}),this.componentStore.yAxis.setRange([s,s+c]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:s}),this.chartData.plots.some(f=>xt(f))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,s=0,a=0,c=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),l=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),f=this.componentStore.plot.calculateSpace({width:c,height:l});t-=f.width,i-=f.height,f=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=f.height,i-=f.height,this.componentStore.xAxis.setAxisPosition("left"),f=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=f.width,s=f.width,this.componentStore.yAxis.setAxisPosition("top"),f=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=f.height,a=e+f.height,t>0&&(c+=t,t=0),i>0&&(l+=i,i=0),this.componentStore.plot.calculateSpace({width:c,height:l}),this.componentStore.plot.setBoundingBoxXY({x:s,y:a}),this.componentStore.yAxis.setRange([s,s+c]),this.componentStore.yAxis.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([a,a+l]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(S=>xt(S))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},ki=class{static{n(this,"XYChartBuilder")}static build(t,i,e,s){return new _i(t,i,e,s).getDrawableElement()}},Z=0,Wt,J=bt(),tt=yt(),m=At(),ft=tt.plotColorPalette.split(",").map(t=>t.trim()),ot=!1,mt=!1;function yt(){const t=xi(),i=pt();return Mt(t.xyChart,i.themeVariables.xyChart)}n(yt,"getChartDefaultThemeConfig");function bt(){const t=pt();return Mt(gi.xyChart,t.xyChart)}n(bt,"getChartDefaultConfig");function At(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}n(At,"getChartDefaultData");function it(t){const i=pt();return ui(t.trim(),i)}n(it,"textSanitizer");function Ft(t){Wt=t}n(Ft,"setTmpSVGG");function Xt(t){t==="horizontal"?J.chartOrientation="horizontal":J.chartOrientation="vertical"}n(Xt,"setOrientation");function Yt(t){m.xAxis.title=it(t.text)}n(Yt,"setXAxisTitle");function wt(t,i){m.xAxis={type:"linear",title:m.xAxis.title,min:t,max:i},ot=!0}n(wt,"setXAxisRangeData");function Nt(t){m.xAxis={type:"band",title:m.xAxis.title,categories:t.map(i=>it(i.text))},ot=!0}n(Nt,"setXAxisBand");function Ht(t){m.yAxis.title=it(t.text)}n(Ht,"setYAxisTitle");function Ut(t,i){m.yAxis={type:"linear",title:m.yAxis.title,min:t,max:i},mt=!0}n(Ut,"setYAxisRangeData");function $t(t){const i=Math.min(...t),e=Math.max(...t),s=j(m.yAxis)?m.yAxis.min:1/0,a=j(m.yAxis)?m.yAxis.max:-1/0;m.yAxis={type:"linear",title:m.yAxis.title,min:Math.min(s,i),max:Math.max(a,e)}}n($t,"setYAxisRangeFromPlotData");function Ct(t){let i=[];if(t.length===0)return i;if(!ot){const e=j(m.xAxis)?m.xAxis.min:1/0,s=j(m.xAxis)?m.xAxis.max:-1/0;wt(Math.min(e,1),Math.max(s,t.length))}if(nt(m.xAxis)&&t.length>m.xAxis.categories.length&&(t=t.slice(0,m.xAxis.categories.length)),mt||$t(t),nt(m.xAxis)&&(i=m.xAxis.categories.map((e,s)=>[e,t[s]])),j(m.xAxis)){const e=m.xAxis.min,s=m.xAxis.max,a=(s-e)/(t.length-1),c=[];for(let l=e;l<=s;l+=a)c.push(`${l}`);i=c.map((l,f)=>[l,t[f]])}return i}n(Ct,"transformDataWithoutCategory");function St(t){return ft[t===0?0:t%ft.length]}n(St,"getPlotColorFromPalette");function qt(t,i){const e=i.map(l=>l.value),s=i.map(l=>l.label?it(l.label):""),a=Ct(e),c=s.some(l=>l!=="");m.plots.push({type:"line",strokeFill:St(Z),strokeWidth:2,data:a,...c?{pointLabels:s}:{}}),Z++}n(qt,"setLineData");function Gt(t,i){const e=i.map(a=>a.value),s=Ct(e);m.plots.push({type:"bar",fill:St(Z),data:s}),Z++}n(Gt,"setBarData");function jt(){if(m.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return m.title=Et(),ki.build(J,m,tt,Wt)}n(jt,"getDrawableElem");function Qt(){return tt}n(Qt,"getChartThemeConfig");function Kt(){return J}n(Kt,"getChartConfig");function Zt(){return m}n(Zt,"getXYChartData");var Ti=n(function(){ci(),Z=0,J=bt(),m=At(),tt=yt(),ft=tt.plotColorPalette.split(",").map(t=>t.trim()),ot=!1,mt=!1},"clear"),Di={getDrawableElem:jt,clear:Ti,setAccTitle:ri,getAccTitle:oi,setDiagramTitle:ni,getDiagramTitle:Et,getAccDescription:ai,setAccDescription:si,setOrientation:Xt,setXAxisTitle:Yt,setXAxisRangeData:wt,setXAxisBand:Nt,setYAxisTitle:Ht,setYAxisRangeData:Ut,setLineData:qt,setBarData:Gt,setTmpSVGG:Ft,getChartThemeConfig:Qt,getChartConfig:Kt,getXYChartData:Zt},vi=n((t,i,e,s)=>{const a=s.db,c=a.getChartThemeConfig(),l=a.getChartConfig(),f=a.getXYChartData().plots[0].data.map(p=>p[1]);function S(p){return p==="top"?"text-before-edge":"middle"}n(S,"getDominantBaseLine");function k(p){return p==="left"?"start":p==="right"?"end":"middle"}n(k,"getTextAnchor");function L(p){return`translate(${p.x}, ${p.y}) rotate(${p.rotation||0})`}n(L,"getTextTransformation"),It.debug(`Rendering xychart chart +`+t);const _=hi(i),y=_.append("g").attr("class","main"),E=y.append("rect").attr("width",l.width).attr("height",l.height).attr("class","background");li(_,l.height,l.width,!0),_.attr("viewBox",`0 0 ${l.width} ${l.height}`),E.attr("fill",c.backgroundColor),a.setTmpSVGG(_.append("g").attr("class","mermaid-tmp-group"));const v=a.getDrawableElem(),P={};function I(p){let T=y,h="";for(const[B]of p.entries()){let W=y;B>0&&P[h]&&(W=P[h]),h+=p[B],T=P[h],T||(T=P[h]=W.append("g").attr("class",p[B]))}return T}n(I,"getGroup");for(const p of v){if(p.data.length===0)continue;const T=I(p.groupTexts);switch(p.type){case"rect":if(T.selectAll("rect").data(p.data).enter().append("rect").attr("x",h=>h.x).attr("y",h=>h.y).attr("width",h=>h.width).attr("height",h=>h.height).attr("fill",h=>h.fill).attr("stroke",h=>h.strokeFill).attr("stroke-width",h=>h.strokeWidth),l.showDataLabel){const h=l.showDataLabelOutsideBar;if(l.chartOrientation==="horizontal"){let B=function(A,V){const{data:R,label:Q}=A;return V*Q.length*W<=R.width-X};n(B,"fitsHorizontally");const W=.7,X=10,Y=p.data.map((A,V)=>({data:A,label:f[V].toString()})).filter(A=>A.data.width>0&&A.data.height>0),C=Y.map(A=>{const{data:V}=A;let R=V.height*.7;for(;!B(A,R)&&R>0;)R-=1;return R}),H=Math.floor(Math.min(...C)),b=n(A=>h?A.data.x+A.data.width+X:A.data.x+A.data.width-X,"determineLabelXPosition");T.selectAll("text").data(Y).enter().append("text").attr("x",b).attr("y",A=>A.data.y+A.data.height/2).attr("text-anchor",h?"start":"end").attr("dominant-baseline","middle").attr("fill",c.dataLabelColor).attr("font-size",`${H}px`).text(A=>A.label)}else{let B=function(b,A,V){const{data:R,label:Q}=b,F=A*Q.length*.7,r=R.x+R.width/2,u=r-F/2,g=r+F/2,x=u>=R.x&&g<=R.x+R.width,w=R.y+V+A<=R.y+R.height;return x&&w};n(B,"fitsInBar");const W=10,X=p.data.map((b,A)=>({data:b,label:f[A].toString()})).filter(b=>b.data.width>0&&b.data.height>0),Y=X.map(b=>{const{data:A,label:V}=b;let R=A.width/(V.length*.7);for(;!B(b,R,W)&&R>0;)R-=1;return R}),C=Math.floor(Math.min(...Y)),H=n(b=>h?b.data.y-W:b.data.y+W,"determineLabelYPosition");T.selectAll("text").data(X).enter().append("text").attr("x",b=>b.data.x+b.data.width/2).attr("y",H).attr("text-anchor","middle").attr("dominant-baseline",h?"auto":"hanging").attr("fill",c.dataLabelColor).attr("font-size",`${C}px`).text(b=>b.label)}}break;case"text":T.selectAll("text").data(p.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",h=>h.fill).attr("font-size",h=>h.fontSize).attr("dominant-baseline",h=>S(h.verticalPos)).attr("text-anchor",h=>k(h.horizontalPos)).attr("transform",h=>L(h)).text(h=>h.text);break;case"path":T.selectAll("path").data(p.data).enter().append("path").attr("d",h=>h.path).attr("fill",h=>h.fill?h.fill:"none").attr("stroke",h=>h.strokeFill).attr("stroke-width",h=>h.strokeWidth);break}}},"draw"),Li={draw:vi},Oi={parser:yi,db:Di,renderer:Li};export{Oi as diagram}; diff --git a/apps/kimi-code/src/tui/components/dialogs/survey-preference-selector.ts b/apps/kimi-code/src/tui/components/dialogs/survey-preference-selector.ts new file mode 100644 index 00000000000..0ef788e8831 --- /dev/null +++ b/apps/kimi-code/src/tui/components/dialogs/survey-preference-selector.ts @@ -0,0 +1,34 @@ +import { ChoicePickerComponent, type ChoiceOption } from './choice-picker'; + +const SURVEY_PREFERENCE_OPTIONS: readonly ChoiceOption[] = [ + { + value: 'on', + label: 'On', + description: 'Show the occasional rating prompt above the editor.', + }, + { + value: 'off', + label: 'Off', + description: 'Never show the rating prompt.', + }, +]; + +export interface SurveyPreferenceSelectorOptions { + readonly currentValue: boolean; + readonly onSelect: (value: boolean) => void; + readonly onCancel: () => void; +} + +export class SurveyPreferenceSelectorComponent extends ChoicePickerComponent { + constructor(opts: SurveyPreferenceSelectorOptions) { + super({ + title: 'Feedback survey', + options: [...SURVEY_PREFERENCE_OPTIONS], + currentValue: opts.currentValue ? 'on' : 'off', + onSelect: (value) => { + opts.onSelect(value === 'on'); + }, + onCancel: opts.onCancel, + }); + } +} diff --git a/apps/kimi-code/src/tui/components/panes/survey-panel.ts b/apps/kimi-code/src/tui/components/panes/survey-panel.ts new file mode 100644 index 00000000000..046b72f4d63 --- /dev/null +++ b/apps/kimi-code/src/tui/components/panes/survey-panel.ts @@ -0,0 +1,96 @@ +import type { Component } from '@moonshot-ai/pi-tui'; +import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from '@moonshot-ai/pi-tui'; + +import { + SURVEY_MIN_OPTIONS_WIDTH, + SURVEY_OPTION_GAP, + SURVEY_OPTION_LABELS, + SURVEY_QUESTION, +} from '../../constant/survey'; + +import { currentTheme } from '../../theme'; +import type { SurveyResponse } from '../../utils/survey-policy'; + +export type SurveyPanelPhase = 'open' | 'pending' | 'thanks'; + +export interface SurveyPanelView { + phase: SurveyPanelPhase; + response?: Exclude; + hoverIndex?: number; +} + +const DOT = '●'; +const DOT_PREFIX_WIDTH = 2; +const OPTION_INDENT = ' '; + +const RESPONSE_LABELS: Record, string> = { + bad: 'Bad', + fine: 'Fine', + good: 'Good', +}; +const THANKS = 'Thanks for your feedback!'; + +export class SurveyPanelComponent implements Component { + constructor(private readonly view: SurveyPanelView) {} + + invalidate(): void {} + + render(width: number): string[] { + if (width < 1) return ['']; + switch (this.view.phase) { + case 'open': + return this.renderOpen(width); + case 'pending': { + const label = + this.view.response === undefined ? '' : RESPONSE_LABELS[this.view.response]; + return this.renderStatusLine(width, currentTheme.fg('textDim', `Feedback: ${label} · [escape: undo]`)); + } + case 'thanks': + return this.renderStatusLine(width, currentTheme.fg('success', THANKS)); + } + } + + private renderOpen(width: number): string[] { + const title = wrapTextWithAnsi(SURVEY_QUESTION, Math.max(1, width - DOT_PREFIX_WIDTH)).map( + (line, index) => + (index === 0 ? this.dotPrefix() : ' '.repeat(DOT_PREFIX_WIDTH)) + + currentTheme.boldFg('textStrong', line), + ); + const optionsLine = OPTION_INDENT + this.styledOptions(); + if (visibleWidth(optionsLine) <= width) { + return [...title, optionsLine]; + } + if (width >= SURVEY_MIN_OPTIONS_WIDTH) { + return [ + ...title, + ...this.styledOptionsPerLine().map((option) => OPTION_INDENT + option), + ]; + } + return title; + } + + private renderStatusLine(width: number, styledText: string): string[] { + return [truncateToWidth(this.dotPrefix() + styledText, width)]; + } + + private dotPrefix(): string { + return currentTheme.fg('accent', DOT) + ' '; + } + + private styledOptions(): string { + return SURVEY_OPTION_LABELS.map((label, index) => this.styleOption(label, index)).join( + ' '.repeat(SURVEY_OPTION_GAP), + ); + } + + private styledOptionsPerLine(): string[] { + return SURVEY_OPTION_LABELS.map((label, index) => this.styleOption(label, index)); + } + + private styleOption(label: string, index: number): string { + if (this.view.hoverIndex === index) { + return currentTheme.bg('border', currentTheme.boldFg('textStrong', label)); + } + return currentTheme.fg('text', label); + } +} diff --git a/apps/kimi-code/src/tui/constant/survey.ts b/apps/kimi-code/src/tui/constant/survey.ts new file mode 100644 index 00000000000..dd11b3f8638 --- /dev/null +++ b/apps/kimi-code/src/tui/constant/survey.ts @@ -0,0 +1,71 @@ +export const SURVEY_IDLE_EVALUATION_DELAY_MS = 2000; + +export const SURVEY_IDLE_STABILITY_MS = 2000; + +export const SURVEY_MOUNT_PROTECTION_MS = 600; + +export const SURVEY_DIGIT_DEBOUNCE_MS = 400; + +export const SURVEY_PENDING_UNDO_WINDOW_MS = 3000; + +export const SURVEY_THANKS_DURATION_MS = 5000; + +export const SURVEY_CONFIG_REFRESH_INTERVAL_MS = 3_600_000; + +export const SURVEY_MIN_OPTIONS_WIDTH = 12; + +export const SURVEY_QUESTION = 'How is Kimi doing this session? (optional)'; + +export const SURVEY_OPTION_LABELS = ['1: Bad', '2: Fine', '3: Good', '0: Dismiss'] as const; + +export const SURVEY_OPTION_GAP = 2; + +const SURVEY_SPACER_ROWS = 1; +const SURVEY_PANEL_HORIZONTAL_CHROME = 2; +const SURVEY_EDITOR_MIN_ROWS = 3; +const SURVEY_TRANSCRIPT_MIN_ROWS = 1; +const SURVEY_FOOTER_MIN_ROWS = 1; + +export function surveyMinTotalHeight(contentWidth: number): number { + const innerWidth = Math.max(1, contentWidth - SURVEY_PANEL_HORIZONTAL_CHROME); + const inlineWidth = + SURVEY_OPTION_LABELS.reduce((total, label) => total + label.length, 0) + + SURVEY_OPTION_GAP * (SURVEY_OPTION_LABELS.length - 1); + const optionsRows = innerWidth >= inlineWidth ? 1 : SURVEY_OPTION_LABELS.length; + return ( + SURVEY_SPACER_ROWS + + surveyQuestionRows(innerWidth) + + optionsRows + + SURVEY_EDITOR_MIN_ROWS + + SURVEY_TRANSCRIPT_MIN_ROWS + + SURVEY_FOOTER_MIN_ROWS + ); +} + +function surveyQuestionRows(width: number): number { + let rows = 1; + let lineLength = 0; + for (const word of SURVEY_QUESTION.split(' ')) { + if (lineLength > 0 && lineLength + 1 + word.length > width) { + rows += 1; + lineLength = word.length; + } else { + lineLength += (lineLength > 0 ? 1 : 0) + word.length; + } + } + return rows; +} + +export const SURVEY_ORDERED_LIST_START = /^[ \t]*\d{1,2}[.)][ \t]/m; + +export const SURVEY_SINGLE_OPTION_DIGIT = /^[0-3]$/; + +export const SURVEY_OPTION_COUNT = 4; + +export const SURVEY_DISMISS_OPTION_INDEX = SURVEY_OPTION_COUNT - 1; + +export const SURVEY_DIGIT_RESPONSES: Record = { + '1': 'bad', + '2': 'fine', + '3': 'good', +}; diff --git a/apps/kimi-code/src/tui/controllers/survey-controller.ts b/apps/kimi-code/src/tui/controllers/survey-controller.ts new file mode 100644 index 00000000000..fb71633946b --- /dev/null +++ b/apps/kimi-code/src/tui/controllers/survey-controller.ts @@ -0,0 +1,682 @@ +import { randomUUID } from 'node:crypto'; + +import { isTelemetryDisabledByEnv } from '@moonshot-ai/kimi-telemetry'; +import { Key, matchesKey, Spacer } from '@moonshot-ai/pi-tui'; + +import { + getSurveyPopupConfig, + peekSurveyPopupConfig, + peekSurveyPopupConfigFresh, + type SurveyPopupConfig, +} from '#/utils/survey-popup-config'; +import { readSurveyLastShownTime, writeSurveyLastShownTime } from '#/utils/survey-state-store'; +import { currentKimiRegion } from '#/utils/region'; + +import { SurveyPanelComponent, type SurveyPanelView } from '../components/panes/survey-panel'; +import { CHROME_GUTTER } from '../constant/rendering'; +import { printableChar } from '../utils/printable-key'; +import { + SURVEY_DIGIT_DEBOUNCE_MS, + SURVEY_IDLE_EVALUATION_DELAY_MS, + SURVEY_MOUNT_PROTECTION_MS, + SURVEY_PENDING_UNDO_WINDOW_MS, + SURVEY_ORDERED_LIST_START, + SURVEY_SINGLE_OPTION_DIGIT, + SURVEY_OPTION_COUNT, + SURVEY_DISMISS_OPTION_INDEX, + SURVEY_DIGIT_RESPONSES, + SURVEY_MIN_OPTIONS_WIDTH, + surveyMinTotalHeight, + SURVEY_CONFIG_REFRESH_INTERVAL_MS, + SURVEY_THANKS_DURATION_MS, +} from '../constant/survey'; +import type { TUIState } from '../tui-state'; +import { + buildSurveyEventProperties, + evaluateSurveyGate, + SURVEY_EVENT_NAMES, + SURVEY_MACHINE_CLOSED, + surveyMachineReduce, + type LongContextArmGateInput, + type SessionArmGateInput, + type SharedArmGateInput, + type SurveyAppearance, + type SurveyEventEnvironmentFields, + type SurveyKind, + type SurveyMachineAction, + type SurveyMachineEffect, + type SurveyMachineState, +} from '../utils/survey-policy'; +import type { BtwPanelController } from './btw-panel'; + +export interface SurveyHost { + readonly state: TUIState; + readonly btwPanelController: BtwPanelController; + track(event: string, props?: Record): void; +} + +export interface SurveyControllerDeps { + readonly config?: () => SurveyPopupConfig; + readonly monotonicNow?: () => number; + readonly wallNow?: () => number; + readonly random?: () => number; + readonly appearanceId?: () => string; + readonly setTimer?: (fn: () => void, ms: number) => unknown; + readonly clearTimer?: (handle: unknown) => void; + readonly telemetryDisabled?: () => boolean; + readonly feedbackSurveyDisabled?: () => boolean; + readonly refreshConfig?: () => unknown; + readonly terminalHeight?: () => number; + readonly configFresh?: () => boolean; + readonly terminalWidth?: () => number; + readonly configRegion?: () => string; + readonly accessToken?: () => Promise; + readonly readGlobalLastShown?: () => Promise; + readonly writeGlobalLastShown?: (wallTime: number) => void; +} + +const defaultDeps = { + monotonicNow: () => performance.now(), + wallNow: () => Date.now(), + random: () => Math.random(), + appearanceId: () => randomUUID(), + setTimer: (fn: () => void, ms: number) => setTimeout(fn, ms), + clearTimer: (handle: unknown) => { + clearTimeout(handle as Parameters[0]); + }, + telemetryDisabled: () => isTelemetryDisabledByEnv(), + config: () => peekSurveyPopupConfig(), + configFresh: () => peekSurveyPopupConfigFresh(), + terminalHeight: () => process.stdout.rows, + configRegion: () => currentKimiRegion(), + terminalWidth: () => process.stdout.columns, + readGlobalLastShown: readSurveyLastShownTime, + writeGlobalLastShown: writeSurveyLastShownTime, +} satisfies Omit< + Required, + 'feedbackSurveyDisabled' | 'refreshConfig' | 'accessToken' +>; + +export class SurveyController { + private machine: SurveyMachineState = SURVEY_MACHINE_CLOSED; + private readonly view: SurveyPanelView = { phase: 'open' }; + private mounted = false; + private mountedAt: number; + private userTurnCount = 0; + private lastShownAt: number | undefined; + private userTurnsAtLastShown: number | undefined; + private appearanceCount = 0; + private globalLastShownAt: number | undefined; + private longContextRollConsumed = false; + private generation = 0; + private idleSince: number | undefined; + private openedAt = 0; + private stickySample: { readonly turnCount: number; readonly value: number } | undefined; + private lastTypedDigit: string | undefined; + private openedEditorText: string | undefined; + private idleTimer: unknown; + private digitTimer: unknown; + private phaseTimer: unknown; + private toolCallCount = 0; + private compactionCount = 0; + private currentTurnUserOrigin: boolean | undefined; + private evaluationPending = false; + private appearanceConfig: SurveyPopupConfig | undefined; + private configReady = false; + private cooldownReady = false; + private configRefreshedAt = 0; + private coldRefreshAttemptedAt = 0; + private configRegion: string | undefined; + + constructor( + private readonly host: SurveyHost, + private readonly deps: SurveyControllerDeps = {}, + ) { + this.mountedAt = this.now(); + this.reset(); + this.refreshConfig(); + this.coldRefreshAttemptedAt = this.now(); + } + + reset(): void { + this.generation += 1; + this.clearIdleTimer(); + this.clearDigitTimer(); + this.clearPhaseTimer(); + this.applyClose(); + this.machine = SURVEY_MACHINE_CLOSED; + this.mountedAt = this.now(); + this.userTurnCount = 0; + this.lastShownAt = undefined; + this.userTurnsAtLastShown = undefined; + this.appearanceCount = 0; + this.longContextRollConsumed = false; + this.idleSince = undefined; + this.stickySample = undefined; + this.toolCallCount = 0; + this.compactionCount = 0; + this.appearanceConfig = undefined; + this.currentTurnUserOrigin = undefined; + this.evaluationPending = false; + const generation = this.generation; + this.cooldownReady = false; + void (this.deps.readGlobalLastShown ?? defaultDeps.readGlobalLastShown)() + .then((lastShown) => { + if (this.generation !== generation) return; + if (lastShown !== undefined) { + this.globalLastShownAt = Math.max(lastShown, this.globalLastShownAt ?? 0); + } + this.cooldownReady = true; + }) + .catch(() => { + if (this.generation === generation) this.cooldownReady = true; + }); + } + + dispose(): void { + this.generation += 1; + this.clearIdleTimer(); + this.clearDigitTimer(); + this.clearPhaseTimer(); + this.applyClose(); + } + + notifyTurnStarted(userOrigin: boolean): void { + this.currentTurnUserOrigin = userOrigin; + this.idleSince = undefined; + this.clearIdleTimer(); + if (this.machine.phase !== 'closed') this.applyAction({ type: 'close-silently' }); + if (userOrigin) { + this.userTurnCount += 1; + this.evaluationPending = false; + } + } + + notifyTurnEnded(): void { + if (this.currentTurnUserOrigin === true) this.evaluationPending = true; + this.currentTurnUserOrigin = undefined; + if (!this.evaluationPending) return; + this.idleSince = this.now(); + this.clearIdleTimer(); + this.idleTimer = this.setT(() => { + this.idleTimer = undefined; + this.evaluationPending = false; + this.evaluate(); + }, SURVEY_IDLE_EVALUATION_DELAY_MS); + } + + notifyToolCallStarted(): void { + this.toolCallCount += 1; + } + + notifyCompactionFinished(): void { + this.compactionCount += 1; + } + + notifyInputModeChanged(mode: 'prompt' | 'bash'): void { + if (mode !== 'bash') return; + if (this.machine.phase === 'closed') return; + if (this.machine.phase === 'open') { + this.applyAction({ type: 'abandon' }); + return; + } + this.applyAction({ type: 'close-silently' }); + } + + closeSilently(): void { + if (this.machine.phase === 'closed') return; + this.applyAction({ type: 'close-silently' }); + } + + handlePreInput(data: string): boolean { + const phase = this.machine.phase; + if (phase === 'closed') return false; + if (this.inMountProtection()) { + const printable = printableChar(data); + if (SURVEY_SINGLE_OPTION_DIGIT.test(printable)) { + this.lastTypedDigit = printable; + } + return false; + } + if (this.host.state.editor.hasAutocompleteActivity()) return false; + if (matchesKey(data, Key.escape)) { + switch (phase) { + case 'open': + if (this.tooNarrow() || this.tooShort()) return false; + this.applyAction({ type: 'dismiss' }); + return true; + case 'pending': + this.applyAction({ type: 'undo' }); + return true; + case 'thanks': + this.applyAction({ type: 'close-silently' }); + return true; + } + } + if (this.tooNarrow()) return false; + if (this.tooShort()) return false; + if (phase !== 'open') return false; + const editor = this.host.state.editor; + const empty = editor.getText().length === 0; + const printable = printableChar(data); + if (SURVEY_SINGLE_OPTION_DIGIT.test(printable)) { + this.lastTypedDigit = printable; + if (!empty) this.clearDigitTimer(); + return false; + } + this.lastTypedDigit = undefined; + if (matchesKey(data, Key.up) || matchesKey(data, Key.down)) { + if (!empty) this.clearDigitTimer(); + return false; + } + if (!empty) { + this.clearDigitTimer(); + return false; + } + if (matchesKey(data, Key.left)) { + this.moveHover(-1); + return true; + } + if (matchesKey(data, Key.right)) { + this.moveHover(1); + return true; + } + return false; + } + + handleEditorChange(text: string): void { + if (this.machine.phase !== 'open') return; + const wasTyped = text === this.lastTypedDigit; + this.lastTypedDigit = undefined; + if (this.inMountProtection()) { + if (text.length === 0 || wasTyped) return; + this.applyAction({ type: 'abandon' }); + return; + } + if (this.openedEditorText !== undefined) { + if (text.length > 0 && text !== this.openedEditorText) { + this.openedEditorText = undefined; + } else if (text === this.openedEditorText && !wasTyped) { + this.clearDigitTimer(); + return; + } + } + const bashMode = this.host.state.editor.inputMode === 'bash'; + if (text.length === 0) { + this.clearDigitTimer(); + return; + } + if (!bashMode && SURVEY_SINGLE_OPTION_DIGIT.test(text)) { + if (!wasTyped) { + this.applyAction({ type: 'abandon' }); + return; + } + this.clearDigitTimer(); + this.digitTimer = this.setT(() => { + this.digitTimer = undefined; + if (this.tooNarrow() || this.tooShort()) return; + this.chooseDigit(text); + }, SURVEY_DIGIT_DEBOUNCE_MS); + return; + } + this.applyAction({ type: 'abandon' }); + } + + handleSubmit(text: string): boolean { + if (this.machine.phase !== 'open') return false; + if (this.inMountProtection()) return false; + if (this.tooNarrow()) return false; + if (this.tooShort()) return false; + if (this.host.state.editor.inputMode === 'bash') { + this.applyAction({ type: 'abandon' }); + return false; + } + if (SURVEY_SINGLE_OPTION_DIGIT.test(text) && text !== this.openedEditorText) { + this.chooseDigit(text); + return true; + } + if (text.trim().length === 0 && this.view.hoverIndex !== undefined) { + this.chooseHovered(); + return true; + } + if (text.trim().length > 0) { + this.applyAction({ type: 'abandon' }); + } + return false; + } + + private evaluate(): void { + if (this.machine.phase !== 'closed') return; + if (!this.configReady) return; + if (!this.cooldownReady) return; + const region = (this.deps.configRegion ?? defaultDeps.configRegion)(); + const cacheCold = !(this.deps.configFresh ?? defaultDeps.configFresh)(); + if ( + cacheCold && + this.now() - this.coldRefreshAttemptedAt >= SURVEY_CONFIG_REFRESH_INTERVAL_MS + ) { + this.coldRefreshAttemptedAt = this.now(); + if (this.refreshConfig()) return; + } else if ( + (region !== this.configRegion || + this.now() - this.configRefreshedAt >= SURVEY_CONFIG_REFRESH_INTERVAL_MS) && + this.refreshConfig() + ) { + return; + } + const config = (this.deps.config ?? defaultDeps.config)(); + const verdict = evaluateSurveyGate({ ...this.gateInputs(), config }); + if (verdict.longContextRollConsumed === true) this.longContextRollConsumed = true; + if (!verdict.show) return; + this.open(verdict.survey, config); + } + + private gateInputs(): { session: SessionArmGateInput; longContext: LongContextArmGateInput } { + const { appState } = this.host.state; + const now = this.now(); + const shared: SharedArmGateInput = { + phase: this.machine.phase, + turnInProgress: appState.streamingPhase !== 'idle' || appState.isCompacting, + idleForMs: this.idleSince === undefined ? 0 : now - this.idleSince, + promptActive: this.promptActive(), + editorBashActive: this.host.state.editor.inputMode === 'bash', + editorAutocompleteActive: this.host.state.editor.hasAutocompleteActivity(), + externalEditorActive: this.host.state.externalEditorRunning, + terminalWidth: (this.deps.terminalWidth ?? defaultDeps.terminalWidth)() - 2 * CHROME_GUTTER, + terminalHeight: (this.deps.terminalHeight ?? defaultDeps.terminalHeight)(), + feedbackSurveyDisabled: + this.deps.feedbackSurveyDisabled?.() ?? + this.host.state.appState.disableFeedbackSurvey === true, + telemetryDisabled: (this.deps.telemetryDisabled ?? defaultDeps.telemetryDisabled)(), + currentModel: appState.model, + lastUserMessageStartsOrderedList: this.lastUserMessageStartsOrderedList(), + }; + return { + session: { + ...shared, + mountedForMs: now - this.mountedAt, + userTurnsSinceMount: this.userTurnCount, + msSinceLastShown: this.lastShownAt === undefined ? undefined : now - this.lastShownAt, + userTurnsSinceLastShown: + this.userTurnsAtLastShown === undefined + ? undefined + : this.userTurnCount - this.userTurnsAtLastShown, + sample: this.currentSample(), + msSinceGlobalLastShown: + this.globalLastShownAt === undefined ? undefined : this.wallNow() - this.globalLastShownAt, + }, + longContext: { + ...shared, + cumulativeTokens: appState.cumulativeTokens ?? 0, + virtualContextTokens: appState.contextTokens, + mountRollConsumed: this.longContextRollConsumed, + drawMountRoll: () => (this.deps.random ?? defaultDeps.random)(), + }, + }; + } + + private promptActive(): boolean { + const { state } = this.host; + return ( + state.editorReplacementMounted || + state.activeDialog !== null || + state.livePane.pendingApproval !== null || + state.livePane.pendingQuestion !== null || + state.tasksBrowser !== undefined || + this.host.btwPanelController.isActive() + ); + } + + private lastUserMessageStartsOrderedList(): boolean { + const entries = this.host.state.transcriptEntries; + for (let index = entries.length - 1; index >= 0; index--) { + const entry = entries[index]!; + if (entry.kind !== 'user' || entry.bullet === '') continue; + return SURVEY_ORDERED_LIST_START.test(entry.content); + } + return false; + } + + private currentSample(): number { + if (this.stickySample?.turnCount !== this.userTurnCount) { + this.stickySample = { + turnCount: this.userTurnCount, + value: (this.deps.random ?? defaultDeps.random)(), + }; + } + return this.stickySample.value; + } + + private open(survey: SurveyKind, config: SurveyPopupConfig): void { + this.appearanceCount += 1; + const appearance: SurveyAppearance = { + survey, + appearanceId: (this.deps.appearanceId ?? defaultDeps.appearanceId)(), + appearanceIndex: this.appearanceCount, + }; + const shownAt = this.now(); + this.appearanceConfig = config; + this.applyAction({ type: 'open', appearance }); + if (this.machine.phase !== 'open') return; + this.openedAt = shownAt; + this.openedEditorText = this.host.state.editor.getText(); + this.lastShownAt = shownAt; + this.userTurnsAtLastShown = this.userTurnCount; + if (survey !== 'session') return; + this.globalLastShownAt = this.wallNow(); + try { + (this.deps.writeGlobalLastShown ?? defaultDeps.writeGlobalLastShown)( + this.globalLastShownAt, + ); + } catch {} + } + + private applyAction(action: SurveyMachineAction): void { + this.clearDigitTimer(); + this.clearPhaseTimer(); + const transition = surveyMachineReduce(this.machine, action); + if (transition.state === this.machine && transition.effects.length === 0) return; + const appearance = transition.state.appearance ?? this.machine.appearance; + this.machine = transition.state; + for (const effect of transition.effects) { + this.runEffect(effect, appearance); + } + this.syncView(); + } + + private runEffect(effect: SurveyMachineEffect, appearance: SurveyAppearance | undefined): void { + switch (effect.type) { + case 'report': { + if (appearance === undefined) return; + this.host.track( + SURVEY_EVENT_NAMES[appearance.survey], + buildSurveyEventProperties( + { + event_type: effect.eventType, + appearance_id: appearance.appearanceId, + appearance_index: appearance.appearanceIndex, + response: effect.response, + }, + this.environmentFields(), + this.appearanceConfig ?? (this.deps.config ?? defaultDeps.config)(), + ), + ); + return; + } + case 'schedule': { + if (effect.timer === 'pending-settle') { + this.phaseTimer = this.setT(() => { + this.phaseTimer = undefined; + this.applyAction({ type: 'settle' }); + }, SURVEY_PENDING_UNDO_WINDOW_MS); + } else { + this.phaseTimer = this.setT(() => { + this.phaseTimer = undefined; + this.applyAction({ type: 'thanks-elapsed' }); + }, SURVEY_THANKS_DURATION_MS); + } + } + } + } + + private syncView(): void { + if (this.machine.phase === 'closed') { + this.view.hoverIndex = undefined; + this.applyClose(); + return; + } + this.view.phase = this.machine.phase; + this.view.response = + this.machine.response === undefined || this.machine.response === 'dismissed' + ? undefined + : this.machine.response; + if (this.machine.phase !== 'open') this.view.hoverIndex = undefined; + this.mount(); + this.host.state.ui.requestRender(); + } + + private applyClose(): void { + if (!this.mounted) return; + this.mounted = false; + this.lastTypedDigit = undefined; + this.openedEditorText = undefined; + this.host.state.surveyContainer.clear(); + this.host.state.ui.requestRender(); + } + + private mount(): void { + if (this.mounted) return; + this.mounted = true; + const container = this.host.state.surveyContainer; + container.clear(); + container.addChild(new Spacer(1)); + container.addChild(new SurveyPanelComponent(this.view)); + } + + private chooseDigit(digit: string): void { + const response = SURVEY_DIGIT_RESPONSES[digit]; + if (response === undefined) { + this.applyAction({ type: 'dismiss' }); + } else { + this.applyAction({ type: 'select', response }); + } + this.host.state.editor.setText(''); + } + + private chooseHovered(): void { + const hoverIndex = this.view.hoverIndex; + if (hoverIndex === undefined) return; + if (hoverIndex === SURVEY_DISMISS_OPTION_INDEX) { + this.applyAction({ type: 'dismiss' }); + return; + } + const response = SURVEY_DIGIT_RESPONSES[String(hoverIndex + 1)]; + if (response === undefined) return; + this.applyAction({ type: 'select', response }); + } + + private moveHover(delta: number): void { + const current = this.view.hoverIndex; + this.view.hoverIndex = + current === undefined + ? (delta > 0 ? 0 : SURVEY_OPTION_COUNT - 1) + : (current + delta + SURVEY_OPTION_COUNT) % SURVEY_OPTION_COUNT; + this.host.state.ui.requestRender(); + } + + private environmentFields(): SurveyEventEnvironmentFields { + const { appState } = this.host.state; + return { + current_model: appState.model, + user_turn_count: this.userTurnCount, + cumulative_tokens: appState.cumulativeTokens ?? 0, + virtual_context_tokens: appState.contextTokens, + tool_call_count: this.toolCallCount, + compaction_count: this.compactionCount, + permission_mode: appState.permissionMode, + thinking_effort: appState.thinkingEffort, + }; + } + + private refreshConfig(): boolean { + this.configRefreshedAt = this.now(); + this.configRegion = (this.deps.configRegion ?? defaultDeps.configRegion)(); + const markReady = () => { + this.configReady = true; + }; + if (this.deps.refreshConfig !== undefined) { + this.configReady = false; + void Promise.resolve(this.deps.refreshConfig()) + .catch(() => undefined) + .finally(markReady); + return true; + } + const accessToken = this.deps.accessToken; + if (accessToken === undefined) { + markReady(); + return false; + } + this.configReady = false; + void (async () => { + const token = await accessToken(); + await getSurveyPopupConfig({ accessToken: token }); + })() + .catch(() => undefined) + .finally(markReady); + return true; + } + + private tooNarrow(): boolean { + return ( + (this.deps.terminalWidth ?? defaultDeps.terminalWidth)() - 2 * CHROME_GUTTER < + SURVEY_MIN_OPTIONS_WIDTH + ); + } + + private tooShort(): boolean { + return ( + (this.deps.terminalHeight ?? defaultDeps.terminalHeight)() < + surveyMinTotalHeight( + (this.deps.terminalWidth ?? defaultDeps.terminalWidth)() - 2 * CHROME_GUTTER, + ) + ); + } + + private inMountProtection(): boolean { + return this.now() - this.openedAt < SURVEY_MOUNT_PROTECTION_MS; + } + + private now(): number { + return (this.deps.monotonicNow ?? defaultDeps.monotonicNow)(); + } + + private wallNow(): number { + return (this.deps.wallNow ?? defaultDeps.wallNow)(); + } + + private setT(fn: () => void, ms: number): unknown { + return (this.deps.setTimer ?? defaultDeps.setTimer)(fn, ms); + } + + private clearT(handle: unknown): void { + (this.deps.clearTimer ?? defaultDeps.clearTimer)(handle); + } + + private clearIdleTimer(): void { + if (this.idleTimer === undefined) return; + this.clearT(this.idleTimer); + this.idleTimer = undefined; + } + + private clearDigitTimer(): void { + if (this.digitTimer === undefined) return; + this.clearT(this.digitTimer); + this.digitTimer = undefined; + } + + private clearPhaseTimer(): void { + if (this.phaseTimer === undefined) return; + this.clearT(this.phaseTimer); + this.phaseTimer = undefined; + } +} diff --git a/apps/kimi-code/src/tui/utils/survey-policy.ts b/apps/kimi-code/src/tui/utils/survey-policy.ts new file mode 100644 index 00000000000..5e82041d21f --- /dev/null +++ b/apps/kimi-code/src/tui/utils/survey-policy.ts @@ -0,0 +1,378 @@ + +import type { SurveyPopupConfig } from '#/utils/survey-popup-config'; + +import { + SURVEY_IDLE_STABILITY_MS, + SURVEY_MIN_OPTIONS_WIDTH, + surveyMinTotalHeight, +} from '../constant/survey'; + +export type SurveyKind = 'session' | 'long_context'; + +export type SurveyGateSkipReason = + | 'mount-roll-consumed' + | 'survey-active' + | 'turn-in-progress' + | 'idle-too-short' + | 'ordered-list-ambiguity' + | 'prompt-active' + | 'editor-bash-active' + | 'editor-autocomplete-active' + | 'external-editor-active' + | 'terminal-too-narrow' + | 'terminal-too-short' + | 'feature-disabled' + | 'telemetry-disabled' + | 'model-gated' + | 'warmup' + | 'pacing' + | 'threshold-invalid' + | 'below-threshold' + | 'sampled-out' + | 'global-cooldown'; + +export interface SharedArmGateInput { + readonly phase: SurveyPhase; + readonly turnInProgress: boolean; + readonly idleForMs: number; + readonly promptActive: boolean; + readonly editorBashActive: boolean; + readonly editorAutocompleteActive: boolean; + readonly externalEditorActive: boolean; + readonly terminalWidth: number; + readonly terminalHeight: number; + readonly feedbackSurveyDisabled: boolean; + readonly telemetryDisabled: boolean; + readonly currentModel: string; + readonly lastUserMessageStartsOrderedList: boolean; +} + +export interface SessionArmGateInput extends SharedArmGateInput { + readonly mountedForMs: number; + readonly userTurnsSinceMount: number; + readonly msSinceLastShown: number | undefined; + readonly userTurnsSinceLastShown: number | undefined; + readonly sample: number; + readonly msSinceGlobalLastShown: number | undefined; +} + +export interface LongContextArmGateInput extends SharedArmGateInput { + readonly cumulativeTokens: number; + readonly virtualContextTokens: number; + readonly mountRollConsumed: boolean; + readonly drawMountRoll: () => number; +} + +export interface SurveyGateInput { + readonly session: SessionArmGateInput; + readonly longContext: LongContextArmGateInput; + readonly config: SurveyPopupConfig; +} + +export type SurveyGateVerdict = + | { + readonly show: true; + readonly survey: SurveyKind; + readonly longContextRollConsumed?: boolean; + } + | { + readonly show: false; + readonly reason: SurveyGateSkipReason; + readonly longContextRollConsumed?: boolean; + }; + +function modelGatePasses(onForModels: readonly string[], currentModel: string): boolean { + if (onForModels.length === 0) return false; + if (onForModels.includes('*')) return true; + return onForModels.includes(currentModel); +} + +function evaluateSessionArm(input: SurveyGateInput): SurveyGateVerdict { + const { session, config } = input; + if (session.phase !== 'closed') return { show: false, reason: 'survey-active' }; + if (session.turnInProgress) return { show: false, reason: 'turn-in-progress' }; + if (session.idleForMs < SURVEY_IDLE_STABILITY_MS) { + return { show: false, reason: 'idle-too-short' }; + } + if (session.lastUserMessageStartsOrderedList) { + return { show: false, reason: 'ordered-list-ambiguity' }; + } + if (session.promptActive) return { show: false, reason: 'prompt-active' }; + if (session.editorBashActive) return { show: false, reason: 'editor-bash-active' }; + if (session.editorAutocompleteActive) { + return { show: false, reason: 'editor-autocomplete-active' }; + } + if (session.externalEditorActive) { + return { show: false, reason: 'external-editor-active' }; + } + if (session.terminalWidth < SURVEY_MIN_OPTIONS_WIDTH) { + return { show: false, reason: 'terminal-too-narrow' }; + } + if (session.terminalHeight < surveyMinTotalHeight(session.terminalWidth)) { + return { show: false, reason: 'terminal-too-short' }; + } + if (session.feedbackSurveyDisabled) return { show: false, reason: 'feature-disabled' }; + if (session.telemetryDisabled) return { show: false, reason: 'telemetry-disabled' }; + if (!modelGatePasses(config.on_for_models, session.currentModel)) { + return { show: false, reason: 'model-gated' }; + } + if (session.msSinceLastShown === undefined) { + if ( + session.mountedForMs < config.min_time_before_feedback_ms || + session.userTurnsSinceMount < config.min_user_turns_before_feedback + ) { + return { show: false, reason: 'warmup' }; + } + } else if ( + session.msSinceLastShown < config.min_time_between_feedback_ms || + (session.userTurnsSinceLastShown ?? 0) < config.min_user_turns_between_feedback + ) { + return { show: false, reason: 'pacing' }; + } + if (session.sample >= config.probability) return { show: false, reason: 'sampled-out' }; + if ( + session.msSinceGlobalLastShown !== undefined && + session.msSinceGlobalLastShown < config.min_time_between_global_feedback_ms + ) { + return { show: false, reason: 'global-cooldown' }; + } + return { show: true, survey: 'session' }; +} + +export function evaluateLongContextArm(input: SurveyGateInput): SurveyGateVerdict { + const { longContext, config } = input; + if (longContext.mountRollConsumed) return { show: false, reason: 'mount-roll-consumed' }; + if (longContext.phase !== 'closed') return { show: false, reason: 'survey-active' }; + if (longContext.turnInProgress) return { show: false, reason: 'turn-in-progress' }; + if (longContext.idleForMs < SURVEY_IDLE_STABILITY_MS) { + return { show: false, reason: 'idle-too-short' }; + } + if (longContext.lastUserMessageStartsOrderedList) { + return { show: false, reason: 'ordered-list-ambiguity' }; + } + if (longContext.promptActive) return { show: false, reason: 'prompt-active' }; + if (longContext.editorBashActive) return { show: false, reason: 'editor-bash-active' }; + if (longContext.editorAutocompleteActive) { + return { show: false, reason: 'editor-autocomplete-active' }; + } + if (longContext.externalEditorActive) { + return { show: false, reason: 'external-editor-active' }; + } + if (longContext.terminalWidth < SURVEY_MIN_OPTIONS_WIDTH) { + return { show: false, reason: 'terminal-too-narrow' }; + } + if (longContext.terminalHeight < surveyMinTotalHeight(longContext.terminalWidth)) { + return { show: false, reason: 'terminal-too-short' }; + } + if (longContext.feedbackSurveyDisabled) return { show: false, reason: 'feature-disabled' }; + if (longContext.telemetryDisabled) return { show: false, reason: 'telemetry-disabled' }; + if (!modelGatePasses(config.on_for_models, longContext.currentModel)) { + return { show: false, reason: 'model-gated' }; + } + if (!(config.long_context_survey_threshold > 0)) { + return { show: false, reason: 'threshold-invalid' }; + } + const counter = + config.long_context_trigger_mode === 'cumulative' + ? longContext.cumulativeTokens + : longContext.virtualContextTokens; + if (counter < config.long_context_survey_threshold) { + return { show: false, reason: 'below-threshold' }; + } + if (longContext.drawMountRoll() >= config.long_context_probability) { + return { show: false, reason: 'sampled-out', longContextRollConsumed: true }; + } + return { show: true, survey: 'long_context', longContextRollConsumed: true }; +} + +export function evaluateSurveyGate(input: SurveyGateInput): SurveyGateVerdict { + const longContext = evaluateLongContextArm(input); + if (longContext.show) return longContext; + const session = evaluateSessionArm(input); + if (longContext.longContextRollConsumed === true) { + return { ...session, longContextRollConsumed: true }; + } + return session; +} + +export type SurveyPhase = 'closed' | 'open' | 'pending' | 'thanks'; + +export type SurveyResponse = 'bad' | 'fine' | 'good' | 'dismissed'; + +export type SurveyEventType = 'appeared' | 'responded' | 'abandoned'; + +export interface SurveyAppearance { + readonly survey: SurveyKind; + readonly appearanceId: string; + readonly appearanceIndex: number; +} + +export interface SurveyMachineState { + readonly phase: SurveyPhase; + readonly appearance: SurveyAppearance | undefined; + readonly response: SurveyResponse | undefined; +} + +export const SURVEY_MACHINE_CLOSED: SurveyMachineState = { + phase: 'closed', + appearance: undefined, + response: undefined, +}; + +const SURVEY_PRIORITY: Record = { session: 0, long_context: 1 }; + +export type SurveyMachineAction = + | { readonly type: 'open'; readonly appearance: SurveyAppearance } + | { readonly type: 'select'; readonly response: 'bad' | 'fine' | 'good' } + | { readonly type: 'dismiss' } + | { readonly type: 'undo' } + | { readonly type: 'settle' } + | { readonly type: 'thanks-elapsed' } + | { readonly type: 'abandon' } + | { readonly type: 'close-silently' }; + +export type SurveyMachineEffect = + | { + readonly type: 'report'; + readonly eventType: SurveyEventType; + readonly response?: SurveyResponse; + } + | { readonly type: 'schedule'; readonly timer: 'pending-settle' | 'thanks-close' }; + +export interface SurveyMachineTransition { + readonly state: SurveyMachineState; + readonly effects: readonly SurveyMachineEffect[]; +} + +const NO_EFFECTS: readonly SurveyMachineEffect[] = []; + +function noTransition(state: SurveyMachineState): SurveyMachineTransition { + return { state, effects: NO_EFFECTS }; +} + +export function surveyMachineReduce( + state: SurveyMachineState, + action: SurveyMachineAction, +): SurveyMachineTransition { + switch (action.type) { + case 'open': { + if (state.phase === 'closed') { + return { + state: { phase: 'open', appearance: action.appearance, response: undefined }, + effects: [{ type: 'report', eventType: 'appeared' }], + }; + } + if (state.phase !== 'open' || state.appearance === undefined) { + return noTransition(state); + } + if (SURVEY_PRIORITY[action.appearance.survey] <= SURVEY_PRIORITY[state.appearance.survey]) { + return noTransition(state); + } + return { + state: { phase: 'open', appearance: action.appearance, response: undefined }, + effects: [{ type: 'report', eventType: 'appeared' }], + }; + } + case 'select': { + if (state.phase !== 'open') return noTransition(state); + return { + state: { ...state, phase: 'pending', response: action.response }, + effects: [{ type: 'schedule', timer: 'pending-settle' }], + }; + } + case 'dismiss': { + if (state.phase !== 'open') return noTransition(state); + return { + state: SURVEY_MACHINE_CLOSED, + effects: [{ type: 'report', eventType: 'responded', response: 'dismissed' }], + }; + } + case 'undo': { + if (state.phase !== 'pending') return noTransition(state); + return { + state: { ...state, phase: 'open', response: undefined }, + effects: NO_EFFECTS, + }; + } + case 'settle': { + if (state.phase !== 'pending' || state.response === undefined) { + return noTransition(state); + } + return { + state: { ...state, phase: 'thanks' }, + effects: [ + { type: 'report', eventType: 'responded', response: state.response }, + { type: 'schedule', timer: 'thanks-close' }, + ], + }; + } + case 'thanks-elapsed': { + if (state.phase !== 'thanks') return noTransition(state); + return { state: SURVEY_MACHINE_CLOSED, effects: NO_EFFECTS }; + } + case 'abandon': { + if (state.phase !== 'open') return noTransition(state); + return { + state: SURVEY_MACHINE_CLOSED, + effects: [{ type: 'report', eventType: 'abandoned' }], + }; + } + case 'close-silently': { + if (state.phase === 'closed') return noTransition(state); + if (state.phase === 'pending' && state.response !== undefined) { + return { + state: SURVEY_MACHINE_CLOSED, + effects: [{ type: 'report', eventType: 'responded', response: state.response }], + }; + } + return { state: SURVEY_MACHINE_CLOSED, effects: NO_EFFECTS }; + } + } +} + +export const SURVEY_EVENT_NAMES: Record = { + session: 'feedback_survey', + long_context: 'long_context_survey', +}; + +export interface SurveyEventCoreFields { + readonly event_type: SurveyEventType; + readonly appearance_id: string; + readonly appearance_index: number; + readonly response?: SurveyResponse; +} + +export interface SurveyEventEnvironmentFields { + readonly current_model: string; + readonly user_turn_count: number; + readonly cumulative_tokens: number; + readonly virtual_context_tokens: number; + readonly tool_call_count: number; + readonly compaction_count: number; + readonly permission_mode: string; + readonly thinking_effort: string; +} + +export function buildSurveyEventProperties( + core: SurveyEventCoreFields, + environment: SurveyEventEnvironmentFields, + config: SurveyPopupConfig, +): Record { + return { + event_type: core.event_type, + appearance_id: core.appearance_id, + appearance_index: core.appearance_index, + response: core.response, + ...environment, + config_probability: config.probability, + config_on_for_models: config.on_for_models.join(','), + config_min_time_before_feedback_ms: config.min_time_before_feedback_ms, + config_min_user_turns_before_feedback: config.min_user_turns_before_feedback, + config_min_time_between_feedback_ms: config.min_time_between_feedback_ms, + config_min_user_turns_between_feedback: config.min_user_turns_between_feedback, + config_min_time_between_global_feedback_ms: config.min_time_between_global_feedback_ms, + config_long_context_survey_threshold: config.long_context_survey_threshold, + config_long_context_probability: config.long_context_probability, + config_long_context_trigger_mode: config.long_context_trigger_mode, + }; +} diff --git a/apps/kimi-code/src/utils/survey-popup-config.ts b/apps/kimi-code/src/utils/survey-popup-config.ts new file mode 100644 index 00000000000..a7efd807ef3 --- /dev/null +++ b/apps/kimi-code/src/utils/survey-popup-config.ts @@ -0,0 +1,91 @@ +import { z } from 'zod'; + +import { + getClientConfig, + peekClientConfig, + resetClientConfigCache, + type ClientConfigFetchOptions, +} from '#/utils/client-configs'; + +const CONFIG_NAME = 'survey_popup'; + +/** The `survey_popup` wire shape; every layer below (process cache, disk + * cache, network failure, per-field parse failure) falls back to the + * built-in defaults. */ +export interface SurveyPopupConfig { + probability: number; + /** Model gate: exact match, `"*"` opens for every model, `[]` closes both arms. */ + on_for_models: string[]; + min_time_before_feedback_ms: number; + min_user_turns_before_feedback: number; + min_time_between_feedback_ms: number; + min_user_turns_between_feedback: number; + /** Cross-session cooldown, persisted as `last_shown_time`. */ + min_time_between_global_feedback_ms: number; + /** Token threshold for the long-context arm; invalid/non-positive disables that arm. */ + long_context_survey_threshold: number; + long_context_probability: number; + /** Which token counter the threshold compares against. */ + long_context_trigger_mode: 'cumulative' | 'virtual_context'; +} + +export const DEFAULT_SURVEY_POPUP_CONFIG: SurveyPopupConfig = { + probability: 0.005, + on_for_models: ['*'], + min_time_before_feedback_ms: 600_000, + min_user_turns_before_feedback: 5, + min_time_between_feedback_ms: 3_600_000, + min_user_turns_between_feedback: 10, + min_time_between_global_feedback_ms: 100_000_000, + long_context_survey_threshold: 200_000, + long_context_probability: 0.2, + long_context_trigger_mode: 'cumulative', +}; + +const FIELD_SCHEMAS = { + probability: z.number().min(0).max(1), + on_for_models: z.array(z.string()), + min_time_before_feedback_ms: z.number().min(0), + min_user_turns_before_feedback: z.number().int().min(0), + min_time_between_feedback_ms: z.number().min(0), + min_user_turns_between_feedback: z.number().int().min(0), + min_time_between_global_feedback_ms: z.number().min(0), + long_context_survey_threshold: z.number(), + long_context_probability: z.number().min(0).max(1), + long_context_trigger_mode: z.enum(['cumulative', 'virtual_context']), +} satisfies Record; + +const surveyPopupConfigSchema = z.unknown().transform((raw): Partial => { + if (typeof raw !== 'object' || raw === null) return {}; + const record = raw as Record; + const partial: Record = {}; + for (const [key, schema] of Object.entries(FIELD_SCHEMAS)) { + const value = record[key]; + if (value === undefined) continue; + const parsed = schema.safeParse(value); + if (parsed.success) partial[key] = parsed.data; + } + return partial as Partial; +}); + +function withDefaults(partial: Partial | undefined): SurveyPopupConfig { + return { ...DEFAULT_SURVEY_POPUP_CONFIG, ...partial }; +} + +export async function getSurveyPopupConfig( + options: ClientConfigFetchOptions = {}, +): Promise { + return withDefaults(await getClientConfig(CONFIG_NAME, surveyPopupConfigSchema, options)); +} + +export function peekSurveyPopupConfig(now?: number): SurveyPopupConfig { + return withDefaults(peekClientConfig(CONFIG_NAME, surveyPopupConfigSchema, now)); +} + +export function peekSurveyPopupConfigFresh(now?: number): boolean { + return peekClientConfig(CONFIG_NAME, surveyPopupConfigSchema, now) !== undefined; +} + +export function resetSurveyPopupConfigCache(): void { + resetClientConfigCache(CONFIG_NAME); +} diff --git a/apps/kimi-code/src/utils/survey-state-store.ts b/apps/kimi-code/src/utils/survey-state-store.ts new file mode 100644 index 00000000000..d6acf1c775a --- /dev/null +++ b/apps/kimi-code/src/utils/survey-state-store.ts @@ -0,0 +1,33 @@ +import { z } from 'zod'; + +import { getSurveyStateFile } from '#/utils/paths'; +import { readJsonFile, writeJsonFileSync } from '#/utils/persistence'; + +const SurveyStateSchema = z.object({ + version: z.literal(1), + last_shown_time: z.number(), +}); + +export async function readSurveyLastShownTime( + filePath: string = getSurveyStateFile(), +): Promise { + try { + const state = await readJsonFile(filePath, SurveyStateSchema, { + version: 1, + last_shown_time: Number.NaN, + }); + return Number.isFinite(state.last_shown_time) ? state.last_shown_time : undefined; + } catch { + return undefined; + } +} + +export function writeSurveyLastShownTime( + lastShownTime: number, + filePath: string = getSurveyStateFile(), +): void { + writeJsonFileSync(filePath, SurveyStateSchema, { + version: 1, + last_shown_time: lastShownTime, + }); +} diff --git a/apps/kimi-code/test/tui/commands/survey-preferences.test.ts b/apps/kimi-code/test/tui/commands/survey-preferences.test.ts new file mode 100644 index 00000000000..b8b8073025b --- /dev/null +++ b/apps/kimi-code/test/tui/commands/survey-preferences.test.ts @@ -0,0 +1,87 @@ +import { describe, expect, it, vi } from 'vitest'; + +import { applySurveyPreferenceChoice } from '#/tui/commands/config'; +import { darkColors } from '#/tui/theme/colors'; + +const mocks = vi.hoisted(() => ({ + saveTuiConfig: vi.fn(), +})); + +vi.mock('../../../src/tui/config', async () => { + const actual = await vi.importActual( + '../../../src/tui/config.js', + ); + return { + ...actual, + saveTuiConfig: mocks.saveTuiConfig, + }; +}); + +function makeHost(disableFeedbackSurvey: boolean) { + return { + state: { + appState: { + theme: 'auto' as const, + editorCommand: null, + notifications: { enabled: true, condition: 'unfocused' as const }, + upgrade: { autoInstall: true }, + disableFeedbackSurvey, + }, + theme: { palette: darkColors }, + }, + setAppState: vi.fn(), + showStatus: vi.fn(), + }; +} + +describe('survey preference commands', () => { + it('saves the opt-out to tui.toml and mirrors it into appState', async () => { + mocks.saveTuiConfig.mockClear(); + const host = makeHost(false); + + await applySurveyPreferenceChoice(host, false); + + expect(mocks.saveTuiConfig).toHaveBeenCalledWith( + expect.objectContaining({ disableFeedbackSurvey: true }), + ); + expect(host.setAppState).toHaveBeenCalledWith({ disableFeedbackSurvey: true }); + expect(host.showStatus).toHaveBeenCalledWith('Feedback survey disabled.'); + }); + + it('re-enables the survey from an opt-out state', async () => { + mocks.saveTuiConfig.mockClear(); + const host = makeHost(true); + + await applySurveyPreferenceChoice(host, true); + + expect(mocks.saveTuiConfig).toHaveBeenCalledWith( + expect.objectContaining({ disableFeedbackSurvey: false }), + ); + expect(host.setAppState).toHaveBeenCalledWith({ disableFeedbackSurvey: false }); + expect(host.showStatus).toHaveBeenCalledWith('Feedback survey enabled.'); + }); + + it('does not rewrite the config when the value is unchanged', async () => { + mocks.saveTuiConfig.mockClear(); + const host = makeHost(false); + + await applySurveyPreferenceChoice(host, true); + + expect(mocks.saveTuiConfig).not.toHaveBeenCalled(); + expect(host.setAppState).not.toHaveBeenCalled(); + expect(host.showStatus).toHaveBeenCalledWith('Feedback survey already enabled.'); + }); + + it('reports a save failure without touching appState', async () => { + mocks.saveTuiConfig.mockRejectedValueOnce(new Error('disk full')); + const host = makeHost(false); + + await applySurveyPreferenceChoice(host, false); + + expect(host.setAppState).not.toHaveBeenCalled(); + expect(host.showStatus).toHaveBeenCalledWith( + 'Failed to save session rating setting: disk full', + 'error', + ); + }); +}); diff --git a/apps/kimi-code/test/tui/components/dialogs/survey-preference-selector.test.ts b/apps/kimi-code/test/tui/components/dialogs/survey-preference-selector.test.ts new file mode 100644 index 00000000000..6538d939092 --- /dev/null +++ b/apps/kimi-code/test/tui/components/dialogs/survey-preference-selector.test.ts @@ -0,0 +1,30 @@ +import { describe, expect, it } from 'vitest'; + +import { SurveyPreferenceSelectorComponent } from '#/tui/components/dialogs/survey-preference-selector'; + +const ANSI = /\[[0-9;]*m/g; +const strip = (s: string): string => s.replaceAll(ANSI, ''); + +describe('SurveyPreferenceSelectorComponent', () => { + it('maps the current preference onto the picker options', () => { + const selected: boolean[] = []; + const enabledPicker = new SurveyPreferenceSelectorComponent({ + currentValue: true, + onSelect: (value) => selected.push(value), + onCancel: () => {}, + }); + const disabledPicker = new SurveyPreferenceSelectorComponent({ + currentValue: false, + onSelect: (value) => selected.push(value), + onCancel: () => {}, + }); + + expect(strip(enabledPicker.render(60).join('\n'))).toContain('Feedback survey'); + expect(strip(disabledPicker.render(60).join('\n'))).toContain('Off'); + + enabledPicker.handleInput('\r'); + expect(selected).toEqual([true]); + disabledPicker.handleInput('\r'); + expect(selected).toEqual([true, false]); + }); +}); diff --git a/apps/kimi-code/test/tui/components/panes/survey-panel.test.ts b/apps/kimi-code/test/tui/components/panes/survey-panel.test.ts new file mode 100644 index 00000000000..177d87b9516 --- /dev/null +++ b/apps/kimi-code/test/tui/components/panes/survey-panel.test.ts @@ -0,0 +1,76 @@ +import chalk from 'chalk'; +import { afterEach, beforeEach, describe, expect, it } from 'vitest'; +import { visibleWidth } from '@moonshot-ai/pi-tui'; + +import { + SurveyPanelComponent, + type SurveyPanelView, +} from '#/tui/components/panes/survey-panel'; + +function stripAnsi(text: string): string { + return text.replaceAll(/\u001B\[[0-9;]*m/g, ''); +} + +function render(view: SurveyPanelView, width: number): string[] { + return new SurveyPanelComponent(view).render(width).map(stripAnsi); +} + +describe('SurveyPanelComponent', () => { + const previousChalkLevel = chalk.level; + + beforeEach(() => { + chalk.level = 3; + }); + + afterEach(() => { + chalk.level = previousChalkLevel; + }); + + it('renders the question and the four options on one line', () => { + const lines = render({ phase: 'open' }, 80); + expect(lines).toHaveLength(2); + expect(lines[0]).toContain('●'); + expect(lines[0]).toContain('How is Kimi doing this session? (optional)'); + expect(lines[1]).toBe(' 1: Bad 2: Fine 3: Good 0: Dismiss'); + }); + + it('folds the options onto their own lines when narrow', () => { + const lines = render({ phase: 'open' }, 30); + expect(lines[0]).toContain('How is Kimi doing this'); + expect(lines[1]).toContain('session? (optional)'); + expect(lines.slice(2)).toEqual([' 1: Bad', ' 2: Fine', ' 3: Good', ' 0: Dismiss']); + }); + + it('keeps only the title line at extreme widths, without hard-breaking', () => { + const width = 10; + const lines = render({ phase: 'open' }, width); + expect(lines.length).toBeGreaterThan(0); + for (const line of lines) { + expect(visibleWidth(line)).toBeLessThanOrEqual(width); + } + expect(lines.join('\n')).not.toContain('1: Bad'); + expect(lines[0]).toContain('●'); + }); + + it('renders the pending line with the chosen rating and the undo hint', () => { + const lines = render({ phase: 'pending', response: 'bad' }, 80); + expect(lines).toEqual(['● Feedback: Bad · [escape: undo]']); + }); + + it('renders the thanks line', () => { + const lines = render({ phase: 'thanks' }, 80); + expect(lines).toEqual(['● Thanks for your feedback!']); + }); + + it('highlights the hovered option', () => { + const plain = new SurveyPanelComponent({ phase: 'open' }).render(80)[1]!; + const hovered = new SurveyPanelComponent({ phase: 'open', hoverIndex: 2 }).render(80)[1]!; + expect(stripAnsi(hovered)).toBe(stripAnsi(plain)); + expect(hovered).not.toBe(plain); + expect(hovered).toContain('3: Good'); + }); + + it('renders a single blank line when the terminal cannot hold a column', () => { + expect(render({ phase: 'open' }, 0)).toEqual(['']); + }); +}); diff --git a/apps/kimi-code/test/tui/controllers/auth-flow.test.ts b/apps/kimi-code/test/tui/controllers/auth-flow.test.ts new file mode 100644 index 00000000000..e562c71afd2 --- /dev/null +++ b/apps/kimi-code/test/tui/controllers/auth-flow.test.ts @@ -0,0 +1,146 @@ +import { describe, expect, it, vi } from 'vitest'; + +import { + AuthFlowController, + type AuthFlowHost, +} from '#/tui/controllers/auth-flow'; + +function makeHost( + options: { + engineV2?: boolean; + withSession?: boolean; + defaultModel?: string; + boundModel?: string; + } = {}, +) { + const appState = { + workDir: '/tmp/work', + additionalDirs: [] as string[], + planMode: false, + model: 'old-model', + thinkingEffort: 'off', + }; + const session = + options.withSession === true + ? { + id: 'ses-live', + getStatus: vi.fn(async () => ({ model: options.boundModel ?? 'old-model' })), + setModel: vi.fn(async () => ({ model: 'k2', providerName: 'managed' })), + setThinking: vi.fn(async () => {}), + } + : undefined; + const host = { + state: { appState }, + session, + engineV2: options.engineV2 === true, + harness: { + createSession: vi.fn(async () => ({ id: 'ses-new', summary: { title: null } })), + getConfig: vi.fn(async () => ({ + defaultModel: options.defaultModel, + models: { k2: { provider: 'managed:kimi-code', model: 'kimi-k2', maxContextSize: 200_000 } }, + providers: {}, + })), + }, + options: { startup: {} }, + setAppState: vi.fn((patch: Record) => Object.assign(appState, patch)), + setStartupReady: vi.fn(), + resetSessionRuntime: vi.fn(), + setSession: vi.fn(async (next: unknown) => { + (host as { session: unknown }).session = next; + }), + syncRuntimeState: vi.fn(async () => {}), + appendStartupNotice: vi.fn(), + hydrateLazyConfigDefaults: vi.fn(async () => {}), + sessionEventHandler: { startSubscription: vi.fn() }, + fetchSessions: vi.fn(async () => {}), + updateTerminalTitle: vi.fn(), + refreshSkillCommands: vi.fn(async () => {}), + refreshPluginCommands: vi.fn(async () => {}), + } as unknown as AuthFlowHost & { + session: unknown; + harness: { + createSession: ReturnType; + getConfig: ReturnType; + }; + setAppState: ReturnType; + }; + return { host, appState, session }; +} + +describe('activateModelAfterLogin', () => { + it('reports an engine-tracked switch when the pick changes the bound alias', async () => { + const { host, session } = makeHost({ withSession: true }); + const authFlow = new AuthFlowController(host); + + const engineTrackedSwitch = await authFlow.activateModelAfterLogin('k2', 'high'); + + expect(engineTrackedSwitch).toBe(true); + expect(session!.setModel).toHaveBeenCalledWith('k2'); + expect(session!.setThinking).toHaveBeenCalledWith('high'); + }); + + it('reports no engine switch when the live session already binds the alias', async () => { + const { host, session } = makeHost({ withSession: true, boundModel: 'k2' }); + const authFlow = new AuthFlowController(host); + + // setModel is an alias no-op here, so neither engine emits model_switch — + // callers must stay the producer. The effort still goes through + // setThinking, whose thinking_toggle is the engine's own event. + const engineTrackedSwitch = await authFlow.activateModelAfterLogin('k2', 'high'); + + expect(engineTrackedSwitch).toBe(false); + expect(session!.setModel).toHaveBeenCalledWith('k2'); + expect(session!.setThinking).toHaveBeenCalledWith('high'); + }); + + it('only patches app state and reports no engine switch on the session-less v2 path', async () => { + const { host, appState } = makeHost({ engineV2: true }); + const authFlow = new AuthFlowController(host); + + const engineTrackedSwitch = await authFlow.activateModelAfterLogin('k2', 'high'); + + expect(engineTrackedSwitch).toBe(false); + expect(host.harness.createSession).not.toHaveBeenCalled(); + expect(appState.model).toBe('k2'); + expect(appState).toMatchObject({ lazySessionThinking: 'high' }); + }); + + it('creates the session on the session-less v1 path and still reports no engine switch', async () => { + const { host } = makeHost(); + const authFlow = new AuthFlowController(host); + + // The v1 creation binds the model without an engine model_switch event, + // so callers must treat this path as "no engine switch" even though + // host.session is defined afterwards. + const engineTrackedSwitch = await authFlow.activateModelAfterLogin('k2', 'high'); + + expect(engineTrackedSwitch).toBe(false); + expect(host.harness.createSession).toHaveBeenCalledWith( + expect.objectContaining({ model: 'k2', thinking: 'high' }), + ); + expect(host.session).toMatchObject({ id: 'ses-new' }); + }); +}); + +describe('refreshConfigAfterLogin', () => { + it('reports false without activating when no default model is configured', async () => { + const { host } = makeHost({ withSession: true }); + const authFlow = new AuthFlowController(host); + + const engineTrackedSwitch = await authFlow.refreshConfigAfterLogin(); + + expect(engineTrackedSwitch).toBe(false); + }); + + it('propagates the activation result for the persisted default model', async () => { + const live = makeHost({ withSession: true, defaultModel: 'k2' }); + const reachedLive = await new AuthFlowController(live.host).refreshConfigAfterLogin(); + expect(reachedLive).toBe(true); + expect(live.session!.setModel).toHaveBeenCalledWith('k2'); + + const lazy = makeHost({ engineV2: true, defaultModel: 'k2' }); + const reachedLazy = await new AuthFlowController(lazy.host).refreshConfigAfterLogin(); + expect(reachedLazy).toBe(false); + expect(lazy.host.harness.createSession).not.toHaveBeenCalled(); + }); +}); diff --git a/apps/kimi-code/test/tui/controllers/survey-controller.test.ts b/apps/kimi-code/test/tui/controllers/survey-controller.test.ts new file mode 100644 index 00000000000..b99c22b54be --- /dev/null +++ b/apps/kimi-code/test/tui/controllers/survey-controller.test.ts @@ -0,0 +1,1884 @@ +import { describe, expect, it, vi } from 'vitest'; + +import { GutterContainer } from '#/tui/components/chrome/gutter-container'; +import { + SurveyController, + type SurveyControllerDeps, + type SurveyHost, +} from '#/tui/controllers/survey-controller'; +import type { TranscriptEntry } from '#/tui/types'; +import { DEFAULT_SURVEY_POPUP_CONFIG } from '#/utils/survey-popup-config'; + +const mocks = vi.hoisted(() => ({ + getSurveyPopupConfig: vi.fn(() => Promise.resolve(undefined)), +})); + +vi.mock('#/utils/survey-popup-config', async (importOriginal) => { + const actual = await importOriginal(); + return { + ...actual, + getSurveyPopupConfig: mocks.getSurveyPopupConfig, + }; +}); + +const ESC = '\u001B'; +const CSI_LEFT = '\u001B[D'; +const CSI_RIGHT = '\u001B[C'; +const CSI_UP = '\u001B[A'; + +interface TimerDriver { + readonly setTimer: (fn: () => void, ms: number) => unknown; + readonly clearTimer: (handle: unknown) => void; + fire(ms: number): void; + pending(): number[]; +} + +function createTimerDriver(): TimerDriver { + interface Entry { + readonly id: number; + readonly fn: () => void; + readonly ms: number; + cleared: boolean; + } + const entries: Entry[] = []; + let nextId = 0; + return { + setTimer: (fn, ms) => { + nextId += 1; + entries.push({ id: nextId, fn, ms, cleared: false }); + return nextId; + }, + clearTimer: (handle) => { + const entry = entries.find((candidate) => candidate.id === handle); + if (entry !== undefined) entry.cleared = true; + }, + fire: (ms) => { + for (const entry of entries.splice(0)) { + if (!entry.cleared && entry.ms === ms) entry.fn(); + } + }, + pending: () => entries.filter((entry) => !entry.cleared).map((entry) => entry.ms), + }; +} + +interface Harness { + readonly controller: SurveyController; + readonly host: SurveyHost; + readonly container: GutterContainer; + readonly timers: TimerDriver; + readonly clock: { mono: number; wall: number }; + elapse(ms: number): void; + readonly track: ReturnType; + readonly editor: { + inputMode: 'prompt' | 'bash'; + autocompleteActive: boolean; + getText(): string; + setText(text: string): void; + }; + typeDigit(digit: string): void; + readonly state: SurveyHost['state']; + readonly writes: number[]; + readonly randomCalls: () => number; + flush(): Promise; + runTurns(count: number): void; + appear(): void; + renderSurvey(): string; +} + +function createHarness(deps: Partial = {}): Harness { + const clock = { mono: 0, wall: 1_700_000_000_000 }; + const timers = createTimerDriver(); + const track = vi.fn(); + const writes: number[] = []; + const container = new GutterContainer(1, 1); + let editorText = ''; + const editor = { + inputMode: 'prompt' as 'prompt' | 'bash', + autocompleteActive: false, + getText: () => editorText, + setText: (text: string) => { + editorText = text; + }, + hasAutocompleteActivity: () => editor.autocompleteActive, + }; + const state = { + surveyContainer: container, + transcriptEntries: [] as TranscriptEntry[], + editorReplacementMounted: false, + activeDialog: null, + livePane: { mode: 'idle', pendingApproval: null, pendingQuestion: null }, + externalEditorRunning: false, + tasksBrowser: undefined, + editor, + appState: { + model: 'k2', + streamingPhase: 'idle', + isCompacting: false, + contextTokens: 640, + cumulativeTokens: 1234, + permissionMode: 'manual', + thinkingEffort: 'high', + disableFeedbackSurvey: false, + }, + ui: { requestRender: vi.fn() }, + }; + let randomCallCount = 0; + let appearanceCounter = 0; + const { random: randomOverride, ...restDeps } = deps; + const host = { + state, + btwPanelController: { isActive: () => false }, + track, + } as unknown as SurveyHost; + const controller = new SurveyController(host, { + monotonicNow: () => clock.mono, + wallNow: () => clock.wall, + random: () => { + randomCallCount += 1; + return (randomOverride ?? (() => 0))(); + }, + appearanceId: () => { + appearanceCounter += 1; + return `appearance-${String(appearanceCounter)}`; + }, + setTimer: timers.setTimer, + clearTimer: timers.clearTimer, + terminalWidth: () => 120, + terminalHeight: () => 24, + configFresh: () => true, + readGlobalLastShown: async () => undefined, + writeGlobalLastShown: (wallTime) => { + writes.push(wallTime); + }, + ...restDeps, + }); + + const harness: Harness = { + controller, + host, + container, + timers, + clock, + track, + editor, + state: state as unknown as SurveyHost['state'], + writes, + randomCalls: () => randomCallCount, + elapse: (ms) => { + clock.mono += ms; + timers.fire(ms); + }, + flush: async () => { + await new Promise((resolve) => { + setImmediate(resolve); + }); + }, + runTurns: (count) => { + for (let turn = 1; turn <= count; turn++) { + controller.notifyTurnStarted(true); + controller.notifyTurnEnded(); + } + }, + appear: () => { + clock.mono += 600_000; + harness.runTurns(5); + harness.elapse(2000); + clock.mono += 600; + }, + typeDigit: (digit: string) => { + controller.handlePreInput(digit); + controller.handleEditorChange(digit); + }, + renderSurvey: () => + container + .render(120) + .join('\n') + .replaceAll(/\u001B\[[0-9;]*m/g, ''), + }; + return harness; +} + +function userEntry(content: string): TranscriptEntry { + return { id: content, kind: 'user', turnId: undefined, renderMode: 'plain', content }; +} + +const HARNESS_ENVIRONMENT = { + current_model: 'k2', + user_turn_count: 5, + cumulative_tokens: 1234, + virtual_context_tokens: 640, + tool_call_count: 0, + compaction_count: 0, + permission_mode: 'manual', + thinking_effort: 'high', +}; + +const DEFAULT_SNAPSHOT = { + config_probability: 0.005, + config_on_for_models: '*', + config_min_time_before_feedback_ms: 600_000, + config_min_user_turns_before_feedback: 5, + config_min_time_between_feedback_ms: 3_600_000, + config_min_user_turns_between_feedback: 10, + config_min_time_between_global_feedback_ms: 100_000_000, + config_long_context_survey_threshold: 200_000, + config_long_context_probability: 0.2, + config_long_context_trigger_mode: 'cumulative', +}; + +describe('SurveyController gating', () => { + it('appears once the session clears warmup and reports appeared', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + + expect(harness.renderSurvey()).toContain('How is Kimi doing this session? (optional)'); + expect(harness.renderSurvey()).toContain('1: Bad'); + expect(harness.track).toHaveBeenCalledTimes(1); + expect(harness.track).toHaveBeenCalledWith('feedback_survey', { + event_type: 'appeared', + appearance_id: 'appearance-1', + appearance_index: 1, + response: undefined, + ...HARNESS_ENVIRONMENT, + ...DEFAULT_SNAPSHOT, + }); + expect(harness.writes).toEqual([1_700_000_000_000]); + }); + + it('stays hidden during warmup and appears once it completes', async () => { + const harness = createHarness(); + await harness.flush(); + harness.clock.mono += 597_999; + harness.runTurns(5); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + }); + + it('stays hidden without enough user turns', async () => { + const harness = createHarness(); + await harness.flush(); + harness.clock.mono += 600_000; + harness.runTurns(4); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + }); + + it('stays hidden when sampled out', async () => { + const harness = createHarness({ random: () => 0.9 }); + await harness.flush(); + harness.appear(); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + }); + + it('stays hidden when telemetry is disabled', async () => { + const harness = createHarness({ telemetryDisabled: () => true }); + await harness.flush(); + harness.appear(); + expect(harness.container.children).toHaveLength(0); + }); + + it('stays hidden when the user disabled the survey', async () => { + const harness = createHarness({ feedbackSurveyDisabled: () => true }); + await harness.flush(); + harness.appear(); + expect(harness.container.children).toHaveLength(0); + }); + + it('stays hidden inside the persisted global cooldown', async () => { + const harness = createHarness({ + readGlobalLastShown: async () => 1_700_000_000_000 - 1000, + }); + await harness.flush(); + harness.appear(); + expect(harness.container.children).toHaveLength(0); + }); + + it('stays hidden while the latest user message opens an ordered list', async () => { + const harness = createHarness(); + await harness.flush(); + harness.state.transcriptEntries.push(userEntry('1. first item')); + harness.appear(); + expect(harness.container.children).toHaveLength(0); + }); + + it('stays hidden while a btw panel is active', async () => { + const harness = createHarness(); + (harness.host.btwPanelController as { isActive: () => boolean }).isActive = () => true; + await harness.flush(); + harness.appear(); + expect(harness.container.children).toHaveLength(0); + }); + + it('stays hidden while an editor replacement is mounted', async () => { + const harness = createHarness(); + harness.state.editorReplacementMounted = true; + await harness.flush(); + harness.appear(); + expect(harness.container.children).toHaveLength(0); + }); + + it('cancels a pending evaluation when a new turn starts', async () => { + const harness = createHarness(); + await harness.flush(); + harness.clock.mono += 600_000; + harness.runTurns(4); + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.controller.notifyTurnStarted(true); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + }); + + it('does not arm the idle evaluation when a cron turn ends on its own', async () => { + const harness = createHarness(); + await harness.flush(); + harness.clock.mono += 600_000; + harness.controller.notifyTurnStarted(false); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + + harness.runTurns(5); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'appeared' }), + ); + }); + + it('re-arms the pending evaluation after non-user continuation turns end', async () => { + const harness = createHarness(); + await harness.flush(); + harness.clock.mono += 600_000; + harness.runTurns(4); + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + + harness.controller.notifyTurnStarted(false); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + }); + + it('keeps one sample per user turn across evaluations', async () => { + const harness = createHarness({ random: () => 0.9 }); + await harness.flush(); + harness.clock.mono += 600_000; + harness.runTurns(5); + harness.elapse(2000); + harness.controller.notifyTurnStarted(false); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + expect(harness.randomCalls()).toBe(1); + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + expect(harness.randomCalls()).toBe(2); + }); + + it('paces the second appearance by time and turns, and bumps appearance_index', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.controller.handlePreInput(ESC); + expect(harness.container.children).toHaveLength(0); + + harness.runTurns(5); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + + harness.clock.mono += 3_600_000; + harness.clock.wall += 100_000_000; + harness.runTurns(10); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + expect(harness.track).toHaveBeenLastCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'appeared', appearance_index: 2 }), + ); + }); +}); + +describe('SurveyController long-context arm', () => { + it('shows the long-context survey over the cumulative threshold without any warmup', async () => { + const harness = createHarness(); + harness.state.appState.cumulativeTokens = 250_000; + await harness.flush(); + + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + + expect(harness.renderSurvey()).toContain('How is Kimi doing this session? (optional)'); + expect(harness.track).toHaveBeenCalledTimes(1); + expect(harness.track).toHaveBeenCalledWith('long_context_survey', { + event_type: 'appeared', + appearance_id: 'appearance-1', + appearance_index: 1, + response: undefined, + current_model: 'k2', + user_turn_count: 1, + cumulative_tokens: 250_000, + virtual_context_tokens: 640, + tool_call_count: 0, + compaction_count: 0, + permission_mode: 'manual', + thinking_effort: 'high', + ...DEFAULT_SNAPSHOT, + }); + expect(harness.writes).toEqual([]); + }); + + it('reports the responded and abandoned states under the long_context_survey name', async () => { + const responded = createHarness(); + responded.state.appState.cumulativeTokens = 250_000; + await responded.flush(); + responded.controller.notifyTurnStarted(true); + responded.controller.notifyTurnEnded(); + responded.elapse(2000); + responded.clock.mono += 600; + + responded.typeDigit('2'); + responded.elapse(400); + responded.elapse(3000); + expect(responded.track).toHaveBeenCalledWith( + 'long_context_survey', + expect.objectContaining({ + event_type: 'responded', + response: 'fine', + appearance_id: 'appearance-1', + }), + ); + + const abandoned = createHarness(); + abandoned.state.appState.cumulativeTokens = 250_000; + await abandoned.flush(); + abandoned.controller.notifyTurnStarted(true); + abandoned.controller.notifyTurnEnded(); + abandoned.elapse(2000); + abandoned.clock.mono += 600; + + abandoned.controller.handleEditorChange('hello'); + expect(abandoned.track).toHaveBeenCalledWith( + 'long_context_survey', + expect.objectContaining({ event_type: 'abandoned', appearance_id: 'appearance-1' }), + ); + }); + + it('prefers the long-context survey when the session arm is also eligible', async () => { + const harness = createHarness(); + harness.state.appState.cumulativeTokens = 250_000; + await harness.flush(); + + harness.appear(); + + expect(harness.track).toHaveBeenCalledTimes(1); + expect(harness.track).toHaveBeenCalledWith( + 'long_context_survey', + expect.objectContaining({ event_type: 'appeared', appearance_index: 1 }), + ); + }); + + it('compares the cumulative counter by default and ignores the window occupancy', async () => { + const harness = createHarness(); + harness.state.appState.contextTokens = 500_000; + await harness.flush(); + + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + }); + + it('compares the window occupancy when the trigger mode is virtual_context', async () => { + const harness = createHarness({ + config: () => ({ + ...DEFAULT_SURVEY_POPUP_CONFIG, + long_context_trigger_mode: 'virtual_context', + }), + }); + harness.state.appState.contextTokens = 250_000; + await harness.flush(); + + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + + expect(harness.track).toHaveBeenCalledWith( + 'long_context_survey', + expect.objectContaining({ + event_type: 'appeared', + cumulative_tokens: 1234, + virtual_context_tokens: 250_000, + config_long_context_trigger_mode: 'virtual_context', + }), + ); + }); + + it('closes the arm on a non-positive effective threshold and produces no events', async () => { + const harness = createHarness({ + config: () => ({ ...DEFAULT_SURVEY_POPUP_CONFIG, long_context_survey_threshold: 0 }), + }); + harness.state.appState.cumulativeTokens = 500_000; + await harness.flush(); + + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + }); + + it('leaves the session arm running when the threshold closes the long-context arm', async () => { + const harness = createHarness({ + config: () => ({ ...DEFAULT_SURVEY_POPUP_CONFIG, long_context_survey_threshold: 0 }), + }); + harness.state.appState.cumulativeTokens = 500_000; + await harness.flush(); + + harness.appear(); + + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'appeared', config_long_context_survey_threshold: 0 }), + ); + }); + + it('stays hidden when the long-context roll misses, and never rolls again this mount', async () => { + const harness = createHarness({ random: () => 0.9 }); + harness.state.appState.cumulativeTokens = 250_000; + await harness.flush(); + + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + expect(harness.randomCalls()).toBe(2); + + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + expect(harness.randomCalls()).toBe(3); + }); + + it('shows at most once per mount even after the first appearance closes', async () => { + const harness = createHarness(); + harness.state.appState.cumulativeTokens = 250_000; + await harness.flush(); + + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + expect(harness.track).toHaveBeenCalledWith( + 'long_context_survey', + expect.objectContaining({ event_type: 'appeared' }), + ); + + harness.clock.mono += 600; + harness.controller.handlePreInput(ESC); + expect(harness.container.children).toHaveLength(0); + + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + + const appeared = harness.track.mock.calls.filter( + (call) => (call[1] as { event_type?: string }).event_type === 'appeared', + ); + expect(appeared).toHaveLength(1); + }); + + it('regains its one chance after a session reset', async () => { + let roll = 0.9; + const harness = createHarness({ random: () => roll }); + harness.state.appState.cumulativeTokens = 250_000; + await harness.flush(); + + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + + roll = 0.1; + harness.controller.reset(); + await harness.flush(); + + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + expect(harness.track).toHaveBeenCalledWith( + 'long_context_survey', + expect.objectContaining({ event_type: 'appeared', appearance_index: 1 }), + ); + expect(harness.writes).toEqual([]); + }); + + it('does not spend the roll while an active prompt suppresses the evaluation', async () => { + const harness = createHarness(); + harness.state.appState.cumulativeTokens = 250_000; + (harness.host.btwPanelController as { isActive: () => boolean }).isActive = () => true; + await harness.flush(); + + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + expect(harness.randomCalls()).toBe(1); + + (harness.host.btwPanelController as { isActive: () => boolean }).isActive = () => false; + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + expect(harness.track).toHaveBeenCalledWith( + 'long_context_survey', + expect.objectContaining({ event_type: 'appeared' }), + ); + }); + + it('evaluates only after the mount produced a user turn, even with tokens past the threshold', async () => { + const harness = createHarness(); + harness.state.appState.cumulativeTokens = 250_000; + await harness.flush(); + + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + + harness.controller.notifyTurnStarted(false); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + expect(harness.track).toHaveBeenCalledWith( + 'long_context_survey', + expect.objectContaining({ event_type: 'appeared' }), + ); + }); + + it('ignores the persisted global cooldown that gates the session arm', async () => { + const harness = createHarness({ + readGlobalLastShown: async () => 1_700_000_000_000 - 1000, + }); + harness.state.appState.cumulativeTokens = 250_000; + await harness.flush(); + + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + + expect(harness.track).toHaveBeenCalledWith( + 'long_context_survey', + expect.objectContaining({ event_type: 'appeared' }), + ); + expect(harness.writes).toEqual([]); + }); + + it('does not suppress the session arm through the persisted cooldown after a long-context appearance', async () => { + const harness = createHarness(); + harness.state.appState.cumulativeTokens = 250_000; + await harness.flush(); + + harness.controller.notifyTurnStarted(true); + harness.controller.notifyTurnEnded(); + harness.elapse(2000); + expect(harness.track).toHaveBeenCalledWith( + 'long_context_survey', + expect.objectContaining({ event_type: 'appeared' }), + ); + harness.clock.mono += 600; + harness.controller.handlePreInput(ESC); + expect(harness.writes).toEqual([]); + + harness.clock.mono += 3_600_000; + harness.runTurns(10); + harness.elapse(2000); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'appeared' }), + ); + expect(harness.writes).toEqual([1_700_000_000_000]); + }); +}); + +describe('SurveyController interaction', () => { + it('selects a rating after the digit debounce and walks pending → thanks → closed', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.track.mockClear(); + + harness.editor.setText('2'); + harness.typeDigit('2'); + harness.typeDigit('2'); + harness.elapse(400); + + expect(harness.track).not.toHaveBeenCalled(); + expect(harness.editor.getText()).toBe(''); + expect(harness.renderSurvey()).toContain('Feedback: Fine · [escape: undo]'); + + harness.elapse(3000); + expect(harness.track).toHaveBeenCalledWith('feedback_survey', { + event_type: 'responded', + appearance_id: 'appearance-1', + appearance_index: 1, + response: 'fine', + ...HARNESS_ENVIRONMENT, + ...DEFAULT_SNAPSHOT, + }); + expect(harness.renderSurvey()).toContain('Thanks for your feedback!'); + + harness.elapse(5000); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).toHaveBeenCalledTimes(1); + }); + + it('cancels a pending digit selection when the edit continues', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.typeDigit('1'); + harness.controller.handleEditorChange(''); + harness.elapse(400); + expect(harness.container.children).not.toHaveLength(0); + expect(harness.track).toHaveBeenCalledTimes(1); + }); + + it('undo cancels the pending report, and a re-choice reports only the final rating', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.track.mockClear(); + + harness.typeDigit('1'); + harness.elapse(400); + expect(harness.controller.handlePreInput(ESC)).toBe(true); + expect(harness.renderSurvey()).toContain('How is Kimi doing this session? (optional)'); + harness.elapse(3000); + expect(harness.track).not.toHaveBeenCalled(); + + harness.typeDigit('3'); + harness.elapse(400); + harness.elapse(3000); + + const responses = harness.track.mock.calls.map( + (call) => (call[1] as { response?: string }).response, + ); + expect(responses).toEqual(['good']); + expect(harness.track.mock.calls[0]![1]).toMatchObject({ appearance_id: 'appearance-1' }); + }); + + it('Esc dismisses without thanks', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.track.mockClear(); + + expect(harness.controller.handlePreInput(ESC)).toBe(true); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).toHaveBeenCalledTimes(1); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'responded', response: 'dismissed' }), + ); + expect(harness.timers.pending()).toHaveLength(0); + }); + + it('digit 0 dismisses without thanks and clears the editor', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.editor.setText('0'); + harness.typeDigit('0'); + harness.elapse(400); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'responded', response: 'dismissed' }), + ); + expect(harness.editor.getText()).toBe(''); + expect(harness.container.children).toHaveLength(0); + }); + + it('abandons on non-option input', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.track.mockClear(); + + harness.controller.handleEditorChange('hello'); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'abandoned' }), + ); + }); + + it('preserves the pre-existing draft snapshot through the editor pre-submit clear', async () => { + const harness = createHarness(); + await harness.flush(); + harness.editor.setText('2'); + harness.appear(); + harness.track.mockClear(); + + harness.controller.handleEditorChange(''); + expect(harness.controller.handleSubmit('2')).toBe(false); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'abandoned' }), + ); + }); + + it('treats a digit retyped after deleting the snapshot draft as fresh input', async () => { + const harness = createHarness(); + await harness.flush(); + harness.editor.setText('2'); + harness.appear(); + + harness.controller.handleEditorChange(''); + harness.controller.handlePreInput('2'); + harness.editor.setText('2'); + harness.controller.handleEditorChange('2'); + expect(harness.timers.pending()).toHaveLength(1); + }); + + it('lets a pre-existing digit draft submit instead of treating it as a rating', async () => { + const harness = createHarness(); + await harness.flush(); + harness.editor.setText('2'); + harness.appear(); + harness.track.mockClear(); + + harness.controller.handleEditorChange('2'); + harness.elapse(400); + expect(harness.track).not.toHaveBeenCalled(); + + expect(harness.controller.handleSubmit('2')).toBe(false); + expect(harness.editor.getText()).toBe('2'); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'abandoned' }), + ); + }); + + it('intercepts a lone digit submit as a selection instead of sending', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.editor.setText('1'); + + expect(harness.controller.handleSubmit('1')).toBe(true); + harness.elapse(3000); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'responded', response: 'bad' }), + ); + expect(harness.editor.getText()).toBe(''); + }); + + it('lets other submissions through and abandons the survey', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + + expect(harness.controller.handleSubmit('hello')).toBe(false); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'abandoned' }), + ); + }); + + it('ignores all input during the mount protection window', async () => { + const harness = createHarness(); + await harness.flush(); + harness.clock.mono += 600_000; + harness.runTurns(5); + harness.elapse(2000); + + expect(harness.controller.handlePreInput('1')).toBe(false); + harness.editor.setText('1'); + harness.controller.handleEditorChange('1'); + expect(harness.timers.pending()).toHaveLength(0); + expect(harness.container.children).not.toHaveLength(0); + expect(harness.controller.handlePreInput(ESC)).toBe(false); + expect(harness.controller.handleSubmit('1')).toBe(false); + + harness.clock.mono += 600; + harness.typeDigit('1'); + harness.elapse(400); + harness.elapse(3000); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'responded', response: 'bad' }), + ); + }); + + it('abandons when a yank injects a lone digit during the mount window', async () => { + const harness = createHarness(); + await harness.flush(); + harness.clock.mono += 600_000; + harness.runTurns(5); + harness.elapse(2000); + harness.track.mockClear(); + + expect(harness.controller.handlePreInput('\u0019')).toBe(false); + harness.editor.setText('2'); + harness.controller.handleEditorChange('2'); + + expect(harness.container.children).toHaveLength(0); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'abandoned' }), + ); + }); + + it('abandons when history recall injects a digit during the mount window', async () => { + const harness = createHarness(); + await harness.flush(); + harness.clock.mono += 600_000; + harness.runTurns(5); + harness.elapse(2000); + harness.track.mockClear(); + + expect(harness.controller.handlePreInput(CSI_UP)).toBe(false); + harness.editor.setText('2'); + harness.controller.handleEditorChange('2'); + + expect(harness.container.children).toHaveLength(0); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'abandoned' }), + ); + }); + + it('moves the hover with arrow keys and confirms with Enter', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + + expect(harness.controller.handlePreInput(CSI_RIGHT)).toBe(true); + expect(harness.controller.handlePreInput(CSI_RIGHT)).toBe(true); + expect(harness.controller.handleSubmit('')).toBe(true); + harness.elapse(3000); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'responded', response: 'fine' }), + ); + }); + + it('wraps the hover backwards from nothing to Dismiss', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + + expect(harness.controller.handlePreInput(CSI_LEFT)).toBe(true); + expect(harness.controller.handleSubmit('')).toBe(true); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'responded', response: 'dismissed' }), + ); + }); + + it('abandons instead of rating when history recall replaces a draft at column zero', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.editor.setText('draft'); + harness.track.mockClear(); + + expect(harness.controller.handlePreInput(CSI_UP)).toBe(false); + harness.editor.setText('2'); + harness.controller.handleEditorChange('2'); + + expect(harness.container.children).toHaveLength(0); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'abandoned' }), + ); + }); + + it('debounces a digit that arrives as a CSI-u sequence', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + + expect(harness.controller.handlePreInput('\u001B[49u')).toBe(false); + harness.editor.setText('1'); + harness.controller.handleEditorChange('1'); + expect(harness.timers.pending()).toHaveLength(1); + harness.elapse(400); + harness.elapse(3000); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'responded', response: 'bad' }), + ); + }); + + it('debounces a typed digit even right after an Up cursor move', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.editor.setText('draft'); + + expect(harness.controller.handlePreInput(CSI_UP)).toBe(false); + expect(harness.controller.handlePreInput('2')).toBe(false); + harness.editor.setText('2'); + harness.controller.handleEditorChange('2'); + expect(harness.timers.pending()).toHaveLength(1); + harness.elapse(400); + harness.elapse(3000); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'responded', response: 'fine' }), + ); + }); + + it('abandons instead of rating when history recall injects a lone digit', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.track.mockClear(); + + expect(harness.controller.handlePreInput(CSI_UP)).toBe(false); + harness.editor.setText('2'); + harness.controller.handleEditorChange('2'); + + expect(harness.container.children).toHaveLength(0); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'abandoned' }), + ); + harness.elapse(400); + expect(harness.track).toHaveBeenCalledTimes(1); + }); + + it('abandons instead of rating when a kill-ring yank injects a lone digit', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.track.mockClear(); + + expect(harness.controller.handlePreInput('\u0019')).toBe(false); + harness.editor.setText('2'); + harness.controller.handleEditorChange('2'); + + expect(harness.container.children).toHaveLength(0); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'abandoned' }), + ); + }); + + it('abandons instead of rating when a paste injects a lone digit', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.track.mockClear(); + + expect(harness.controller.handlePreInput('\u001B[200~2\u001B[201~')).toBe(false); + harness.editor.setText('2'); + harness.controller.handleEditorChange('2'); + + expect(harness.container.children).toHaveLength(0); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'abandoned' }), + ); + harness.elapse(400); + expect(harness.track).toHaveBeenCalledTimes(1); + }); + + it('lets arrow keys through to the editor when a draft exists', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.editor.setText('draft'); + + expect(harness.controller.handlePreInput(CSI_RIGHT)).toBe(false); + expect(harness.controller.handlePreInput(CSI_LEFT)).toBe(false); + expect(harness.controller.handleSubmit('')).toBe(false); + expect(harness.track).toHaveBeenCalledTimes(1); + }); + + it('clears the hover when the survey closes so a later appearance starts clean', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + expect(harness.controller.handlePreInput(CSI_RIGHT)).toBe(true); + harness.controller.handlePreInput(ESC); + expect(harness.container.children).toHaveLength(0); + + harness.clock.mono += 3_600_000; + harness.clock.wall += 100_000_000; + harness.runTurns(10); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + + harness.track.mockClear(); + expect(harness.controller.handleSubmit('')).toBe(false); + expect(harness.track).not.toHaveBeenCalled(); + }); + + it('reports the settled rating with the turn count of the turn it was made in', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.typeDigit('1'); + harness.elapse(400); + harness.track.mockClear(); + + harness.controller.notifyTurnStarted(true); + + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'responded', user_turn_count: 5 }), + ); + }); + + it('settles the pending rating when a turn starts inside the undo window', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.typeDigit('1'); + harness.elapse(400); + harness.track.mockClear(); + + harness.controller.notifyTurnStarted(true); + + expect(harness.container.children).toHaveLength(0); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'responded', response: 'bad' }), + ); + expect(harness.timers.pending()).toHaveLength(0); + }); + + it('closes silently when a turn starts while open', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.track.mockClear(); + + harness.controller.notifyTurnStarted(true); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + }); + + it('closes silently on a gate flip (editor replacement) without reporting', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.track.mockClear(); + + harness.controller.closeSilently(); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + }); + + it('treats bash-mode input as non-option input', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.editor.inputMode = 'bash'; + + harness.typeDigit('1'); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'abandoned' }), + ); + }); + + it('sweeps the survey away as abandoned when the editor enters bash mode', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.track.mockClear(); + + harness.editor.inputMode = 'bash'; + harness.controller.notifyInputModeChanged('bash'); + + expect(harness.container.children).toHaveLength(0); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'abandoned' }), + ); + expect(harness.controller.handlePreInput(ESC)).toBe(false); + }); + + it('does not open while the external editor is running, on either arm', async () => { + const harness = createHarness(); + harness.state.appState.cumulativeTokens = 250_000; + await harness.flush(); + harness.clock.mono += 600_000; + harness.state.externalEditorRunning = true; + harness.runTurns(5); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + + harness.state.externalEditorRunning = false; + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + expect(harness.track).toHaveBeenCalledWith( + 'long_context_survey', + expect.objectContaining({ event_type: 'appeared' }), + ); + }); + + it('does not open while the tasks browser takeover is active', async () => { + const harness = createHarness(); + await harness.flush(); + harness.clock.mono += 600_000; + harness.state.tasksBrowser = {} as never; + harness.runTurns(5); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + + harness.state.tasksBrowser = undefined; + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + }); + + it('does not select a hovered option with Enter after the terminal narrows', async () => { + let width = 120; + const harness = createHarness({ terminalWidth: () => width }); + await harness.flush(); + harness.appear(); + expect(harness.controller.handlePreInput(CSI_RIGHT)).toBe(true); + harness.track.mockClear(); + + width = 8; + expect(harness.controller.handleSubmit('')).toBe(false); + expect(harness.track).not.toHaveBeenCalled(); + expect(harness.container.children).not.toHaveLength(0); + }); + + it('does not fire a pending digit selection after the terminal narrows', async () => { + let width = 120; + const harness = createHarness({ terminalWidth: () => width }); + await harness.flush(); + harness.appear(); + harness.editor.setText('2'); + harness.typeDigit('2'); + harness.track.mockClear(); + + width = 8; + harness.elapse(400); + expect(harness.track).not.toHaveBeenCalled(); + expect(harness.editor.getText()).toBe('2'); + expect(harness.container.children).not.toHaveLength(0); + }); + + it('lets Escape undo a pending rating even after the terminal narrows', async () => { + let width = 120; + const harness = createHarness({ terminalWidth: () => width }); + await harness.flush(); + harness.appear(); + harness.typeDigit('2'); + harness.elapse(400); + harness.track.mockClear(); + + width = 8; + expect(harness.controller.handlePreInput(ESC)).toBe(true); + harness.elapse(3000); + expect(harness.track).not.toHaveBeenCalled(); + expect(harness.renderSurvey()).toContain('How is Kimi doing this session? (optional)'); + }); + + it('does not open when the terminal is shorter than the survey needs', async () => { + let height = 24; + const harness = createHarness({ terminalHeight: () => height }); + await harness.flush(); + harness.clock.mono += 600_000; + height = 7; + harness.runTurns(5); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + + height = 8; + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + }); + + it('requires more height when a narrow terminal wraps the survey title', async () => { + let height = 24; + const harness = createHarness({ terminalWidth: () => 14, terminalHeight: () => height }); + await harness.flush(); + harness.clock.mono += 600_000; + height = 14; + harness.runTurns(5); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + + height = 15; + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + }); + + it('counts word-wrapped title rows instead of dividing characters', async () => { + let height = 24; + const harness = createHarness({ terminalWidth: () => 18, terminalHeight: () => height }); + await harness.flush(); + harness.clock.mono += 600_000; + height = 13; + harness.runTurns(5); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + + height = 14; + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + }); + + it('passes keys through when the terminal shrinks in height while open', async () => { + let height = 24; + const harness = createHarness({ terminalHeight: () => height }); + await harness.flush(); + harness.appear(); + harness.track.mockClear(); + + height = 6; + expect(harness.controller.handlePreInput(ESC)).toBe(false); + expect(harness.track).not.toHaveBeenCalled(); + expect(harness.container.children).not.toHaveLength(0); + }); + + it('does not open when the terminal is narrower than the option legend', async () => { + let width = 120; + const harness = createHarness({ terminalWidth: () => width }); + await harness.flush(); + harness.clock.mono += 600_000; + width = 13; + harness.runTurns(5); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + + width = 14; + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + }); + + it('passes keys through when the terminal is narrowed below the legend width while open', async () => { + let width = 120; + const harness = createHarness({ terminalWidth: () => width }); + await harness.flush(); + harness.appear(); + harness.track.mockClear(); + + width = 8; + expect(harness.controller.handlePreInput(ESC)).toBe(false); + expect(harness.track).not.toHaveBeenCalled(); + expect(harness.container.children).not.toHaveLength(0); + }); + + it('does not open while autocomplete is active, and Esc passes through to it', async () => { + const harness = createHarness(); + await harness.flush(); + harness.clock.mono += 600_000; + harness.editor.autocompleteActive = true; + harness.runTurns(5); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + + harness.editor.autocompleteActive = false; + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + + harness.editor.autocompleteActive = true; + harness.track.mockClear(); + expect(harness.controller.handlePreInput(ESC)).toBe(false); + expect(harness.container.children).not.toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + }); + + it('does not open while the editor is in bash mode', async () => { + const harness = createHarness(); + await harness.flush(); + harness.clock.mono += 600_000; + harness.editor.inputMode = 'bash'; + harness.runTurns(5); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + + harness.editor.inputMode = 'prompt'; + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + }); + + it('settles and closes a pending rating when the editor enters bash mode', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.typeDigit('2'); + harness.elapse(400); + harness.track.mockClear(); + + harness.editor.inputMode = 'bash'; + harness.controller.notifyInputModeChanged('bash'); + + expect(harness.container.children).toHaveLength(0); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'responded', response: 'fine' }), + ); + expect(harness.controller.handlePreInput(ESC)).toBe(false); + }); + + it('closes the thanks state silently when the editor enters bash mode', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.typeDigit('2'); + harness.elapse(400); + harness.elapse(3000); + expect(harness.renderSurvey()).toContain('Thanks for your feedback!'); + harness.track.mockClear(); + + harness.editor.inputMode = 'bash'; + harness.controller.notifyInputModeChanged('bash'); + + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + expect(harness.controller.handlePreInput(ESC)).toBe(false); + }); + + it('defers evaluation until the persisted cooldown read settles, then honors it', async () => { + let settleRead!: () => void; + const harness = createHarness({ + readGlobalLastShown: () => + new Promise((resolve) => { + settleRead = () => { + resolve(1_700_000_000_000); + }; + }), + }); + await harness.flush(); + harness.clock.mono += 600_000; + harness.runTurns(5); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + + settleRead(); + await harness.flush(); + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + }); + + it('keeps the just-written global cooldown across a reset', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + expect(harness.writes).toEqual([1_700_000_000_000]); + harness.track.mockClear(); + + harness.controller.reset(); + await harness.flush(); + + harness.clock.wall += 1; + harness.clock.mono += 600_000; + harness.runTurns(5); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + }); + + it('takes the newer of the in-memory and reloaded cooldown timestamps', async () => { + let diskValue: number | undefined = 1_600_000_000_000; + const harness = createHarness({ readGlobalLastShown: async () => diskValue }); + await harness.flush(); + harness.appear(); + expect(harness.writes).toEqual([1_700_000_000_000]); + harness.track.mockClear(); + + diskValue = 1_650_000_000_000; + harness.controller.reset(); + await harness.flush(); + + harness.clock.wall += 1; + harness.clock.mono += 600_000; + harness.runTurns(5); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + }); + + it('resets in-session pacing on session reset', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.controller.reset(); + await harness.flush(); + + harness.runTurns(5); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + }); + + it('stays hidden when the appState mirror disables the survey', async () => { + const harness = createHarness(); + harness.state.appState.disableFeedbackSurvey = true; + await harness.flush(); + harness.appear(); + expect(harness.container.children).toHaveLength(0); + }); +}); + +describe('SurveyController event payload', () => { + it('reports the live session statistics and the current model', async () => { + const harness = createHarness(); + await harness.flush(); + harness.state.appState.model = 'k3'; + harness.clock.mono += 600_000; + for (let turn = 1; turn <= 5; turn++) { + harness.controller.notifyTurnStarted(true); + harness.controller.notifyToolCallStarted(); + harness.controller.notifyToolCallStarted(); + harness.controller.notifyTurnEnded(); + } + harness.controller.notifyToolCallStarted(); + harness.elapse(2000); + + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ + current_model: 'k3', + user_turn_count: 5, + cumulative_tokens: 1234, + virtual_context_tokens: 640, + tool_call_count: 11, + permission_mode: 'manual', + }), + ); + }); + + it('counts finished compactions since mount and resets on remount', async () => { + const harness = createHarness(); + await harness.flush(); + harness.controller.notifyCompactionFinished(); + harness.controller.notifyCompactionFinished(); + harness.appear(); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ compaction_count: 2, thinking_effort: 'high' }), + ); + + harness.controller.reset(); + await harness.flush(); + harness.clock.wall += 100_000_000; + harness.appear(); + expect(harness.track).toHaveBeenLastCalledWith( + 'feedback_survey', + expect.objectContaining({ compaction_count: 0 }), + ); + }); + + it('snapshots the config that produced the appearance, not a later refresh', async () => { + let cloudConfig = { ...DEFAULT_SURVEY_POPUP_CONFIG, probability: 0.5 }; + const harness = createHarness({ config: () => cloudConfig }); + await harness.flush(); + harness.appear(); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'appeared', config_probability: 0.5 }), + ); + + cloudConfig = { ...cloudConfig, probability: 0.9 }; + harness.typeDigit('1'); + harness.elapse(400); + harness.elapse(3000); + expect(harness.track).toHaveBeenLastCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'responded', config_probability: 0.5 }), + ); + }); + + it('cancels the pending digit selection when a cursor key passes through to the draft', async () => { + const harness = createHarness(); + await harness.flush(); + harness.appear(); + harness.editor.setText('2'); + harness.typeDigit('2'); + + expect(harness.controller.handlePreInput(CSI_LEFT)).toBe(false); + harness.elapse(400); + expect(harness.track).toHaveBeenCalledTimes(1); + expect(harness.editor.getText()).toBe('2'); + expect(harness.container.children).not.toHaveLength(0); + }); + + it('keeps deferring while a region-change refresh is still in flight', async () => { + let region = 'region-a'; + let settle!: () => void; + let first = true; + const harness = createHarness({ + configRegion: () => region, + refreshConfig: () => { + if (first) { + first = false; + return undefined; + } + return new Promise((resolve) => { + settle = resolve; + }); + }, + }); + await harness.flush(); + harness.clock.mono += 600_000; + harness.runTurns(4); + + region = 'region-b'; + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + + settle(); + await harness.flush(); + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + }); + + it('defers evaluation until the startup refresh settles', async () => { + let settle!: () => void; + const harness = createHarness({ + refreshConfig: () => + new Promise((resolve) => { + settle = resolve; + }), + }); + await harness.flush(); + harness.clock.mono += 600_000; + harness.runTurns(5); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + + settle(); + await harness.flush(); + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + }); + + it('refreshes and defers when the config cache has gone stale', async () => { + let fresh = true; + const refreshConfig = vi.fn(() => { + fresh = true; + }); + const harness = createHarness({ configFresh: () => fresh, refreshConfig }); + await harness.flush(); + harness.clock.mono += 600_000; + harness.runTurns(4); + expect(harness.container.children).toHaveLength(0); + + fresh = false; + harness.clock.mono += 3_600_000; + harness.runTurns(1); + harness.elapse(2000); + expect(refreshConfig).toHaveBeenCalledTimes(2); + expect(harness.container.children).toHaveLength(0); + + await harness.flush(); + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + }); + + it('defers the evaluation that triggers a refresh so a stale policy cannot open the survey', async () => { + let region = 'region-a'; + let config = { ...DEFAULT_SURVEY_POPUP_CONFIG, probability: 1 }; + const refreshConfig = vi.fn(() => { + config = { ...config, probability: 0 }; + }); + const harness = createHarness({ + configRegion: () => region, + config: () => config, + refreshConfig, + random: () => 0.9, + }); + await harness.flush(); + harness.clock.mono += 600_000; + harness.runTurns(4); + + region = 'region-b'; + harness.runTurns(1); + harness.elapse(2000); + expect(refreshConfig).toHaveBeenCalledTimes(2); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + expect(harness.track).not.toHaveBeenCalled(); + }); + + it('evaluates with the refreshed policy on the next turn after the deferred evaluation', async () => { + let region = 'region-a'; + let config = { ...DEFAULT_SURVEY_POPUP_CONFIG, probability: 1, on_for_models: ['other-model'] }; + const refreshConfig = vi.fn(() => { + config = { ...config, on_for_models: ['*'] }; + }); + const harness = createHarness({ + configRegion: () => region, + config: () => config, + refreshConfig, + }); + await harness.flush(); + harness.clock.mono += 600_000; + harness.runTurns(4); + + region = 'region-b'; + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).toHaveLength(0); + + await harness.flush(); + harness.runTurns(1); + harness.elapse(2000); + expect(harness.container.children).not.toHaveLength(0); + expect(harness.track).toHaveBeenCalledWith( + 'feedback_survey', + expect.objectContaining({ event_type: 'appeared', config_on_for_models: '*' }), + ); + }); + + it('re-refreshes the cloud config when the region changes', async () => { + let region = 'region-a'; + const refreshConfig = vi.fn(); + const harness = createHarness({ refreshConfig, configRegion: () => region }); + await harness.flush(); + expect(refreshConfig).toHaveBeenCalledTimes(1); + + region = 'region-b'; + harness.runTurns(1); + harness.elapse(2000); + expect(refreshConfig).toHaveBeenCalledTimes(2); + }); + + it('re-refreshes the cloud config once the previous refresh is over an hour old', async () => { + const refreshConfig = vi.fn(); + const harness = createHarness({ refreshConfig }); + await harness.flush(); + expect(refreshConfig).toHaveBeenCalledTimes(1); + + harness.clock.mono += 3_597_000; + harness.runTurns(1); + harness.elapse(2000); + expect(refreshConfig).toHaveBeenCalledTimes(1); + + harness.clock.mono += 2_000; + harness.runTurns(1); + harness.elapse(2000); + expect(refreshConfig).toHaveBeenCalledTimes(2); + }); + + it('applies the cloud model gate at evaluation time', async () => { + const harness = createHarness({ + config: () => ({ ...DEFAULT_SURVEY_POPUP_CONFIG, on_for_models: ['other-model'] }), + }); + await harness.flush(); + harness.appear(); + expect(harness.container.children).toHaveLength(0); + }); +}); + +describe('SurveyController cloud config refresh', () => { + it('fires the injected refresh once at mount and not on session reset', async () => { + const refreshConfig = vi.fn(); + const harness = createHarness({ refreshConfig }); + await harness.flush(); + expect(refreshConfig).toHaveBeenCalledTimes(1); + + harness.controller.reset(); + expect(refreshConfig).toHaveBeenCalledTimes(1); + }); + + it('resolves the access token before refreshing the named config', async () => { + mocks.getSurveyPopupConfig.mockClear(); + const harness = createHarness({ accessToken: async () => 'tok' }); + await harness.flush(); + expect(mocks.getSurveyPopupConfig).toHaveBeenCalledWith({ + accessToken: 'tok', + }); + }); + + it('refreshes anonymously when no token is cached', async () => { + mocks.getSurveyPopupConfig.mockClear(); + const harness = createHarness({ accessToken: async () => undefined }); + await harness.flush(); + expect(mocks.getSurveyPopupConfig).toHaveBeenCalledWith({ + accessToken: undefined, + }); + }); + + it.each([ + [ + 'rejects', + async (): Promise => { + throw new Error('no facade'); + }, + ], + [ + 'throws synchronously', + () => { + throw new Error('no facade'); + }, + ], + ])('skips the fetch when the token provider %s', async (_kind, accessToken) => { + mocks.getSurveyPopupConfig.mockClear(); + const harness = createHarness({ + accessToken: accessToken as () => Promise, + }); + await harness.flush(); + expect(mocks.getSurveyPopupConfig).not.toHaveBeenCalled(); + }); + + it('does not fetch without a token provider', async () => { + mocks.getSurveyPopupConfig.mockClear(); + const harness = createHarness(); + await harness.flush(); + expect(mocks.getSurveyPopupConfig).not.toHaveBeenCalled(); + }); +}); diff --git a/apps/kimi-code/test/tui/utils/survey-policy.test.ts b/apps/kimi-code/test/tui/utils/survey-policy.test.ts new file mode 100644 index 00000000000..b86ef3f42f9 --- /dev/null +++ b/apps/kimi-code/test/tui/utils/survey-policy.test.ts @@ -0,0 +1,663 @@ +import { describe, expect, it, vi } from 'vitest'; + +import { + DEFAULT_SURVEY_POPUP_CONFIG, + type SurveyPopupConfig, +} from '#/utils/survey-popup-config'; +import { + buildSurveyEventProperties, + evaluateLongContextArm, + evaluateSurveyGate, + SURVEY_EVENT_NAMES, + SURVEY_MACHINE_CLOSED, + surveyMachineReduce, + type LongContextArmGateInput, + type SessionArmGateInput, + type SurveyEventEnvironmentFields, + type SurveyGateInput, + type SurveyMachineState, +} from '#/tui/utils/survey-policy'; + +const CONFIG = DEFAULT_SURVEY_POPUP_CONFIG; + +function passingSession(overrides: Partial = {}): SessionArmGateInput { + return { + phase: 'closed', + turnInProgress: false, + idleForMs: 2000, + externalEditorActive: false, + terminalWidth: 120, + terminalHeight: 24, + promptActive: false, + editorBashActive: false, + editorAutocompleteActive: false, + feedbackSurveyDisabled: false, + telemetryDisabled: false, + currentModel: 'k2', + lastUserMessageStartsOrderedList: false, + mountedForMs: 600_000, + userTurnsSinceMount: 5, + msSinceLastShown: undefined, + userTurnsSinceLastShown: undefined, + sample: 0, + msSinceGlobalLastShown: undefined, + ...overrides, + }; +} + +function passingLongContext( + overrides: Partial = {}, +): LongContextArmGateInput { + return { + phase: 'closed', + turnInProgress: false, + idleForMs: 2000, + promptActive: false, + editorBashActive: false, + editorAutocompleteActive: false, + externalEditorActive: false, + terminalWidth: 120, + terminalHeight: 24, + feedbackSurveyDisabled: false, + telemetryDisabled: false, + currentModel: 'k2', + lastUserMessageStartsOrderedList: false, + cumulativeTokens: 0, + virtualContextTokens: 0, + mountRollConsumed: false, + drawMountRoll: () => 0, + ...overrides, + }; +} + +function gate( + sessionOverrides: Partial = {}, + config: SurveyPopupConfig = CONFIG, + longContextOverrides: Partial = {}, +): SurveyGateInput { + return { + session: passingSession(sessionOverrides), + longContext: passingLongContext(longContextOverrides), + config, + }; +} + +describe('evaluateSurveyGate (session arm)', () => { + it('shows the session survey when every gate passes', () => { + expect(evaluateSurveyGate(gate())).toEqual({ show: true, survey: 'session' }); + }); + + it.each<[Partial, string]>([ + [{ phase: 'open' }, 'survey-active'], + [{ phase: 'pending' }, 'survey-active'], + [{ phase: 'thanks' }, 'survey-active'], + [{ turnInProgress: true }, 'turn-in-progress'], + [{ idleForMs: 1999 }, 'idle-too-short'], + [{ lastUserMessageStartsOrderedList: true }, 'ordered-list-ambiguity'], + [{ promptActive: true }, 'prompt-active'], + [{ editorBashActive: true }, 'editor-bash-active'], + [{ editorAutocompleteActive: true }, 'editor-autocomplete-active'], + [{ externalEditorActive: true }, 'external-editor-active'], + [{ terminalWidth: 10 }, 'terminal-too-narrow'], + [{ terminalHeight: 7 }, 'terminal-too-short'], + [{ terminalWidth: 12, terminalHeight: 14 }, 'terminal-too-short'], + [{ terminalWidth: 16, terminalHeight: 13 }, 'terminal-too-short'], + [{ feedbackSurveyDisabled: true }, 'feature-disabled'], + [{ telemetryDisabled: true }, 'telemetry-disabled'], + [{ mountedForMs: 599_999 }, 'warmup'], + [{ userTurnsSinceMount: 4 }, 'warmup'], + [{ sample: 0.006 }, 'sampled-out'], + [{ msSinceGlobalLastShown: 99_999_999 }, 'global-cooldown'], + ])('skips with %j → %s', (overrides, reason) => { + expect(evaluateSurveyGate(gate(overrides))).toEqual({ show: false, reason }); + }); + + it('applies the chain in order: an open survey reports survey-active, not later reasons', () => { + expect( + evaluateSurveyGate(gate({ phase: 'open', turnInProgress: true, telemetryDisabled: true })), + ).toEqual({ show: false, reason: 'survey-active' }); + }); + + it('samples with a half-open test: sample below probability shows, at-or-above is out', () => { + expect(evaluateSurveyGate(gate({ sample: 0.004_999 }))).toEqual({ + show: true, + survey: 'session', + }); + expect(evaluateSurveyGate(gate({ sample: 0.005 }))).toEqual({ + show: false, + reason: 'sampled-out', + }); + expect(evaluateSurveyGate(gate({ sample: 0 }, { ...CONFIG, probability: 0 })).show).toBe( + false, + ); + }); + + describe('model gate', () => { + it('opens for every model with "*"', () => { + expect(evaluateSurveyGate(gate({ currentModel: 'anything' })).show).toBe(true); + }); + + it('closes both arms with an empty list', () => { + expect(evaluateSurveyGate(gate({}, { ...CONFIG, on_for_models: [] }))).toEqual({ + show: false, + reason: 'model-gated', + }); + }); + + it('requires an exact match otherwise', () => { + const config = { ...CONFIG, on_for_models: ['k3'] }; + expect(evaluateSurveyGate(gate({ currentModel: 'k3' }, config)).show).toBe(true); + expect(evaluateSurveyGate(gate({ currentModel: 'k2' }, config))).toEqual({ + show: false, + reason: 'model-gated', + }); + expect(evaluateSurveyGate(gate({ currentModel: 'k3-fictional' }, config))).toEqual({ + show: false, + reason: 'model-gated', + }); + }); + }); + + describe('in-session pacing', () => { + const shown = { + msSinceLastShown: 3_600_000, + userTurnsSinceLastShown: 10, + } as const; + + it('requires the gap and the new turns once shown before', () => { + expect(evaluateSurveyGate(gate(shown)).show).toBe(true); + }); + + it('skips inside the time gap', () => { + expect( + evaluateSurveyGate(gate({ ...shown, msSinceLastShown: 3_599_999 })), + ).toEqual({ show: false, reason: 'pacing' }); + }); + + it('skips without enough new turns', () => { + expect(evaluateSurveyGate(gate({ ...shown, userTurnsSinceLastShown: 9 }))).toEqual({ + show: false, + reason: 'pacing', + }); + }); + }); + + it('honours the global cooldown exactly at the boundary', () => { + expect(evaluateSurveyGate(gate({ msSinceGlobalLastShown: 100_000_000 })).show).toBe(true); + }); +}); + +describe('evaluateLongContextArm', () => { + const ELIGIBLE: Partial = { cumulativeTokens: 250_000 }; + + function arm( + overrides: Partial = {}, + config: SurveyPopupConfig = CONFIG, + ): ReturnType { + return evaluateLongContextArm(gate({}, config, { ...ELIGIBLE, ...overrides })); + } + + it('shows the long-context survey when the whole chain passes', () => { + expect(arm()).toEqual({ + show: true, + survey: 'long_context', + longContextRollConsumed: true, + }); + }); + + it.each<[Partial, string]>([ + [{ mountRollConsumed: true }, 'mount-roll-consumed'], + [{ phase: 'open' }, 'survey-active'], + [{ phase: 'pending' }, 'survey-active'], + [{ phase: 'thanks' }, 'survey-active'], + [{ turnInProgress: true }, 'turn-in-progress'], + [{ idleForMs: 1999 }, 'idle-too-short'], + [{ promptActive: true }, 'prompt-active'], + [{ editorBashActive: true }, 'editor-bash-active'], + [{ editorAutocompleteActive: true }, 'editor-autocomplete-active'], + [{ externalEditorActive: true }, 'external-editor-active'], + [{ terminalWidth: 10 }, 'terminal-too-narrow'], + [{ terminalHeight: 7 }, 'terminal-too-short'], + [{ terminalWidth: 12, terminalHeight: 14 }, 'terminal-too-short'], + [{ terminalWidth: 16, terminalHeight: 13 }, 'terminal-too-short'], + [{ feedbackSurveyDisabled: true }, 'feature-disabled'], + [{ telemetryDisabled: true }, 'telemetry-disabled'], + [{ lastUserMessageStartsOrderedList: true }, 'ordered-list-ambiguity'], + [{ cumulativeTokens: 199_999 }, 'below-threshold'], + ])('skips with %j → %s', (overrides, reason) => { + expect(arm(overrides)).toEqual({ show: false, reason }); + }); + + it('checks the mount latch first: a spent roll reports mount-roll-consumed, not later reasons', () => { + expect(arm({ mountRollConsumed: true, phase: 'open', telemetryDisabled: true })).toEqual({ + show: false, + reason: 'mount-roll-consumed', + }); + }); + + it('applies the chain in order: an open survey reports survey-active, not later reasons', () => { + expect(arm({ phase: 'open', telemetryDisabled: true })).toEqual({ + show: false, + reason: 'survey-active', + }); + }); + + it('applies the model gate before the threshold', () => { + expect(arm({}, { ...CONFIG, on_for_models: [], long_context_survey_threshold: 0 })).toEqual({ + show: false, + reason: 'model-gated', + }); + expect(arm({}, { ...CONFIG, on_for_models: ['k3'] })).toEqual({ + show: false, + reason: 'model-gated', + }); + }); + + it('shows at the counter boundary (counter == threshold)', () => { + expect(arm({ cumulativeTokens: 200_000 })).toEqual({ + show: true, + survey: 'long_context', + longContextRollConsumed: true, + }); + }); + + it('samples with a half-open test: roll below long_context_probability shows, at-or-above is out', () => { + expect(arm({ drawMountRoll: () => 0.199_999 })).toEqual({ + show: true, + survey: 'long_context', + longContextRollConsumed: true, + }); + expect(arm({ drawMountRoll: () => 0.2 })).toEqual({ + show: false, + reason: 'sampled-out', + longContextRollConsumed: true, + }); + }); + + describe('mount one-shot', () => { + it('does not draw the dice below the threshold, so the roll stays unspent', () => { + const drawMountRoll = vi.fn(() => 0); + expect(arm({ cumulativeTokens: 199_999, drawMountRoll })).toEqual({ + show: false, + reason: 'below-threshold', + }); + expect(drawMountRoll).not.toHaveBeenCalled(); + }); + + it('does not draw the dice while transiently suppressed by an active prompt', () => { + const drawMountRoll = vi.fn(() => 0); + expect(arm({ promptActive: true, drawMountRoll })).toEqual({ + show: false, + reason: 'prompt-active', + }); + expect(drawMountRoll).not.toHaveBeenCalled(); + }); + + it('spends the roll on a miss: the arm stays silent for the rest of the mount', () => { + expect(arm({ drawMountRoll: () => 0.9 })).toEqual({ + show: false, + reason: 'sampled-out', + longContextRollConsumed: true, + }); + }); + + it('spends the roll on a hit and shows once', () => { + expect(arm({ drawMountRoll: () => 0.1 })).toEqual({ + show: true, + survey: 'long_context', + longContextRollConsumed: true, + }); + }); + + it('never draws again once the roll is spent', () => { + const drawMountRoll = vi.fn(() => 0); + expect(arm({ mountRollConsumed: true, drawMountRoll })).toEqual({ + show: false, + reason: 'mount-roll-consumed', + }); + expect(drawMountRoll).not.toHaveBeenCalled(); + }); + }); + + describe('threshold validity', () => { + it.each([0, -1, Number.NaN])('closes the arm on a non-positive threshold (%s)', (threshold) => { + expect(arm({}, { ...CONFIG, long_context_survey_threshold: threshold })).toEqual({ + show: false, + reason: 'threshold-invalid', + }); + }); + + it('runs on the built-in 200k default when the field never took a cloud value', () => { + expect(arm({ cumulativeTokens: 199_999 })).toEqual({ show: false, reason: 'below-threshold' }); + expect(arm({ cumulativeTokens: 200_000 })).toEqual({ + show: true, + survey: 'long_context', + longContextRollConsumed: true, + }); + }); + }); + + describe('counter mode', () => { + it('compares the cumulative counter by default and ignores the window occupancy', () => { + expect(arm({ cumulativeTokens: 199_999, virtualContextTokens: 500_000 })).toEqual({ + show: false, + reason: 'below-threshold', + }); + }); + + it('compares the window occupancy when the trigger mode is virtual_context', () => { + const config = { ...CONFIG, long_context_trigger_mode: 'virtual_context' as const }; + expect(arm({ cumulativeTokens: 0, virtualContextTokens: 250_000 }, config)).toEqual({ + show: true, + survey: 'long_context', + longContextRollConsumed: true, + }); + expect(arm({ cumulativeTokens: 500_000, virtualContextTokens: 100 }, config)).toEqual({ + show: false, + reason: 'below-threshold', + }); + }); + }); +}); + +describe('evaluateSurveyGate (arbitration)', () => { + const ELIGIBLE: Partial = { cumulativeTokens: 250_000 }; + + it('prefers the long-context survey when both arms pass', () => { + expect(evaluateSurveyGate(gate({}, CONFIG, ELIGIBLE))).toEqual({ + show: true, + survey: 'long_context', + longContextRollConsumed: true, + }); + }); + + it('falls back to the session arm when the long-context arm is below the threshold', () => { + expect(evaluateSurveyGate(gate())).toEqual({ show: true, survey: 'session' }); + }); + + it('falls back to the session arm when the long-context arm misses its roll, latching it spent', () => { + expect( + evaluateSurveyGate(gate({ sample: 0 }, CONFIG, { ...ELIGIBLE, drawMountRoll: () => 0.9 })), + ).toEqual({ + show: true, + survey: 'session', + longContextRollConsumed: true, + }); + }); + + it('falls back to the session arm when the threshold closes the long-context arm', () => { + expect( + evaluateSurveyGate(gate({}, { ...CONFIG, long_context_survey_threshold: 0 }, ELIGIBLE)), + ).toEqual({ show: true, survey: 'session' }); + }); + + it('shows the long-context survey even when the session arm is sampled out', () => { + expect(evaluateSurveyGate(gate({ sample: 0.9 }, CONFIG, ELIGIBLE))).toEqual({ + show: true, + survey: 'long_context', + longContextRollConsumed: true, + }); + }); + + it('shows the long-context survey inside the persisted cooldown that still gates the session arm', () => { + expect( + evaluateSurveyGate(gate({ msSinceGlobalLastShown: 1000 }, CONFIG, ELIGIBLE)), + ).toEqual({ + show: true, + survey: 'long_context', + longContextRollConsumed: true, + }); + }); + + it('shows nothing when the long-context arm is ineligible and the session arm is sampled out', () => { + expect(evaluateSurveyGate(gate({ sample: 0.9 }))).toEqual({ + show: false, + reason: 'sampled-out', + }); + }); + + it('reports the spent roll even when both arms lose', () => { + expect( + evaluateSurveyGate( + gate({ sample: 0.9 }, CONFIG, { ...ELIGIBLE, drawMountRoll: () => 0.9 }), + ), + ).toEqual({ + show: false, + reason: 'sampled-out', + longContextRollConsumed: true, + }); + }); +}); + +describe('surveyMachineReduce', () => { + const appearance = { survey: 'session' as const, appearanceId: 'a1', appearanceIndex: 1 }; + const openState: SurveyMachineState = { phase: 'open', appearance, response: undefined }; + + it('walks the happy path: closed → open → pending → thanks → closed', () => { + const opened = surveyMachineReduce(SURVEY_MACHINE_CLOSED, { type: 'open', appearance }); + expect(opened.state.phase).toBe('open'); + expect(opened.effects).toEqual([{ type: 'report', eventType: 'appeared' }]); + + const selected = surveyMachineReduce(opened.state, { type: 'select', response: 'bad' }); + expect(selected.state).toEqual({ phase: 'pending', appearance, response: 'bad' }); + expect(selected.effects).toEqual([{ type: 'schedule', timer: 'pending-settle' }]); + + const settled = surveyMachineReduce(selected.state, { type: 'settle' }); + expect(settled.state.phase).toBe('thanks'); + expect(settled.effects).toEqual([ + { type: 'report', eventType: 'responded', response: 'bad' }, + { type: 'schedule', timer: 'thanks-close' }, + ]); + + const closed = surveyMachineReduce(settled.state, { type: 'thanks-elapsed' }); + expect(closed.state).toEqual(SURVEY_MACHINE_CLOSED); + expect(closed.effects).toEqual([]); + }); + + it('undo returns pending to open without reporting, and settle after an undo reports only the final choice', () => { + const selected = surveyMachineReduce(openState, { type: 'select', response: 'fine' }); + const undone = surveyMachineReduce(selected.state, { type: 'undo' }); + expect(undone.state).toEqual(openState); + expect(undone.effects).toEqual([]); + + const reselected = surveyMachineReduce(undone.state, { type: 'select', response: 'good' }); + const settled = surveyMachineReduce(reselected.state, { type: 'settle' }); + expect(settled.effects).toEqual([ + { type: 'report', eventType: 'responded', response: 'good' }, + { type: 'schedule', timer: 'thanks-close' }, + ]); + }); + + it('dismiss reports responded dismissed and closes without thanks', () => { + const dismissed = surveyMachineReduce(openState, { type: 'dismiss' }); + expect(dismissed.state).toEqual(SURVEY_MACHINE_CLOSED); + expect(dismissed.effects).toEqual([ + { type: 'report', eventType: 'responded', response: 'dismissed' }, + ]); + }); + + it('abandon reports abandoned and closes', () => { + const abandoned = surveyMachineReduce(openState, { type: 'abandon' }); + expect(abandoned.state).toEqual(SURVEY_MACHINE_CLOSED); + expect(abandoned.effects).toEqual([{ type: 'report', eventType: 'abandoned' }]); + }); + + it.each(['open', 'thanks'] as const)('close-silently from %s reports nothing', (phase) => { + const state: SurveyMachineState = { phase, appearance, response: 'good' }; + const closed = surveyMachineReduce(state, { type: 'close-silently' }); + expect(closed.state).toEqual(SURVEY_MACHINE_CLOSED); + expect(closed.effects).toEqual([]); + }); + + it('close-silently from pending settles the un-undone choice before closing', () => { + const state: SurveyMachineState = { phase: 'pending', appearance, response: 'bad' }; + const closed = surveyMachineReduce(state, { type: 'close-silently' }); + expect(closed.state).toEqual(SURVEY_MACHINE_CLOSED); + expect(closed.effects).toEqual([ + { type: 'report', eventType: 'responded', response: 'bad' }, + ]); + }); + + it.each([ + [{ type: 'select', response: 'good' } as const], + [{ type: 'dismiss' } as const], + [{ type: 'abandon' } as const], + [{ type: 'undo' } as const], + [{ type: 'settle' } as const], + [{ type: 'thanks-elapsed' } as const], + ])('ignores %s while closed', (action) => { + const result = surveyMachineReduce(SURVEY_MACHINE_CLOSED, action); + expect(result.state).toEqual(SURVEY_MACHINE_CLOSED); + expect(result.effects).toEqual([]); + }); + + describe('takeover', () => { + const longContextAppearance = { + survey: 'long_context' as const, + appearanceId: 'a2', + appearanceIndex: 2, + }; + + it('a long-context survey takes over an open session survey silently', () => { + const result = surveyMachineReduce(openState, { + type: 'open', + appearance: longContextAppearance, + }); + expect(result.state).toEqual({ + phase: 'open', + appearance: longContextAppearance, + response: undefined, + }); + expect(result.effects).toEqual([{ type: 'report', eventType: 'appeared' }]); + }); + + it('a session survey never takes over an open long-context survey', () => { + const longOpen: SurveyMachineState = { + phase: 'open', + appearance: longContextAppearance, + response: undefined, + }; + const result = surveyMachineReduce(longOpen, { type: 'open', appearance }); + expect(result.state).toEqual(longOpen); + expect(result.effects).toEqual([]); + }); + + it('ignores a re-open of the same survey while open (no double appearance)', () => { + const other = { survey: 'session' as const, appearanceId: 'a9', appearanceIndex: 3 }; + const result = surveyMachineReduce(openState, { type: 'open', appearance: other }); + expect(result.state).toEqual(openState); + expect(result.effects).toEqual([]); + }); + + it.each(['pending', 'thanks'] as const)('ignores a takeover while %s', (phase) => { + const state: SurveyMachineState = { phase, appearance, response: 'good' }; + const result = surveyMachineReduce(state, { + type: 'open', + appearance: longContextAppearance, + }); + expect(result.state).toEqual(state); + expect(result.effects).toEqual([]); + }); + }); +}); + +describe('buildSurveyEventProperties', () => { + it('maps survey kinds to the wire event names', () => { + expect(SURVEY_EVENT_NAMES).toEqual({ + session: 'feedback_survey', + long_context: 'long_context_survey', + }); + }); + + const ENVIRONMENT: SurveyEventEnvironmentFields = { + current_model: 'k2', + user_turn_count: 9, + cumulative_tokens: 123, + virtual_context_tokens: 45, + tool_call_count: 6, + compaction_count: 2, + permission_mode: 'manual', + thinking_effort: 'high', + }; + + it('builds the core three-state fields', () => { + expect( + buildSurveyEventProperties( + { + event_type: 'responded', + appearance_id: 'a1', + appearance_index: 2, + response: 'fine', + }, + ENVIRONMENT, + CONFIG, + ), + ).toEqual({ + event_type: 'responded', + appearance_id: 'a1', + appearance_index: 2, + response: 'fine', + ...ENVIRONMENT, + config_probability: 0.005, + config_on_for_models: '*', + config_min_time_before_feedback_ms: 600_000, + config_min_user_turns_before_feedback: 5, + config_min_time_between_feedback_ms: 3_600_000, + config_min_user_turns_between_feedback: 10, + config_min_time_between_global_feedback_ms: 100_000_000, + config_long_context_survey_threshold: 200_000, + config_long_context_probability: 0.2, + config_long_context_trigger_mode: 'cumulative', + }); + }); + + it('leaves response undefined for appeared / abandoned', () => { + const properties = buildSurveyEventProperties( + { + event_type: 'appeared', + appearance_id: 'a1', + appearance_index: 1, + }, + ENVIRONMENT, + CONFIG, + ); + expect(properties['response']).toBeUndefined(); + }); + + it('flattens the effective config into primitive config_* properties', () => { + const properties = buildSurveyEventProperties( + { + event_type: 'appeared', + appearance_id: 'a1', + appearance_index: 1, + }, + ENVIRONMENT, + { ...CONFIG, probability: 0.5, on_for_models: ['k3', 'k2'] }, + ); + expect(properties['config_probability']).toBe(0.5); + expect(properties['config_on_for_models']).toBe('k3,k2'); + }); + + it('keeps every property a telemetry primitive so sanitize drops nothing', () => { + const properties = buildSurveyEventProperties( + { + event_type: 'responded', + appearance_id: 'a1', + appearance_index: 1, + response: 'bad', + }, + ENVIRONMENT, + { ...CONFIG, on_for_models: [] }, + ); + for (const [key, value] of Object.entries(properties)) { + const isPrimitive = + value === undefined || + value === null || + typeof value === 'boolean' || + typeof value === 'number' || + typeof value === 'string'; + expect(isPrimitive, `property ${key} is not a primitive`).toBe(true); + } + expect(properties['config_on_for_models']).toBe(''); + }); +}); diff --git a/apps/kimi-code/test/utils/survey-popup-config.test.ts b/apps/kimi-code/test/utils/survey-popup-config.test.ts new file mode 100644 index 00000000000..e0f4195ec28 --- /dev/null +++ b/apps/kimi-code/test/utils/survey-popup-config.test.ts @@ -0,0 +1,319 @@ +import { mkdtemp, readFile, rm } from 'node:fs/promises'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; + +import { afterEach, describe, expect, it, vi } from 'vitest'; + +import { + DEFAULT_SURVEY_POPUP_CONFIG, + getSurveyPopupConfig, + peekSurveyPopupConfig, + resetSurveyPopupConfigCache, +} from '#/utils/survey-popup-config'; + +const CLOUD_CONFIG = { + probability: 0.5, + on_for_models: ['k3', 'k2'], + min_time_before_feedback_ms: 60_000, + min_user_turns_before_feedback: 2, + min_time_between_feedback_ms: 120_000, + min_user_turns_between_feedback: 3, + min_time_between_global_feedback_ms: 240_000, + long_context_survey_threshold: 100_000, + long_context_probability: 0.9, + long_context_trigger_mode: 'virtual_context', +}; + +const ENVELOPE = { name: 'survey_popup', config: CLOUD_CONFIG }; + +const tempDirs: string[] = []; + +function jsonResponse(body: unknown, status = 200): Response { + return new Response(JSON.stringify(body), { + status, + headers: { 'Content-Type': 'application/json' }, + }); +} + +async function makeCacheFile(): Promise { + const dir = await mkdtemp(join(tmpdir(), 'survey-popup-config-')); + tempDirs.push(dir); + return join(dir, 'cache.json'); +} + +afterEach(async () => { + resetSurveyPopupConfigCache(); + await Promise.all(tempDirs.splice(0).map((dir) => rm(dir, { recursive: true, force: true }))); +}); + +describe('DEFAULT_SURVEY_POPUP_CONFIG', () => { + it('matches the contract defaults', () => { + expect(DEFAULT_SURVEY_POPUP_CONFIG).toEqual({ + probability: 0.005, + on_for_models: ['*'], + min_time_before_feedback_ms: 600_000, + min_user_turns_before_feedback: 5, + min_time_between_feedback_ms: 3_600_000, + min_user_turns_between_feedback: 10, + min_time_between_global_feedback_ms: 100_000_000, + long_context_survey_threshold: 200_000, + long_context_probability: 0.2, + long_context_trigger_mode: 'cumulative', + }); + }); +}); + +describe('getSurveyPopupConfig', () => { + it('POSTs the survey_popup name and returns the cloud config over the defaults', async () => { + const fetchImpl = vi.fn(async () => jsonResponse(ENVELOPE)); + + const result = await getSurveyPopupConfig({ + fetchImpl: fetchImpl as typeof fetch, + cacheFile: null, + }); + + expect(result).toEqual(CLOUD_CONFIG); + expect(fetchImpl).toHaveBeenCalledWith( + expect.stringContaining('/client_configs'), + expect.objectContaining({ + method: 'POST', + body: JSON.stringify({ name: 'survey_popup' }), + }), + ); + }); + + it('fills fields the cloud payload omits from the built-in defaults', async () => { + const fetchImpl = vi.fn(async () => + jsonResponse({ name: 'survey_popup', config: { probability: 0.5 } }), + ); + + const result = await getSurveyPopupConfig({ + fetchImpl: fetchImpl as typeof fetch, + cacheFile: null, + }); + + expect(result).toEqual({ ...DEFAULT_SURVEY_POPUP_CONFIG, probability: 0.5 }); + }); + + it('drops only the invalid field and keeps the rest', async () => { + const fetchImpl = vi.fn(async () => + jsonResponse({ + name: 'survey_popup', + config: { + ...CLOUD_CONFIG, + probability: 'often', + on_for_models: ['k3', 42], + long_context_trigger_mode: 'sometimes', + }, + }), + ); + + const result = await getSurveyPopupConfig({ + fetchImpl: fetchImpl as typeof fetch, + cacheFile: null, + }); + + expect(result).toEqual({ + ...CLOUD_CONFIG, + probability: DEFAULT_SURVEY_POPUP_CONFIG.probability, + on_for_models: DEFAULT_SURVEY_POPUP_CONFIG.on_for_models, + long_context_trigger_mode: DEFAULT_SURVEY_POPUP_CONFIG.long_context_trigger_mode, + }); + }); + + it('drops negative pacing values and fractional turn counts back to defaults', async () => { + const fetchImpl = vi.fn(async () => + jsonResponse({ + name: 'survey_popup', + config: { + min_time_before_feedback_ms: -1, + min_user_turns_before_feedback: 2.5, + min_time_between_feedback_ms: -100, + min_user_turns_between_feedback: -3, + min_time_between_global_feedback_ms: -1, + }, + }), + ); + + const result = await getSurveyPopupConfig({ + fetchImpl: fetchImpl as typeof fetch, + cacheFile: null, + }); + + expect(result).toEqual(DEFAULT_SURVEY_POPUP_CONFIG); + }); + + it('accepts zero pacing values as the documented no-limit semantics', async () => { + const fetchImpl = vi.fn(async () => + jsonResponse({ + name: 'survey_popup', + config: { + min_time_before_feedback_ms: 0, + min_user_turns_before_feedback: 0, + min_time_between_feedback_ms: 0, + min_user_turns_between_feedback: 0, + min_time_between_global_feedback_ms: 0, + }, + }), + ); + + const result = await getSurveyPopupConfig({ + fetchImpl: fetchImpl as typeof fetch, + cacheFile: null, + }); + + expect(result).toEqual({ + ...DEFAULT_SURVEY_POPUP_CONFIG, + min_time_before_feedback_ms: 0, + min_user_turns_before_feedback: 0, + min_time_between_feedback_ms: 0, + min_user_turns_between_feedback: 0, + min_time_between_global_feedback_ms: 0, + }); + }); + + it('drops out-of-range probabilities back to the built-in defaults', async () => { + const fetchImpl = vi.fn(async () => + jsonResponse({ + name: 'survey_popup', + config: { probability: 2, long_context_probability: -0.5 }, + }), + ); + + const result = await getSurveyPopupConfig({ + fetchImpl: fetchImpl as typeof fetch, + cacheFile: null, + }); + + expect(result.probability).toBe(DEFAULT_SURVEY_POPUP_CONFIG.probability); + expect(result.long_context_probability).toBe( + DEFAULT_SURVEY_POPUP_CONFIG.long_context_probability, + ); + }); + + it('drops a non-numeric long-context threshold back to the built-in default', async () => { + const fetchImpl = vi.fn(async () => + jsonResponse({ name: 'survey_popup', config: { long_context_survey_threshold: 'never' } }), + ); + + const result = await getSurveyPopupConfig({ + fetchImpl: fetchImpl as typeof fetch, + cacheFile: null, + }); + + expect(result.long_context_survey_threshold).toBe( + DEFAULT_SURVEY_POPUP_CONFIG.long_context_survey_threshold, + ); + }); + + it('keeps a non-positive threshold so the policy layer can close the long-context arm', async () => { + const fetchImpl = vi.fn(async () => + jsonResponse({ name: 'survey_popup', config: { long_context_survey_threshold: 0 } }), + ); + + const result = await getSurveyPopupConfig({ + fetchImpl: fetchImpl as typeof fetch, + cacheFile: null, + }); + + expect(result.long_context_survey_threshold).toBe(0); + }); + + it('falls back to the defaults when the payload is not an object', async () => { + const fetchImpl = vi.fn(async () => jsonResponse({ name: 'survey_popup', config: 'nope' })); + + const result = await getSurveyPopupConfig({ + fetchImpl: fetchImpl as typeof fetch, + cacheFile: null, + }); + + expect(result).toEqual(DEFAULT_SURVEY_POPUP_CONFIG); + }); + + it('falls back to the defaults when the fetch fails', async () => { + const fetchImpl = vi.fn(async () => { + throw new Error('offline'); + }); + + const result = await getSurveyPopupConfig({ + fetchImpl: fetchImpl as typeof fetch, + cacheFile: null, + }); + + expect(result).toEqual(DEFAULT_SURVEY_POPUP_CONFIG); + }); + + it('serves the in-process cache within a day and refetches after it', async () => { + const fetchImpl = vi.fn(async () => jsonResponse(ENVELOPE)); + const now = Date.now(); + + await getSurveyPopupConfig({ fetchImpl: fetchImpl as typeof fetch, now, cacheFile: null }); + const cached = await getSurveyPopupConfig({ + fetchImpl: fetchImpl as typeof fetch, + now: now + 60_000, + cacheFile: null, + }); + expect(cached).toEqual(CLOUD_CONFIG); + expect(fetchImpl).toHaveBeenCalledTimes(1); + + await getSurveyPopupConfig({ + fetchImpl: fetchImpl as typeof fetch, + now: now + 25 * 60 * 60 * 1000, + cacheFile: null, + }); + expect(fetchImpl).toHaveBeenCalledTimes(2); + }); + + it('persists the fetched config to the disk cache for the next process', async () => { + const cacheFile = await makeCacheFile(); + const fetchImpl = vi.fn(async () => jsonResponse(ENVELOPE)); + const now = Date.now(); + + await getSurveyPopupConfig({ fetchImpl: fetchImpl as typeof fetch, now, cacheFile }); + + const persisted = JSON.parse(await readFile(cacheFile, 'utf-8')) as { config: unknown }; + expect(persisted.config).toEqual(CLOUD_CONFIG); + + resetSurveyPopupConfigCache(); + const result = await getSurveyPopupConfig({ + fetchImpl: vi.fn(async () => { + throw new Error('must not fetch'); + }) as unknown as typeof fetch, + now: now + 60_000, + cacheFile, + }); + expect(result).toEqual(CLOUD_CONFIG); + }); + + it('ignores a stale disk cache and falls back to the defaults when the refetch fails', async () => { + const cacheFile = await makeCacheFile(); + const fetchImpl = vi.fn(async () => jsonResponse(ENVELOPE)); + const now = Date.now(); + + await getSurveyPopupConfig({ fetchImpl: fetchImpl as typeof fetch, now, cacheFile }); + resetSurveyPopupConfigCache(); + + const result = await getSurveyPopupConfig({ + fetchImpl: vi.fn(async () => jsonResponse('no', 503)) as unknown as typeof fetch, + now: now + 25 * 60 * 60 * 1000, + cacheFile, + }); + expect(result).toEqual(DEFAULT_SURVEY_POPUP_CONFIG); + }); +}); + +describe('peekSurveyPopupConfig', () => { + it('returns the defaults while the cache is cold', () => { + expect(peekSurveyPopupConfig()).toEqual(DEFAULT_SURVEY_POPUP_CONFIG); + }); + + it('sees the fetched config once the cache is warm', async () => { + const fetchImpl = vi.fn(async () => jsonResponse(ENVELOPE)); + const now = Date.now(); + + await getSurveyPopupConfig({ fetchImpl: fetchImpl as typeof fetch, now, cacheFile: null }); + + expect(peekSurveyPopupConfig(now + 60_000)).toEqual(CLOUD_CONFIG); + expect(peekSurveyPopupConfig(now + 25 * 60 * 60 * 1000)).toEqual(DEFAULT_SURVEY_POPUP_CONFIG); + }); +}); diff --git a/apps/kimi-code/test/utils/survey-state-store.test.ts b/apps/kimi-code/test/utils/survey-state-store.test.ts new file mode 100644 index 00000000000..b162b64ddeb --- /dev/null +++ b/apps/kimi-code/test/utils/survey-state-store.test.ts @@ -0,0 +1,49 @@ +import { mkdtemp, rm, writeFile } from 'node:fs/promises'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; + +import { afterEach, beforeEach, describe, expect, it } from 'vitest'; + +import { + readSurveyLastShownTime, + writeSurveyLastShownTime, +} from '#/utils/survey-state-store'; + +describe('survey-state-store', () => { + let dir: string; + let file: string; + + beforeEach(async () => { + dir = await mkdtemp(join(tmpdir(), 'kimi-survey-state-')); + file = join(dir, 'feedback-survey-state.json'); + }); + + afterEach(async () => { + await rm(dir, { recursive: true, force: true }); + }); + + it('returns undefined when the file is missing', async () => { + await expect(readSurveyLastShownTime(file)).resolves.toBeUndefined(); + }); + + it('round-trips last_shown_time', async () => { + writeSurveyLastShownTime(1_700_000_000_000, file); + await expect(readSurveyLastShownTime(file)).resolves.toBe(1_700_000_000_000); + }); + + it('returns undefined when the file is corrupt', async () => { + await writeFile(file, 'not json', 'utf-8'); + await expect(readSurveyLastShownTime(file)).resolves.toBeUndefined(); + }); + + it('returns undefined when the schema does not match', async () => { + await writeFile(file, JSON.stringify({ version: 2, last_shown_time: 1 }), 'utf-8'); + await expect(readSurveyLastShownTime(file)).resolves.toBeUndefined(); + }); + + it('overwrites a previous timestamp atomically', async () => { + writeSurveyLastShownTime(1, file); + writeSurveyLastShownTime(2, file); + await expect(readSurveyLastShownTime(file)).resolves.toBe(2); + }); +}); diff --git a/docs/media/provider-manager.jpg b/docs/media/provider-manager.jpg new file mode 100644 index 00000000000..bb5edf80837 Binary files /dev/null and b/docs/media/provider-manager.jpg differ diff --git a/packages/agent-core-v2/src/agent/fullCompaction/compactionInstruction.ts b/packages/agent-core-v2/src/agent/fullCompaction/compactionInstruction.ts new file mode 100644 index 00000000000..cd3a10f916f --- /dev/null +++ b/packages/agent-core-v2/src/agent/fullCompaction/compactionInstruction.ts @@ -0,0 +1,15 @@ +import { renderPrompt } from '#/_base/utils/render-prompt'; + +import compactionInstructionTemplate from './compaction-instruction.md?raw'; + +export interface CompactionInstructionInput { + readonly customInstruction?: string; +} + +export function renderCompactionInstruction(input: CompactionInstructionInput): string { + const customInstruction = input.customInstruction?.trim() ?? ''; + return renderPrompt(compactionInstructionTemplate, { + custom_instruction_block: + customInstruction.length > 0 ? `\nOptional user instruction:\n${customInstruction}\n` : '', + }).trimEnd(); +} diff --git a/packages/agent-core-v2/src/agent/fullCompaction/context-recovery-footer.md b/packages/agent-core-v2/src/agent/fullCompaction/context-recovery-footer.md new file mode 100644 index 00000000000..5aba814ea31 --- /dev/null +++ b/packages/agent-core-v2/src/agent/fullCompaction/context-recovery-footer.md @@ -0,0 +1,10 @@ +## Context Recovery +Everything before this note is still on disk in this agent's event log (read-only, append-only): + ${wire_path} +${window_lines} +If you need exact command output, file contents, error text, or the wording of an earlier request, look it up there instead of guessing. How to read it: +- Layout: one file per agent. agents/main/ is the main agent; each subagent has its own agents//wire.jsonl. A parent's log holds only the Agent tool call and the subagent's returned result — the subagent's own steps are in its own file. +- Format: one JSON record per line, append-only; `type` says what it is. The conversation is in `context.append_message` (user prompts) and `context.append_loop_event` (event.type: step.begin | content.part [text|think] | tool.call | tool.result | step.end). Every other type (llm.request, usage.record, token_counting.measured, metadata, profile.bind, …) is bookkeeping — skip it. +- Boundaries: `context.apply_compaction` marks a compaction (older lines stay in the file; grep for it to find exact boundaries). `context.undo` count=N retracts the previous N messages — treat retracted content as never having happened. `context.clear` resets the conversation. +- Externalized content: tool results over 50k chars are stored truncated, with an `output_path` to a tool-results/*.txt file holding the full text. Media parts are blob references, not inline. +- Reading: lines are long JSON (often 10k+ chars). Grep the file for a keyword to get line numbers, then Read exactly that line (line_offset=N, n_lines=1) — Read returns wire.jsonl lines whole up to ~150k chars. To pull one field with real newlines: sed -n 'Np' wire.jsonl | jq -r '.event.result.output'. Never Read large ranges — a handful of records can exceed the per-call byte cap. diff --git a/packages/agent-core-v2/src/agent/fullCompaction/contextRecovery.ts b/packages/agent-core-v2/src/agent/fullCompaction/contextRecovery.ts new file mode 100644 index 00000000000..430f821c46d --- /dev/null +++ b/packages/agent-core-v2/src/agent/fullCompaction/contextRecovery.ts @@ -0,0 +1,28 @@ +import { renderPrompt } from '#/_base/utils/render-prompt'; +import type { WireLineRange } from '#/wire/record'; + +import contextRecoveryTemplate from './context-recovery-footer.md?raw'; + +export const CONTEXT_RECOVERY_HEADING = '## Context Recovery'; + +export interface ContextRecoveryPointer { + readonly journalPath: string; + readonly windows: readonly WireLineRange[]; +} + +export function renderContextRecoveryPointer(pointer: ContextRecoveryPointer): string { + const windows = pointer.windows; + const summarized = windows.length - 1; + const lines = windows.map((range, index) => { + const label = `window ${String(index + 1)}: lines ${String(range.start)}–${String(range.end)}`; + return index === summarized ? `${label} ← the conversation this note summarizes` : label; + }); + const nextStart = windows[summarized]!.end + 1; + lines.push( + `window ${String(windows.length + 1)} (the one you are in now) starts at line ${String(nextStart)} with the \`context.apply_compaction\` record that carries this note — it is already in your context; no need to read it.`, + ); + return renderPrompt(contextRecoveryTemplate, { + wire_path: pointer.journalPath, + window_lines: lines.map((line) => ` ${line}`).join('\n'), + }).trimEnd(); +} diff --git a/packages/agent-core-v2/src/features/contextBudget/compaction-ahead.md b/packages/agent-core-v2/src/features/contextBudget/compaction-ahead.md new file mode 100644 index 00000000000..709aa6c6af8 --- /dev/null +++ b/packages/agent-core-v2/src/features/contextBudget/compaction-ahead.md @@ -0,0 +1,8 @@ + +Context is at ~${used_pct}%; automatic compaction runs at ${trigger_pct}% (about ${remaining_k}k tokens from now). When it runs you will write a handoff note with text only — no tool calls. This is your last chance to act: +- persist unfinished intermediate results to files or the todo list — these survive verbatim and can be read back; +- verify with tools any claim you intend to carry forward (run the test; don't assume) — the note will be written with the result in view; +- bring the current sub-task to a hand-off-able boundary; don't start large new work now; +- if a long user input or constraint may be truncated (kept user messages are capped at ~${kept_k}k tokens), restate its essentials. +Then continue the task; do not stop. + diff --git a/packages/agent-core-v2/src/features/contextBudget/context-budget.md b/packages/agent-core-v2/src/features/contextBudget/context-budget.md new file mode 100644 index 00000000000..897043ad4d1 --- /dev/null +++ b/packages/agent-core-v2/src/features/contextBudget/context-budget.md @@ -0,0 +1,5 @@ + +Context: ~${used_pct}% of the ${max_k}k-token window is used; automatic compaction runs at ${trigger_k}k (${trigger_pct}%). Figures are as of the last check. +At compaction this window is replaced by a handoff note you write yourself (text only, no tools). Kept verbatim: your recent user messages (capped at ~${kept_k}k tokens; a long one keeps only its head) and the todo list. Cleared: assistant messages, tool calls and tool results — but the full record stays on disk and a recovery pointer will follow the note. +Do not wrap up or stop early because of budget. Prefer Grep or paged Read over whole-file reads when the payoff is small. + diff --git a/packages/agent-core-v2/src/features/contextBudget/contextBudgetFeature.ts b/packages/agent-core-v2/src/features/contextBudget/contextBudgetFeature.ts new file mode 100644 index 00000000000..715ec1112ff --- /dev/null +++ b/packages/agent-core-v2/src/features/contextBudget/contextBudgetFeature.ts @@ -0,0 +1,15 @@ +import { Feature } from '#/features/feature'; +import { registerFeature } from '#/features/featureRegistry'; + +import { AgentContextBudgetService, IAgentContextBudgetService } from './contextBudgetService'; + +export class ContextBudgetFeature extends Feature { + static override readonly name = 'contextBudget'; + + constructor() { + super(); + this.contributeAgentService(IAgentContextBudgetService, AgentContextBudgetService); + } +} + +registerFeature(ContextBudgetFeature); diff --git a/packages/agent-core-v2/src/features/contextBudget/contextBudgetReminder.ts b/packages/agent-core-v2/src/features/contextBudget/contextBudgetReminder.ts new file mode 100644 index 00000000000..1a2d5ad368f --- /dev/null +++ b/packages/agent-core-v2/src/features/contextBudget/contextBudgetReminder.ts @@ -0,0 +1,124 @@ +import { renderPrompt } from '#/_base/utils/render-prompt'; +import { COMPACT_USER_MESSAGE_MAX_TOKENS } from '#/agent/contextMemory/compactionHandoff'; +import type { ContextMessage } from '#/agent/contextMemory/types'; +import type { CompactionBudget } from '#/agent/fullCompaction/fullCompaction'; + +import compactionAheadTemplate from './compaction-ahead.md?raw'; +import contextBudgetTemplate from './context-budget.md?raw'; + +export const CONTEXT_BUDGET_REMINDER_VARIANT = 'context_budget'; +export const COMPACTION_AHEAD_REMINDER_VARIANT = 'compaction_ahead'; + +export const COMPACTION_AHEAD_LEAD_RATIO = 0.1; + +export type ContextBudgetBucket = 'half' | 'three_quarters'; + +export interface ContextBudgetDisclosure { + readonly bucket: ContextBudgetBucket; +} + +const BUCKET_THRESHOLDS: readonly (readonly [ContextBudgetBucket, number])[] = [ + ['three_quarters', 0.75], + ['half', 0.5], +]; + +const WRITE_TOOL_NAMES = new Set(['Write', 'Edit']); +const BASH_TOOL_NAMES = new Set(['Bash']); +const TODO_TOOL_NAMES = new Set(['TodoList', 'SetTodoList']); + +export interface CompactionAheadFollowUp { + readonly stepCount: number; + readonly writeCallCount: number; + readonly bashCallCount: number; + readonly todoCallCount: number; +} + +export function contextBudgetBucket(budget: CompactionBudget): ContextBudgetBucket | undefined { + if (!Number.isFinite(budget.triggerTokens) || budget.triggerTokens <= 0) return undefined; + const share = budget.used / budget.triggerTokens; + for (const [bucket, threshold] of BUCKET_THRESHOLDS) { + if (share >= threshold) return bucket; + } + return undefined; +} + +export function compactionAheadLeadTokens(budget: CompactionBudget): number { + return Math.ceil(budget.maxSize * COMPACTION_AHEAD_LEAD_RATIO); +} + +export function shouldRemindCompactionAhead(budget: CompactionBudget): boolean { + if (!Number.isFinite(budget.triggerTokens) || budget.maxSize <= 0) return false; + if (budget.used >= budget.triggerTokens) return false; + return budget.triggerTokens - budget.used <= compactionAheadLeadTokens(budget); +} + +export function renderContextBudgetReminder(budget: CompactionBudget): string { + return renderPrompt(contextBudgetTemplate, { + used_pct: percent(budget.used, budget.maxSize), + max_k: thousands(budget.maxSize), + trigger_k: thousands(budget.triggerTokens), + trigger_pct: percent(budget.triggerTokens, budget.maxSize), + kept_k: thousands(COMPACT_USER_MESSAGE_MAX_TOKENS), + }).trimEnd(); +} + +export function renderCompactionAheadReminder(budget: CompactionBudget): string { + return renderPrompt(compactionAheadTemplate, { + used_pct: percent(budget.used, budget.maxSize), + trigger_pct: percent(budget.triggerTokens, budget.maxSize), + remaining_k: thousands(Math.max(0, budget.triggerTokens - budget.used)), + kept_k: thousands(COMPACT_USER_MESSAGE_MAX_TOKENS), + }).trimEnd(); +} + +export function isContextBudgetReminder(message: ContextMessage): boolean { + return ( + message.origin?.kind === 'injection' && + (message.origin.variant === CONTEXT_BUDGET_REMINDER_VARIANT || + message.origin.variant === COMPACTION_AHEAD_REMINDER_VARIANT) + ); +} + +export function isCompactionAheadReminder(message: ContextMessage): boolean { + return ( + message.origin?.kind === 'injection' && + message.origin.variant === COMPACTION_AHEAD_REMINDER_VARIANT + ); +} + +export function summarizeCompactionAheadFollowUp( + history: readonly ContextMessage[], +): CompactionAheadFollowUp | undefined { + let reminderIndex = -1; + for (let index = history.length - 1; index >= 0; index -= 1) { + if (isCompactionAheadReminder(history[index]!)) { + reminderIndex = index; + break; + } + } + if (reminderIndex < 0) return undefined; + + let stepCount = 0; + let writeCallCount = 0; + let bashCallCount = 0; + let todoCallCount = 0; + for (const message of history.slice(reminderIndex + 1)) { + if (message.role !== 'assistant') continue; + stepCount += 1; + for (const toolCall of message.toolCalls) { + if (WRITE_TOOL_NAMES.has(toolCall.name)) writeCallCount += 1; + else if (BASH_TOOL_NAMES.has(toolCall.name)) bashCallCount += 1; + else if (TODO_TOOL_NAMES.has(toolCall.name)) todoCallCount += 1; + } + } + return { stepCount, writeCallCount, bashCallCount, todoCallCount }; +} + +function percent(part: number, whole: number): number { + if (whole <= 0) return 0; + return Math.round((part / whole) * 100); +} + +function thousands(tokens: number): number { + return Math.round(tokens / 1000); +} diff --git a/packages/agent-core-v2/src/features/contextBudget/contextBudgetService.ts b/packages/agent-core-v2/src/features/contextBudget/contextBudgetService.ts new file mode 100644 index 00000000000..cdaef5d0d0b --- /dev/null +++ b/packages/agent-core-v2/src/features/contextBudget/contextBudgetService.ts @@ -0,0 +1,125 @@ +import { fromCallback, setup } from 'xstate'; + +import { createDecorator, IInstantiationService } from '#/_base/di/instantiation'; +import { + AgentActorService, + type AgentActorContext, + type AgentActorRestoreEvent, +} from '#/agent/actorService/agentActorService'; +import { IAgentFullCompactionService } from '#/agent/fullCompaction/fullCompaction'; +import { IAgentScopeContext } from '#/agent/scopeContext/scopeContext'; +import { ITelemetryService } from '#/app/telemetry/telemetry'; +import { IAgentReminderService } from '#/features/reminder/reminderService'; +import type { ContextInjectionResult } from '#/features/reminder/types'; +import { IEventDispatcher } from '#/state/eventDispatcher'; + +import { + COMPACTION_AHEAD_REMINDER_VARIANT, + CONTEXT_BUDGET_REMINDER_VARIANT, + compactionAheadLeadTokens, + contextBudgetBucket, + renderCompactionAheadReminder, + renderContextBudgetReminder, + shouldRemindCompactionAhead, + type ContextBudgetDisclosure, +} from './contextBudgetReminder'; + +interface ContextBudgetActorContext { + readonly runtime: AgentActorContext; +} + +const contextBudgetReminders = fromCallback(({ + input, +}: { + input: { + readonly runtime: AgentActorContext; + }; +}) => { + const runtime = input.runtime; + const reminder = runtime.get(IAgentReminderService); + const compaction = runtime.get(IAgentFullCompactionService); + const telemetry = runtime.get(ITelemetryService); + + const budgetRegistration = reminder.register( + CONTEXT_BUDGET_REMINDER_VARIANT, + ({ lastDisclosure }): ContextInjectionResult | undefined => { + const budget = compaction.budget(); + const bucket = contextBudgetBucket(budget); + if (bucket === undefined || lastDisclosure?.bucket === bucket) return undefined; + telemetry.track2('context_budget_reminder', { + bucket, + used_tokens: budget.used, + trigger_tokens: budget.triggerTokens, + max_tokens: budget.maxSize, + }); + return { content: renderContextBudgetReminder(budget), disclosure: { bucket } }; + }, + ); + + const aheadRegistration = reminder.register( + COMPACTION_AHEAD_REMINDER_VARIANT, + ({ lastInjection }): string | undefined => { + if (lastInjection !== undefined) return undefined; + const budget = compaction.budget(); + if (!shouldRemindCompactionAhead(budget)) return undefined; + telemetry.track2('compaction_ahead_reminder', { + used_tokens: budget.used, + trigger_tokens: budget.triggerTokens, + lead_tokens: compactionAheadLeadTokens(budget), + }); + return renderCompactionAheadReminder(budget); + }, + ); + + return () => { + budgetRegistration.dispose(); + aheadRegistration.dispose(); + }; +}); + +const contextBudgetActorLogic = setup({ + types: {} as { + context: ContextBudgetActorContext; + input: AgentActorContext; + events: AgentActorRestoreEvent; + }, + actors: { contextBudgetReminders }, +}).createMachine({ + context: ({ input }) => ({ runtime: input }), + initial: 'beforeRestore', + states: { + beforeRestore: { + on: { 'runtime.restore': 'active' }, + }, + active: { + invoke: { + src: 'contextBudgetReminders', + input: ({ context }) => ({ runtime: context.runtime }), + }, + }, + }, +}); + +export interface IAgentContextBudgetService { + readonly _serviceBrand: undefined; +} + +export const IAgentContextBudgetService = createDecorator( + 'agentContextBudgetService', +); + +export class AgentContextBudgetService + extends AgentActorService + implements IAgentContextBudgetService +{ + declare readonly _serviceBrand: undefined; + + constructor( + @IEventDispatcher dispatcher: IEventDispatcher, + @IAgentScopeContext scopeContext: IAgentScopeContext, + @IInstantiationService instantiation: IInstantiationService, + ) { + super(dispatcher, scopeContext, instantiation); + this.attachActor(contextBudgetActorLogic, { id: 'contextBudget' }); + } +} diff --git a/packages/agent-core-v2/test/features/contextBudget/contextBudget.test.ts b/packages/agent-core-v2/test/features/contextBudget/contextBudget.test.ts new file mode 100644 index 00000000000..e631ca79389 --- /dev/null +++ b/packages/agent-core-v2/test/features/contextBudget/contextBudget.test.ts @@ -0,0 +1,178 @@ +import { afterEach, beforeEach, describe, expect, it } from 'vitest'; + +import { IAgentContextMemoryService } from '#/agent/contextMemory/contextMemory'; +import type { ContextMessage } from '#/agent/contextMemory/types'; +import { IAgentLoopService } from '#/agent/loop/loop'; +import type { CompactionBudget } from '#/agent/fullCompaction/fullCompaction'; +import { + contextBudgetBucket, + renderCompactionAheadReminder, + renderContextBudgetReminder, + shouldRemindCompactionAhead, +} from '#/features/contextBudget/contextBudgetReminder'; + +import { runWillBeginStepHooks, type StubLoop } from '../../agent/loop/stubs'; +import { recordingTelemetry, type TelemetryRecord } from '../../app/telemetry/stubs'; +import { testAgent, type TestAgentContext } from '../../harness'; + +const PROVIDER = { + type: 'kimi', + apiKey: 'test-key', + baseUrl: 'https://api.example/v1', + model: 'kimi-code', +} as const; +const CAPABILITIES = { + image_in: true, + video_in: true, + audio_in: false, + thinking: true, + tool_use: true, + max_context_tokens: 100_000, +} as const; + +function budget(used: number, overrides: Partial = {}): CompactionBudget { + return { + used, + maxSize: 100_000, + triggerRatio: 0.85, + reservedContextSize: 0, + triggerTokens: 85_000, + ...overrides, + }; +} + +function reminders(context: IAgentContextMemoryService, variant: string): ContextMessage[] { + return context + .get() + .filter((message) => message.origin?.kind === 'injection' && message.origin.variant === variant); +} + +function textOf(message: ContextMessage | undefined): string { + const part = message?.content[0]; + return part?.type === 'text' ? part.text : ''; +} + +describe('context budget reminder rules', () => { + it('buckets usage by its share of the compaction trigger', () => { + expect(contextBudgetBucket(budget(42_499))).toBeUndefined(); + expect(contextBudgetBucket(budget(42_500))).toBe('half'); + expect(contextBudgetBucket(budget(63_749))).toBe('half'); + expect(contextBudgetBucket(budget(63_750))).toBe('three_quarters'); + expect(contextBudgetBucket(budget(76_500))).toBe('three_quarters'); + expect(contextBudgetBucket(budget(84_999))).toBe('three_quarters'); + expect(contextBudgetBucket(budget(90_000))).toBe('three_quarters'); + }); + + it('never buckets when compaction can never trigger', () => { + expect(contextBudgetBucket(budget(50_000, { triggerTokens: Number.POSITIVE_INFINITY }))).toBeUndefined(); + expect(contextBudgetBucket(budget(50_000, { maxSize: 0, triggerTokens: Number.POSITIVE_INFINITY }))).toBeUndefined(); + }); + + it('warns about compaction only inside the lead window and before the trigger', () => { + expect(shouldRemindCompactionAhead(budget(74_999))).toBe(false); + expect(shouldRemindCompactionAhead(budget(75_000))).toBe(true); + expect(shouldRemindCompactionAhead(budget(84_999))).toBe(true); + expect(shouldRemindCompactionAhead(budget(85_000))).toBe(false); + expect(shouldRemindCompactionAhead(budget(50_000, { triggerTokens: Number.POSITIVE_INFINITY }))).toBe(false); + }); + + it('renders the budget reminder with the numbers that drive compaction', () => { + const text = renderContextBudgetReminder(budget(41_000)); + + expect(text.startsWith('')).toBe(true); + expect(text.endsWith('')).toBe(true); + expect(text).toContain('~41% of the 100k-token window is used; automatic compaction runs at 85k (85%)'); + expect(text).toContain('capped at ~20k tokens'); + expect(text).toContain('Do not wrap up or stop early because of budget'); + expect(text).not.toContain('${'); + }); + + it('renders the compaction-ahead reminder with the remaining lead', () => { + const text = renderCompactionAheadReminder(budget(76_000)); + + expect(text.startsWith('')).toBe(true); + expect(text).toContain('Context is at ~76%; automatic compaction runs at 85% (about 9k tokens from now)'); + expect(text).toContain('text only — no tool calls'); + expect(text).toContain('Then continue the task; do not stop.'); + expect(text).not.toContain('${'); + }); +}); + +describe('context budget reminders in the agent', () => { + let ctx: TestAgentContext; + let context: IAgentContextMemoryService; + let loop: StubLoop; + let telemetry: TelemetryRecord[]; + + beforeEach(async () => { + telemetry = []; + ctx = testAgent({ + telemetry: recordingTelemetry(telemetry), + initialConfig: { loopControl: { reservedContextSize: 0 } }, + }); + ctx.configure({ provider: PROVIDER, modelCapabilities: CAPABILITIES }); + context = ctx.get(IAgentContextMemoryService); + loop = ctx.get(IAgentLoopService) as StubLoop; + await ctx.restorePersisted(); + }); + + afterEach(async () => { + await ctx.dispose(); + }); + + it('tells the model its budget once per bucket as usage grows', async () => { + ctx.appendExchange(1, 'user one', 'assistant one', 30_000); + await runWillBeginStepHooks(loop); + expect(reminders(context, 'context_budget')).toHaveLength(0); + + ctx.appendExchange(2, 'user two', 'assistant two', 45_000); + await runWillBeginStepHooks(loop); + const [first] = reminders(context, 'context_budget'); + expect(textOf(first)).toContain(''); + expect(textOf(first)).toContain('automatic compaction runs at 85k (85%)'); + expect(first?.origin).toMatchObject({ kind: 'injection', variant: 'context_budget', disclosure: { bucket: 'half' } }); + + await runWillBeginStepHooks(loop); + expect(reminders(context, 'context_budget')).toHaveLength(1); + + ctx.appendExchange(3, 'user three', 'assistant three', 65_000); + await runWillBeginStepHooks(loop); + const budgetReminders = reminders(context, 'context_budget'); + expect(budgetReminders).toHaveLength(2); + expect(budgetReminders[1]?.origin).toMatchObject({ disclosure: { bucket: 'three_quarters' } }); + expect(telemetry.filter((record) => record.event === 'context_budget_reminder')).toHaveLength(2); + }); + + it('warns once that compaction is ahead when the trigger is within the lead window', async () => { + ctx.appendExchange(1, 'user one', 'assistant one', 76_000); + await runWillBeginStepHooks(loop); + + const [ahead] = reminders(context, 'compaction_ahead'); + expect(textOf(ahead)).toContain(''); + expect(textOf(ahead)).toContain('This is your last chance to act'); + expect(reminders(context, 'context_budget')).toHaveLength(1); + expect(context.get().at(-1)?.origin).toMatchObject({ variant: 'compaction_ahead' }); + + await runWillBeginStepHooks(loop); + expect(reminders(context, 'compaction_ahead')).toHaveLength(1); + expect(telemetry.filter((record) => record.event === 'compaction_ahead_reminder')).toHaveLength(1); + }); + + it('re-arms both reminders after compaction clears the window', async () => { + ctx.appendExchange(1, 'user one', 'assistant one', 76_000); + await runWillBeginStepHooks(loop); + expect(reminders(context, 'compaction_ahead')).toHaveLength(1); + + const completed = ctx.once('compaction.completed'); + ctx.mockNextResponse({ type: 'text', text: 'Compacted summary.' }); + await ctx.rpc.beginCompaction({}); + await completed; + expect(reminders(context, 'compaction_ahead')).toHaveLength(0); + expect(reminders(context, 'context_budget')).toHaveLength(0); + + ctx.appendExchange(2, 'user two', 'assistant two', 77_000); + await runWillBeginStepHooks(loop); + expect(reminders(context, 'compaction_ahead')).toHaveLength(1); + expect(reminders(context, 'context_budget')).toHaveLength(1); + }); +}); diff --git a/packages/kap-server/test/globalSetup.ts b/packages/kap-server/test/globalSetup.ts new file mode 100644 index 00000000000..757b46523a7 --- /dev/null +++ b/packages/kap-server/test/globalSetup.ts @@ -0,0 +1,36 @@ +import { mkdtemp, rm } from 'node:fs/promises'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; + +import { IModelCatalog } from '@moonshot-ai/agent-core-v2'; +import type { TestProject } from 'vitest/node'; + +import { startServer } from '../src/start'; +import { fakeModelCatalog } from './helpers/fakeModelCatalog'; +import { fixedTokenAuth } from './helpers/fixedAuth'; +import { TEST_HOST_IDENTITY } from './helpers/hostIdentity'; + +export const SHARED_SERVER_TOKEN = 'test-token'; + +export default async function globalSetup(project: TestProject): Promise<() => Promise> { + process.env['KIMI_CODE_EXPERIMENTAL_SEARCH_WORKER'] = 'false'; + process.env['KIMI_CODE_EXPERIMENTAL_PERSISTENCE_MINIDB_READMODEL'] = 'false'; + const home = await mkdtemp(join(tmpdir(), 'kimi-kap-server-shared-home-')); + const server = await startServer({ + hostIdentity: TEST_HOST_IDENTITY, + host: '127.0.0.1', + port: 0, + homeDir: home, + logLevel: 'silent', + authTokenService: fixedTokenAuth(SHARED_SERVER_TOKEN), + seeds: [[IModelCatalog, fakeModelCatalog()]], + }); + project.provide('sharedServer', { + base: `http://127.0.0.1:${server.port}`, + token: SHARED_SERVER_TOKEN, + }); + return async () => { + await server.close(); + await rm(home, { recursive: true, force: true, maxRetries: 5, retryDelay: 50 }); + }; +} diff --git a/packages/kap-server/test/helpers/fakeModelCatalog.ts b/packages/kap-server/test/helpers/fakeModelCatalog.ts new file mode 100644 index 00000000000..846611b9dd5 --- /dev/null +++ b/packages/kap-server/test/helpers/fakeModelCatalog.ts @@ -0,0 +1,28 @@ +import { IModelCatalog } from '@moonshot-ai/agent-core-v2'; + +export function fakeModelCatalog(): IModelCatalog { + return { + _serviceBrand: undefined, + get: () => { + throw new Error('modelCatalog.get not exercised in this test'); + }, + getRequester: () => { + throw new Error('modelCatalog.getRequester not exercised in this test'); + }, + inspect: () => { + throw new Error('modelCatalog.inspect not exercised in this test'); + }, + ping: () => { + throw new Error('modelCatalog.ping not exercised in this test'); + }, + findByName: () => [], + listModels: async () => [], + listProviders: async () => [], + getProvider: async () => { + throw new Error('modelCatalog.getProvider not exercised in this test'); + }, + setDefaultModel: async () => { + throw new Error('modelCatalog.setDefaultModel not exercised in this test'); + }, + }; +} diff --git a/packages/kap-server/test/helpers/sharedServer.ts b/packages/kap-server/test/helpers/sharedServer.ts new file mode 100644 index 00000000000..941bd6fe718 --- /dev/null +++ b/packages/kap-server/test/helpers/sharedServer.ts @@ -0,0 +1,34 @@ +import { inject } from 'vitest'; + +export interface SharedServerContext { + readonly base: string; + readonly token: string; +} + +declare module 'vitest' { + interface ProvidedContext { + readonly sharedServer: SharedServerContext; + } +} + +export function sharedServer(): SharedServerContext { + return inject('sharedServer'); +} + +export function sharedAuthHeaders(extra: Record = {}): Record { + return { ...extra, authorization: `Bearer ${sharedServer().token}` }; +} + +interface SharedFetchOptions { + readonly method?: string; + readonly headers?: Record; + readonly body?: string; + readonly signal?: AbortSignal; +} + +export async function sharedAuthedFetch(path: string, init: SharedFetchOptions = {}): Promise { + return fetch(`${sharedServer().base}${path}`, { + ...init, + headers: sharedAuthHeaders(init.headers), + } as never); +} diff --git a/packages/kap-server/test/search/searchService.bench.ts b/packages/kap-server/test/search/searchService.bench.ts new file mode 100644 index 00000000000..d38c13765a8 --- /dev/null +++ b/packages/kap-server/test/search/searchService.bench.ts @@ -0,0 +1,235 @@ +import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; +import { monitorEventLoopDelay, performance, type IntervalHistogram } from 'node:perf_hooks'; + +import type { + IBootstrapService, + IFlagService, + ILogService, + ISessionIndex, + SessionSummary, +} from '@moonshot-ai/agent-core-v2'; +import { afterEach, beforeEach, describe, expect, it } from 'vitest'; + +import { + GlobalSearchService, + SEARCH_WORKER_FLAG_ID, + drainGlobalSearchDisposals, +} from '../../src/search/searchService'; + +const WS = 'ws_test'; + +const T1 = 1_700_000_000_000; + +function summary(id: string, title: string, updatedAt = T1): SessionSummary { + return { id, workspaceId: WS, title, createdAt: updatedAt, updatedAt, archived: false }; +} + +function makeBootstrap(home: string): IBootstrapService { + return { + homeDir: home, + scope: (name: string) => name, + } as unknown as IBootstrapService; +} + +function makeSessionIndex(list: ISessionIndex['listRecent']): ISessionIndex { + return { + _serviceBrand: undefined, + prepare: async () => ({ state: 'uninitialized', degradedCount: 0 }), + status: () => ({ state: 'uninitialized', degradedCount: 0 }), + listRecent: list, + get: async () => undefined, + count: async () => 0, + remove: async () => {}, + }; +} + +function staticIndex(summaries: SessionSummary[]): ISessionIndex { + return makeSessionIndex(async () => ({ items: summaries, nextCursor: undefined })); +} + +function userLine(text: string, time: number, origin?: unknown): string { + return JSON.stringify({ + type: 'context.append_message', + time, + message: { + role: 'user', + content: [{ type: 'text', text }], + origin: origin ?? { kind: 'user' }, + }, + }); +} + +function assistantLine(text: string, time: number): string { + return JSON.stringify({ + type: 'context.append_loop_event', + time, + event: { type: 'content.part', part: { type: 'text', text } }, + }); +} + +async function writeWire( + home: string, + sessionId: string, + agentId: string, + lines: string[], +): Promise { + const dir = join(home, 'sessions', WS, sessionId, 'agents', agentId); + await mkdir(dir, { recursive: true }); + const file = join(dir, 'wire.jsonl'); + await writeFile(file, lines.map((l) => `${l}\n`).join(''), 'utf8'); + return file; +} + +const noopLog = { + error: () => {}, + warn: () => {}, + info: () => {}, + debug: () => {}, +} as unknown as ILogService; + +function makeFlags(workerEnabled: boolean): IFlagService { + return { + enabled: (id: string) => id === SEARCH_WORKER_FLAG_ID && workerEnabled, + } as unknown as IFlagService; +} + +function makeService(home: string, index: ISessionIndex): GlobalSearchService { + const service = new GlobalSearchService(index, makeBootstrap(home), noopLog, makeFlags(true)); + service.syncDebounceMs = 0; + return service; +} + +describe('baseline: synthetic corpus', () => { + let home: string | undefined; + const services: GlobalSearchService[] = []; + + beforeEach(async () => { + home = await mkdtemp(join(tmpdir(), 'kimi-kap-search-baseline-')); + }); + + afterEach(async () => { + for (const service of services.splice(0)) service.dispose(); + await drainGlobalSearchDisposals(); + if (home !== undefined) { + await rm(home, { recursive: true, force: true }); + home = undefined; + } + }); + + const TOPICS = ['compaction', 'walrus', 'snapshot', 'recovery', '索引', '持久化']; + + async function writeCorpus(from: number, to: number): Promise { + const summaries: SessionSummary[] = []; + for (let i = from; i < to; i++) { + const id = `s${i}`; + summaries.push(summary(id, `session ${i} 索引讨论`, T1 + i)); + const lines: string[] = []; + for (let j = 0; j < 8; j++) { + lines.push(userLine(`session ${i} message ${j} about ${TOPICS[(i + j) % TOPICS.length]!}`, T1 + i * 100 + j)); + lines.push(assistantLine(`reply ${j} covering ${TOPICS[(i + 2 * j) % TOPICS.length]!}`, T1 + i * 100 + j + 1)); + } + await writeWire(home!, id, 'main', lines); + } + return summaries; + } + + async function medianMs(fn: () => Promise, runs = 5): Promise { + const times: number[] = []; + for (let r = 0; r < runs; r++) { + const t0 = performance.now(); + await fn(); + times.push(performance.now() - t0); + } + times.sort((a, b) => a - b); + return times[(times.length / 2) | 0]!; + } + + it('indexing and search latency scale within a linear budget from 100 to 400 sessions', async () => { + const all: SessionSummary[] = []; + const service = makeService(home!, staticIndex(all)); + services.push(service); + + all.push(...(await writeCorpus(0, 100))); + const t0 = performance.now(); + await service.reindex(); + const index100 = performance.now() - t0; + const terms100 = await medianMs(() => service.search({ query: 'compaction' })); + const literal100 = await medianMs(() => service.search({ query: 'message 3 about', mode: 'literal' })); + + all.push(...(await writeCorpus(100, 400))); + const t1 = performance.now(); + await service.reindex(); + const index400 = performance.now() - t1; + const terms400 = await medianMs(() => service.search({ query: 'compaction' })); + const literal400 = await medianMs(() => service.search({ query: 'message 3 about', mode: 'literal' })); + + const hits = await service.search({ query: 'compaction' }); + expect(hits.items.length).toBeGreaterThan(0); + expect((await service.search({ query: 'message 3 about', mode: 'literal' })).items.length).toBeGreaterThan(0); + + console.log( + `[baseline] searchService ${JSON.stringify({ + sessions: [100, 400], + reindexMs: [index100, index400], + termsMedianMs: [terms100, terms400], + literalMedianMs: [literal100, literal400], + })}`, + ); + expect(index400).toBeLessThan(index100 * 10 + 2000); + expect(terms400).toBeLessThan(terms100 * 10 + 100); + expect(literal400).toBeLessThan(literal100 * 10 + 100); + }, 120_000); + + it('stage-4: deep keyset pages cost like the first page, with a bounded event-loop pause', async () => { + const all: SessionSummary[] = []; + const service = makeService(home!, staticIndex(all)); + services.push(service); + all.push(...(await writeCorpus(0, 400))); + await service.reindex(); + + const eld: IntervalHistogram = monitorEventLoopDelay(); + eld.enable(); + try { + const tokens: (string | undefined)[] = [undefined]; + let page = await service.search({ query: 'message', sort: 'time_desc', pageSize: 20 }); + for (let p = 1; p < 10; p++) { + tokens.push(page.pageToken); + page = await service.search({ + query: 'message', + sort: 'time_desc', + pageSize: 20, + pageToken: page.pageToken, + }); + } + expect(page.items.length).toBe(20); + + const page1Ms = await medianMs(() => + service.search({ query: 'message', sort: 'time_desc', pageSize: 20 }), + ); + const page10Ms = await medianMs(() => + service.search({ query: 'message', sort: 'time_desc', pageSize: 20, pageToken: tokens[9] }), + ); + const literalMs = await medianMs(() => + service.search({ query: 'message 3 about', mode: 'literal' }), + ); + + const eldMaxMs = eld.max / 1e6; + const eldP99Ms = eld.percentile(99) / 1e6; + console.log( + `[baseline] stage4 ${JSON.stringify({ + sessions: 400, + page1MedianMs: page1Ms, + page10MedianMs: page10Ms, + literalMedianMs: literalMs, + eventLoopDelayMs: { p99: eldP99Ms, max: eldMaxMs }, + })}`, + ); + expect(page10Ms).toBeLessThan(page1Ms * 5 + 50); + expect(eldMaxMs).toBeLessThan(500); + } finally { + eld.disable(); + } + }, 120_000); +}); diff --git a/packages/kap-server/vitest.bench.config.ts b/packages/kap-server/vitest.bench.config.ts new file mode 100644 index 00000000000..f35a9cf325d --- /dev/null +++ b/packages/kap-server/vitest.bench.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from 'vitest/config'; + +import { rawTextPlugin } from '../../build/raw-text-plugin.mjs'; + +export default defineConfig({ + plugins: [rawTextPlugin()], + test: { + name: 'kap-server-bench', + include: ['test/**/*.bench.ts'], + setupFiles: ['test/setup.ts'], + }, +});