const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DSCno0m2.js","assets/index-DloS-pmm.css","assets/index2-C7YGxbrO.js","assets/chatbot-Dfd2mpvB.js","assets/FormItem-CHgZe7qM.js","assets/Alert-Cm6VlYYh.js","assets/Flex-CK9o7tXW.js","assets/get-slot-Bk_rJcZu.js","assets/assistant-Vu8dw-ko.js","assets/index3-taFg7ef2.js","assets/CodeBlockNode-HLQ5TA-U.js","assets/index4-BgHvAk1M.js","assets/index5-DJlccZkz.js","assets/index6-Bla8rVPT.js"])))=>i.map(i=>d[i]);
import{d as Se,E,a7 as Xs,a8 as qe,a9 as Rt,aa as _r,ab as So,ac as Tm,ad as vf,ae as Ao,af as yf,ag as Dm,ah as Em,ai as Mm,aj as Lm,y as Fe,C as je,x as Be,D as Ge,ak as ii,al as Rm,K as Zl,F as qr,U as G,am as _l,f as O,H as Yn,an as $m,G as kf,J as Hr,L as kr,ao as xt,ap as Im,aq as jr,ar as bo,as as Fm,M as an,at as cn,au as Ri,av as Om,aw as Nm,ax as Pm,ay as Bm,O as $n,P as bf,az as wl,aA as _f,aB as pn,T as Oe,aC as ir,aD as hs,aE as Qs,aF as Br,B as Xe,aG as vi,aH as Hi,W as Gl,aI as Js,aJ as ec,aK as tc,aL as Ur,aM as nc,aN as rc,aO as dt,aP as wf,Y as ar,aQ as ji,aR as xf,aS as zm,aT as Cf,aU as xl,aV as Sf,aW as Hm,aX as jm,aY as Cl,aZ as Vm,a_ as Wm,a$ as qm,b0 as Um,b1 as Ym,b2 as Km,b3 as Zm,b4 as Gm,b5 as Xm,b6 as Qm,b7 as Af,b8 as Jm,b9 as eg,ba as wn,a as Q,o as z,b as te,c as Ie,w as Ae,e as ge,p as Ue,h as se,Z as Tf,g as ot,bb as tg,bc as Df,X as Xl,a4 as Qe,a5 as gt,a6 as Ft,t as $e,Q as hi,bd as Ef,N as ic,be as Ql,R as gn,bf as ng,bg as rg,bh as tn,_ as oc,bi as Jl,bj as ea,V as Vo,bk as To,s as br,bl as Xn,bm as Mi,bn as ci,bo as ig,bp as Cn,bq as og,br as lg,S as lc,bs as ag,bt as sg,bu as cg,a1 as ug,bv as dg,l as fg,bw as hg,bx as pg,by as mg,bz as gg,bA as vg,bB as yg,bC as kg,bD as bg,bE as _g,bF as wg}from"./index-DSCno0m2.js";import{f as xg}from"./chatbot-Dfd2mpvB.js";import{F as Vi,B as Wi,b as qi,c as Ui,N as Cg,a as ps}from"./FormItem-CHgZe7qM.js";import{N as Sg}from"./Alert-Cm6VlYYh.js";import{N as ms}from"./Flex-CK9o7tXW.js";import{f as Ag}from"./assistant-Vu8dw-ko.js";const Tg=Se({name:"ChevronLeft",render(){return E("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},E("path",{d:"M10.3536 3.14645C10.5488 3.34171 10.5488 3.65829 10.3536 3.85355L6.20711 8L10.3536 12.1464C10.5488 12.3417 10.5488 12.6583 10.3536 12.8536C10.1583 13.0488 9.84171 13.0488 9.64645 12.8536L5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L9.64645 3.14645C9.84171 2.95118 10.1583 2.95118 10.3536 3.14645Z",fill:"currentColor"}))}}),nu=Xs("date",()=>E("svg",{width:"28px",height:"28px",viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},E("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},E("g",{"fill-rule":"nonzero"},E("path",{d:"M21.75,3 C23.5449254,3 25,4.45507456 25,6.25 L25,21.75 C25,23.5449254 23.5449254,25 21.75,25 L6.25,25 C4.45507456,25 3,23.5449254 3,21.75 L3,6.25 C3,4.45507456 4.45507456,3 6.25,3 L21.75,3 Z M23.5,9.503 L4.5,9.503 L4.5,21.75 C4.5,22.7164983 5.28350169,23.5 6.25,23.5 L21.75,23.5 C22.7164983,23.5 23.5,22.7164983 23.5,21.75 L23.5,9.503 Z M21.75,4.5 L6.25,4.5 C5.28350169,4.5 4.5,5.28350169 4.5,6.25 L4.5,8.003 L23.5,8.003 L23.5,6.25 C23.5,5.28350169 22.7164983,4.5 21.75,4.5 Z"}))))),Dg=Xs("time",()=>E("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},E("path",{d:"M256,64C150,64,64,150,64,256s86,192,192,192,192-86,192-192S362,64,256,64Z",style:`
        fill: none;
        stroke: currentColor;
        stroke-miterlimit: 10;
        stroke-width: 32px;
      `}),E("polyline",{points:"256 128 256 272 352 272",style:`
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 32px;
      `}))),Eg=Xs("to",()=>E("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},E("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},E("g",{fill:"currentColor","fill-rule":"nonzero"},E("path",{d:"M11.2654,3.20511 C10.9644,2.92049 10.4897,2.93371 10.2051,3.23464 C9.92049,3.53558 9.93371,4.01027 10.2346,4.29489 L15.4737,9.25 L2.75,9.25 C2.33579,9.25 2,9.58579 2,10.0000012 C2,10.4142 2.33579,10.75 2.75,10.75 L15.476,10.75 L10.2346,15.7073 C9.93371,15.9919 9.92049,16.4666 10.2051,16.7675 C10.4897,17.0684 10.9644,17.0817 11.2654,16.797 L17.6826,10.7276 C17.8489,10.5703 17.9489,10.3702 17.9826,10.1614 C17.994,10.1094 18,10.0554 18,10.0000012 C18,9.94241 17.9935,9.88633 17.9812,9.83246 C17.9462,9.62667 17.8467,9.42976 17.6826,9.27455 L11.2654,3.20511 Z"})))));function Li(e,t,n){const r=qe(e,n?.in);return isNaN(t)?Rt(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Qt(e,t,n){const r=qe(e,n?.in);if(isNaN(t))return Rt(e,NaN);if(!t)return r;const i=r.getDate(),o=Rt(e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const l=o.getDate();return i>=l?o:(r.setFullYear(o.getFullYear(),o.getMonth(),i),r)}function Yi(e,t){return _r(e,{...t,weekStartsOn:1})}function Mf(e,t){const n=qe(e,t?.in),r=n.getFullYear(),i=Rt(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const o=Yi(i),l=Rt(n,0);l.setFullYear(r,0,4),l.setHours(0,0,0,0);const a=Yi(l);return n.getTime()>=o.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function Sl(e){const t=qe(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ki(e,t){const n=qe(e,t?.in);return n.setHours(0,0,0,0),n}function Mg(e,t,n){const[r,i]=So(n?.in,e,t),o=Ki(r),l=Ki(i),a=+o-Sl(o),s=+l-Sl(l);return Math.round((a-s)/Tm)}function Lg(e,t){const n=Mf(e,t),r=Rt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Yi(r)}function Rg(e,t,n){return Qt(e,t*3,n)}function gs(e,t,n){return Qt(e,t*12,n)}function $g(e,t,n){const[r,i]=So(n?.in,e,t);return+Ki(r)==+Ki(i)}function Ig(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function qn(e){return!(!Ig(e)&&typeof e!="number"||isNaN(+qe(e)))}function Fg(e,t){const n=qe(e,t?.in);return Math.trunc(n.getMonth()/3)+1}function _o(e,t){const n=qe(e,t?.in),r=n.getMonth(),i=r-r%3;return n.setMonth(i,1),n.setHours(0,0,0,0),n}function vr(e,t){const n=qe(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Do(e,t){const n=qe(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Og(e,t){const n=qe(e,t?.in);return Mg(n,Do(n))+1}function Lf(e,t){const n=qe(e,t?.in),r=+Yi(n)-+Lg(n);return Math.round(r/vf)+1}function ac(e,t){const n=qe(e,t?.in),r=n.getFullYear(),i=Ao(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,l=Rt(t?.in||e,0);l.setFullYear(r+1,0,o),l.setHours(0,0,0,0);const a=_r(l,t),s=Rt(t?.in||e,0);s.setFullYear(r,0,o),s.setHours(0,0,0,0);const c=_r(s,t);return+n>=+a?r+1:+n>=+c?r:r-1}function Ng(e,t){const n=Ao(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=ac(e,t),o=Rt(t?.in||e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),_r(o,t)}function Rf(e,t){const n=qe(e,t?.in),r=+_r(n,t)-+Ng(n,t);return Math.round(r/vf)+1}function ct(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Lr={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ct(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ct(n+1,2)},d(e,t){return ct(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ct(e.getHours()%12||12,t.length)},H(e,t){return ct(e.getHours(),t.length)},m(e,t){return ct(e.getMinutes(),t.length)},s(e,t){return ct(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return ct(i,t.length)}},_i={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ru={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Lr.y(e,t)},Y:function(e,t,n,r){const i=ac(e,r),o=i>0?i:1-i;if(t==="YY"){const l=o%100;return ct(l,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):ct(o,t.length)},R:function(e,t){const n=Mf(e);return ct(n,t.length)},u:function(e,t){const n=e.getFullYear();return ct(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ct(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ct(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Lr.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ct(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=Rf(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):ct(i,t.length)},I:function(e,t,n){const r=Lf(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ct(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Lr.d(e,t)},D:function(e,t,n){const r=Og(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ct(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return ct(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return ct(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return ct(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=_i.noon:r===0?i=_i.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=_i.evening:r>=12?i=_i.afternoon:r>=4?i=_i.morning:i=_i.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Lr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Lr.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ct(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ct(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Lr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Lr.s(e,t)},S:function(e,t){return Lr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return ou(r);case"XXXX":case"XX":return ri(r);default:return ri(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return ou(r);case"xxxx":case"xx":return ri(r);default:return ri(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+iu(r,":");default:return"GMT"+ri(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+iu(r,":");default:return"GMT"+ri(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return ct(r,t.length)},T:function(e,t,n){return ct(+e,t.length)}};function iu(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+ct(o,2)}function ou(e,t){return e%60===0?(e>0?"-":"+")+ct(Math.abs(e)/60,2):ri(e,t)}function ri(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=ct(Math.trunc(r/60),2),o=ct(r%60,2);return n+i+t+o}const lu=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},$f=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Pg=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return lu(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",lu(r,t)).replace("{{time}}",$f(i,t))},vs={p:$f,P:Pg},Bg=/^D+$/,zg=/^Y+$/,Hg=["D","DD","YY","YYYY"];function If(e){return Bg.test(e)}function Ff(e){return zg.test(e)}function ys(e,t,n){const r=jg(e,t,n);if(console.warn(r),Hg.includes(e))throw new RangeError(r)}function jg(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Vg=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Wg=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,qg=/^'([^]*?)'?$/,Ug=/''/g,Yg=/[a-zA-Z]/;function ut(e,t,n){const r=Ao(),i=n?.locale??r.locale??yf,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,l=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=qe(e,n?.in);if(!qn(a))throw new RangeError("Invalid time value");let s=t.match(Wg).map(f=>{const u=f[0];if(u==="p"||u==="P"){const d=vs[u];return d(f,i.formatLong)}return f}).join("").match(Vg).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const u=f[0];if(u==="'")return{isToken:!1,value:Kg(f)};if(ru[u])return{isToken:!0,value:f};if(u.match(Yg))throw new RangeError("Format string contains an unescaped latin alphabet character `"+u+"`");return{isToken:!1,value:f}});i.localize.preprocessor&&(s=i.localize.preprocessor(a,s));const c={firstWeekContainsDate:o,weekStartsOn:l,locale:i};return s.map(f=>{if(!f.isToken)return f.value;const u=f.value;(!n?.useAdditionalWeekYearTokens&&Ff(u)||!n?.useAdditionalDayOfYearTokens&&If(u))&&ys(u,t,String(e));const d=ru[u[0]];return d(a,u,i.localize,c)}).join("")}function Kg(e){const t=e.match(qg);return t?t[1].replace(Ug,"'"):e}function Vn(e,t){return qe(e,t?.in).getDate()}function Zg(e,t){return qe(e,t?.in).getDay()}function Gg(e,t){const n=qe(e,t?.in),r=n.getFullYear(),i=n.getMonth(),o=Rt(n,0);return o.setFullYear(r,i+1,0),o.setHours(0,0,0,0),o.getDate()}function Of(){return Object.assign({},Ao())}function Fr(e,t){return qe(e,t?.in).getHours()}function Xg(e,t){const n=qe(e,t?.in).getDay();return n===0?7:n}function Qg(e){return qe(e).getMilliseconds()}function Al(e,t){return qe(e,t?.in).getMinutes()}function kt(e,t){return qe(e,t?.in).getMonth()}function Tl(e){return qe(e).getSeconds()}function ve(e){return+qe(e)}function Dt(e,t){return qe(e,t?.in).getFullYear()}function Jg(e,t){const n=e0(t)?new t(0):Rt(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function e0(e){return typeof e=="function"&&e.prototype?.constructor===e}const t0=10;class Nf{subPriority=0;validate(t,n){return!0}}class n0 extends Nf{constructor(t,n,r,i,o){super(),this.value=t,this.validateValue=n,this.setValue=r,this.priority=i,o&&(this.subPriority=o)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,r){return this.setValue(t,n,this.value,r)}}class r0 extends Nf{priority=t0;subPriority=-1;constructor(t,n){super(),this.context=t||(r=>Rt(n,r))}set(t,n){return n.timestampIsSet?t:Rt(t,Jg(t,this.context))}}class rt{run(t,n,r,i){const o=this.parse(t,n,r,i);return o?{setter:new n0(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,n,r){return!0}}class i0 extends rt{priority=140;parse(t,n,r){switch(n){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,n,r){return n.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const Ot={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},nr={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Nt(e,t){return e&&{value:t(e.value),rest:e.rest}}function Mt(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function rr(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const r=n[1]==="+"?1:-1,i=n[2]?parseInt(n[2],10):0,o=n[3]?parseInt(n[3],10):0,l=n[5]?parseInt(n[5],10):0;return{value:r*(i*Dm+o*Em+l*Mm),rest:t.slice(n[0].length)}}function Pf(e){return Mt(Ot.anyDigitsSigned,e)}function $t(e,t){switch(e){case 1:return Mt(Ot.singleDigit,t);case 2:return Mt(Ot.twoDigits,t);case 3:return Mt(Ot.threeDigits,t);case 4:return Mt(Ot.fourDigits,t);default:return Mt(new RegExp("^\\d{1,"+e+"}"),t)}}function Dl(e,t){switch(e){case 1:return Mt(Ot.singleDigitSigned,t);case 2:return Mt(Ot.twoDigitsSigned,t);case 3:return Mt(Ot.threeDigitsSigned,t);case 4:return Mt(Ot.fourDigitsSigned,t);default:return Mt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function sc(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Bf(e,t){const n=t>0,r=n?t:1-t;let i;if(r<=50)i=e||100;else{const o=r+50,l=Math.trunc(o/100)*100,a=e>=o%100;i=e+l-(a?100:0)}return n?i:1-i}function zf(e){return e%400===0||e%4===0&&e%100!==0}class o0 extends rt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,r){const i=o=>({year:o,isTwoDigitYear:n==="yy"});switch(n){case"y":return Nt($t(4,t),i);case"yo":return Nt(r.ordinalNumber(t,{unit:"year"}),i);default:return Nt($t(n.length,t),i)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,r){const i=t.getFullYear();if(r.isTwoDigitYear){const l=Bf(r.year,i);return t.setFullYear(l,0,1),t.setHours(0,0,0,0),t}const o=!("era"in n)||n.era===1?r.year:1-r.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class l0 extends rt{priority=130;parse(t,n,r){const i=o=>({year:o,isTwoDigitYear:n==="YY"});switch(n){case"Y":return Nt($t(4,t),i);case"Yo":return Nt(r.ordinalNumber(t,{unit:"year"}),i);default:return Nt($t(n.length,t),i)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,r,i){const o=ac(t,i);if(r.isTwoDigitYear){const a=Bf(r.year,o);return t.setFullYear(a,0,i.firstWeekContainsDate),t.setHours(0,0,0,0),_r(t,i)}const l=!("era"in n)||n.era===1?r.year:1-r.year;return t.setFullYear(l,0,i.firstWeekContainsDate),t.setHours(0,0,0,0),_r(t,i)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class a0 extends rt{priority=130;parse(t,n){return Dl(n==="R"?4:n.length,t)}set(t,n,r){const i=Rt(t,0);return i.setFullYear(r,0,4),i.setHours(0,0,0,0),Yi(i)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class s0 extends rt{priority=130;parse(t,n){return Dl(n==="u"?4:n.length,t)}set(t,n,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class c0 extends rt{priority=120;parse(t,n,r){switch(n){case"Q":case"QQ":return $t(n.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,r){return t.setMonth((r-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class u0 extends rt{priority=120;parse(t,n,r){switch(n){case"q":case"qq":return $t(n.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,r){return t.setMonth((r-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class d0 extends rt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,r){const i=o=>o-1;switch(n){case"M":return Nt(Mt(Ot.month,t),i);case"MM":return Nt($t(2,t),i);case"Mo":return Nt(r.ordinalNumber(t,{unit:"month"}),i);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}}class f0 extends rt{priority=110;parse(t,n,r){const i=o=>o-1;switch(n){case"L":return Nt(Mt(Ot.month,t),i);case"LL":return Nt($t(2,t),i);case"Lo":return Nt(r.ordinalNumber(t,{unit:"month"}),i);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function h0(e,t,n){const r=qe(e,n?.in),i=Rf(r,n)-t;return r.setDate(r.getDate()-i*7),qe(r,n?.in)}class p0 extends rt{priority=100;parse(t,n,r){switch(n){case"w":return Mt(Ot.week,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return $t(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,r,i){return _r(h0(t,r,i),i)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function m0(e,t,n){const r=qe(e,n?.in),i=Lf(r,n)-t;return r.setDate(r.getDate()-i*7),r}class g0 extends rt{priority=100;parse(t,n,r){switch(n){case"I":return Mt(Ot.week,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return $t(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,r){return Yi(m0(t,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const v0=[31,28,31,30,31,30,31,31,30,31,30,31],y0=[31,29,31,30,31,30,31,31,30,31,30,31];class k0 extends rt{priority=90;subPriority=1;parse(t,n,r){switch(n){case"d":return Mt(Ot.date,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return $t(n.length,t)}}validate(t,n){const r=t.getFullYear(),i=zf(r),o=t.getMonth();return i?n>=1&&n<=y0[o]:n>=1&&n<=v0[o]}set(t,n,r){return t.setDate(r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class b0 extends rt{priority=90;subpriority=1;parse(t,n,r){switch(n){case"D":case"DD":return Mt(Ot.dayOfYear,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return $t(n.length,t)}}validate(t,n){const r=t.getFullYear();return zf(r)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function cc(e,t,n){const r=Ao(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=qe(e,n?.in),l=o.getDay(),s=(t%7+7)%7,c=7-i,f=t<0||t>6?t-(l+c)%7:(s+c)%7-(l+c)%7;return Li(o,f,n)}class _0 extends rt{priority=90;parse(t,n,r){switch(n){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,r,i){return t=cc(t,r,i),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class w0 extends rt{priority=90;parse(t,n,r,i){const o=l=>{const a=Math.floor((l-1)/7)*7;return(l+i.weekStartsOn+6)%7+a};switch(n){case"e":case"ee":return Nt($t(n.length,t),o);case"eo":return Nt(r.ordinalNumber(t,{unit:"day"}),o);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,r,i){return t=cc(t,r,i),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class x0 extends rt{priority=90;parse(t,n,r,i){const o=l=>{const a=Math.floor((l-1)/7)*7;return(l+i.weekStartsOn+6)%7+a};switch(n){case"c":case"cc":return Nt($t(n.length,t),o);case"co":return Nt(r.ordinalNumber(t,{unit:"day"}),o);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,r,i){return t=cc(t,r,i),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function C0(e,t,n){const r=qe(e,n?.in),i=Xg(r,n),o=t-i;return Li(r,o,n)}class S0 extends rt{priority=90;parse(t,n,r){const i=o=>o===0?7:o;switch(n){case"i":case"ii":return $t(n.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return Nt(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),i);case"iiiii":return Nt(r.day(t,{width:"narrow",context:"formatting"}),i);case"iiiiii":return Nt(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),i);default:return Nt(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),i)}}validate(t,n){return n>=1&&n<=7}set(t,n,r){return t=C0(t,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class A0 extends rt{priority=80;parse(t,n,r){switch(n){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,r){return t.setHours(sc(r),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class T0 extends rt{priority=80;parse(t,n,r){switch(n){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,r){return t.setHours(sc(r),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class D0 extends rt{priority=80;parse(t,n,r){switch(n){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,r){return t.setHours(sc(r),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class E0 extends rt{priority=70;parse(t,n,r){switch(n){case"h":return Mt(Ot.hour12h,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return $t(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,r){const i=t.getHours()>=12;return i&&r<12?t.setHours(r+12,0,0,0):!i&&r===12?t.setHours(0,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class M0 extends rt{priority=70;parse(t,n,r){switch(n){case"H":return Mt(Ot.hour23h,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return $t(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,r){return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class L0 extends rt{priority=70;parse(t,n,r){switch(n){case"K":return Mt(Ot.hour11h,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return $t(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class R0 extends rt{priority=70;parse(t,n,r){switch(n){case"k":return Mt(Ot.hour24h,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return $t(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,r){const i=r<=24?r%24:r;return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class $0 extends rt{priority=60;parse(t,n,r){switch(n){case"m":return Mt(Ot.minute,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return $t(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,r){return t.setMinutes(r,0,0),t}incompatibleTokens=["t","T"]}class I0 extends rt{priority=50;parse(t,n,r){switch(n){case"s":return Mt(Ot.second,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return $t(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,r){return t.setSeconds(r,0),t}incompatibleTokens=["t","T"]}class F0 extends rt{priority=30;parse(t,n){const r=i=>Math.trunc(i*Math.pow(10,-n.length+3));return Nt($t(n.length,t),r)}set(t,n,r){return t.setMilliseconds(r),t}incompatibleTokens=["t","T"]}class O0 extends rt{priority=10;parse(t,n){switch(n){case"X":return rr(nr.basicOptionalMinutes,t);case"XX":return rr(nr.basic,t);case"XXXX":return rr(nr.basicOptionalSeconds,t);case"XXXXX":return rr(nr.extendedOptionalSeconds,t);default:return rr(nr.extended,t)}}set(t,n,r){return n.timestampIsSet?t:Rt(t,t.getTime()-Sl(t)-r)}incompatibleTokens=["t","T","x"]}class N0 extends rt{priority=10;parse(t,n){switch(n){case"x":return rr(nr.basicOptionalMinutes,t);case"xx":return rr(nr.basic,t);case"xxxx":return rr(nr.basicOptionalSeconds,t);case"xxxxx":return rr(nr.extendedOptionalSeconds,t);default:return rr(nr.extended,t)}}set(t,n,r){return n.timestampIsSet?t:Rt(t,t.getTime()-Sl(t)-r)}incompatibleTokens=["t","T","X"]}class P0 extends rt{priority=40;parse(t){return Pf(t)}set(t,n,r){return[Rt(t,r*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class B0 extends rt{priority=20;parse(t){return Pf(t)}set(t,n,r){return[Rt(t,r),{timestampIsSet:!0}]}incompatibleTokens="*"}const z0={G:new i0,y:new o0,Y:new l0,R:new a0,u:new s0,Q:new c0,q:new u0,M:new d0,L:new f0,w:new p0,I:new g0,d:new k0,D:new b0,E:new _0,e:new w0,c:new x0,i:new S0,a:new A0,b:new T0,B:new D0,h:new E0,H:new M0,K:new L0,k:new R0,m:new $0,s:new I0,S:new F0,X:new O0,x:new N0,t:new P0,T:new B0},H0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,j0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,V0=/^'([^]*?)'?$/,W0=/''/g,q0=/\S/,U0=/[a-zA-Z]/;function Y0(e,t,n,r){const i=()=>Rt(r?.in||n,NaN),o=Of(),l=r?.locale??o.locale??yf,a=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(!t)return e?i():qe(n,r?.in);const c={firstWeekContainsDate:a,weekStartsOn:s,locale:l},f=[new r0(r?.in,n)],u=t.match(j0).map(v=>{const y=v[0];if(y in vs){const g=vs[y];return g(v,l.formatLong)}return v}).join("").match(H0),d=[];for(let v of u){!r?.useAdditionalWeekYearTokens&&Ff(v)&&ys(v,t,e),!r?.useAdditionalDayOfYearTokens&&If(v)&&ys(v,t,e);const y=v[0],g=z0[y];if(g){const{incompatibleTokens:b}=g;if(Array.isArray(b)){const _=d.find(T=>b.includes(T.token)||T.token===y);if(_)throw new RangeError(`The format string mustn't contain \`${_.fullToken}\` and \`${v}\` at the same time`)}else if(g.incompatibleTokens==="*"&&d.length>0)throw new RangeError(`The format string mustn't contain \`${v}\` and any other token at the same time`);d.push({token:y,fullToken:v});const k=g.run(e,v,l.match,c);if(!k)return i();f.push(k.setter),e=k.rest}else{if(y.match(U0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");if(v==="''"?v="'":y==="'"&&(v=K0(v)),e.indexOf(v)===0)e=e.slice(v.length);else return i()}}if(e.length>0&&q0.test(e))return i();const h=f.map(v=>v.priority).sort((v,y)=>y-v).filter((v,y,g)=>g.indexOf(v)===y).map(v=>f.filter(y=>y.priority===v).sort((y,g)=>g.subPriority-y.subPriority)).map(v=>v[0]);let p=qe(n,r?.in);if(isNaN(+p))return i();const m={};for(const v of h){if(!v.validate(p,c))return i();const y=v.set(p,m,c);Array.isArray(y)?(p=y[0],Object.assign(m,y[1])):p=y}return p}function K0(e){return e.match(V0)[1].replace(W0,"'")}function Z0(e,t){const n=qe(e,t?.in);return n.setMinutes(0,0,0),n}function G0(e,t){const n=qe(e,t?.in);return n.setSeconds(0,0),n}function Eo(e,t,n){const[r,i]=So(n?.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function Hf(e,t,n){const[r,i]=So(n?.in,e,t);return+_o(r)==+_o(i)}function uc(e,t){const n=qe(e,t?.in);return n.setMilliseconds(0),n}function jf(e,t,n){const[r,i]=So(n?.in,e,t);return r.getFullYear()===i.getFullYear()}function dc(e,t,n){const r=qe(e,n?.in),i=r.getFullYear(),o=r.getDate(),l=Rt(e,0);l.setFullYear(i,t,15),l.setHours(0,0,0,0);const a=Gg(l);return r.setMonth(t,Math.min(o,a)),r}function Jt(e,t,n){let r=qe(e,n?.in);return isNaN(+r)?Rt(e,NaN):(t.year!=null&&r.setFullYear(t.year),t.month!=null&&(r=dc(r,t.month)),t.date!=null&&r.setDate(t.date),t.hours!=null&&r.setHours(t.hours),t.minutes!=null&&r.setMinutes(t.minutes),t.seconds!=null&&r.setSeconds(t.seconds),t.milliseconds!=null&&r.setMilliseconds(t.milliseconds),r)}function Jr(e,t,n){const r=qe(e,n?.in);return r.setHours(t),r}function xa(e,t,n){const r=qe(e,n?.in);return r.setMinutes(t),r}function X0(e,t,n){const r=qe(e,n?.in),i=Math.trunc(r.getMonth()/3)+1,o=t-i;return dc(r,r.getMonth()+o*3)}function Ca(e,t,n){const r=qe(e,n?.in);return r.setSeconds(t),r}function ks(e,t,n){const r=qe(e,n?.in);return isNaN(+r)?Rt(e,NaN):(r.setFullYear(t),r)}const Q0={date:$g,month:Eo,year:jf,quarter:Hf};function J0(e){return(t,n)=>{const r=e1(e);return Lm(t,n,{weekStartsOn:r})}}function e1(e){return(e+1)%7}function fn(e,t,n,r=0){return(n==="week"?J0(r):Q0[n])(e,t)}function Sa(e,t,n,r,i,o){return i==="date"?t1(e,t,n,r):n1(e,t,n,r,o)}function t1(e,t,n,r){let i=!1,o=!1,l=!1;Array.isArray(n)&&(n[0]<e&&e<n[1]&&(i=!0),fn(n[0],e,"date")&&(o=!0),fn(n[1],e,"date")&&(l=!0));const a=n!==null&&(Array.isArray(n)?fn(n[0],e,"date")||fn(n[1],e,"date"):fn(n,e,"date"));return{type:"date",dateObject:{date:Vn(e),month:kt(e),year:Dt(e)},inCurrentMonth:Eo(e,t),isCurrentDate:fn(r,e,"date"),inSpan:i,inSelectedWeek:!1,startOfSpan:o,endOfSpan:l,selected:a,ts:ve(e)}}function Vf(e,t,n){const r=new Date(2e3,e,1).getTime();return ut(r,t,{locale:n})}function Wf(e,t,n){const r=new Date(e,1,1).getTime();return ut(r,t,{locale:n})}function qf(e,t,n){const r=new Date(2e3,e*3-2,1).getTime();return ut(r,t,{locale:n})}function n1(e,t,n,r,i){let o=!1,l=!1,a=!1;Array.isArray(n)&&(n[0]<e&&e<n[1]&&(o=!0),fn(n[0],e,"week",i)&&(l=!0),fn(n[1],e,"week",i)&&(a=!0));const s=n!==null&&(Array.isArray(n)?fn(n[0],e,"week",i)||fn(n[1],e,"week",i):fn(n,e,"week",i));return{type:"date",dateObject:{date:Vn(e),month:kt(e),year:Dt(e)},inCurrentMonth:Eo(e,t),isCurrentDate:fn(r,e,"date"),inSpan:o,startOfSpan:l,endOfSpan:a,selected:!1,inSelectedWeek:s,ts:ve(e)}}function r1(e,t,n,{monthFormat:r}){return{type:"month",monthFormat:r,dateObject:{month:kt(e),year:Dt(e)},isCurrent:Eo(n,e),selected:t!==null&&fn(t,e,"month"),ts:ve(e)}}function i1(e,t,n,{yearFormat:r}){return{type:"year",yearFormat:r,dateObject:{year:Dt(e)},isCurrent:jf(n,e),selected:t!==null&&fn(t,e,"year"),ts:ve(e)}}function o1(e,t,n,{quarterFormat:r}){return{type:"quarter",quarterFormat:r,dateObject:{quarter:Fg(e),year:Dt(e)},isCurrent:Hf(n,e),selected:t!==null&&fn(t,e,"quarter"),ts:ve(e)}}function bs(e,t,n,r,i=!1,o=!1){const l=o?"week":"date",a=kt(e);let s=ve(vr(e)),c=ve(Li(s,-1));const f=[];let u=!i;for(;Zg(c)!==r||u;)f.unshift(Sa(c,e,t,n,l,r)),c=ve(Li(c,-1)),u=!1;for(;kt(s)===a;)f.push(Sa(s,e,t,n,l,r)),s=ve(Li(s,1));const d=i?f.length<=28?28:f.length<=35?35:42:42;for(;f.length<d;)f.push(Sa(s,e,t,n,l,r)),s=ve(Li(s,1));return f}function _s(e,t,n,r){const i=[],o=Do(e);for(let l=0;l<12;l++)i.push(r1(ve(Qt(o,l)),t,n,r));return i}function ws(e,t,n,r){const i=[],o=Do(e);for(let l=0;l<4;l++)i.push(o1(ve(Rg(o,l)),t,n,r));return i}function xs(e,t,n,r){const i=r.value,o=[],l=Do(ks(new Date,i[0]));for(let a=0;a<i[1]-i[0];a++)o.push(i1(ve(gs(l,a)),e,t,n));return o}function xn(e,t,n,r){const i=Y0(e,t,n,r);return qn(i)?ut(i,t,r)===e?i:new Date(Number.NaN):i}function l1(e,t){const n=t(e);return $i(n)}function au(e,t,n,r){const i=t(e,n,r);return $i(i)}function $i(e){if(e===void 0)return;if(typeof e=="number")return e;const[t,n,r]=e.split(":");return{hours:Number(t),minutes:Number(n),seconds:Number(r)}}function wi(e,t){return Array.isArray(e)?e[t==="start"?0:1]:null}const a1=Fe("collapse","width: 100%;",[Fe("collapse-item",`
 font-size: var(--n-font-size);
 color: var(--n-text-color);
 transition:
 color .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
 margin: var(--n-item-margin);
 `,[je("disabled",[Ge("header","cursor: not-allowed;",[Ge("header-main",`
 color: var(--n-title-text-color-disabled);
 `),Fe("collapse-item-arrow",`
 color: var(--n-arrow-color-disabled);
 `)])]),Fe("collapse-item","margin-left: 32px;"),Be("&:first-child","margin-top: 0;"),Be("&:first-child >",[Ge("header","padding-top: 0;")]),je("left-arrow-placement",[Ge("header",[Fe("collapse-item-arrow","margin-right: 4px;")])]),je("right-arrow-placement",[Ge("header",[Fe("collapse-item-arrow","margin-left: 4px;")])]),Ge("content-wrapper",[Ge("content-inner","padding-top: 16px;"),Rm({duration:"0.15s"})]),je("active",[Ge("header",[je("active",[Fe("collapse-item-arrow","transform: rotate(90deg);")])])]),Be("&:not(:first-child)","border-top: 1px solid var(--n-divider-color);"),ii("disabled",[je("trigger-area-main",[Ge("header",[Ge("header-main","cursor: pointer;"),Fe("collapse-item-arrow","cursor: default;")])]),je("trigger-area-arrow",[Ge("header",[Fe("collapse-item-arrow","cursor: pointer;")])]),je("trigger-area-extra",[Ge("header",[Ge("header-extra","cursor: pointer;")])])]),Ge("header",`
 font-size: var(--n-title-font-size);
 display: flex;
 flex-wrap: nowrap;
 align-items: center;
 transition: color .3s var(--n-bezier);
 position: relative;
 padding: var(--n-title-padding);
 color: var(--n-title-text-color);
 `,[Ge("header-main",`
 display: flex;
 flex-wrap: nowrap;
 align-items: center;
 font-weight: var(--n-title-font-weight);
 transition: color .3s var(--n-bezier);
 flex: 1;
 color: var(--n-title-text-color);
 `),Ge("header-extra",`
 display: flex;
 align-items: center;
 transition: color .3s var(--n-bezier);
 color: var(--n-text-color);
 `),Fe("collapse-item-arrow",`
 display: flex;
 transition:
 transform .15s var(--n-bezier),
 color .3s var(--n-bezier);
 font-size: 18px;
 color: var(--n-arrow-color);
 `)])])]),s1=Object.assign(Object.assign({},Yn.props),{defaultExpandedNames:{type:[Array,String],default:null},expandedNames:[Array,String],arrowPlacement:{type:String,default:"left"},accordion:{type:Boolean,default:!1},displayDirective:{type:String,default:"if"},triggerAreas:{type:Array,default:()=>["main","extra","arrow"]},onItemHeaderClick:[Function,Array],"onUpdate:expandedNames":[Function,Array],onUpdateExpandedNames:[Function,Array],onExpandedNamesChange:{type:[Function,Array],validator:()=>!0,default:void 0}}),Uf=Zl("n-collapse"),Yf=Se({name:"Collapse",props:s1,slots:Object,setup(e,{slots:t}){const{mergedClsPrefixRef:n,inlineThemeDisabled:r,mergedRtlRef:i}=qr(e),o=G(e.defaultExpandedNames),l=O(()=>e.expandedNames),a=_l(l,o),s=Yn("Collapse","-collapse",a1,$m,e,n);function c(m){const{"onUpdate:expandedNames":v,onUpdateExpandedNames:y,onExpandedNamesChange:g}=e;y&&xt(y,m),v&&xt(v,m),g&&xt(g,m),o.value=m}function f(m){const{onItemHeaderClick:v}=e;v&&xt(v,m)}function u(m,v,y){const{accordion:g}=e,{value:b}=a;if(g)m?(c([v]),f({name:v,expanded:!0,event:y})):(c([]),f({name:v,expanded:!1,event:y}));else if(!Array.isArray(b))c([v]),f({name:v,expanded:!0,event:y});else{const k=b.slice(),_=k.findIndex(T=>v===T);~_?(k.splice(_,1),c(k),f({name:v,expanded:!1,event:y})):(k.push(v),c(k),f({name:v,expanded:!0,event:y}))}}kr(Uf,{props:e,mergedClsPrefixRef:n,expandedNamesRef:a,slots:t,toggleItem:u});const d=kf("Collapse",i,n),h=O(()=>{const{common:{cubicBezierEaseInOut:m},self:{titleFontWeight:v,dividerColor:y,titlePadding:g,titleTextColor:b,titleTextColorDisabled:k,textColor:_,arrowColor:T,fontSize:x,titleFontSize:S,arrowColorDisabled:R,itemMargin:W}}=s.value;return{"--n-font-size":x,"--n-bezier":m,"--n-text-color":_,"--n-divider-color":y,"--n-title-padding":g,"--n-title-font-size":S,"--n-title-text-color":b,"--n-title-text-color-disabled":k,"--n-title-font-weight":v,"--n-arrow-color":T,"--n-arrow-color-disabled":R,"--n-item-margin":W}}),p=r?Hr("collapse",void 0,h,e):void 0;return{rtlEnabled:d,mergedTheme:s,mergedClsPrefix:n,cssVars:r?void 0:h,themeClass:p?.themeClass,onRender:p?.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),E("div",{class:[`${this.mergedClsPrefix}-collapse`,this.rtlEnabled&&`${this.mergedClsPrefix}-collapse--rtl`,this.themeClass],style:this.cssVars},this.$slots)}}),c1=Se({name:"CollapseItemContent",props:{displayDirective:{type:String,required:!0},show:Boolean,clsPrefix:{type:String,required:!0}},setup(e){return{onceTrue:Fm(an(e,"show"))}},render(){return E(Im,null,{default:()=>{const{show:e,displayDirective:t,onceTrue:n,clsPrefix:r}=this,i=t==="show"&&n,o=E("div",{class:`${r}-collapse-item__content-wrapper`},E("div",{class:`${r}-collapse-item__content-inner`},this.$slots));return i?jr(o,[[bo,e]]):e?o:null}})}}),u1={title:String,name:[String,Number],disabled:Boolean,displayDirective:String},Kf=Se({name:"CollapseItem",props:u1,setup(e){const{mergedRtlRef:t}=qr(e),n=Pm(),r=Bm(()=>{var u;return(u=e.name)!==null&&u!==void 0?u:n}),i=$n(Uf);i||bf("collapse-item","`n-collapse-item` must be placed inside `n-collapse`.");const{expandedNamesRef:o,props:l,mergedClsPrefixRef:a,slots:s}=i,c=O(()=>{const{value:u}=o;if(Array.isArray(u)){const{value:d}=r;return!~u.findIndex(h=>h===d)}else if(u){const{value:d}=r;return d!==u}return!0});return{rtlEnabled:kf("Collapse",t,a),collapseSlots:s,randomName:n,mergedClsPrefix:a,collapsed:c,triggerAreas:an(l,"triggerAreas"),mergedDisplayDirective:O(()=>{const{displayDirective:u}=e;return u||l.displayDirective}),arrowPlacement:O(()=>l.arrowPlacement),handleClick(u){let d="main";wl(u,"arrow")&&(d="arrow"),wl(u,"extra")&&(d="extra"),l.triggerAreas.includes(d)&&i&&!e.disabled&&i.toggleItem(c.value,r.value,u)}}},render(){const{collapseSlots:e,$slots:t,arrowPlacement:n,collapsed:r,mergedDisplayDirective:i,mergedClsPrefix:o,disabled:l,triggerAreas:a}=this,s=cn(t.header,{collapsed:r},()=>[this.title]),c=t["header-extra"]||e["header-extra"],f=t.arrow||e.arrow;return E("div",{class:[`${o}-collapse-item`,`${o}-collapse-item--${n}-arrow-placement`,l&&`${o}-collapse-item--disabled`,!r&&`${o}-collapse-item--active`,a.map(u=>`${o}-collapse-item--trigger-area-${u}`)]},E("div",{class:[`${o}-collapse-item__header`,!r&&`${o}-collapse-item__header--active`]},E("div",{class:`${o}-collapse-item__header-main`,onClick:this.handleClick},n==="right"&&s,E("div",{class:`${o}-collapse-item-arrow`,key:this.rtlEnabled?0:1,"data-arrow":!0},cn(f,{collapsed:r},()=>[E(Ri,{clsPrefix:o},{default:()=>this.rtlEnabled?E(Tg,null):E(Om,null)})])),n==="left"&&s),Nm(c,{collapsed:r},u=>E("div",{class:`${o}-collapse-item__header-extra`,onClick:this.handleClick,"data-extra":!0},u))),E(c1,{clsPrefix:o,displayDirective:i,show:!r},t))}}),ta=Zl("n-date-picker"),pi=40,d1="HH:mm:ss",Zf={active:Boolean,dateFormat:String,calendarDayFormat:String,calendarHeaderYearFormat:String,calendarHeaderMonthFormat:String,calendarHeaderMonthYearSeparator:{type:String,required:!0},calendarHeaderMonthBeforeYear:{type:Boolean,default:void 0},timePickerFormat:{type:String,value:d1},value:{type:[Array,Number],default:null},shortcuts:Object,defaultTime:[Number,String,Array,Function],inputReadonly:Boolean,onClear:Function,onConfirm:Function,onClose:Function,onTabOut:Function,onKeydown:Function,actions:Array,onUpdateValue:{type:Function,required:!0},themeClass:String,onRender:Function,panel:Boolean,onNextMonth:Function,onPrevMonth:Function,onNextYear:Function,onPrevYear:Function};function Gf(e){const{dateLocaleRef:t,timePickerSizeRef:n,timePickerPropsRef:r,localeRef:i,mergedClsPrefixRef:o,mergedThemeRef:l}=$n(ta),a=O(()=>({locale:t.value.locale})),s=G(null),c=_f();function f(){const{onClear:C}=e;C&&C()}function u(){const{onConfirm:C,value:A}=e;C&&C(A)}function d(C,A){const{onUpdateValue:M}=e;M(C,A)}function h(C=!1){const{onClose:A}=e;A&&A(C)}function p(){const{onTabOut:C}=e;C&&C()}function m(){d(null,!0),h(!0),f()}function v(){p()}function y(){(e.active||e.panel)&&pn(()=>{const{value:C}=s;if(!C)return;const A=C.querySelectorAll("[data-n-date]");A.forEach(M=>{M.classList.add("transition-disabled")}),C.offsetWidth,A.forEach(M=>{M.classList.remove("transition-disabled")})})}function g(C){C.key==="Tab"&&C.target===s.value&&c.shift&&(C.preventDefault(),p())}function b(C){const{value:A}=s;c.tab&&C.target===A&&A?.contains(C.relatedTarget)&&p()}let k=null,_=!1;function T(){k=e.value,_=!0}function x(){_=!1}function S(){_&&(d(k,!1),_=!1)}function R(C){return typeof C=="function"?C():C}const W=G(!1);function w(){W.value=!W.value}return{mergedTheme:l,mergedClsPrefix:o,dateFnsOptions:a,timePickerSize:n,timePickerProps:r,selfRef:s,locale:i,doConfirm:u,doClose:h,doUpdateValue:d,doTabOut:p,handleClearClick:m,handleFocusDetectorFocus:v,disableTransitionOneTick:y,handlePanelKeyDown:g,handlePanelFocus:b,cachePendingValue:T,clearPendingValue:x,restorePendingValue:S,getShortcutValue:R,handleShortcutMouseleave:S,showMonthYearPanel:W,handleOpenQuickSelectMonthPanel:w}}const fc=Object.assign(Object.assign({},Zf),{defaultCalendarStartTime:Number,actions:{type:Array,default:()=>["now","clear","confirm"]}});function hc(e,t){var n;const r=Gf(e),{isValueInvalidRef:i,isDateDisabledRef:o,isDateInvalidRef:l,isTimeInvalidRef:a,isDateTimeInvalidRef:s,isHourDisabledRef:c,isMinuteDisabledRef:f,isSecondDisabledRef:u,localeRef:d,firstDayOfWeekRef:h,datePickerSlots:p,yearFormatRef:m,monthFormatRef:v,quarterFormatRef:y,yearRangeRef:g}=$n(ta),b={isValueInvalid:i,isDateDisabled:o,isDateInvalid:l,isTimeInvalid:a,isDateTimeInvalid:s,isHourDisabled:c,isMinuteDisabled:f,isSecondDisabled:u},k=O(()=>e.dateFormat||d.value.dateFormat),_=O(()=>e.calendarDayFormat||d.value.dayFormat),T=G(e.value===null||Array.isArray(e.value)?"":ut(e.value,k.value)),x=G(e.value===null||Array.isArray(e.value)?(n=e.defaultCalendarStartTime)!==null&&n!==void 0?n:Date.now():e.value),S=G(null),R=G(null),W=G(null),w=G(Date.now()),C=O(()=>{var J;return bs(x.value,e.value,w.value,(J=h.value)!==null&&J!==void 0?J:d.value.firstDayOfWeek,!1,t==="week")}),A=O(()=>{const{value:J}=e;return _s(x.value,Array.isArray(J)?null:J,w.value,{monthFormat:v.value})}),M=O(()=>{const{value:J}=e;return xs(Array.isArray(J)?null:J,w.value,{yearFormat:m.value},g)}),L=O(()=>{const{value:J}=e;return ws(x.value,Array.isArray(J)?null:J,w.value,{quarterFormat:y.value})}),P=O(()=>C.value.slice(0,7).map(J=>{const{ts:Ee}=J;return ut(Ee,_.value,r.dateFnsOptions.value)})),I=O(()=>ut(x.value,e.calendarHeaderMonthFormat||d.value.monthFormat,r.dateFnsOptions.value)),N=O(()=>ut(x.value,e.calendarHeaderYearFormat||d.value.yearFormat,r.dateFnsOptions.value)),V=O(()=>{var J;return(J=e.calendarHeaderMonthBeforeYear)!==null&&J!==void 0?J:d.value.monthBeforeYear});Oe(x,(J,Ee)=>{(t==="date"||t==="datetime")&&(Eo(J,Ee)||r.disableTransitionOneTick())}),Oe(O(()=>e.value),J=>{J!==null&&!Array.isArray(J)?(T.value=ut(J,k.value,r.dateFnsOptions.value),x.value=J):T.value=""});function K(J){var Ee;if(t==="datetime")return ve(uc(J));if(t==="month")return ve(vr(J));if(t==="year")return ve(Do(J));if(t==="quarter")return ve(_o(J));if(t==="week"){const Ke=(((Ee=h.value)!==null&&Ee!==void 0?Ee:d.value.firstDayOfWeek)+1)%7;return ve(_r(J,{weekStartsOn:Ke}))}return ve(Ki(J))}function $(J,Ee){const{isDateDisabled:{value:Ke}}=b;return Ke?Ke(J,Ee):!1}function H(J){const Ee=xn(J,k.value,new Date,r.dateFnsOptions.value);if(qn(Ee)){if(e.value===null)r.doUpdateValue(ve(K(Date.now())),e.panel);else if(!Array.isArray(e.value)){const Ke=Jt(e.value,{year:Dt(Ee),month:kt(Ee),date:Vn(Ee)});r.doUpdateValue(ve(K(ve(Ke))),e.panel)}}else T.value=J}function re(){const J=xn(T.value,k.value,new Date,r.dateFnsOptions.value);if(qn(J)){if(e.value===null)r.doUpdateValue(ve(K(Date.now())),!1);else if(!Array.isArray(e.value)){const Ee=Jt(e.value,{year:Dt(J),month:kt(J),date:Vn(J)});r.doUpdateValue(ve(K(ve(Ee))),!1)}}else et()}function Z(){r.doUpdateValue(null,!0),T.value="",r.doClose(!0),r.handleClearClick()}function ne(){r.doUpdateValue(ve(K(Date.now())),!0);const J=Date.now();x.value=J,r.doClose(!0),e.panel&&(t==="month"||t==="quarter"||t==="year")&&(r.disableTransitionOneTick(),Ne(J))}const de=G(null);function be(J){J.type==="date"&&t==="week"&&(de.value=K(ve(J.ts)))}function Te(J){return J.type==="date"&&t==="week"?K(ve(J.ts))===de.value:!1}function pe(J){if($(J.ts,J.type==="date"?{type:"date",year:J.dateObject.year,month:J.dateObject.month,date:J.dateObject.date}:J.type==="month"?{type:"month",year:J.dateObject.year,month:J.dateObject.month}:J.type==="year"?{type:"year",year:J.dateObject.year}:{type:"quarter",year:J.dateObject.year,quarter:J.dateObject.quarter}))return;let Ee;if(e.value!==null&&!Array.isArray(e.value)?Ee=e.value:Ee=Date.now(),t==="datetime"&&e.defaultTime!==null&&!Array.isArray(e.defaultTime)){let Ke;typeof e.defaultTime=="function"?Ke=l1(J.ts,e.defaultTime):Ke=$i(e.defaultTime),Ke&&(Ee=ve(Jt(Ee,Ke)))}switch(Ee=ve(J.type==="quarter"&&J.dateObject.quarter?X0(ks(Ee,J.dateObject.year),J.dateObject.quarter):Jt(Ee,J.dateObject)),r.doUpdateValue(K(Ee),e.panel||t==="date"||t==="week"||t==="year"),t){case"date":case"week":r.doClose();break;case"year":e.panel&&r.disableTransitionOneTick(),r.doClose();break;case"month":r.disableTransitionOneTick(),Ne(Ee);break;case"quarter":r.disableTransitionOneTick(),Ne(Ee);break}}function ke(J,Ee){let Ke;e.value!==null&&!Array.isArray(e.value)?Ke=e.value:Ke=Date.now(),Ke=ve(J.type==="month"?dc(Ke,J.dateObject.month):ks(Ke,J.dateObject.year)),Ee(Ke),Ne(Ke)}function Me(J){x.value=J}function et(J){if(e.value===null||Array.isArray(e.value)){T.value="";return}J===void 0&&(J=e.value),T.value=ut(J,k.value,r.dateFnsOptions.value)}function Je(){b.isDateInvalid.value||b.isTimeInvalid.value||(r.doConfirm(),bt())}function bt(){e.active&&r.doClose()}function vt(){var J;x.value=ve(gs(x.value,1)),(J=e.onNextYear)===null||J===void 0||J.call(e)}function lt(){var J;x.value=ve(gs(x.value,-1)),(J=e.onPrevYear)===null||J===void 0||J.call(e)}function nt(){var J;x.value=ve(Qt(x.value,1)),(J=e.onNextMonth)===null||J===void 0||J.call(e)}function Pt(){var J;x.value=ve(Qt(x.value,-1)),(J=e.onPrevMonth)===null||J===void 0||J.call(e)}function We(){const{value:J}=S;return J?.listElRef||null}function Ve(){const{value:J}=S;return J?.itemsElRef||null}function oe(){var J;(J=R.value)===null||J===void 0||J.sync()}function X(J){J!==null&&r.doUpdateValue(J,e.panel)}function me(J){r.cachePendingValue();const Ee=r.getShortcutValue(J);typeof Ee=="number"&&r.doUpdateValue(Ee,!1)}function ze(J){const Ee=r.getShortcutValue(J);typeof Ee=="number"&&(r.doUpdateValue(Ee,e.panel),r.clearPendingValue(),Je())}function Ne(J){const{value:Ee}=e;if(W.value){const Ke=kt(J===void 0?Ee===null?Date.now():Ee:J);W.value.scrollTo({top:Ke*pi})}if(S.value){const Ke=Dt(J===void 0?Ee===null?Date.now():Ee:J)-g.value[0];S.value.scrollTo({top:Ke*pi})}}const He={monthScrollbarRef:W,yearScrollbarRef:R,yearVlRef:S};return Object.assign(Object.assign(Object.assign(Object.assign({dateArray:C,monthArray:A,yearArray:M,quarterArray:L,calendarYear:N,calendarMonth:I,weekdays:P,calendarMonthBeforeYear:V,mergedIsDateDisabled:$,nextYear:vt,prevYear:lt,nextMonth:nt,prevMonth:Pt,handleNowClick:ne,handleConfirmClick:Je,handleSingleShortcutMouseenter:me,handleSingleShortcutClick:ze},b),r),He),{handleDateClick:pe,handleDateInputBlur:re,handleDateInput:H,handleDateMouseEnter:be,isWeekHovered:Te,handleTimePickerChange:X,clearSelectedDateTime:Z,virtualListContainer:We,virtualListContent:Ve,handleVirtualListScroll:oe,timePickerSize:r.timePickerSize,dateInputValue:T,datePickerSlots:p,handleQuickMonthClick:ke,justifyColumnsScrollState:Ne,calendarValue:x,onUpdateCalendarValue:Me})}const Xf=Se({name:"MonthPanel",props:Object.assign(Object.assign({},fc),{type:{type:String,required:!0},useAsQuickJump:Boolean}),setup(e){const t=hc(e,e.type),{dateLocaleRef:n}=Hi("DatePicker"),r=l=>{switch(l.type){case"year":return Wf(l.dateObject.year,l.yearFormat,n.value.locale);case"month":return Vf(l.dateObject.month,l.monthFormat,n.value.locale);case"quarter":return qf(l.dateObject.quarter,l.quarterFormat,n.value.locale)}},{useAsQuickJump:i}=e,o=(l,a,s)=>{const{mergedIsDateDisabled:c,handleDateClick:f,handleQuickMonthClick:u}=t;return E("div",{"data-n-date":!0,key:a,class:[`${s}-date-panel-month-calendar__picker-col-item`,l.isCurrent&&`${s}-date-panel-month-calendar__picker-col-item--current`,l.selected&&`${s}-date-panel-month-calendar__picker-col-item--selected`,!i&&c(l.ts,l.type==="year"?{type:"year",year:l.dateObject.year}:l.type==="month"?{type:"month",year:l.dateObject.year,month:l.dateObject.month}:l.type==="quarter"?{type:"month",year:l.dateObject.year,month:l.dateObject.quarter}:null)&&`${s}-date-panel-month-calendar__picker-col-item--disabled`],onClick:()=>{i?u(l,d=>{e.onUpdateValue(d,!1)}):f(l)}},r(l))};return Gl(()=>{t.justifyColumnsScrollState()}),Object.assign(Object.assign({},t),{renderItem:o})},render(){const{mergedClsPrefix:e,mergedTheme:t,shortcuts:n,actions:r,renderItem:i,type:o,onRender:l}=this;return l?.(),E("div",{ref:"selfRef",tabindex:0,class:[`${e}-date-panel`,`${e}-date-panel--month`,!this.panel&&`${e}-date-panel--shadow`,this.themeClass],onFocus:this.handlePanelFocus,onKeydown:this.handlePanelKeyDown},E("div",{class:`${e}-date-panel-month-calendar`},E(ir,{ref:"yearScrollbarRef",class:`${e}-date-panel-month-calendar__picker-col`,theme:t.peers.Scrollbar,themeOverrides:t.peerOverrides.Scrollbar,container:this.virtualListContainer,content:this.virtualListContent,horizontalRailStyle:{zIndex:1},verticalRailStyle:{zIndex:1}},{default:()=>E(hs,{ref:"yearVlRef",items:this.yearArray,itemSize:pi,showScrollbar:!1,keyField:"ts",onScroll:this.handleVirtualListScroll,paddingBottom:4},{default:({item:a,index:s})=>i(a,s,e)})}),o==="month"||o==="quarter"?E("div",{class:`${e}-date-panel-month-calendar__picker-col`},E(ir,{ref:"monthScrollbarRef",theme:t.peers.Scrollbar,themeOverrides:t.peerOverrides.Scrollbar},{default:()=>[(o==="month"?this.monthArray:this.quarterArray).map((a,s)=>i(a,s,e)),E("div",{class:`${e}-date-panel-${o}-calendar__padding`})]})):null),Qs(this.datePickerSlots.footer,a=>a?E("div",{class:`${e}-date-panel-footer`},a):null),r?.length||n?E("div",{class:`${e}-date-panel-actions`},E("div",{class:`${e}-date-panel-actions__prefix`},n&&Object.keys(n).map(a=>{const s=n[a];return Array.isArray(s)?null:E(Br,{size:"tiny",onMouseenter:()=>{this.handleSingleShortcutMouseenter(s)},onClick:()=>{this.handleSingleShortcutClick(s)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>a})})),E("div",{class:`${e}-date-panel-actions__suffix`},r?.includes("clear")?cn(this.datePickerSlots.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[E(Xe,{theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,r?.includes("now")?cn(this.datePickerSlots.now,{onNow:this.handleNowClick,text:this.locale.now},()=>[E(Xe,{theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,size:"tiny",onClick:this.handleNowClick},{default:()=>this.locale.now})]):null,r?.includes("confirm")?cn(this.datePickerSlots.confirm,{onConfirm:this.handleConfirmClick,disabled:this.isDateInvalid,text:this.locale.confirm},()=>[E(Xe,{theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isDateInvalid,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,E(vi,{onFocus:this.handleFocusDetectorFocus}))}}),Zi=Se({props:{mergedClsPrefix:{type:String,required:!0},value:Number,monthBeforeYear:{type:Boolean,required:!0},monthYearSeparator:{type:String,required:!0},calendarMonth:{type:String,required:!0},calendarYear:{type:String,required:!0},onUpdateValue:{type:Function,required:!0}},setup(){const e=G(null),t=G(null),n=G(!1);function r(o){var l;n.value&&!(!((l=e.value)===null||l===void 0)&&l.contains(rc(o)))&&(n.value=!1)}function i(){n.value=!n.value}return{show:n,triggerRef:e,monthPanelRef:t,handleHeaderClick:i,handleClickOutside:r}},render(){const{handleClickOutside:e,mergedClsPrefix:t}=this;return E("div",{class:`${t}-date-panel-month__month-year`,ref:"triggerRef"},E(Js,null,{default:()=>[E(ec,null,{default:()=>E("div",{class:[`${t}-date-panel-month__text`,this.show&&`${t}-date-panel-month__text--active`],onClick:this.handleHeaderClick},this.monthBeforeYear?[this.calendarMonth,this.monthYearSeparator,this.calendarYear]:[this.calendarYear,this.monthYearSeparator,this.calendarMonth])}),E(tc,{show:this.show,teleportDisabled:!0},{default:()=>E(Ur,{name:"fade-in-scale-up-transition",appear:!0},{default:()=>this.show?jr(E(Xf,{ref:"monthPanelRef",onUpdateValue:this.onUpdateValue,actions:[],calendarHeaderMonthYearSeparator:this.monthYearSeparator,type:"month",key:"month",useAsQuickJump:!0,value:this.value}),[[nc,e,void 0,{capture:!0}]]):null})})]}))}}),f1=Se({name:"DatePanel",props:Object.assign(Object.assign({},fc),{type:{type:String,required:!0}}),setup(e){return hc(e,e.type)},render(){var e,t,n;const{mergedClsPrefix:r,mergedTheme:i,shortcuts:o,onRender:l,datePickerSlots:a,type:s}=this;return l?.(),E("div",{ref:"selfRef",tabindex:0,class:[`${r}-date-panel`,`${r}-date-panel--${s}`,!this.panel&&`${r}-date-panel--shadow`,this.themeClass],onFocus:this.handlePanelFocus,onKeydown:this.handlePanelKeyDown},E("div",{class:`${r}-date-panel-calendar`},E("div",{class:`${r}-date-panel-month`},E("div",{class:`${r}-date-panel-month__fast-prev`,onClick:this.prevYear},dt(a["prev-year"],()=>[E(Vi,null)])),E("div",{class:`${r}-date-panel-month__prev`,onClick:this.prevMonth},dt(a["prev-month"],()=>[E(Wi,null)])),E(Zi,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.calendarValue,onUpdateValue:this.onUpdateCalendarValue,mergedClsPrefix:r,calendarMonth:this.calendarMonth,calendarYear:this.calendarYear}),E("div",{class:`${r}-date-panel-month__next`,onClick:this.nextMonth},dt(a["next-month"],()=>[E(qi,null)])),E("div",{class:`${r}-date-panel-month__fast-next`,onClick:this.nextYear},dt(a["next-year"],()=>[E(Ui,null)]))),E("div",{class:`${r}-date-panel-weekdays`},this.weekdays.map(c=>E("div",{key:c,class:`${r}-date-panel-weekdays__day`},c))),E("div",{class:`${r}-date-panel-dates`},this.dateArray.map((c,f)=>E("div",{"data-n-date":!0,key:f,class:[`${r}-date-panel-date`,{[`${r}-date-panel-date--current`]:c.isCurrentDate,[`${r}-date-panel-date--selected`]:c.selected,[`${r}-date-panel-date--excluded`]:!c.inCurrentMonth,[`${r}-date-panel-date--disabled`]:this.mergedIsDateDisabled(c.ts,{type:"date",year:c.dateObject.year,month:c.dateObject.month,date:c.dateObject.date}),[`${r}-date-panel-date--week-hovered`]:this.isWeekHovered(c),[`${r}-date-panel-date--week-selected`]:c.inSelectedWeek}],onClick:()=>{this.handleDateClick(c)},onMouseenter:()=>{this.handleDateMouseEnter(c)}},E("div",{class:`${r}-date-panel-date__trigger`}),c.dateObject.date,c.isCurrentDate?E("div",{class:`${r}-date-panel-date__sup`}):null)))),this.datePickerSlots.footer?E("div",{class:`${r}-date-panel-footer`},this.datePickerSlots.footer()):null,!((e=this.actions)===null||e===void 0)&&e.length||o?E("div",{class:`${r}-date-panel-actions`},E("div",{class:`${r}-date-panel-actions__prefix`},o&&Object.keys(o).map(c=>{const f=o[c];return Array.isArray(f)?null:E(Br,{size:"tiny",onMouseenter:()=>{this.handleSingleShortcutMouseenter(f)},onClick:()=>{this.handleSingleShortcutClick(f)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>c})})),E("div",{class:`${r}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?cn(this.$slots.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[E(Xe,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("now")?cn(this.$slots.now,{onNow:this.handleNowClick,text:this.locale.now},()=>[E(Xe,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",onClick:this.handleNowClick},{default:()=>this.locale.now})]):null)):null,E(vi,{onFocus:this.handleFocusDetectorFocus}))}}),pc=Object.assign(Object.assign({},Zf),{defaultCalendarStartTime:Number,defaultCalendarEndTime:Number,bindCalendarMonths:Boolean,actions:{type:Array,default:()=>["clear","confirm"]}});function mc(e,t){var n,r;const{isDateDisabledRef:i,isStartHourDisabledRef:o,isEndHourDisabledRef:l,isStartMinuteDisabledRef:a,isEndMinuteDisabledRef:s,isStartSecondDisabledRef:c,isEndSecondDisabledRef:f,isStartDateInvalidRef:u,isEndDateInvalidRef:d,isStartTimeInvalidRef:h,isEndTimeInvalidRef:p,isStartValueInvalidRef:m,isEndValueInvalidRef:v,isRangeInvalidRef:y,localeRef:g,rangesRef:b,closeOnSelectRef:k,updateValueOnCloseRef:_,firstDayOfWeekRef:T,datePickerSlots:x,monthFormatRef:S,yearFormatRef:R,quarterFormatRef:W,yearRangeRef:w}=$n(ta),C={isDateDisabled:i,isStartHourDisabled:o,isEndHourDisabled:l,isStartMinuteDisabled:a,isEndMinuteDisabled:s,isStartSecondDisabled:c,isEndSecondDisabled:f,isStartDateInvalid:u,isEndDateInvalid:d,isStartTimeInvalid:h,isEndTimeInvalid:p,isStartValueInvalid:m,isEndValueInvalid:v,isRangeInvalid:y},A=Gf(e),M=G(null),L=G(null),P=G(null),I=G(null),N=G(null),V=G(null),K=G(null),$=G(null),{value:H}=e,re=(n=e.defaultCalendarStartTime)!==null&&n!==void 0?n:Array.isArray(H)&&typeof H[0]=="number"?H[0]:Date.now(),Z=G(re),ne=G((r=e.defaultCalendarEndTime)!==null&&r!==void 0?r:Array.isArray(H)&&typeof H[1]=="number"?H[1]:ve(Qt(re,1)));ft(!0);const de=G(Date.now()),be=G(!1),Te=G(0),pe=O(()=>e.dateFormat||g.value.dateFormat),ke=O(()=>e.calendarDayFormat||g.value.dayFormat),Me=G(Array.isArray(H)?ut(H[0],pe.value,A.dateFnsOptions.value):""),et=G(Array.isArray(H)?ut(H[1],pe.value,A.dateFnsOptions.value):""),Je=O(()=>be.value?"end":"start"),bt=O(()=>{var Y;return bs(Z.value,e.value,de.value,(Y=T.value)!==null&&Y!==void 0?Y:g.value.firstDayOfWeek)}),vt=O(()=>{var Y;return bs(ne.value,e.value,de.value,(Y=T.value)!==null&&Y!==void 0?Y:g.value.firstDayOfWeek)}),lt=O(()=>bt.value.slice(0,7).map(Y=>{const{ts:he}=Y;return ut(he,ke.value,A.dateFnsOptions.value)})),nt=O(()=>ut(Z.value,e.calendarHeaderMonthFormat||g.value.monthFormat,A.dateFnsOptions.value)),Pt=O(()=>ut(ne.value,e.calendarHeaderMonthFormat||g.value.monthFormat,A.dateFnsOptions.value)),We=O(()=>ut(Z.value,e.calendarHeaderYearFormat||g.value.yearFormat,A.dateFnsOptions.value)),Ve=O(()=>ut(ne.value,e.calendarHeaderYearFormat||g.value.yearFormat,A.dateFnsOptions.value)),oe=O(()=>{const{value:Y}=e;return Array.isArray(Y)?Y[0]:null}),X=O(()=>{const{value:Y}=e;return Array.isArray(Y)?Y[1]:null}),me=O(()=>{const{shortcuts:Y}=e;return Y||b.value}),ze=O(()=>xs(wi(e.value,"start"),de.value,{yearFormat:R.value},w)),Ne=O(()=>xs(wi(e.value,"end"),de.value,{yearFormat:R.value},w)),He=O(()=>{const Y=wi(e.value,"start");return ws(Y??Date.now(),Y,de.value,{quarterFormat:W.value})}),J=O(()=>{const Y=wi(e.value,"end");return ws(Y??Date.now(),Y,de.value,{quarterFormat:W.value})}),Ee=O(()=>{const Y=wi(e.value,"start");return _s(Y??Date.now(),Y,de.value,{monthFormat:S.value})}),Ke=O(()=>{const Y=wi(e.value,"end");return _s(Y??Date.now(),Y,de.value,{monthFormat:S.value})}),nn=O(()=>{var Y;return(Y=e.calendarHeaderMonthBeforeYear)!==null&&Y!==void 0?Y:g.value.monthBeforeYear});Oe(O(()=>e.value),Y=>{if(Y!==null&&Array.isArray(Y)){const[he,De]=Y;Me.value=ut(he,pe.value,A.dateFnsOptions.value),et.value=ut(De,pe.value,A.dateFnsOptions.value),be.value||U(Y)}else Me.value="",et.value=""});function Mn(Y,he){(t==="daterange"||t==="datetimerange")&&(Dt(Y)!==Dt(he)||kt(Y)!==kt(he))&&A.disableTransitionOneTick()}Oe(Z,Mn),Oe(ne,Mn);function ft(Y){const he=vr(Z.value),De=vr(ne.value);(e.bindCalendarMonths||he>=De)&&(Y?ne.value=ve(Qt(he,1)):Z.value=ve(Qt(De,-1)))}function Wt(){Z.value=ve(Qt(Z.value,12)),ft(!0)}function Ht(){Z.value=ve(Qt(Z.value,-12)),ft(!0)}function qt(){Z.value=ve(Qt(Z.value,1)),ft(!0)}function St(){Z.value=ve(Qt(Z.value,-1)),ft(!0)}function Lt(){ne.value=ve(Qt(ne.value,12)),ft(!1)}function _t(){ne.value=ve(Qt(ne.value,-12)),ft(!1)}function rn(){ne.value=ve(Qt(ne.value,1)),ft(!1)}function Gt(){ne.value=ve(Qt(ne.value,-1)),ft(!1)}function ee(Y){Z.value=Y,ft(!0)}function xe(Y){ne.value=Y,ft(!1)}function q(Y){const he=i.value;if(!he)return!1;if(!Array.isArray(e.value)||Je.value==="start")return he(Y,"start",null);{const{value:De}=Te;return Y<Te.value?he(Y,"start",[De,De]):he(Y,"end",[De,De])}}function U(Y){if(Y===null)return;const[he,De]=Y;Z.value=he,vr(De)<=vr(he)?ne.value=ve(vr(Qt(he,1))):ne.value=ve(vr(De))}function ce(Y){if(!be.value)be.value=!0,Te.value=Y.ts,ht(Y.ts,Y.ts,"done");else{be.value=!1;const{value:he}=e;e.panel&&Array.isArray(he)?ht(he[0],he[1],"done"):k.value&&t==="daterange"&&(_.value?ae():B())}}function _e(Y){if(be.value){if(q(Y.ts))return;Y.ts>=Te.value?ht(Te.value,Y.ts,"wipPreview"):ht(Y.ts,Te.value,"wipPreview")}}function B(){y.value||(A.doConfirm(),ae())}function ae(){be.value=!1,e.active&&A.doClose()}function ye(Y){typeof Y!="number"&&(Y=ve(Y)),e.value===null?A.doUpdateValue([Y,Y],e.panel):Array.isArray(e.value)&&A.doUpdateValue([Y,Math.max(e.value[1],Y)],e.panel)}function Ze(Y){typeof Y!="number"&&(Y=ve(Y)),e.value===null?A.doUpdateValue([Y,Y],e.panel):Array.isArray(e.value)&&A.doUpdateValue([Math.min(e.value[0],Y),Y],e.panel)}function ht(Y,he,De){if(typeof Y!="number"&&(Y=ve(Y)),De!=="shortcutPreview"&&De!=="shortcutDone"){let Et,bn;if(t==="datetimerange"){const{defaultTime:at}=e;typeof at=="function"?(Et=au(Y,at,"start",[Y,he]),bn=au(he,at,"end",[Y,he])):Array.isArray(at)?(Et=$i(at[0]),bn=$i(at[1])):(Et=$i(at),bn=Et)}Et&&(Y=ve(Jt(Y,Et))),bn&&(he=ve(Jt(he,bn)))}A.doUpdateValue([Y,he],e.panel&&(De==="done"||De==="shortcutDone"))}function pt(Y){return ve(t==="datetimerange"?uc(Y):t==="monthrange"?vr(Y):Ki(Y))}function At(Y){const he=xn(Y,pe.value,new Date,A.dateFnsOptions.value);if(qn(he))if(e.value){if(Array.isArray(e.value)){const De=Jt(e.value[0],{year:Dt(he),month:kt(he),date:Vn(he)});ye(pt(ve(De)))}}else{const De=Jt(new Date,{year:Dt(he),month:kt(he),date:Vn(he)});ye(pt(ve(De)))}else Me.value=Y}function jn(Y){const he=xn(Y,pe.value,new Date,A.dateFnsOptions.value);if(qn(he)){if(e.value===null){const De=Jt(new Date,{year:Dt(he),month:kt(he),date:Vn(he)});Ze(pt(ve(De)))}else if(Array.isArray(e.value)){const De=Jt(e.value[1],{year:Dt(he),month:kt(he),date:Vn(he)});Ze(pt(ve(De)))}}else et.value=Y}function cr(){const Y=xn(Me.value,pe.value,new Date,A.dateFnsOptions.value),{value:he}=e;if(qn(Y)){if(he===null){const De=Jt(new Date,{year:Dt(Y),month:kt(Y),date:Vn(Y)});ye(pt(ve(De)))}else if(Array.isArray(he)){const De=Jt(he[0],{year:Dt(Y),month:kt(Y),date:Vn(Y)});ye(pt(ve(De)))}}else tr()}function ur(){const Y=xn(et.value,pe.value,new Date,A.dateFnsOptions.value),{value:he}=e;if(qn(Y)){if(he===null){const De=Jt(new Date,{year:Dt(Y),month:kt(Y),date:Vn(Y)});Ze(pt(ve(De)))}else if(Array.isArray(he)){const De=Jt(he[1],{year:Dt(Y),month:kt(Y),date:Vn(Y)});Ze(pt(ve(De)))}}else tr()}function tr(Y){const{value:he}=e;if(he===null||!Array.isArray(he)){Me.value="",et.value="";return}Y===void 0&&(Y=he),Me.value=ut(Y[0],pe.value,A.dateFnsOptions.value),et.value=ut(Y[1],pe.value,A.dateFnsOptions.value)}function dr(Y){Y!==null&&ye(Y)}function xr(Y){Y!==null&&Ze(Y)}function fr(Y){A.cachePendingValue();const he=A.getShortcutValue(Y);Array.isArray(he)&&ht(he[0],he[1],"shortcutPreview")}function yn(Y){const he=A.getShortcutValue(Y);Array.isArray(he)&&(ht(he[0],he[1],"shortcutDone"),A.clearPendingValue(),B())}function kn(Y,he){const De=Y===void 0?e.value:Y;if(Y===void 0||he==="start"){if(K.value){const Et=Array.isArray(De)?kt(De[0]):kt(Date.now());K.value.scrollTo({debounce:!1,index:Et,elSize:pi})}if(N.value){const Et=(Array.isArray(De)?Dt(De[0]):Dt(Date.now()))-w.value[0];N.value.scrollTo({index:Et,debounce:!1})}}if(Y===void 0||he==="end"){if($.value){const Et=Array.isArray(De)?kt(De[1]):kt(Date.now());$.value.scrollTo({debounce:!1,index:Et,elSize:pi})}if(V.value){const Et=(Array.isArray(De)?Dt(De[1]):Dt(Date.now()))-w.value[0];V.value.scrollTo({index:Et,debounce:!1})}}}function un(Y,he){const{value:De}=e,Et=!Array.isArray(De),bn=Y.type==="year"&&t!=="yearrange"?Et?Jt(Y.ts,{month:kt(t==="quarterrange"?_o(new Date):new Date)}).valueOf():Jt(Y.ts,{month:kt(t==="quarterrange"?_o(De[he==="start"?0:1]):De[he==="start"?0:1])}).valueOf():Y.ts;if(Et){const Sr=pt(bn),pr=[Sr,Sr];A.doUpdateValue(pr,e.panel),kn(pr,"start"),kn(pr,"end"),A.disableTransitionOneTick();return}const at=[De[0],De[1]];let Kn=!1;switch(he==="start"?(at[0]=pt(bn),at[0]>at[1]&&(at[1]=at[0],Kn=!0)):(at[1]=pt(bn),at[0]>at[1]&&(at[0]=at[1],Kn=!0)),A.doUpdateValue(at,e.panel),t){case"monthrange":case"quarterrange":A.disableTransitionOneTick(),Kn?(kn(at,"start"),kn(at,"end")):kn(at,he);break;case"yearrange":A.disableTransitionOneTick(),kn(at,"start"),kn(at,"end")}}function Ut(){var Y;(Y=P.value)===null||Y===void 0||Y.sync()}function dn(){var Y;(Y=I.value)===null||Y===void 0||Y.sync()}function Yr(Y){var he,De;return Y==="start"?((he=N.value)===null||he===void 0?void 0:he.listElRef)||null:((De=V.value)===null||De===void 0?void 0:De.listElRef)||null}function hr(Y){var he,De;return Y==="start"?((he=N.value)===null||he===void 0?void 0:he.itemsElRef)||null:((De=V.value)===null||De===void 0?void 0:De.itemsElRef)||null}const Cr={startYearVlRef:N,endYearVlRef:V,startMonthScrollbarRef:K,endMonthScrollbarRef:$,startYearScrollbarRef:P,endYearScrollbarRef:I};return Object.assign(Object.assign(Object.assign(Object.assign({startDatesElRef:M,endDatesElRef:L,handleDateClick:ce,handleColItemClick:un,handleDateMouseEnter:_e,handleConfirmClick:B,startCalendarPrevYear:Ht,startCalendarPrevMonth:St,startCalendarNextYear:Wt,startCalendarNextMonth:qt,endCalendarPrevYear:_t,endCalendarPrevMonth:Gt,endCalendarNextMonth:rn,endCalendarNextYear:Lt,mergedIsDateDisabled:q,changeStartEndTime:ht,ranges:b,calendarMonthBeforeYear:nn,startCalendarMonth:nt,startCalendarYear:We,endCalendarMonth:Pt,endCalendarYear:Ve,weekdays:lt,startDateArray:bt,endDateArray:vt,startYearArray:ze,startMonthArray:Ee,startQuarterArray:He,endYearArray:Ne,endMonthArray:Ke,endQuarterArray:J,isSelecting:be,handleRangeShortcutMouseenter:fr,handleRangeShortcutClick:yn},A),C),Cr),{startDateDisplayString:Me,endDateInput:et,timePickerSize:A.timePickerSize,startTimeValue:oe,endTimeValue:X,datePickerSlots:x,shortcuts:me,startCalendarDateTime:Z,endCalendarDateTime:ne,justifyColumnsScrollState:kn,handleFocusDetectorFocus:A.handleFocusDetectorFocus,handleStartTimePickerChange:dr,handleEndTimePickerChange:xr,handleStartDateInput:At,handleStartDateInputBlur:cr,handleEndDateInput:jn,handleEndDateInputBlur:ur,handleStartYearVlScroll:Ut,handleEndYearVlScroll:dn,virtualListContainer:Yr,virtualListContent:hr,onUpdateStartCalendarValue:ee,onUpdateEndCalendarValue:xe})}const h1=Se({name:"DateRangePanel",props:pc,setup(e){return mc(e,"daterange")},render(){var e,t,n;const{mergedClsPrefix:r,mergedTheme:i,shortcuts:o,onRender:l,datePickerSlots:a}=this;return l?.(),E("div",{ref:"selfRef",tabindex:0,class:[`${r}-date-panel`,`${r}-date-panel--daterange`,!this.panel&&`${r}-date-panel--shadow`,this.themeClass],onKeydown:this.handlePanelKeyDown,onFocus:this.handlePanelFocus},E("div",{ref:"startDatesElRef",class:`${r}-date-panel-calendar ${r}-date-panel-calendar--start`},E("div",{class:`${r}-date-panel-month`},E("div",{class:`${r}-date-panel-month__fast-prev`,onClick:this.startCalendarPrevYear},dt(a["prev-year"],()=>[E(Vi,null)])),E("div",{class:`${r}-date-panel-month__prev`,onClick:this.startCalendarPrevMonth},dt(a["prev-month"],()=>[E(Wi,null)])),E(Zi,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.startCalendarDateTime,onUpdateValue:this.onUpdateStartCalendarValue,mergedClsPrefix:r,calendarMonth:this.startCalendarMonth,calendarYear:this.startCalendarYear}),E("div",{class:`${r}-date-panel-month__next`,onClick:this.startCalendarNextMonth},dt(a["next-month"],()=>[E(qi,null)])),E("div",{class:`${r}-date-panel-month__fast-next`,onClick:this.startCalendarNextYear},dt(a["next-year"],()=>[E(Ui,null)]))),E("div",{class:`${r}-date-panel-weekdays`},this.weekdays.map(s=>E("div",{key:s,class:`${r}-date-panel-weekdays__day`},s))),E("div",{class:`${r}-date-panel__divider`}),E("div",{class:`${r}-date-panel-dates`},this.startDateArray.map((s,c)=>E("div",{"data-n-date":!0,key:c,class:[`${r}-date-panel-date`,{[`${r}-date-panel-date--excluded`]:!s.inCurrentMonth,[`${r}-date-panel-date--current`]:s.isCurrentDate,[`${r}-date-panel-date--selected`]:s.selected,[`${r}-date-panel-date--covered`]:s.inSpan,[`${r}-date-panel-date--start`]:s.startOfSpan,[`${r}-date-panel-date--end`]:s.endOfSpan,[`${r}-date-panel-date--disabled`]:this.mergedIsDateDisabled(s.ts)}],onClick:()=>{this.handleDateClick(s)},onMouseenter:()=>{this.handleDateMouseEnter(s)}},E("div",{class:`${r}-date-panel-date__trigger`}),s.dateObject.date,s.isCurrentDate?E("div",{class:`${r}-date-panel-date__sup`}):null)))),E("div",{class:`${r}-date-panel__vertical-divider`}),E("div",{ref:"endDatesElRef",class:`${r}-date-panel-calendar ${r}-date-panel-calendar--end`},E("div",{class:`${r}-date-panel-month`},E("div",{class:`${r}-date-panel-month__fast-prev`,onClick:this.endCalendarPrevYear},dt(a["prev-year"],()=>[E(Vi,null)])),E("div",{class:`${r}-date-panel-month__prev`,onClick:this.endCalendarPrevMonth},dt(a["prev-month"],()=>[E(Wi,null)])),E(Zi,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.endCalendarDateTime,onUpdateValue:this.onUpdateEndCalendarValue,mergedClsPrefix:r,calendarMonth:this.endCalendarMonth,calendarYear:this.endCalendarYear}),E("div",{class:`${r}-date-panel-month__next`,onClick:this.endCalendarNextMonth},dt(a["next-month"],()=>[E(qi,null)])),E("div",{class:`${r}-date-panel-month__fast-next`,onClick:this.endCalendarNextYear},dt(a["next-year"],()=>[E(Ui,null)]))),E("div",{class:`${r}-date-panel-weekdays`},this.weekdays.map(s=>E("div",{key:s,class:`${r}-date-panel-weekdays__day`},s))),E("div",{class:`${r}-date-panel__divider`}),E("div",{class:`${r}-date-panel-dates`},this.endDateArray.map((s,c)=>E("div",{"data-n-date":!0,key:c,class:[`${r}-date-panel-date`,{[`${r}-date-panel-date--excluded`]:!s.inCurrentMonth,[`${r}-date-panel-date--current`]:s.isCurrentDate,[`${r}-date-panel-date--selected`]:s.selected,[`${r}-date-panel-date--covered`]:s.inSpan,[`${r}-date-panel-date--start`]:s.startOfSpan,[`${r}-date-panel-date--end`]:s.endOfSpan,[`${r}-date-panel-date--disabled`]:this.mergedIsDateDisabled(s.ts)}],onClick:()=>{this.handleDateClick(s)},onMouseenter:()=>{this.handleDateMouseEnter(s)}},E("div",{class:`${r}-date-panel-date__trigger`}),s.dateObject.date,s.isCurrentDate?E("div",{class:`${r}-date-panel-date__sup`}):null)))),this.datePickerSlots.footer?E("div",{class:`${r}-date-panel-footer`},this.datePickerSlots.footer()):null,!((e=this.actions)===null||e===void 0)&&e.length||o?E("div",{class:`${r}-date-panel-actions`},E("div",{class:`${r}-date-panel-actions__prefix`},o&&Object.keys(o).map(s=>{const c=o[s];return Array.isArray(c)||typeof c=="function"?E(Br,{size:"tiny",onMouseenter:()=>{this.handleRangeShortcutMouseenter(c)},onClick:()=>{this.handleRangeShortcutClick(c)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>s}):null})),E("div",{class:`${r}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?cn(a.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[E(Xe,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("confirm")?cn(a.confirm,{onConfirm:this.handleConfirmClick,disabled:this.isRangeInvalid||this.isSelecting,text:this.locale.confirm},()=>[E(Xe,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isRangeInvalid||this.isSelecting,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,E(vi,{onFocus:this.handleFocusDetectorFocus}))}});function su(e,t,n){const r=Of(),i=g1(e,n.timeZone,n.locale??r.locale);return"formatToParts"in i?p1(i,t):m1(i,t)}function p1(e,t){const n=e.formatToParts(t);for(let r=n.length-1;r>=0;--r)if(n[r].type==="timeZoneName")return n[r].value}function m1(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(n);return r?r[0].substr(1):""}function g1(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function v1(e,t){const n=w1(t);return"formatToParts"in n?k1(n,e):b1(n,e)}const y1={year:0,month:1,day:2,hour:3,minute:4,second:5};function k1(e,t){try{const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const o=y1[n[i].type];o!==void 0&&(r[o]=parseInt(n[i].value,10))}return r}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function b1(e,t){const n=e.format(t),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(r[3],10),parseInt(r[1],10),parseInt(r[2],10),parseInt(r[4],10),parseInt(r[5],10),parseInt(r[6],10)]}const Aa={},cu=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),_1=cu==="06/25/2014, 00:00:00"||cu==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function w1(e){return Aa[e]||(Aa[e]=_1?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Aa[e]}function Qf(e,t,n,r,i,o,l){const a=new Date(0);return a.setUTCFullYear(e,t,n),a.setUTCHours(r,i,o,l),a}const uu=36e5,x1=6e4,Ta={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function gc(e,t,n){if(!e)return 0;let r=Ta.timezoneZ.exec(e);if(r)return 0;let i,o;if(r=Ta.timezoneHH.exec(e),r)return i=parseInt(r[1],10),du(i)?-(i*uu):NaN;if(r=Ta.timezoneHHMM.exec(e),r){i=parseInt(r[2],10);const l=parseInt(r[3],10);return du(i,l)?(o=Math.abs(i)*uu+l*x1,r[1]==="+"?-o:o):NaN}if(A1(e)){t=new Date(t||Date.now());const l=n?t:C1(t),a=Cs(l,e);return-(n?a:S1(t,a,e))}return NaN}function C1(e){return Qf(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Cs(e,t){const n=v1(e,t),r=Qf(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let i=e.getTime();const o=i%1e3;return i-=o>=0?o:1e3+o,r-i}function S1(e,t,n){let i=e.getTime()-t;const o=Cs(new Date(i),n);if(t===o)return t;i-=o-t;const l=Cs(new Date(i),n);return o===l?o:Math.max(o,l)}function du(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const fu={};function A1(e){if(fu[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),fu[e]=!0,!0}catch{return!1}}const T1=60*1e3,D1={X:function(e,t,n){const r=Da(n.timeZone,e);if(r===0)return"Z";switch(t){case"X":return hu(r);case"XXXX":case"XX":return Ei(r);default:return Ei(r,":")}},x:function(e,t,n){const r=Da(n.timeZone,e);switch(t){case"x":return hu(r);case"xxxx":case"xx":return Ei(r);default:return Ei(r,":")}},O:function(e,t,n){const r=Da(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+E1(r,":");default:return"GMT"+Ei(r,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return su("short",e,n);default:return su("long",e,n)}}};function Da(e,t){const n=e?gc(e,t,!0)/T1:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function El(e,t){const n=e<0?"-":"";let r=Math.abs(e).toString();for(;r.length<t;)r="0"+r;return n+r}function Ei(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=El(Math.floor(r/60),2),o=El(Math.floor(r%60),2);return n+i+t+o}function hu(e,t){return e%60===0?(e>0?"-":"+")+El(Math.abs(e)/60,2):Ei(e,t)}function E1(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+El(o,2)}function pu(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const M1=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ea=36e5,mu=6e4,L1=2,hn={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:M1};function Jf(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?L1:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const r=R1(e),{year:i,restDateString:o}=$1(r.date,n),l=I1(o,i);if(l===null||isNaN(l.getTime()))return new Date(NaN);if(l){const a=l.getTime();let s=0,c;if(r.time&&(s=F1(r.time),s===null||isNaN(s)))return new Date(NaN);if(r.timeZone||t.timeZone){if(c=gc(r.timeZone||t.timeZone,new Date(a+s)),isNaN(c))return new Date(NaN)}else c=pu(new Date(a+s)),c=pu(new Date(a+s+c));return new Date(a+s+c)}else return new Date(NaN)}function R1(e){const t={};let n=hn.dateTimePattern.exec(e),r;if(n?(t.date=n[1],r=n[3]):(n=hn.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){const i=hn.timeZone.exec(r);i?(t.time=r.replace(i[1],""),t.timeZone=i[1].trim()):t.time=r}return t}function $1(e,t){if(e){const n=hn.YYY[t],r=hn.YYYYY[t];let i=hn.YYYY.exec(e)||r.exec(e);if(i){const o=i[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(i=hn.YY.exec(e)||n.exec(e),i){const o=i[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function I1(e,t){if(t===null)return null;let n,r,i;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=hn.MM.exec(e);if(o)return n=new Date(0),r=parseInt(o[1],10)-1,vu(t,r)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(o=hn.DDD.exec(e),o){n=new Date(0);const l=parseInt(o[1],10);return P1(t,l)?(n.setUTCFullYear(t,0,l),n):new Date(NaN)}if(o=hn.MMDD.exec(e),o){n=new Date(0),r=parseInt(o[1],10)-1;const l=parseInt(o[2],10);return vu(t,r,l)?(n.setUTCFullYear(t,r,l),n):new Date(NaN)}if(o=hn.Www.exec(e),o)return i=parseInt(o[1],10)-1,yu(i)?gu(t,i):new Date(NaN);if(o=hn.WwwD.exec(e),o){i=parseInt(o[1],10)-1;const l=parseInt(o[2],10)-1;return yu(i,l)?gu(t,i,l):new Date(NaN)}return null}function F1(e){let t,n,r=hn.HH.exec(e);if(r)return t=parseFloat(r[1].replace(",",".")),Ma(t)?t%24*Ea:NaN;if(r=hn.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(",",".")),Ma(t,n)?t%24*Ea+n*mu:NaN;if(r=hn.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);const i=parseFloat(r[3].replace(",","."));return Ma(t,n,i)?t%24*Ea+n*mu+i*1e3:NaN}return null}function gu(e,t,n){t=t||0,n=n||0;const r=new Date(0);r.setUTCFullYear(e,0,4);const i=r.getUTCDay()||7,o=t*7+n+1-i;return r.setUTCDate(r.getUTCDate()+o),r}const O1=[31,28,31,30,31,30,31,31,30,31,30,31],N1=[31,29,31,30,31,30,31,31,30,31,30,31];function eh(e){return e%400===0||e%4===0&&e%100!==0}function vu(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const r=eh(e);if(r&&n>N1[t]||!r&&n>O1[t])return!1}return!0}function P1(e,t){if(t<1)return!1;const n=eh(e);return!(n&&t>366||!n&&t>365)}function yu(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Ma(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const B1=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function z1(e,t,n={}){t=String(t);const r=t.match(B1);if(r){const i=Jf(n.originalDate||e,n);t=r.reduce(function(o,l){if(l[0]==="'")return o;const a=o.indexOf(l),s=o[a-1]==="'",c=o.replace(l,"'"+D1[l[0]](i,l,n)+"'");return s?c.substring(0,a-1)+c.substring(a+1):c},t)}return ut(e,t,n)}function H1(e,t,n){e=Jf(e,n);const r=gc(t,e,!0),i=new Date(e.getTime()-r),o=new Date(0);return o.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),o.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),o}function j1(e,t,n,r){return r={...r,timeZone:t,originalDate:e},z1(H1(e,t,{timeZone:r.timeZone}),n,r)}const th=Zl("n-time-picker"),Wo=Se({name:"TimePickerPanelCol",props:{clsPrefix:{type:String,required:!0},data:{type:Array,required:!0},activeValue:{type:[Number,String],default:null},onItemClick:Function},render(){const{activeValue:e,onItemClick:t,clsPrefix:n}=this;return this.data.map(r=>{const{label:i,disabled:o,value:l}=r,a=e===l;return E("div",{key:i,"data-active":a?"":null,class:[`${n}-time-picker-col__item`,a&&`${n}-time-picker-col__item--active`,o&&`${n}-time-picker-col__item--disabled`],onClick:t&&!o?()=>{t(l)}:void 0},i)})}}),io={amHours:["00","01","02","03","04","05","06","07","08","09","10","11"],pmHours:["12","01","02","03","04","05","06","07","08","09","10","11"],hours:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"],minutes:["00","01","02","03","04","05","06","07","08","09","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","50","51","52","53","54","55","56","57","58","59"],seconds:["00","01","02","03","04","05","06","07","08","09","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","50","51","52","53","54","55","56","57","58","59"],period:["AM","PM"]};function La(e){return`00${e}`.slice(-2)}function oo(e,t,n){return Array.isArray(t)?(n==="am"?t.filter(r=>r<12):n==="pm"?t.filter(r=>r>=12).map(r=>r===12?12:r-12):t).map(r=>La(r)):typeof t=="number"?n==="am"?e.filter(r=>{const i=Number(r);return i<12&&i%t===0}):n==="pm"?e.filter(r=>{const i=Number(r);return i>=12&&i%t===0}).map(r=>{const i=Number(r);return La(i===12?12:i-12)}):e.filter(r=>Number(r)%t===0):n==="am"?e.filter(r=>Number(r)<12):n==="pm"?e.map(r=>Number(r)).filter(r=>Number(r)>=12).map(r=>La(r===12?12:r-12)):e}function qo(e,t,n){return n?typeof n=="number"?e%n===0:n.includes(e):!0}function V1(e,t,n){const r=oo(io[t],n).map(Number);let i,o;for(let l=0;l<r.length;++l){const a=r[l];if(a===e)return a;if(a>e){o=a;break}i=a}return i===void 0?(o||bf("time-picker","Please set 'hours' or 'minutes' or 'seconds' props"),o):o===void 0||o-e>e-i?i:o}function W1(e){return Fr(e)<12?"am":"pm"}const q1={actions:{type:Array,default:()=>["now","confirm"]},showHour:{type:Boolean,default:!0},showMinute:{type:Boolean,default:!0},showSecond:{type:Boolean,default:!0},showPeriod:{type:Boolean,default:!0},isHourInvalid:Boolean,isMinuteInvalid:Boolean,isSecondInvalid:Boolean,isAmPmInvalid:Boolean,isValueInvalid:Boolean,hourValue:{type:Number,default:null},minuteValue:{type:Number,default:null},secondValue:{type:Number,default:null},amPmValue:{type:String,default:null},isHourDisabled:Function,isMinuteDisabled:Function,isSecondDisabled:Function,onHourClick:{type:Function,required:!0},onMinuteClick:{type:Function,required:!0},onSecondClick:{type:Function,required:!0},onAmPmClick:{type:Function,required:!0},onNowClick:Function,clearText:String,nowText:String,confirmText:String,transitionDisabled:Boolean,onClearClick:Function,onConfirmClick:Function,onFocusin:Function,onFocusout:Function,onFocusDetectorFocus:Function,onKeydown:Function,hours:[Number,Array],minutes:[Number,Array],seconds:[Number,Array],use12Hours:Boolean},U1=Se({name:"TimePickerPanel",props:q1,setup(e){const{mergedThemeRef:t,mergedClsPrefixRef:n}=$n(th),r=O(()=>{const{isHourDisabled:a,hours:s,use12Hours:c,amPmValue:f}=e;if(c){const u=f??W1(Date.now());return oo(io.hours,s,u).map(d=>{const h=Number(d),p=u==="pm"&&h!==12?h+12:h;return{label:d,value:p,disabled:a?a(p):!1}})}else return oo(io.hours,s).map(u=>({label:u,value:Number(u),disabled:a?a(Number(u)):!1}))}),i=O(()=>{const{isMinuteDisabled:a,minutes:s}=e;return oo(io.minutes,s).map(c=>({label:c,value:Number(c),disabled:a?a(Number(c),e.hourValue):!1}))}),o=O(()=>{const{isSecondDisabled:a,seconds:s}=e;return oo(io.seconds,s).map(c=>({label:c,value:Number(c),disabled:a?a(Number(c),e.minuteValue,e.hourValue):!1}))}),l=O(()=>{const{isHourDisabled:a}=e;let s=!0,c=!0;for(let f=0;f<12;++f)if(!a?.(f)){s=!1;break}for(let f=12;f<24;++f)if(!a?.(f)){c=!1;break}return[{label:"AM",value:"am",disabled:s},{label:"PM",value:"pm",disabled:c}]});return{mergedTheme:t,mergedClsPrefix:n,hours:r,minutes:i,seconds:o,amPm:l,hourScrollRef:G(null),minuteScrollRef:G(null),secondScrollRef:G(null),amPmScrollRef:G(null)}},render(){var e,t,n,r;const{mergedClsPrefix:i,mergedTheme:o}=this;return E("div",{tabindex:0,class:`${i}-time-picker-panel`,onFocusin:this.onFocusin,onFocusout:this.onFocusout,onKeydown:this.onKeydown},E("div",{class:`${i}-time-picker-cols`},this.showHour?E("div",{class:[`${i}-time-picker-col`,this.isHourInvalid&&`${i}-time-picker-col--invalid`,this.transitionDisabled&&`${i}-time-picker-col--transition-disabled`]},E(ir,{ref:"hourScrollRef",theme:o.peers.Scrollbar,themeOverrides:o.peerOverrides.Scrollbar},{default:()=>[E(Wo,{clsPrefix:i,data:this.hours,activeValue:this.hourValue,onItemClick:this.onHourClick}),E("div",{class:`${i}-time-picker-col__padding`})]})):null,this.showMinute?E("div",{class:[`${i}-time-picker-col`,this.transitionDisabled&&`${i}-time-picker-col--transition-disabled`,this.isMinuteInvalid&&`${i}-time-picker-col--invalid`]},E(ir,{ref:"minuteScrollRef",theme:o.peers.Scrollbar,themeOverrides:o.peerOverrides.Scrollbar},{default:()=>[E(Wo,{clsPrefix:i,data:this.minutes,activeValue:this.minuteValue,onItemClick:this.onMinuteClick}),E("div",{class:`${i}-time-picker-col__padding`})]})):null,this.showSecond?E("div",{class:[`${i}-time-picker-col`,this.isSecondInvalid&&`${i}-time-picker-col--invalid`,this.transitionDisabled&&`${i}-time-picker-col--transition-disabled`]},E(ir,{ref:"secondScrollRef",theme:o.peers.Scrollbar,themeOverrides:o.peerOverrides.Scrollbar},{default:()=>[E(Wo,{clsPrefix:i,data:this.seconds,activeValue:this.secondValue,onItemClick:this.onSecondClick}),E("div",{class:`${i}-time-picker-col__padding`})]})):null,this.use12Hours?E("div",{class:[`${i}-time-picker-col`,this.isAmPmInvalid&&`${i}-time-picker-col--invalid`,this.transitionDisabled&&`${i}-time-picker-col--transition-disabled`]},E(ir,{ref:"amPmScrollRef",theme:o.peers.Scrollbar,themeOverrides:o.peerOverrides.Scrollbar},{default:()=>[E(Wo,{clsPrefix:i,data:this.amPm,activeValue:this.amPmValue,onItemClick:this.onAmPmClick}),E("div",{class:`${i}-time-picker-col__padding`})]})):null),!((e=this.actions)===null||e===void 0)&&e.length?E("div",{class:`${i}-time-picker-actions`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?E(Xe,{theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,size:"tiny",onClick:this.onClearClick},{default:()=>this.clearText}):null,!((n=this.actions)===null||n===void 0)&&n.includes("now")?E(Xe,{size:"tiny",theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,onClick:this.onNowClick},{default:()=>this.nowText}):null,!((r=this.actions)===null||r===void 0)&&r.includes("confirm")?E(Xe,{size:"tiny",type:"primary",class:`${i}-time-picker-actions__confirm`,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,disabled:this.isValueInvalid,onClick:this.onConfirmClick},{default:()=>this.confirmText}):null):null,E(vi,{onFocus:this.onFocusDetectorFocus}))}}),Y1=Be([Fe("time-picker",`
 z-index: auto;
 position: relative;
 `,[Fe("time-picker-icon",`
 color: var(--n-icon-color-override);
 transition: color .3s var(--n-bezier);
 `),je("disabled",[Fe("time-picker-icon",`
 color: var(--n-icon-color-disabled-override);
 `)])]),Fe("time-picker-panel",`
 transition:
 box-shadow .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
 outline: none;
 font-size: var(--n-item-font-size);
 border-radius: var(--n-border-radius);
 margin: 4px 0;
 min-width: 104px;
 overflow: hidden;
 background-color: var(--n-panel-color);
 box-shadow: var(--n-panel-box-shadow);
 `,[wf(),Fe("time-picker-actions",`
 padding: var(--n-panel-action-padding);
 align-items: center;
 display: flex;
 justify-content: space-evenly;
 `),Fe("time-picker-cols",`
 height: calc(var(--n-item-height) * 6);
 display: flex;
 position: relative;
 transition: border-color .3s var(--n-bezier);
 border-bottom: 1px solid var(--n-panel-divider-color);
 `),Fe("time-picker-col",`
 flex-grow: 1;
 min-width: var(--n-item-width);
 height: calc(var(--n-item-height) * 6);
 flex-direction: column;
 transition: box-shadow .3s var(--n-bezier);
 `,[je("transition-disabled",[Ge("item","transition: none;",[Be("&::before","transition: none;")])]),Ge("padding",`
 height: calc(var(--n-item-height) * 5);
 `),Be("&:first-child","min-width: calc(var(--n-item-width) + 4px);",[Ge("item",[Be("&::before","left: 4px;")])]),Ge("item",`
 cursor: pointer;
 height: var(--n-item-height);
 display: flex;
 align-items: center;
 justify-content: center;
 transition: 
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 opacity .3s var(--n-bezier),
 text-decoration-color .3s var(--n-bezier);
 background: #0000;
 text-decoration-color: #0000;
 color: var(--n-item-text-color);
 z-index: 0;
 box-sizing: border-box;
 padding-top: 4px;
 position: relative;
 `,[Be("&::before",`
 content: "";
 transition: background-color .3s var(--n-bezier);
 z-index: -1;
 position: absolute;
 left: 0;
 right: 4px;
 top: 4px;
 bottom: 0;
 border-radius: var(--n-item-border-radius);
 `),ii("disabled",[Be("&:hover::before",`
 background-color: var(--n-item-color-hover);
 `)]),je("active",`
 color: var(--n-item-text-color-active);
 `,[Be("&::before",`
 background-color: var(--n-item-color-hover);
 `)]),je("disabled",`
 opacity: var(--n-item-opacity-disabled);
 cursor: not-allowed;
 `)]),je("invalid",[Ge("item",[je("active",`
 text-decoration: line-through;
 text-decoration-color: var(--n-item-text-color-active);
 `)])])])])]);function Ra(e,t){return e===void 0?!0:Array.isArray(e)?e.every(n=>n>=0&&n<=t):e>=0&&e<=t}const K1=Object.assign(Object.assign({},Yn.props),{to:ji.propTo,bordered:{type:Boolean,default:void 0},actions:Array,defaultValue:{type:Number,default:null},defaultFormattedValue:String,placeholder:String,placement:{type:String,default:"bottom-start"},value:Number,format:{type:String,default:"HH:mm:ss"},valueFormat:String,formattedValue:String,isHourDisabled:Function,size:String,isMinuteDisabled:Function,isSecondDisabled:Function,inputReadonly:Boolean,clearable:Boolean,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onUpdateFormattedValue:[Function,Array],"onUpdate:formattedValue":[Function,Array],onBlur:[Function,Array],onConfirm:[Function,Array],onClear:Function,onFocus:[Function,Array],timeZone:String,showIcon:{type:Boolean,default:!0},disabled:{type:Boolean,default:void 0},show:{type:Boolean,default:void 0},hours:{type:[Number,Array],validator:e=>Ra(e,23)},minutes:{type:[Number,Array],validator:e=>Ra(e,59)},seconds:{type:[Number,Array],validator:e=>Ra(e,59)},use12Hours:Boolean,stateful:{type:Boolean,default:!0},onChange:[Function,Array]}),Ss=Se({name:"TimePicker",props:K1,setup(e){const{mergedBorderedRef:t,mergedClsPrefixRef:n,namespaceRef:r,inlineThemeDisabled:i}=qr(e),{localeRef:o,dateLocaleRef:l}=Hi("TimePicker"),a=xf(e),{mergedSizeRef:s,mergedDisabledRef:c,mergedStatusRef:f}=a,u=Yn("TimePicker","-time-picker",Y1,zm,e,n),d=_f(),h=G(null),p=G(null),m=O(()=>({locale:l.value.locale}));function v(B){return B===null?null:xn(B,e.valueFormat||e.format,new Date,m.value).getTime()}const{defaultValue:y,defaultFormattedValue:g}=e,b=G(g!==void 0?v(g):y),k=O(()=>{const{formattedValue:B}=e;if(B!==void 0)return v(B);const{value:ae}=e;return ae!==void 0?ae:b.value}),_=O(()=>{const{timeZone:B}=e;return B?(ae,ye,Ze)=>j1(ae,B,ye,Ze):(ae,ye,Ze)=>ut(ae,ye,Ze)}),T=G("");Oe(()=>e.timeZone,()=>{const B=k.value;T.value=B===null?"":_.value(B,e.format,m.value)},{immediate:!0});const x=G(!1),S=an(e,"show"),R=_l(S,x),W=G(k.value),w=G(!1),C=O(()=>o.value.clear),A=O(()=>o.value.now),M=O(()=>e.placeholder!==void 0?e.placeholder:o.value.placeholder),L=O(()=>o.value.negativeText),P=O(()=>o.value.positiveText),I=O(()=>/H|h|K|k/.test(e.format)),N=O(()=>e.format.includes("m")),V=O(()=>e.format.includes("s")),K=O(()=>{const{value:B}=k;return B===null?null:Number(_.value(B,"HH",m.value))}),$=O(()=>{const{value:B}=k;return B===null?null:Number(_.value(B,"mm",m.value))}),H=O(()=>{const{value:B}=k;return B===null?null:Number(_.value(B,"ss",m.value))}),re=O(()=>{const{isHourDisabled:B}=e;return K.value===null?!1:qo(K.value,"hours",e.hours)?B?B(K.value):!1:!0}),Z=O(()=>{const{value:B}=$,{value:ae}=K;if(B===null||ae===null)return!1;if(!qo(B,"minutes",e.minutes))return!0;const{isMinuteDisabled:ye}=e;return ye?ye(B,ae):!1}),ne=O(()=>{const{value:B}=$,{value:ae}=K,{value:ye}=H;if(ye===null||B===null||ae===null)return!1;if(!qo(ye,"seconds",e.seconds))return!0;const{isSecondDisabled:Ze}=e;return Ze?Ze(ye,B,ae):!1}),de=O(()=>re.value||Z.value||ne.value),be=O(()=>e.format.length+4),Te=O(()=>{const{value:B}=k;return B===null?null:Fr(B)<12?"am":"pm"});function pe(B,ae){const{onUpdateFormattedValue:ye,"onUpdate:formattedValue":Ze}=e;ye&&xt(ye,B,ae),Ze&&xt(Ze,B,ae)}function ke(B){return B===null?null:_.value(B,e.valueFormat||e.format)}function Me(B){const{onUpdateValue:ae,"onUpdate:value":ye,onChange:Ze}=e,{nTriggerFormChange:ht,nTriggerFormInput:pt}=a,At=ke(B);ae&&xt(ae,B,At),ye&&xt(ye,B,At),Ze&&xt(Ze,B,At),pe(At,B),b.value=B,ht(),pt()}function et(B){const{onFocus:ae}=e,{nTriggerFormFocus:ye}=a;ae&&xt(ae,B),ye()}function Je(B){const{onBlur:ae}=e,{nTriggerFormBlur:ye}=a;ae&&xt(ae,B),ye()}function bt(){const{onConfirm:B}=e;B&&xt(B,k.value,ke(k.value))}function vt(B){var ae;B.stopPropagation(),Me(null),He(null),(ae=e.onClear)===null||ae===void 0||ae.call(e)}function lt(){St({returnFocus:!0})}function nt(){Me(null),He(null),St({returnFocus:!0})}function Pt(B){B.key==="Escape"&&R.value&&xl(B)}function We(B){var ae;switch(B.key){case"Escape":R.value&&(xl(B),St({returnFocus:!0}));break;case"Tab":d.shift&&B.target===((ae=p.value)===null||ae===void 0?void 0:ae.$el)&&(B.preventDefault(),St({returnFocus:!0}));break}}function Ve(){w.value=!0,pn(()=>{w.value=!1})}function oe(B){c.value||wl(B,"clear")||R.value||Ht()}function X(B){typeof B!="string"&&(k.value===null?Me(ve(Jr(Z0(new Date),B))):Me(ve(Jr(k.value,B))))}function me(B){typeof B!="string"&&(k.value===null?Me(ve(xa(G0(new Date),B))):Me(ve(xa(k.value,B))))}function ze(B){typeof B!="string"&&(k.value===null?Me(ve(Ca(uc(new Date),B))):Me(ve(Ca(k.value,B))))}function Ne(B){const{value:ae}=k;if(ae===null){const ye=new Date,Ze=Fr(ye);B==="pm"&&Ze<12?Me(ve(Jr(ye,Ze+12))):B==="am"&&Ze>=12&&Me(ve(Jr(ye,Ze-12))),Me(ve(ye))}else{const ye=Fr(ae);B==="pm"&&ye<12?Me(ve(Jr(ae,ye+12))):B==="am"&&ye>=12&&Me(ve(Jr(ae,ye-12)))}}function He(B){B===void 0&&(B=k.value),B===null?T.value="":T.value=_.value(B,e.format,m.value)}function J(B){Wt(B)||et(B)}function Ee(B){var ae;if(!Wt(B))if(R.value){const ye=(ae=p.value)===null||ae===void 0?void 0:ae.$el;ye?.contains(B.relatedTarget)||(He(),Je(B),St({returnFocus:!1}))}else He(),Je(B)}function Ke(){c.value||R.value||Ht()}function nn(){c.value||(He(),St({returnFocus:!1}))}function Mn(){if(!p.value)return;const{hourScrollRef:B,minuteScrollRef:ae,secondScrollRef:ye,amPmScrollRef:Ze}=p.value;[B,ae,ye,Ze].forEach(ht=>{var pt;if(!ht)return;const At=(pt=ht.contentRef)===null||pt===void 0?void 0:pt.querySelector("[data-active]");At&&ht.scrollTo({top:At.offsetTop})})}function ft(B){x.value=B;const{onUpdateShow:ae,"onUpdate:show":ye}=e;ae&&xt(ae,B),ye&&xt(ye,B)}function Wt(B){var ae,ye,Ze;return!!(!((ye=(ae=h.value)===null||ae===void 0?void 0:ae.wrapperElRef)===null||ye===void 0)&&ye.contains(B.relatedTarget)||!((Ze=p.value)===null||Ze===void 0)&&Ze.$el.contains(B.relatedTarget))}function Ht(){W.value=k.value,ft(!0),pn(Mn)}function qt(B){var ae,ye;R.value&&!(!((ye=(ae=h.value)===null||ae===void 0?void 0:ae.wrapperElRef)===null||ye===void 0)&&ye.contains(rc(B)))&&St({returnFocus:!1})}function St({returnFocus:B}){var ae;R.value&&(ft(!1),B&&((ae=h.value)===null||ae===void 0||ae.focus()))}function Lt(B){if(B===""){Me(null);return}const ae=xn(B,e.format,new Date,m.value);if(T.value=B,qn(ae)){const{value:ye}=k;if(ye!==null){const Ze=Jt(ye,{hours:Fr(ae),minutes:Al(ae),seconds:Tl(ae),milliseconds:Qg(ae)});Me(ve(Ze))}else Me(ve(ae))}}function _t(){Me(W.value),ft(!1)}function rn(){const B=new Date,ae={hours:Fr,minutes:Al,seconds:Tl},[ye,Ze,ht]=["hours","minutes","seconds"].map(At=>!e[At]||qo(ae[At](B),At,e[At])?ae[At](B):V1(ae[At](B),At,e[At])),pt=Ca(xa(Jr(k.value?k.value:ve(B),ye),Ze),ht);Me(ve(pt))}function Gt(){He(),bt(),St({returnFocus:!0})}function ee(B){Wt(B)||(He(),Je(B),St({returnFocus:!1}))}Oe(k,B=>{He(B),Ve(),pn(Mn)}),Oe(R,()=>{de.value&&Me(W.value)}),kr(th,{mergedThemeRef:u,mergedClsPrefixRef:n});const xe={focus:()=>{var B;(B=h.value)===null||B===void 0||B.focus()},blur:()=>{var B;(B=h.value)===null||B===void 0||B.blur()}},q=O(()=>{const{common:{cubicBezierEaseInOut:B},self:{iconColor:ae,iconColorDisabled:ye}}=u.value;return{"--n-icon-color-override":ae,"--n-icon-color-disabled-override":ye,"--n-bezier":B}}),U=i?Hr("time-picker-trigger",void 0,q,e):void 0,ce=O(()=>{const{self:{panelColor:B,itemTextColor:ae,itemTextColorActive:ye,itemColorHover:Ze,panelDividerColor:ht,panelBoxShadow:pt,itemOpacityDisabled:At,borderRadius:jn,itemFontSize:cr,itemWidth:ur,itemHeight:tr,panelActionPadding:dr,itemBorderRadius:xr},common:{cubicBezierEaseInOut:fr}}=u.value;return{"--n-bezier":fr,"--n-border-radius":jn,"--n-item-color-hover":Ze,"--n-item-font-size":cr,"--n-item-height":tr,"--n-item-opacity-disabled":At,"--n-item-text-color":ae,"--n-item-text-color-active":ye,"--n-item-width":ur,"--n-panel-action-padding":dr,"--n-panel-box-shadow":pt,"--n-panel-color":B,"--n-panel-divider-color":ht,"--n-item-border-radius":xr}}),_e=i?Hr("time-picker",void 0,ce,e):void 0;return{focus:xe.focus,blur:xe.blur,mergedStatus:f,mergedBordered:t,mergedClsPrefix:n,namespace:r,uncontrolledValue:b,mergedValue:k,isMounted:Cf(),inputInstRef:h,panelInstRef:p,adjustedTo:ji(e),mergedShow:R,localizedClear:C,localizedNow:A,localizedPlaceholder:M,localizedNegativeText:L,localizedPositiveText:P,hourInFormat:I,minuteInFormat:N,secondInFormat:V,mergedAttrSize:be,displayTimeString:T,mergedSize:s,mergedDisabled:c,isValueInvalid:de,isHourInvalid:re,isMinuteInvalid:Z,isSecondInvalid:ne,transitionDisabled:w,hourValue:K,minuteValue:$,secondValue:H,amPmValue:Te,handleInputKeydown:Pt,handleTimeInputFocus:J,handleTimeInputBlur:Ee,handleNowClick:rn,handleConfirmClick:Gt,handleTimeInputUpdateValue:Lt,handleMenuFocusOut:ee,handleCancelClick:_t,handleClickOutside:qt,handleTimeInputActivate:Ke,handleTimeInputDeactivate:nn,handleHourClick:X,handleMinuteClick:me,handleSecondClick:ze,handleAmPmClick:Ne,handleTimeInputClear:vt,handleFocusDetectorFocus:lt,handleMenuKeydown:We,handleTriggerClick:oe,mergedTheme:u,triggerCssVars:i?void 0:q,triggerThemeClass:U?.themeClass,triggerOnRender:U?.onRender,cssVars:i?void 0:ce,themeClass:_e?.themeClass,onRender:_e?.onRender,clearSelectedValue:nt}},render(){const{mergedClsPrefix:e,$slots:t,triggerOnRender:n}=this;return n?.(),E("div",{class:[`${e}-time-picker`,this.triggerThemeClass],style:this.triggerCssVars},E(Js,null,{default:()=>[E(ec,null,{default:()=>E(ar,{ref:"inputInstRef",status:this.mergedStatus,value:this.displayTimeString,bordered:this.mergedBordered,passivelyActivated:!0,attrSize:this.mergedAttrSize,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,stateful:this.stateful,size:this.mergedSize,placeholder:this.localizedPlaceholder,clearable:this.clearable,disabled:this.mergedDisabled,textDecoration:this.isValueInvalid?"line-through":void 0,onFocus:this.handleTimeInputFocus,onBlur:this.handleTimeInputBlur,onActivate:this.handleTimeInputActivate,onDeactivate:this.handleTimeInputDeactivate,onUpdateValue:this.handleTimeInputUpdateValue,onClear:this.handleTimeInputClear,internalDeactivateOnEnter:!0,internalForceFocus:this.mergedShow,readonly:this.inputReadonly||this.mergedDisabled,onClick:this.handleTriggerClick,onKeydown:this.handleInputKeydown},this.showIcon?{[this.clearable?"clear-icon-placeholder":"suffix"]:()=>E(Ri,{clsPrefix:e,class:`${e}-time-picker-icon`},{default:()=>t.icon?t.icon():E(Dg,null)})}:null)}),E(tc,{teleportDisabled:this.adjustedTo===ji.tdkey,show:this.mergedShow,to:this.adjustedTo,containerClass:this.namespace,placement:this.placement},{default:()=>E(Ur,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>{var r;return this.mergedShow?((r=this.onRender)===null||r===void 0||r.call(this),jr(E(U1,{ref:"panelInstRef",actions:this.actions,class:this.themeClass,style:this.cssVars,seconds:this.seconds,minutes:this.minutes,hours:this.hours,transitionDisabled:this.transitionDisabled,hourValue:this.hourValue,showHour:this.hourInFormat,isHourInvalid:this.isHourInvalid,isHourDisabled:this.isHourDisabled,minuteValue:this.minuteValue,showMinute:this.minuteInFormat,isMinuteInvalid:this.isMinuteInvalid,isMinuteDisabled:this.isMinuteDisabled,secondValue:this.secondValue,amPmValue:this.amPmValue,showSecond:this.secondInFormat,isSecondInvalid:this.isSecondInvalid,isSecondDisabled:this.isSecondDisabled,isValueInvalid:this.isValueInvalid,clearText:this.localizedClear,nowText:this.localizedNow,confirmText:this.localizedPositiveText,use12Hours:this.use12Hours,onFocusout:this.handleMenuFocusOut,onKeydown:this.handleMenuKeydown,onHourClick:this.handleHourClick,onMinuteClick:this.handleMinuteClick,onSecondClick:this.handleSecondClick,onAmPmClick:this.handleAmPmClick,onNowClick:this.handleNowClick,onConfirmClick:this.handleConfirmClick,onClearClick:this.clearSelectedValue,onFocusDetectorFocus:this.handleFocusDetectorFocus}),[[nc,this.handleClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),Z1=Se({name:"DateTimePanel",props:fc,setup(e){return hc(e,"datetime")},render(){var e,t,n,r;const{mergedClsPrefix:i,mergedTheme:o,shortcuts:l,timePickerProps:a,datePickerSlots:s,onRender:c}=this;return c?.(),E("div",{ref:"selfRef",tabindex:0,class:[`${i}-date-panel`,`${i}-date-panel--datetime`,!this.panel&&`${i}-date-panel--shadow`,this.themeClass],onKeydown:this.handlePanelKeyDown,onFocus:this.handlePanelFocus},E("div",{class:`${i}-date-panel-header`},E(ar,{value:this.dateInputValue,theme:o.peers.Input,themeOverrides:o.peerOverrides.Input,stateful:!1,size:this.timePickerSize,readonly:this.inputReadonly,class:`${i}-date-panel-date-input`,textDecoration:this.isDateInvalid?"line-through":"",placeholder:this.locale.selectDate,onBlur:this.handleDateInputBlur,onUpdateValue:this.handleDateInput}),E(Ss,Object.assign({size:this.timePickerSize,placeholder:this.locale.selectTime,format:this.timePickerFormat},Array.isArray(a)?void 0:a,{showIcon:!1,to:!1,theme:o.peers.TimePicker,themeOverrides:o.peerOverrides.TimePicker,value:Array.isArray(this.value)?null:this.value,isHourDisabled:this.isHourDisabled,isMinuteDisabled:this.isMinuteDisabled,isSecondDisabled:this.isSecondDisabled,onUpdateValue:this.handleTimePickerChange,stateful:!1}))),E("div",{class:`${i}-date-panel-calendar`},E("div",{class:`${i}-date-panel-month`},E("div",{class:`${i}-date-panel-month__fast-prev`,onClick:this.prevYear},dt(s["prev-year"],()=>[E(Vi,null)])),E("div",{class:`${i}-date-panel-month__prev`,onClick:this.prevMonth},dt(s["prev-month"],()=>[E(Wi,null)])),E(Zi,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.calendarValue,onUpdateValue:this.onUpdateCalendarValue,mergedClsPrefix:i,calendarMonth:this.calendarMonth,calendarYear:this.calendarYear}),E("div",{class:`${i}-date-panel-month__next`,onClick:this.nextMonth},dt(s["next-month"],()=>[E(qi,null)])),E("div",{class:`${i}-date-panel-month__fast-next`,onClick:this.nextYear},dt(s["next-year"],()=>[E(Ui,null)]))),E("div",{class:`${i}-date-panel-weekdays`},this.weekdays.map(f=>E("div",{key:f,class:`${i}-date-panel-weekdays__day`},f))),E("div",{class:`${i}-date-panel-dates`},this.dateArray.map((f,u)=>E("div",{"data-n-date":!0,key:u,class:[`${i}-date-panel-date`,{[`${i}-date-panel-date--current`]:f.isCurrentDate,[`${i}-date-panel-date--selected`]:f.selected,[`${i}-date-panel-date--excluded`]:!f.inCurrentMonth,[`${i}-date-panel-date--disabled`]:this.mergedIsDateDisabled(f.ts,{type:"date",year:f.dateObject.year,month:f.dateObject.month,date:f.dateObject.date})}],onClick:()=>{this.handleDateClick(f)}},E("div",{class:`${i}-date-panel-date__trigger`}),f.dateObject.date,f.isCurrentDate?E("div",{class:`${i}-date-panel-date__sup`}):null)))),this.datePickerSlots.footer?E("div",{class:`${i}-date-panel-footer`},this.datePickerSlots.footer()):null,!((e=this.actions)===null||e===void 0)&&e.length||l?E("div",{class:`${i}-date-panel-actions`},E("div",{class:`${i}-date-panel-actions__prefix`},l&&Object.keys(l).map(f=>{const u=l[f];return Array.isArray(u)?null:E(Br,{size:"tiny",onMouseenter:()=>{this.handleSingleShortcutMouseenter(u)},onClick:()=>{this.handleSingleShortcutClick(u)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>f})})),E("div",{class:`${i}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?cn(this.datePickerSlots.clear,{onClear:this.clearSelectedDateTime,text:this.locale.clear},()=>[E(Xe,{theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,size:"tiny",onClick:this.clearSelectedDateTime},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("now")?cn(s.now,{onNow:this.handleNowClick,text:this.locale.now},()=>[E(Xe,{theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,size:"tiny",onClick:this.handleNowClick},{default:()=>this.locale.now})]):null,!((r=this.actions)===null||r===void 0)&&r.includes("confirm")?cn(s.confirm,{onConfirm:this.handleConfirmClick,disabled:this.isDateInvalid,text:this.locale.confirm},()=>[E(Xe,{theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isDateInvalid,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,E(vi,{onFocus:this.handleFocusDetectorFocus}))}}),G1=Se({name:"DateTimeRangePanel",props:pc,setup(e){return mc(e,"datetimerange")},render(){var e,t,n;const{mergedClsPrefix:r,mergedTheme:i,shortcuts:o,timePickerProps:l,onRender:a,datePickerSlots:s}=this;return a?.(),E("div",{ref:"selfRef",tabindex:0,class:[`${r}-date-panel`,`${r}-date-panel--datetimerange`,!this.panel&&`${r}-date-panel--shadow`,this.themeClass],onKeydown:this.handlePanelKeyDown,onFocus:this.handlePanelFocus},E("div",{class:`${r}-date-panel-header`},E(ar,{value:this.startDateDisplayString,theme:i.peers.Input,themeOverrides:i.peerOverrides.Input,size:this.timePickerSize,stateful:!1,readonly:this.inputReadonly,class:`${r}-date-panel-date-input`,textDecoration:this.isStartValueInvalid?"line-through":"",placeholder:this.locale.selectDate,onBlur:this.handleStartDateInputBlur,onUpdateValue:this.handleStartDateInput}),E(Ss,Object.assign({placeholder:this.locale.selectTime,format:this.timePickerFormat,size:this.timePickerSize},Array.isArray(l)?l[0]:l,{value:this.startTimeValue,to:!1,showIcon:!1,disabled:this.isSelecting,theme:i.peers.TimePicker,themeOverrides:i.peerOverrides.TimePicker,stateful:!1,isHourDisabled:this.isStartHourDisabled,isMinuteDisabled:this.isStartMinuteDisabled,isSecondDisabled:this.isStartSecondDisabled,onUpdateValue:this.handleStartTimePickerChange})),E(ar,{value:this.endDateInput,theme:i.peers.Input,themeOverrides:i.peerOverrides.Input,stateful:!1,size:this.timePickerSize,readonly:this.inputReadonly,class:`${r}-date-panel-date-input`,textDecoration:this.isEndValueInvalid?"line-through":"",placeholder:this.locale.selectDate,onBlur:this.handleEndDateInputBlur,onUpdateValue:this.handleEndDateInput}),E(Ss,Object.assign({placeholder:this.locale.selectTime,format:this.timePickerFormat,size:this.timePickerSize},Array.isArray(l)?l[1]:l,{disabled:this.isSelecting,showIcon:!1,theme:i.peers.TimePicker,themeOverrides:i.peerOverrides.TimePicker,to:!1,stateful:!1,value:this.endTimeValue,isHourDisabled:this.isEndHourDisabled,isMinuteDisabled:this.isEndMinuteDisabled,isSecondDisabled:this.isEndSecondDisabled,onUpdateValue:this.handleEndTimePickerChange}))),E("div",{ref:"startDatesElRef",class:`${r}-date-panel-calendar ${r}-date-panel-calendar--start`},E("div",{class:`${r}-date-panel-month`},E("div",{class:`${r}-date-panel-month__fast-prev`,onClick:this.startCalendarPrevYear},dt(s["prev-year"],()=>[E(Vi,null)])),E("div",{class:`${r}-date-panel-month__prev`,onClick:this.startCalendarPrevMonth},dt(s["prev-month"],()=>[E(Wi,null)])),E(Zi,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.startCalendarDateTime,onUpdateValue:this.onUpdateStartCalendarValue,mergedClsPrefix:r,calendarMonth:this.startCalendarMonth,calendarYear:this.startCalendarYear}),E("div",{class:`${r}-date-panel-month__next`,onClick:this.startCalendarNextMonth},dt(s["next-month"],()=>[E(qi,null)])),E("div",{class:`${r}-date-panel-month__fast-next`,onClick:this.startCalendarNextYear},dt(s["next-year"],()=>[E(Ui,null)]))),E("div",{class:`${r}-date-panel-weekdays`},this.weekdays.map(c=>E("div",{key:c,class:`${r}-date-panel-weekdays__day`},c))),E("div",{class:`${r}-date-panel__divider`}),E("div",{class:`${r}-date-panel-dates`},this.startDateArray.map((c,f)=>{const u=this.mergedIsDateDisabled(c.ts);return E("div",{"data-n-date":!0,key:f,class:[`${r}-date-panel-date`,{[`${r}-date-panel-date--excluded`]:!c.inCurrentMonth,[`${r}-date-panel-date--current`]:c.isCurrentDate,[`${r}-date-panel-date--selected`]:c.selected,[`${r}-date-panel-date--covered`]:c.inSpan,[`${r}-date-panel-date--start`]:c.startOfSpan,[`${r}-date-panel-date--end`]:c.endOfSpan,[`${r}-date-panel-date--disabled`]:u}],onClick:u?void 0:()=>{this.handleDateClick(c)},onMouseenter:u?void 0:()=>{this.handleDateMouseEnter(c)}},E("div",{class:`${r}-date-panel-date__trigger`}),c.dateObject.date,c.isCurrentDate?E("div",{class:`${r}-date-panel-date__sup`}):null)}))),E("div",{class:`${r}-date-panel__vertical-divider`}),E("div",{ref:"endDatesElRef",class:`${r}-date-panel-calendar ${r}-date-panel-calendar--end`},E("div",{class:`${r}-date-panel-month`},E("div",{class:`${r}-date-panel-month__fast-prev`,onClick:this.endCalendarPrevYear},dt(s["prev-year"],()=>[E(Vi,null)])),E("div",{class:`${r}-date-panel-month__prev`,onClick:this.endCalendarPrevMonth},dt(s["prev-month"],()=>[E(Wi,null)])),E(Zi,{monthBeforeYear:this.calendarMonthBeforeYear,value:this.endCalendarDateTime,onUpdateValue:this.onUpdateEndCalendarValue,mergedClsPrefix:r,monthYearSeparator:this.calendarHeaderMonthYearSeparator,calendarMonth:this.endCalendarMonth,calendarYear:this.endCalendarYear}),E("div",{class:`${r}-date-panel-month__next`,onClick:this.endCalendarNextMonth},dt(s["next-month"],()=>[E(qi,null)])),E("div",{class:`${r}-date-panel-month__fast-next`,onClick:this.endCalendarNextYear},dt(s["next-year"],()=>[E(Ui,null)]))),E("div",{class:`${r}-date-panel-weekdays`},this.weekdays.map(c=>E("div",{key:c,class:`${r}-date-panel-weekdays__day`},c))),E("div",{class:`${r}-date-panel__divider`}),E("div",{class:`${r}-date-panel-dates`},this.endDateArray.map((c,f)=>{const u=this.mergedIsDateDisabled(c.ts);return E("div",{"data-n-date":!0,key:f,class:[`${r}-date-panel-date`,{[`${r}-date-panel-date--excluded`]:!c.inCurrentMonth,[`${r}-date-panel-date--current`]:c.isCurrentDate,[`${r}-date-panel-date--selected`]:c.selected,[`${r}-date-panel-date--covered`]:c.inSpan,[`${r}-date-panel-date--start`]:c.startOfSpan,[`${r}-date-panel-date--end`]:c.endOfSpan,[`${r}-date-panel-date--disabled`]:u}],onClick:u?void 0:()=>{this.handleDateClick(c)},onMouseenter:u?void 0:()=>{this.handleDateMouseEnter(c)}},E("div",{class:`${r}-date-panel-date__trigger`}),c.dateObject.date,c.isCurrentDate?E("div",{class:`${r}-date-panel-date__sup`}):null)}))),this.datePickerSlots.footer?E("div",{class:`${r}-date-panel-footer`},this.datePickerSlots.footer()):null,!((e=this.actions)===null||e===void 0)&&e.length||o?E("div",{class:`${r}-date-panel-actions`},E("div",{class:`${r}-date-panel-actions__prefix`},o&&Object.keys(o).map(c=>{const f=o[c];return Array.isArray(f)||typeof f=="function"?E(Br,{size:"tiny",onMouseenter:()=>{this.handleRangeShortcutMouseenter(f)},onClick:()=>{this.handleRangeShortcutClick(f)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>c}):null})),E("div",{class:`${r}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?cn(s.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[E(Xe,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("confirm")?cn(s.confirm,{onConfirm:this.handleConfirmClick,disabled:this.isRangeInvalid||this.isSelecting,text:this.locale.confirm},()=>[E(Xe,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isRangeInvalid||this.isSelecting,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,E(vi,{onFocus:this.handleFocusDetectorFocus}))}}),X1=Se({name:"MonthRangePanel",props:Object.assign(Object.assign({},pc),{type:{type:String,required:!0}}),setup(e){const t=mc(e,e.type),{dateLocaleRef:n}=Hi("DatePicker"),r=(i,o,l,a)=>{const{handleColItemClick:s}=t;return E("div",{"data-n-date":!0,key:o,class:[`${l}-date-panel-month-calendar__picker-col-item`,i.isCurrent&&`${l}-date-panel-month-calendar__picker-col-item--current`,i.selected&&`${l}-date-panel-month-calendar__picker-col-item--selected`,!1],onClick:()=>{s(i,a)}},i.type==="month"?Vf(i.dateObject.month,i.monthFormat,n.value.locale):i.type==="quarter"?qf(i.dateObject.quarter,i.quarterFormat,n.value.locale):Wf(i.dateObject.year,i.yearFormat,n.value.locale))};return Gl(()=>{t.justifyColumnsScrollState()}),Object.assign(Object.assign({},t),{renderItem:r})},render(){var e,t,n;const{mergedClsPrefix:r,mergedTheme:i,shortcuts:o,type:l,renderItem:a,onRender:s}=this;return s?.(),E("div",{ref:"selfRef",tabindex:0,class:[`${r}-date-panel`,`${r}-date-panel--daterange`,!this.panel&&`${r}-date-panel--shadow`,this.themeClass],onKeydown:this.handlePanelKeyDown,onFocus:this.handlePanelFocus},E("div",{ref:"startDatesElRef",class:`${r}-date-panel-calendar ${r}-date-panel-calendar--start`},E("div",{class:`${r}-date-panel-month-calendar`},E(ir,{ref:"startYearScrollbarRef",class:`${r}-date-panel-month-calendar__picker-col`,theme:i.peers.Scrollbar,themeOverrides:i.peerOverrides.Scrollbar,container:()=>this.virtualListContainer("start"),content:()=>this.virtualListContent("start"),horizontalRailStyle:{zIndex:1},verticalRailStyle:{zIndex:1}},{default:()=>E(hs,{ref:"startYearVlRef",items:this.startYearArray,itemSize:pi,showScrollbar:!1,keyField:"ts",onScroll:this.handleStartYearVlScroll,paddingBottom:4},{default:({item:c,index:f})=>a(c,f,r,"start")})}),l==="monthrange"||l==="quarterrange"?E("div",{class:`${r}-date-panel-month-calendar__picker-col`},E(ir,{ref:"startMonthScrollbarRef",theme:i.peers.Scrollbar,themeOverrides:i.peerOverrides.Scrollbar},{default:()=>[(l==="monthrange"?this.startMonthArray:this.startQuarterArray).map((c,f)=>a(c,f,r,"start")),l==="monthrange"&&E("div",{class:`${r}-date-panel-month-calendar__padding`})]})):null)),E("div",{class:`${r}-date-panel__vertical-divider`}),E("div",{ref:"endDatesElRef",class:`${r}-date-panel-calendar ${r}-date-panel-calendar--end`},E("div",{class:`${r}-date-panel-month-calendar`},E(ir,{ref:"endYearScrollbarRef",class:`${r}-date-panel-month-calendar__picker-col`,theme:i.peers.Scrollbar,themeOverrides:i.peerOverrides.Scrollbar,container:()=>this.virtualListContainer("end"),content:()=>this.virtualListContent("end"),horizontalRailStyle:{zIndex:1},verticalRailStyle:{zIndex:1}},{default:()=>E(hs,{ref:"endYearVlRef",items:this.endYearArray,itemSize:pi,showScrollbar:!1,keyField:"ts",onScroll:this.handleEndYearVlScroll,paddingBottom:4},{default:({item:c,index:f})=>a(c,f,r,"end")})}),l==="monthrange"||l==="quarterrange"?E("div",{class:`${r}-date-panel-month-calendar__picker-col`},E(ir,{ref:"endMonthScrollbarRef",theme:i.peers.Scrollbar,themeOverrides:i.peerOverrides.Scrollbar},{default:()=>[(l==="monthrange"?this.endMonthArray:this.endQuarterArray).map((c,f)=>a(c,f,r,"end")),l==="monthrange"&&E("div",{class:`${r}-date-panel-month-calendar__padding`})]})):null)),Qs(this.datePickerSlots.footer,c=>c?E("div",{class:`${r}-date-panel-footer`},c):null),!((e=this.actions)===null||e===void 0)&&e.length||o?E("div",{class:`${r}-date-panel-actions`},E("div",{class:`${r}-date-panel-actions__prefix`},o&&Object.keys(o).map(c=>{const f=o[c];return Array.isArray(f)||typeof f=="function"?E(Br,{size:"tiny",onMouseenter:()=>{this.handleRangeShortcutMouseenter(f)},onClick:()=>{this.handleRangeShortcutClick(f)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>c}):null})),E("div",{class:`${r}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?cn(this.datePickerSlots.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[E(Br,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("confirm")?cn(this.datePickerSlots.confirm,{disabled:this.isRangeInvalid,onConfirm:this.handleConfirmClick,text:this.locale.confirm},()=>[E(Br,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isRangeInvalid,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,E(vi,{onFocus:this.handleFocusDetectorFocus}))}}),Q1=Object.assign(Object.assign({},Yn.props),{to:ji.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,updateValueOnClose:Boolean,calendarDayFormat:String,calendarHeaderYearFormat:String,calendarHeaderMonthFormat:String,calendarHeaderMonthYearSeparator:{type:String,default:" "},calendarHeaderMonthBeforeYear:{type:Boolean,default:void 0},defaultValue:[Number,Array],defaultFormattedValue:[String,Array],defaultTime:[Number,String,Array,Function],disabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom-start"},value:[Number,Array],formattedValue:[String,Array],size:String,type:{type:String,default:"date"},valueFormat:String,separator:String,placeholder:String,startPlaceholder:String,endPlaceholder:String,format:String,dateFormat:String,timePickerFormat:String,actions:Array,shortcuts:Object,isDateDisabled:Function,isTimeDisabled:Function,show:{type:Boolean,default:void 0},panel:Boolean,ranges:Object,firstDayOfWeek:Number,inputReadonly:Boolean,closeOnSelect:Boolean,status:String,timePickerProps:[Object,Array],onClear:Function,onConfirm:Function,defaultCalendarStartTime:Number,defaultCalendarEndTime:Number,bindCalendarMonths:Boolean,monthFormat:{type:String,default:"M"},yearFormat:{type:String,default:"y"},quarterFormat:{type:String,default:"'Q'Q"},yearRange:{type:Array,default:()=>[1901,2100]},"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],"onUpdate:formattedValue":[Function,Array],onUpdateFormattedValue:[Function,Array],"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onNextMonth:Function,onPrevMonth:Function,onNextYear:Function,onPrevYear:Function,onChange:[Function,Array]}),J1=Be([Fe("date-picker",`
 position: relative;
 z-index: auto;
 `,[Fe("date-picker-icon",`
 color: var(--n-icon-color-override);
 transition: color .3s var(--n-bezier);
 `),Fe("icon",`
 color: var(--n-icon-color-override);
 transition: color .3s var(--n-bezier);
 `),je("disabled",[Fe("date-picker-icon",`
 color: var(--n-icon-color-disabled-override);
 `),Fe("icon",`
 color: var(--n-icon-color-disabled-override);
 `)])]),Fe("date-panel",`
 width: fit-content;
 outline: none;
 margin: 4px 0;
 display: grid;
 grid-template-columns: 0fr;
 border-radius: var(--n-panel-border-radius);
 background-color: var(--n-panel-color);
 color: var(--n-panel-text-color);
 user-select: none;
 `,[wf(),je("shadow",`
 box-shadow: var(--n-panel-box-shadow);
 `),Fe("date-panel-calendar",{padding:"var(--n-calendar-left-padding)",display:"grid",gridTemplateColumns:"1fr",gridArea:"left-calendar"},[je("end",{padding:"var(--n-calendar-right-padding)",gridArea:"right-calendar"})]),Fe("date-panel-month-calendar",{display:"flex",gridArea:"left-calendar"},[Ge("picker-col",`
 min-width: var(--n-scroll-item-width);
 height: calc(var(--n-scroll-item-height) * 6);
 user-select: none;
 -webkit-user-select: none;
 `,[Be("&:first-child",`
 min-width: calc(var(--n-scroll-item-width) + 4px);
 `,[Ge("picker-col-item",[Be("&::before","left: 4px;")])]),Ge("padding",`
 height: calc(var(--n-scroll-item-height) * 5)
 `)]),Ge("picker-col-item",`
 z-index: 0;
 cursor: pointer;
 height: var(--n-scroll-item-height);
 box-sizing: border-box;
 padding-top: 4px;
 display: flex;
 align-items: center;
 justify-content: center;
 position: relative;
 transition: 
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
 background: #0000;
 color: var(--n-item-text-color);
 `,[Be("&::before",`
 z-index: -1;
 content: "";
 position: absolute;
 left: 0;
 right: 4px;
 top: 4px;
 bottom: 0;
 border-radius: var(--n-scroll-item-border-radius);
 transition: 
 background-color .3s var(--n-bezier);
 `),ii("disabled",[Be("&:hover::before",`
 background-color: var(--n-item-color-hover);
 `),je("selected",`
 color: var(--n-item-color-active);
 `,[Be("&::before","background-color: var(--n-item-color-hover);")])]),je("disabled",`
 color: var(--n-item-text-color-disabled);
 cursor: not-allowed;
 `,[je("selected",[Be("&::before",`
 background-color: var(--n-item-color-disabled);
 `)])])])]),je("date",{gridTemplateAreas:`
 "left-calendar"
 "footer"
 "action"
 `}),je("week",{gridTemplateAreas:`
 "left-calendar"
 "footer"
 "action"
 `}),je("daterange",{gridTemplateAreas:`
 "left-calendar divider right-calendar"
 "footer footer footer"
 "action action action"
 `}),je("datetime",{gridTemplateAreas:`
 "header"
 "left-calendar"
 "footer"
 "action"
 `}),je("datetimerange",{gridTemplateAreas:`
 "header header header"
 "left-calendar divider right-calendar"
 "footer footer footer"
 "action action action"
 `}),je("month",{gridTemplateAreas:`
 "left-calendar"
 "footer"
 "action"
 `}),Fe("date-panel-footer",{gridArea:"footer"}),Fe("date-panel-actions",{gridArea:"action"}),Fe("date-panel-header",{gridArea:"header"}),Fe("date-panel-header",`
 box-sizing: border-box;
 width: 100%;
 align-items: center;
 padding: var(--n-panel-header-padding);
 display: flex;
 justify-content: space-between;
 border-bottom: 1px solid var(--n-panel-header-divider-color);
 `,[Be(">",[Be("*:not(:last-child)",{marginRight:"10px"}),Be("*",{flex:1,width:0}),Fe("time-picker",{zIndex:1})])]),Fe("date-panel-month",`
 box-sizing: border-box;
 display: grid;
 grid-template-columns: var(--n-calendar-title-grid-template-columns);
 align-items: center;
 justify-items: center;
 padding: var(--n-calendar-title-padding);
 height: var(--n-calendar-title-height);
 `,[Ge("prev, next, fast-prev, fast-next",`
 line-height: 0;
 cursor: pointer;
 width: var(--n-arrow-size);
 height: var(--n-arrow-size);
 color: var(--n-arrow-color);
 `),Ge("month-year",`
 user-select: none;
 -webkit-user-select: none;
 flex-grow: 1;
 position: relative;
 `,[Ge("text",`
 font-size: var(--n-calendar-title-font-size);
 line-height: var(--n-calendar-title-font-size);
 font-weight: var(--n-calendar-title-font-weight);
 padding: 6px 8px;
 text-align: center;
 color: var(--n-calendar-title-text-color);
 cursor: pointer;
 transition: background-color .3s var(--n-bezier);
 border-radius: var(--n-panel-border-radius);
 `,[je("active",`
 background-color: var(--n-calendar-title-color-hover);
 `),Be("&:hover",`
 background-color: var(--n-calendar-title-color-hover);
 `)])])]),Fe("date-panel-weekdays",`
 display: grid;
 margin: auto;
 grid-template-columns: repeat(7, var(--n-item-cell-width));
 grid-template-rows: repeat(1, var(--n-item-cell-height));
 align-items: center;
 justify-items: center;
 margin-bottom: 4px;
 border-bottom: 1px solid var(--n-calendar-days-divider-color);
 `,[Ge("day",`
 white-space: nowrap;
 user-select: none;
 -webkit-user-select: none;
 line-height: 15px;
 width: var(--n-item-size);
 text-align: center;
 font-size: var(--n-calendar-days-font-size);
 color: var(--n-item-text-color);
 display: flex;
 align-items: center;
 justify-content: center;
 `)]),Fe("date-panel-dates",`
 margin: auto;
 display: grid;
 grid-template-columns: repeat(7, var(--n-item-cell-width));
 grid-template-rows: repeat(6, var(--n-item-cell-height));
 align-items: center;
 justify-items: center;
 flex-wrap: wrap;
 `,[Fe("date-panel-date",`
 user-select: none;
 -webkit-user-select: none;
 position: relative;
 width: var(--n-item-size);
 height: var(--n-item-size);
 line-height: var(--n-item-size);
 text-align: center;
 font-size: var(--n-item-font-size);
 border-radius: var(--n-item-border-radius);
 z-index: 0;
 cursor: pointer;
 transition:
 background-color .2s var(--n-bezier),
 color .2s var(--n-bezier);
 `,[Ge("trigger",`
 position: absolute;
 left: calc(var(--n-item-size) / 2 - var(--n-item-cell-width) / 2);
 top: calc(var(--n-item-size) / 2 - var(--n-item-cell-height) / 2);
 width: var(--n-item-cell-width);
 height: var(--n-item-cell-height);
 `),je("current",[Ge("sup",`
 position: absolute;
 top: 2px;
 right: 2px;
 content: "";
 height: 4px;
 width: 4px;
 border-radius: 2px;
 background-color: var(--n-item-color-active);
 transition:
 background-color .2s var(--n-bezier);
 `)]),Be("&::after",`
 content: "";
 z-index: -1;
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 border-radius: inherit;
 transition: background-color .3s var(--n-bezier);
 `),je("covered, start, end",[ii("excluded",[Be("&::before",`
 content: "";
 z-index: -2;
 position: absolute;
 left: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2);
 right: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2);
 top: 0;
 bottom: 0;
 background-color: var(--n-item-color-included);
 `),Be("&:nth-child(7n + 1)::before",{borderTopLeftRadius:"var(--n-item-border-radius)",borderBottomLeftRadius:"var(--n-item-border-radius)"}),Be("&:nth-child(7n + 7)::before",{borderTopRightRadius:"var(--n-item-border-radius)",borderBottomRightRadius:"var(--n-item-border-radius)"})])]),je("selected",{color:"var(--n-item-text-color-active)"},[Be("&::after",{backgroundColor:"var(--n-item-color-active)"}),je("start",[Be("&::before",{left:"50%"})]),je("end",[Be("&::before",{right:"50%"})]),Ge("sup",{backgroundColor:"var(--n-panel-color)"})]),je("excluded",{color:"var(--n-item-text-color-disabled)"},[je("selected",[Be("&::after",{backgroundColor:"var(--n-item-color-disabled)"})])]),je("disabled",{cursor:"not-allowed",color:"var(--n-item-text-color-disabled)"},[je("covered",[Be("&::before",{backgroundColor:"var(--n-item-color-disabled)"})]),je("selected",[Be("&::before",{backgroundColor:"var(--n-item-color-disabled)"}),Be("&::after",{backgroundColor:"var(--n-item-color-disabled)"})])]),je("week-hovered",[Be("&::before",`
 background-color: var(--n-item-color-included);
 `),Be("&:nth-child(7n + 1)::before",`
 border-top-left-radius: var(--n-item-border-radius);
 border-bottom-left-radius: var(--n-item-border-radius);
 `),Be("&:nth-child(7n + 7)::before",`
 border-top-right-radius: var(--n-item-border-radius);
 border-bottom-right-radius: var(--n-item-border-radius);
 `)]),je("week-selected",`
 color: var(--n-item-text-color-active)
 `,[Be("&::before",`
 background-color: var(--n-item-color-active);
 `),Be("&:nth-child(7n + 1)::before",`
 border-top-left-radius: var(--n-item-border-radius);
 border-bottom-left-radius: var(--n-item-border-radius);
 `),Be("&:nth-child(7n + 7)::before",`
 border-top-right-radius: var(--n-item-border-radius);
 border-bottom-right-radius: var(--n-item-border-radius);
 `)])])]),ii("week",[Fe("date-panel-dates",[Fe("date-panel-date",[ii("disabled",[ii("selected",[Be("&:hover",`
 background-color: var(--n-item-color-hover);
 `)])])])])]),je("week",[Fe("date-panel-dates",[Fe("date-panel-date",[Be("&::before",`
 content: "";
 z-index: -2;
 position: absolute;
 left: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2);
 right: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2);
 top: 0;
 bottom: 0;
 transition: background-color .3s var(--n-bezier);
 `)])])]),Ge("vertical-divider",`
 grid-area: divider;
 height: 100%;
 width: 1px;
 background-color: var(--n-calendar-divider-color);
 `),Fe("date-panel-footer",`
 border-top: 1px solid var(--n-panel-action-divider-color);
 padding: var(--n-panel-extra-footer-padding);
 `),Fe("date-panel-actions",`
 flex: 1;
 padding: var(--n-panel-action-padding);
 display: flex;
 align-items: center;
 justify-content: space-between;
 border-top: 1px solid var(--n-panel-action-divider-color);
 `,[Ge("prefix, suffix",`
 display: flex;
 margin-bottom: -8px;
 `),Ge("suffix",`
 align-self: flex-end;
 `),Ge("prefix",`
 flex-wrap: wrap;
 `),Fe("button",`
 margin-bottom: 8px;
 `,[Be("&:not(:last-child)",`
 margin-right: 8px;
 `)])])]),Be("[data-n-date].transition-disabled",{transition:"none !important"},[Be("&::before, &::after",{transition:"none !important"})])]);function ev(e,t){const n=O(()=>{const{isTimeDisabled:f}=e,{value:u}=t;if(!(u===null||Array.isArray(u)))return f?.(u)}),r=O(()=>{var f;return(f=n.value)===null||f===void 0?void 0:f.isHourDisabled}),i=O(()=>{var f;return(f=n.value)===null||f===void 0?void 0:f.isMinuteDisabled}),o=O(()=>{var f;return(f=n.value)===null||f===void 0?void 0:f.isSecondDisabled}),l=O(()=>{const{type:f,isDateDisabled:u}=e,{value:d}=t;return d===null||Array.isArray(d)||!["date","datetime"].includes(f)||!u?!1:u(d,{type:"input"})}),a=O(()=>{const{type:f}=e,{value:u}=t;if(u===null||f==="datetime"||Array.isArray(u))return!1;const d=new Date(u),h=d.getHours(),p=d.getMinutes(),m=d.getMinutes();return(r.value?r.value(h):!1)||(i.value?i.value(p,h):!1)||(o.value?o.value(m,p,h):!1)}),s=O(()=>l.value||a.value);return{isValueInvalidRef:O(()=>{const{type:f}=e;return f==="date"?l.value:f==="datetime"?s.value:!1}),isDateInvalidRef:l,isTimeInvalidRef:a,isDateTimeInvalidRef:s,isHourDisabledRef:r,isMinuteDisabledRef:i,isSecondDisabledRef:o}}function tv(e,t){const n=O(()=>{const{isTimeDisabled:u}=e,{value:d}=t;return!Array.isArray(d)||!u?[void 0,void 0]:[u?.(d[0],"start",d),u?.(d[1],"end",d)]}),r={isStartHourDisabledRef:O(()=>{var u;return(u=n.value[0])===null||u===void 0?void 0:u.isHourDisabled}),isEndHourDisabledRef:O(()=>{var u;return(u=n.value[1])===null||u===void 0?void 0:u.isHourDisabled}),isStartMinuteDisabledRef:O(()=>{var u;return(u=n.value[0])===null||u===void 0?void 0:u.isMinuteDisabled}),isEndMinuteDisabledRef:O(()=>{var u;return(u=n.value[1])===null||u===void 0?void 0:u.isMinuteDisabled}),isStartSecondDisabledRef:O(()=>{var u;return(u=n.value[0])===null||u===void 0?void 0:u.isSecondDisabled}),isEndSecondDisabledRef:O(()=>{var u;return(u=n.value[1])===null||u===void 0?void 0:u.isSecondDisabled})},i=O(()=>{const{type:u,isDateDisabled:d}=e,{value:h}=t;return h===null||!Array.isArray(h)||!["daterange","datetimerange"].includes(u)||!d?!1:d(h[0],"start",h)}),o=O(()=>{const{type:u,isDateDisabled:d}=e,{value:h}=t;return h===null||!Array.isArray(h)||!["daterange","datetimerange"].includes(u)||!d?!1:d(h[1],"end",h)}),l=O(()=>{const{type:u}=e,{value:d}=t;if(d===null||!Array.isArray(d)||u!=="datetimerange")return!1;const h=Fr(d[0]),p=Al(d[0]),m=Tl(d[0]),{isStartHourDisabledRef:v,isStartMinuteDisabledRef:y,isStartSecondDisabledRef:g}=r;return(v.value?v.value(h):!1)||(y.value?y.value(p,h):!1)||(g.value?g.value(m,p,h):!1)}),a=O(()=>{const{type:u}=e,{value:d}=t;if(d===null||!Array.isArray(d)||u!=="datetimerange")return!1;const h=Fr(d[1]),p=Al(d[1]),m=Tl(d[1]),{isEndHourDisabledRef:v,isEndMinuteDisabledRef:y,isEndSecondDisabledRef:g}=r;return(v.value?v.value(h):!1)||(y.value?y.value(p,h):!1)||(g.value?g.value(m,p,h):!1)}),s=O(()=>i.value||l.value),c=O(()=>o.value||a.value),f=O(()=>s.value||c.value);return Object.assign(Object.assign({},r),{isStartDateInvalidRef:i,isEndDateInvalidRef:o,isStartTimeInvalidRef:l,isEndTimeInvalidRef:a,isStartValueInvalidRef:s,isEndValueInvalidRef:c,isRangeInvalidRef:f})}const ku=Se({name:"DatePicker",props:Q1,slots:Object,setup(e,{slots:t}){var n;const{localeRef:r,dateLocaleRef:i}=Hi("DatePicker"),o=xf(e),{mergedSizeRef:l,mergedDisabledRef:a,mergedStatusRef:s}=o,{mergedComponentPropsRef:c,mergedClsPrefixRef:f,mergedBorderedRef:u,namespaceRef:d,inlineThemeDisabled:h}=qr(e),p=G(null),m=G(null),v=G(null),y=G(!1),g=an(e,"show"),b=_l(g,y),k=O(()=>({locale:i.value.locale,useAdditionalWeekYearTokens:!0})),_=O(()=>{const{format:ee}=e;if(ee)return ee;switch(e.type){case"date":case"daterange":return r.value.dateFormat;case"datetime":case"datetimerange":return r.value.dateTimeFormat;case"year":case"yearrange":return r.value.yearTypeFormat;case"month":case"monthrange":return r.value.monthTypeFormat;case"quarter":case"quarterrange":return r.value.quarterFormat;case"week":return r.value.weekFormat}}),T=O(()=>{var ee;return(ee=e.valueFormat)!==null&&ee!==void 0?ee:_.value});function x(ee){if(ee===null)return null;const{value:xe}=T,{value:q}=k;return Array.isArray(ee)?[xn(ee[0],xe,new Date,q).getTime(),xn(ee[1],xe,new Date,q).getTime()]:xn(ee,xe,new Date,q).getTime()}const{defaultFormattedValue:S,defaultValue:R}=e,W=G((n=S!==void 0?x(S):R)!==null&&n!==void 0?n:null),w=O(()=>{const{formattedValue:ee}=e;return ee!==void 0?x(ee):e.value}),C=_l(w,W),A=G(null);Sf(()=>{A.value=C.value});const M=G(""),L=G(""),P=G(""),I=Yn("DatePicker","-date-picker",J1,Hm,e,f),N=O(()=>{var ee,xe;return((xe=(ee=c?.value)===null||ee===void 0?void 0:ee.DatePicker)===null||xe===void 0?void 0:xe.timePickerSize)||"small"}),V=O(()=>["daterange","datetimerange","monthrange","quarterrange","yearrange"].includes(e.type)),K=O(()=>{const{placeholder:ee}=e;if(ee===void 0){const{type:xe}=e;switch(xe){case"date":return r.value.datePlaceholder;case"datetime":return r.value.datetimePlaceholder;case"month":return r.value.monthPlaceholder;case"year":return r.value.yearPlaceholder;case"quarter":return r.value.quarterPlaceholder;case"week":return r.value.weekPlaceholder;default:return""}}else return ee}),$=O(()=>e.startPlaceholder===void 0?e.type==="daterange"?r.value.startDatePlaceholder:e.type==="datetimerange"?r.value.startDatetimePlaceholder:e.type==="monthrange"?r.value.startMonthPlaceholder:"":e.startPlaceholder),H=O(()=>e.endPlaceholder===void 0?e.type==="daterange"?r.value.endDatePlaceholder:e.type==="datetimerange"?r.value.endDatetimePlaceholder:e.type==="monthrange"?r.value.endMonthPlaceholder:"":e.endPlaceholder),re=O(()=>{const{actions:ee,type:xe,clearable:q}=e;if(ee===null)return[];if(ee!==void 0)return ee;const U=q?["clear"]:[];switch(xe){case"date":case"week":return U.push("now"),U;case"datetime":return U.push("now","confirm"),U;case"daterange":return U.push("confirm"),U;case"datetimerange":return U.push("confirm"),U;case"month":return U.push("now","confirm"),U;case"year":return U.push("now"),U;case"quarter":return U.push("now","confirm"),U;case"monthrange":case"yearrange":case"quarterrange":return U.push("confirm"),U;default:{jm("date-picker","The type is wrong, n-date-picker's type only supports `date`, `datetime`, `daterange` and `datetimerange`.");break}}});function Z(ee){if(ee===null)return null;if(Array.isArray(ee)){const{value:xe}=T,{value:q}=k;return[ut(ee[0],xe,q),ut(ee[1],xe,k.value)]}else return ut(ee,T.value,k.value)}function ne(ee){A.value=ee}function de(ee,xe){const{"onUpdate:formattedValue":q,onUpdateFormattedValue:U}=e;q&&xt(q,ee,xe),U&&xt(U,ee,xe)}function be(ee,xe){const{"onUpdate:value":q,onUpdateValue:U,onChange:ce}=e,{nTriggerFormChange:_e,nTriggerFormInput:B}=o,ae=Z(ee);xe.doConfirm&&pe(ee,ae),U&&xt(U,ee,ae),q&&xt(q,ee,ae),ce&&xt(ce,ee,ae),W.value=ee,de(ae,ee),_e(),B()}function Te(){const{onClear:ee}=e;ee?.()}function pe(ee,xe){const{onConfirm:q}=e;q&&q(ee,xe)}function ke(ee){const{onFocus:xe}=e,{nTriggerFormFocus:q}=o;xe&&xt(xe,ee),q()}function Me(ee){const{onBlur:xe}=e,{nTriggerFormBlur:q}=o;xe&&xt(xe,ee),q()}function et(ee){const{"onUpdate:show":xe,onUpdateShow:q}=e;xe&&xt(xe,ee),q&&xt(q,ee),y.value=ee}function Je(ee){ee.key==="Escape"&&b.value&&(xl(ee),Wt({returnFocus:!0}))}function bt(ee){ee.key==="Escape"&&b.value&&xl(ee)}function vt(){var ee;et(!1),(ee=v.value)===null||ee===void 0||ee.deactivate(),Te()}function lt(){var ee;(ee=v.value)===null||ee===void 0||ee.deactivate(),Te()}function nt(){Wt({returnFocus:!0})}function Pt(ee){var xe;b.value&&!(!((xe=m.value)===null||xe===void 0)&&xe.contains(rc(ee)))&&Wt({returnFocus:!1})}function We(ee){Wt({returnFocus:!0,disableUpdateOnClose:ee})}function Ve(ee,xe){xe?be(ee,{doConfirm:!1}):ne(ee)}function oe(){const ee=A.value;be(Array.isArray(ee)?[ee[0],ee[1]]:ee,{doConfirm:!0})}function X(){const{value:ee}=A;V.value?(Array.isArray(ee)||ee===null)&&ze(ee):Array.isArray(ee)||me(ee)}function me(ee){ee===null?M.value="":M.value=ut(ee,_.value,k.value)}function ze(ee){if(ee===null)L.value="",P.value="";else{const xe=k.value;L.value=ut(ee[0],_.value,xe),P.value=ut(ee[1],_.value,xe)}}function Ne(){b.value||ft()}function He(ee){var xe;!((xe=p.value)===null||xe===void 0)&&xe.$el.contains(ee.relatedTarget)||(Me(ee),X(),Wt({returnFocus:!1}))}function J(){a.value||(X(),Wt({returnFocus:!1}))}function Ee(ee){if(ee===""){be(null,{doConfirm:!1}),A.value=null,M.value="";return}const xe=xn(ee,_.value,new Date,k.value);qn(xe)?(be(ve(xe),{doConfirm:!1}),X()):M.value=ee}function Ke(ee,{source:xe}){if(ee[0]===""&&ee[1]===""){be(null,{doConfirm:!1}),A.value=null,L.value="",P.value="";return}const[q,U]=ee,ce=xn(q,_.value,new Date,k.value),_e=xn(U,_.value,new Date,k.value);if(qn(ce)&&qn(_e)){let B=ve(ce),ae=ve(_e);_e<ce&&(xe===0?ae=B:B=ae),be([B,ae],{doConfirm:!1}),X()}else[L.value,P.value]=ee}function nn(ee){a.value||wl(ee,"clear")||b.value||ft()}function Mn(ee){a.value||ke(ee)}function ft(){a.value||b.value||et(!0)}function Wt({returnFocus:ee,disableUpdateOnClose:xe}){var q;b.value&&(et(!1),e.type!=="date"&&e.updateValueOnClose&&!xe&&oe(),ee&&((q=v.value)===null||q===void 0||q.focus()))}Oe(A,()=>{X()}),X(),Oe(b,ee=>{ee||(A.value=C.value)});const Ht=ev(e,A),qt=tv(e,A);kr(ta,Object.assign(Object.assign(Object.assign({mergedClsPrefixRef:f,mergedThemeRef:I,timePickerSizeRef:N,localeRef:r,dateLocaleRef:i,firstDayOfWeekRef:an(e,"firstDayOfWeek"),isDateDisabledRef:an(e,"isDateDisabled"),rangesRef:an(e,"ranges"),timePickerPropsRef:an(e,"timePickerProps"),closeOnSelectRef:an(e,"closeOnSelect"),updateValueOnCloseRef:an(e,"updateValueOnClose"),monthFormatRef:an(e,"monthFormat"),yearFormatRef:an(e,"yearFormat"),quarterFormatRef:an(e,"quarterFormat"),yearRangeRef:an(e,"yearRange")},Ht),qt),{datePickerSlots:t}));const St={focus:()=>{var ee;(ee=v.value)===null||ee===void 0||ee.focus()},blur:()=>{var ee;(ee=v.value)===null||ee===void 0||ee.blur()}},Lt=O(()=>{const{common:{cubicBezierEaseInOut:ee},self:{iconColor:xe,iconColorDisabled:q}}=I.value;return{"--n-bezier":ee,"--n-icon-color-override":xe,"--n-icon-color-disabled-override":q}}),_t=h?Hr("date-picker-trigger",void 0,Lt,e):void 0,rn=O(()=>{const{type:ee}=e,{common:{cubicBezierEaseInOut:xe},self:{calendarTitleFontSize:q,calendarDaysFontSize:U,itemFontSize:ce,itemTextColor:_e,itemColorDisabled:B,itemColorIncluded:ae,itemColorHover:ye,itemColorActive:Ze,itemBorderRadius:ht,itemTextColorDisabled:pt,itemTextColorActive:At,panelColor:jn,panelTextColor:cr,arrowColor:ur,calendarTitleTextColor:tr,panelActionDividerColor:dr,panelHeaderDividerColor:xr,calendarDaysDividerColor:fr,panelBoxShadow:yn,panelBorderRadius:kn,calendarTitleFontWeight:un,panelExtraFooterPadding:Ut,panelActionPadding:dn,itemSize:Yr,itemCellWidth:hr,itemCellHeight:Cr,scrollItemWidth:Y,scrollItemHeight:he,calendarTitlePadding:De,calendarTitleHeight:Et,calendarDaysHeight:bn,calendarDaysTextColor:at,arrowSize:Kn,panelHeaderPadding:Sr,calendarDividerColor:pr,calendarTitleGridTempateColumns:Fo,iconColor:ka,iconColorDisabled:mr,scrollItemBorderRadius:Kr,calendarTitleColorHover:Oo,[Cl("calendarLeftPadding",ee)]:No,[Cl("calendarRightPadding",ee)]:Po}}=I.value;return{"--n-bezier":xe,"--n-panel-border-radius":kn,"--n-panel-color":jn,"--n-panel-box-shadow":yn,"--n-panel-text-color":cr,"--n-panel-header-padding":Sr,"--n-panel-header-divider-color":xr,"--n-calendar-left-padding":No,"--n-calendar-right-padding":Po,"--n-calendar-title-color-hover":Oo,"--n-calendar-title-height":Et,"--n-calendar-title-padding":De,"--n-calendar-title-font-size":q,"--n-calendar-title-font-weight":un,"--n-calendar-title-text-color":tr,"--n-calendar-title-grid-template-columns":Fo,"--n-calendar-days-height":bn,"--n-calendar-days-divider-color":fr,"--n-calendar-days-font-size":U,"--n-calendar-days-text-color":at,"--n-calendar-divider-color":pr,"--n-panel-action-padding":dn,"--n-panel-extra-footer-padding":Ut,"--n-panel-action-divider-color":dr,"--n-item-font-size":ce,"--n-item-border-radius":ht,"--n-item-size":Yr,"--n-item-cell-width":hr,"--n-item-cell-height":Cr,"--n-item-text-color":_e,"--n-item-color-included":ae,"--n-item-color-disabled":B,"--n-item-color-hover":ye,"--n-item-color-active":Ze,"--n-item-text-color-disabled":pt,"--n-item-text-color-active":At,"--n-scroll-item-width":Y,"--n-scroll-item-height":he,"--n-scroll-item-border-radius":Kr,"--n-arrow-size":Kn,"--n-arrow-color":ur,"--n-icon-color":ka,"--n-icon-color-disabled":mr}}),Gt=h?Hr("date-picker",O(()=>e.type),rn,e):void 0;return Object.assign(Object.assign({},St),{mergedStatus:s,mergedClsPrefix:f,mergedBordered:u,namespace:d,uncontrolledValue:W,pendingValue:A,panelInstRef:p,triggerElRef:m,inputInstRef:v,isMounted:Cf(),displayTime:M,displayStartTime:L,displayEndTime:P,mergedShow:b,adjustedTo:ji(e),isRange:V,localizedStartPlaceholder:$,localizedEndPlaceholder:H,mergedSize:l,mergedDisabled:a,localizedPlacehoder:K,isValueInvalid:Ht.isValueInvalidRef,isStartValueInvalid:qt.isStartValueInvalidRef,isEndValueInvalid:qt.isEndValueInvalidRef,handleInputKeydown:bt,handleClickOutside:Pt,handleKeydown:Je,handleClear:vt,handlePanelClear:lt,handleTriggerClick:nn,handleInputActivate:Ne,handleInputDeactivate:J,handleInputFocus:Mn,handleInputBlur:He,handlePanelTabOut:nt,handlePanelClose:We,handleRangeUpdateValue:Ke,handleSingleUpdateValue:Ee,handlePanelUpdateValue:Ve,handlePanelConfirm:oe,mergedTheme:I,actions:re,triggerCssVars:h?void 0:Lt,triggerThemeClass:_t?.themeClass,triggerOnRender:_t?.onRender,cssVars:h?void 0:rn,themeClass:Gt?.themeClass,onRender:Gt?.onRender,onNextMonth:e.onNextMonth,onPrevMonth:e.onPrevMonth,onNextYear:e.onNextYear,onPrevYear:e.onPrevYear})},render(){const{clearable:e,triggerOnRender:t,mergedClsPrefix:n,$slots:r}=this,i={onUpdateValue:this.handlePanelUpdateValue,onTabOut:this.handlePanelTabOut,onClose:this.handlePanelClose,onClear:this.handlePanelClear,onKeydown:this.handleKeydown,onConfirm:this.handlePanelConfirm,ref:"panelInstRef",value:this.pendingValue,active:this.mergedShow,actions:this.actions,shortcuts:this.shortcuts,style:this.cssVars,defaultTime:this.defaultTime,themeClass:this.themeClass,panel:this.panel,inputReadonly:this.inputReadonly||this.mergedDisabled,onRender:this.onRender,onNextMonth:this.onNextMonth,onPrevMonth:this.onPrevMonth,onNextYear:this.onNextYear,onPrevYear:this.onPrevYear,timePickerFormat:this.timePickerFormat,dateFormat:this.dateFormat,calendarDayFormat:this.calendarDayFormat,calendarHeaderYearFormat:this.calendarHeaderYearFormat,calendarHeaderMonthFormat:this.calendarHeaderMonthFormat,calendarHeaderMonthYearSeparator:this.calendarHeaderMonthYearSeparator,calendarHeaderMonthBeforeYear:this.calendarHeaderMonthBeforeYear},o=()=>{const{type:a}=this;return a==="datetime"?E(Z1,Object.assign({},i,{defaultCalendarStartTime:this.defaultCalendarStartTime}),r):a==="daterange"?E(h1,Object.assign({},i,{defaultCalendarStartTime:this.defaultCalendarStartTime,defaultCalendarEndTime:this.defaultCalendarEndTime,bindCalendarMonths:this.bindCalendarMonths}),r):a==="datetimerange"?E(G1,Object.assign({},i,{defaultCalendarStartTime:this.defaultCalendarStartTime,defaultCalendarEndTime:this.defaultCalendarEndTime,bindCalendarMonths:this.bindCalendarMonths}),r):a==="month"||a==="year"||a==="quarter"?E(Xf,Object.assign({},i,{type:a,key:a})):a==="monthrange"||a==="yearrange"||a==="quarterrange"?E(X1,Object.assign({},i,{type:a})):E(f1,Object.assign({},i,{type:a,defaultCalendarStartTime:this.defaultCalendarStartTime}),r)};if(this.panel)return o();t?.();const l={bordered:this.mergedBordered,size:this.mergedSize,passivelyActivated:!0,disabled:this.mergedDisabled,readonly:this.inputReadonly||this.mergedDisabled,clearable:e,onClear:this.handleClear,onClick:this.handleTriggerClick,onKeydown:this.handleInputKeydown,onActivate:this.handleInputActivate,onDeactivate:this.handleInputDeactivate,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur};return E("div",{ref:"triggerElRef",class:[`${n}-date-picker`,this.mergedDisabled&&`${n}-date-picker--disabled`,this.isRange&&`${n}-date-picker--range`,this.triggerThemeClass],style:this.triggerCssVars,onKeydown:this.handleKeydown},E(Js,null,{default:()=>[E(ec,null,{default:()=>this.isRange?E(ar,Object.assign({ref:"inputInstRef",status:this.mergedStatus,value:[this.displayStartTime,this.displayEndTime],placeholder:[this.localizedStartPlaceholder,this.localizedEndPlaceholder],textDecoration:[this.isStartValueInvalid?"line-through":"",this.isEndValueInvalid?"line-through":""],pair:!0,onUpdateValue:this.handleRangeUpdateValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,internalForceFocus:this.mergedShow,internalDeactivateOnEnter:!0},l),{separator:()=>this.separator===void 0?dt(r.separator,()=>[E(Ri,{clsPrefix:n,class:`${n}-date-picker-icon`},{default:()=>E(Eg,null)})]):this.separator,[e?"clear-icon-placeholder":"suffix"]:()=>dt(r["date-icon"],()=>[E(Ri,{clsPrefix:n,class:`${n}-date-picker-icon`},{default:()=>E(nu,null)})])}):E(ar,Object.assign({ref:"inputInstRef",status:this.mergedStatus,value:this.displayTime,placeholder:this.localizedPlacehoder,textDecoration:this.isValueInvalid&&!this.isRange?"line-through":"",onUpdateValue:this.handleSingleUpdateValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,internalForceFocus:this.mergedShow,internalDeactivateOnEnter:!0},l),{[e?"clear-icon-placeholder":"suffix"]:()=>E(Ri,{clsPrefix:n,class:`${n}-date-picker-icon`},{default:()=>dt(r["date-icon"],()=>[E(nu,null)])})})}),E(tc,{show:this.mergedShow,containerClass:this.namespace,to:this.adjustedTo,teleportDisabled:this.adjustedTo===ji.tdkey,placement:this.placement},{default:()=>E(Ur,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>this.mergedShow?jr(o(),[[nc,this.handleClickOutside,void 0,{capture:!0}]]):null})})]}))}}),nh=Zl("n-popconfirm"),rh={positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},onPositiveClick:{type:Function,required:!0},onNegativeClick:{type:Function,required:!0}},bu=Vm(rh),nv=Se({name:"NPopconfirmPanel",props:rh,setup(e){const{localeRef:t}=Hi("Popconfirm"),{inlineThemeDisabled:n}=qr(),{mergedClsPrefixRef:r,mergedThemeRef:i,props:o}=$n(nh),l=O(()=>{const{common:{cubicBezierEaseInOut:s},self:{fontSize:c,iconSize:f,iconColor:u}}=i.value;return{"--n-bezier":s,"--n-font-size":c,"--n-icon-size":f,"--n-icon-color":u}}),a=n?Hr("popconfirm-panel",void 0,l,o):void 0;return Object.assign(Object.assign({},Hi("Popconfirm")),{mergedClsPrefix:r,cssVars:n?void 0:l,localizedPositiveText:O(()=>e.positiveText||t.value.positiveText),localizedNegativeText:O(()=>e.negativeText||t.value.negativeText),positiveButtonProps:an(o,"positiveButtonProps"),negativeButtonProps:an(o,"negativeButtonProps"),handlePositiveClick(s){e.onPositiveClick(s)},handleNegativeClick(s){e.onNegativeClick(s)},themeClass:a?.themeClass,onRender:a?.onRender})},render(){var e;const{mergedClsPrefix:t,showIcon:n,$slots:r}=this,i=dt(r.action,()=>this.negativeText===null&&this.positiveText===null?[]:[this.negativeText!==null&&E(Xe,Object.assign({size:"small",onClick:this.handleNegativeClick},this.negativeButtonProps),{default:()=>this.localizedNegativeText}),this.positiveText!==null&&E(Xe,Object.assign({size:"small",type:"primary",onClick:this.handlePositiveClick},this.positiveButtonProps),{default:()=>this.localizedPositiveText})]);return(e=this.onRender)===null||e===void 0||e.call(this),E("div",{class:[`${t}-popconfirm__panel`,this.themeClass],style:this.cssVars},Qs(r.default,o=>n||o?E("div",{class:`${t}-popconfirm__body`},n?E("div",{class:`${t}-popconfirm__icon`},dt(r.icon,()=>[E(Ri,{clsPrefix:t},{default:()=>E(Wm,null)})])):null,o):null),i?E("div",{class:[`${t}-popconfirm__action`]},i):null)}}),rv=Fe("popconfirm",[Ge("body",`
 font-size: var(--n-font-size);
 display: flex;
 align-items: center;
 flex-wrap: nowrap;
 position: relative;
 `,[Ge("icon",`
 display: flex;
 font-size: var(--n-icon-size);
 color: var(--n-icon-color);
 transition: color .3s var(--n-bezier);
 margin: 0 8px 0 0;
 `)]),Ge("action",`
 display: flex;
 justify-content: flex-end;
 `,[Be("&:not(:first-child)","margin-top: 8px"),Fe("button",[Be("&:not(:last-child)","margin-right: 8px;")])])]),iv=Object.assign(Object.assign(Object.assign({},Yn.props),Zm),{positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},trigger:{type:String,default:"click"},positiveButtonProps:Object,negativeButtonProps:Object,onPositiveClick:Function,onNegativeClick:Function}),ov=Se({name:"Popconfirm",props:iv,slots:Object,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=qr(),n=Yn("Popconfirm","-popconfirm",rv,Km,e,t),r=G(null);function i(a){var s;if(!(!((s=r.value)===null||s===void 0)&&s.getMergedShow()))return;const{onPositiveClick:c,"onUpdate:show":f}=e;Promise.resolve(c?c(a):!0).then(u=>{var d;u!==!1&&((d=r.value)===null||d===void 0||d.setShow(!1),f&&xt(f,!1))})}function o(a){var s;if(!(!((s=r.value)===null||s===void 0)&&s.getMergedShow()))return;const{onNegativeClick:c,"onUpdate:show":f}=e;Promise.resolve(c?c(a):!0).then(u=>{var d;u!==!1&&((d=r.value)===null||d===void 0||d.setShow(!1),f&&xt(f,!1))})}return kr(nh,{mergedThemeRef:n,mergedClsPrefixRef:t,props:e}),{setShow(a){var s;(s=r.value)===null||s===void 0||s.setShow(a)},syncPosition(){var a;(a=r.value)===null||a===void 0||a.syncPosition()},mergedTheme:n,popoverInstRef:r,handlePositiveClick:i,handleNegativeClick:o}},render(){const{$slots:e,$props:t,mergedTheme:n}=this;return E(Ym,Object.assign({},Um(t,bu),{theme:n.peers.Popover,themeOverrides:n.peerOverrides.Popover,internalExtraClass:["popconfirm"],ref:"popoverInstRef"}),{trigger:e.trigger,default:()=>{const r=qm(t,bu);return E(nv,Object.assign({},r,{onPositiveClick:this.handlePositiveClick,onNegativeClick:this.handleNegativeClick}),e)}})}}),lv=Be([Be("@keyframes spin-rotate",`
 from {
 transform: rotate(0);
 }
 to {
 transform: rotate(360deg);
 }
 `),Fe("spin-container",`
 position: relative;
 `,[Fe("spin-body",`
 position: absolute;
 top: 50%;
 left: 50%;
 transform: translateX(-50%) translateY(-50%);
 `,[Gm()])]),Fe("spin-body",`
 display: inline-flex;
 align-items: center;
 justify-content: center;
 flex-direction: column;
 `),Fe("spin",`
 display: inline-flex;
 height: var(--n-size);
 width: var(--n-size);
 font-size: var(--n-size);
 color: var(--n-color);
 `,[je("rotate",`
 animation: spin-rotate 2s linear infinite;
 `)]),Fe("spin-description",`
 display: inline-block;
 font-size: var(--n-font-size);
 color: var(--n-text-color);
 transition: color .3s var(--n-bezier);
 margin-top: 8px;
 `),Fe("spin-content",`
 opacity: 1;
 transition: opacity .3s var(--n-bezier);
 pointer-events: all;
 `,[je("spinning",`
 user-select: none;
 -webkit-user-select: none;
 pointer-events: none;
 opacity: var(--n-opacity-spinning);
 `)])]),av={small:20,medium:18,large:16},sv=Object.assign(Object.assign({},Yn.props),{contentClass:String,contentStyle:[Object,String],description:String,stroke:String,size:{type:[String,Number],default:"medium"},show:{type:Boolean,default:!0},strokeWidth:Number,rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0},delay:Number}),vc=Se({name:"Spin",props:sv,slots:Object,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n}=qr(e),r=Yn("Spin","-spin",lv,Qm,e,t),i=O(()=>{const{size:s}=e,{common:{cubicBezierEaseInOut:c},self:f}=r.value,{opacitySpinning:u,color:d,textColor:h}=f,p=typeof s=="number"?Jm(s):f[Cl("size",s)];return{"--n-bezier":c,"--n-opacity-spinning":u,"--n-size":p,"--n-color":d,"--n-text-color":h}}),o=n?Hr("spin",O(()=>{const{size:s}=e;return typeof s=="number"?String(s):s[0]}),i,e):void 0,l=Af(e,["spinning","show"]),a=G(!1);return Sf(s=>{let c;if(l.value){const{delay:f}=e;if(f){c=window.setTimeout(()=>{a.value=!0},f),s(()=>{clearTimeout(c)});return}}a.value=l.value}),{mergedClsPrefix:t,active:a,mergedStrokeWidth:O(()=>{const{strokeWidth:s}=e;if(s!==void 0)return s;const{size:c}=e;return av[typeof c=="number"?"medium":c]}),cssVars:n?void 0:i,themeClass:o?.themeClass,onRender:o?.onRender}},render(){var e,t;const{$slots:n,mergedClsPrefix:r,description:i}=this,o=n.icon&&this.rotate,l=(i||n.description)&&E("div",{class:`${r}-spin-description`},i||((e=n.description)===null||e===void 0?void 0:e.call(n))),a=n.icon?E("div",{class:[`${r}-spin-body`,this.themeClass]},E("div",{class:[`${r}-spin`,o&&`${r}-spin--rotate`],style:n.default?"":this.cssVars},n.icon()),l):E("div",{class:[`${r}-spin-body`,this.themeClass]},E(Xm,{clsPrefix:r,style:n.default?"":this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,class:`${r}-spin`}),l);return(t=this.onRender)===null||t===void 0||t.call(this),n.default?E("div",{class:[`${r}-spin-container`,this.themeClass],style:this.cssVars},E("div",{class:[`${r}-spin-content`,this.active&&`${r}-spin-content--spinning`,this.contentClass],style:this.contentStyle},n),E(Ur,{name:"fade-in-transition"},{default:()=>this.active?a:null})):a}}),cv=Fe("text",`
 transition: color .3s var(--n-bezier);
 color: var(--n-text-color);
`,[je("strong",`
 font-weight: var(--n-font-weight-strong);
 `),je("italic",{fontStyle:"italic"}),je("underline",{textDecoration:"underline"}),je("code",`
 line-height: 1.4;
 display: inline-block;
 font-family: var(--n-font-famliy-mono);
 transition: 
 color .3s var(--n-bezier),
 border-color .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
 box-sizing: border-box;
 padding: .05em .35em 0 .35em;
 border-radius: var(--n-code-border-radius);
 font-size: .9em;
 color: var(--n-code-text-color);
 background-color: var(--n-code-color);
 border: var(--n-code-border);
 `)]),uv=Object.assign(Object.assign({},Yn.props),{code:Boolean,type:{type:String,default:"default"},delete:Boolean,strong:Boolean,italic:Boolean,underline:Boolean,depth:[String,Number],tag:String,as:{type:String,validator:()=>!0,default:void 0}}),dv=Se({name:"Text",props:uv,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n}=qr(e),r=Yn("Typography","-text",cv,eg,e,t),i=O(()=>{const{depth:l,type:a}=e,s=a==="default"?l===void 0?"textColor":`textColor${l}Depth`:Cl("textColor",a),{common:{fontWeightStrong:c,fontFamilyMono:f,cubicBezierEaseInOut:u},self:{codeTextColor:d,codeBorderRadius:h,codeColor:p,codeBorder:m,[s]:v}}=r.value;return{"--n-bezier":u,"--n-text-color":v,"--n-font-weight-strong":c,"--n-font-famliy-mono":f,"--n-code-border-radius":h,"--n-code-text-color":d,"--n-code-color":p,"--n-code-border":m}}),o=n?Hr("text",O(()=>`${e.type[0]}${e.depth||""}`),i,e):void 0;return{mergedClsPrefix:t,compitableTag:Af(e,["as","tag"]),cssVars:n?void 0:i,themeClass:o?.themeClass,onRender:o?.onRender}},render(){var e,t,n;const{mergedClsPrefix:r}=this;(e=this.onRender)===null||e===void 0||e.call(this);const i=[`${r}-text`,this.themeClass,{[`${r}-text--code`]:this.code,[`${r}-text--delete`]:this.delete,[`${r}-text--strong`]:this.strong,[`${r}-text--italic`]:this.italic,[`${r}-text--underline`]:this.underline}],o=(n=(t=this.$slots).default)===null||n===void 0?void 0:n.call(t);return this.code?E("code",{class:i,style:this.cssVars},this.delete?E("del",null,o):o):this.delete?E("del",{class:i,style:this.cssVars},o):E(this.compitableTag||"span",{class:i,style:this.cssVars},o)}}),fv={class:"inline-block",viewBox:"0 0 24 24",width:"1em",height:"1em"};function hv(e,t){return z(),Q("svg",fv,[...t[0]||(t[0]=[te("path",{fill:"currentColor",d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2zM18 4h-2.5l-.71-.71c-.18-.18-.44-.29-.7-.29H9.91c-.26 0-.52.11-.7.29L8.5 4H6c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1"},null,-1)])])}const pv=wn({name:"ic-round-delete",render:hv}),mv={class:"control-card__content"},gv={class:"session-list-header"},vv={class:"session-list-container"},yv={class:"session-list"},kv=["onClick"],bv={class:"session-item-main"},_v={class:"session-item-title"},wv={class:"session-item-time"},xv={class:"session-item-side"},Cv=Se({__name:"chat-control-panel",props:{userId:{},selectedChatbotId:{},chatbotOptions:{},chatbotsLoading:{type:Boolean},currentSessionId:{},creatingSession:{type:Boolean},deletingSessionId:{},sessions:{},sessionsLoading:{type:Boolean},sessionBusy:{type:Boolean}},emits:["update:userId","update:selectedChatbotId","createSession","prepareNewSession","selectSession","deleteSession","refreshSessions"],setup(e,{emit:t}){const n=e,r=t;function i(l){return l?Ql(l).format("YYYY-MM-DD HH:mm:ss"):"-"}function o(l){switch(l){case"active":return"success";case"completed":return"info";case"abandoned":return"warning";default:return"default"}}return(l,a)=>{const s=pv;return z(),Ie(se(ic),{title:"会话控制",bordered:!1,size:"small",class:"panel-card control-card"},{default:Ae(()=>[te("div",mv,[ge(se(Cg),{"label-placement":"top"},{default:Ae(()=>[ge(se(ps),{label:"用户 ID"},{default:Ae(()=>[ge(se(ar),{value:n.userId,placeholder:"请输入 userId",clearable:"","onUpdate:value":a[0]||(a[0]=c=>r("update:userId",c))},null,8,["value"])]),_:1}),ge(se(ps),{label:"Chatbot"},{default:Ae(()=>[ge(se(Tf),{value:n.selectedChatbotId,options:n.chatbotOptions,placeholder:"请选择 chatbot",clearable:"",filterable:"",loading:n.chatbotsLoading,disabled:!!n.currentSessionId,"onUpdate:value":a[1]||(a[1]=c=>r("update:selectedChatbotId",c))},null,8,["value","options","loading","disabled"])]),_:1})]),_:1}),ge(se(Xe),{type:"primary",block:"",loading:n.creatingSession,onClick:a[2]||(a[2]=c=>r("createSession"))},{default:Ae(()=>[...a[6]||(a[6]=[ot("创建会话",-1)])]),_:1},8,["loading"]),n.currentSessionId?(z(),Ie(se(Xe),{key:0,block:"",secondary:"",onClick:a[3]||(a[3]=c=>r("prepareNewSession"))},{default:Ae(()=>[...a[7]||(a[7]=[ot("准备新会话",-1)])]),_:1})):Ue("",!0),ge(se(tg),{class:"!my-0"}),te("div",gv,[a[9]||(a[9]=te("div",{class:"session-list-title"},"历史会话",-1)),ge(se(Xe),{size:"tiny",tertiary:"",onClick:a[4]||(a[4]=c=>r("refreshSessions"))},{default:Ae(()=>[...a[8]||(a[8]=[ot("刷新",-1)])]),_:1})]),ge(se(vc),{show:n.sessionsLoading,class:"session-list-spin"},{default:Ae(()=>[te("div",vv,[ge(se(Df),{class:"session-list-scroll"},{default:Ae(()=>[n.sessions.length?Ue("",!0):(z(),Ie(se(Xl),{key:0,description:"暂无历史会话",size:"small",class:"session-list-empty"})),te("div",yv,[(z(!0),Q(Qe,null,gt(n.sessions,c=>(z(),Q("div",{key:c.sessionId,class:Ft(["session-item",{"session-item--active":c.sessionId===n.currentSessionId}]),onClick:f=>r("selectSession",c)},[te("div",bv,[te("div",_v,$e(c.title||"新会话"),1),te("div",wv,$e(i(c.createdAt)),1)]),te("div",xv,[ge(se(hi),{size:"small",type:o(c.status),class:"session-item-status"},{default:Ae(()=>[ot($e(c.status),1)]),_:2},1032,["type"]),ge(se(ov),{"positive-text":"删除","negative-text":"取消",onPositiveClick:f=>r("deleteSession",c)},{trigger:Ae(()=>[ge(se(Xe),{type:"error",quaternary:"",class:"session-item-delete",title:"删除会话",loading:n.deletingSessionId===c.sessionId,disabled:!!n.deletingSessionId||n.sessionBusy&&c.sessionId===n.currentSessionId,onClick:a[5]||(a[5]=Ef(()=>{},["stop"]))},{icon:Ae(()=>[ge(s,{class:"text-icon"})]),_:1},8,["loading","disabled"])]),default:Ae(()=>[a[10]||(a[10]=ot(" 确认删除该历史会话吗？ ",-1))]),_:2},1032,["onPositiveClick"])])],10,kv))),128))])]),_:1})])]),_:1},8,["show"])])]),_:1})}}}),Sv=gn(Cv,[["__scopeId","data-v-a226d1e6"]]),Av={class:"context-reset-banner__body"},Tv=Se({__name:"chat-context-reset-banner",props:{loading:{type:Boolean}},emits:["undo"],setup(e,{emit:t}){const n=e,r=t;return(i,o)=>(z(),Ie(se(Sg),{type:"warning",class:"context-reset-banner","show-icon":!1},{header:Ae(()=>[...o[1]||(o[1]=[ot("下一次发送将从新的上下文开始",-1)])]),default:Ae(()=>[te("div",Av,[o[3]||(o[3]=te("span",null,"这次操作不会删除历史消息，但下一条消息不会携带之前的上下文。",-1)),ge(se(Xe),{text:"",type:"warning",disabled:n.loading,onClick:o[0]||(o[0]=l=>r("undo"))},{default:Ae(()=>[...o[2]||(o[2]=[ot("恢复上下文",-1)])]),_:1},8,["disabled"])])]),_:1}))}}),Dv=gn(Tv,[["__scopeId","data-v-755984ec"]]),Ev={class:"inline-block",viewBox:"0 0 24 24",width:"1em",height:"1em"};function Mv(e,t){return z(),Q("svg",Ev,[...t[0]||(t[0]=[te("path",{fill:"currentColor",d:"M12 15c.81 0 1.5-.3 2.11-.89c.59-.61.89-1.3.89-2.11s-.3-1.5-.89-2.11C13.5 9.3 12.81 9 12 9s-1.5.3-2.11.89C9.3 10.5 9 11.19 9 12s.3 1.5.89 2.11c.61.59 1.3.89 2.11.89m0-13c2.75 0 5.1 1 7.05 2.95S22 9.25 22 12v1.45c0 1-.35 1.85-1 2.55c-.7.67-1.5 1-2.5 1c-1.2 0-2.19-.5-2.94-1.5c-1 1-2.18 1.5-3.56 1.5c-1.37 0-2.55-.5-3.54-1.46C7.5 14.55 7 13.38 7 12c0-1.37.5-2.55 1.46-3.54C9.45 7.5 10.63 7 12 7c1.38 0 2.55.5 3.54 1.46C16.5 9.45 17 10.63 17 12v1.45c0 .41.16.77.46 1.08s.65.47 1.04.47c.42 0 .77-.16 1.07-.47s.43-.67.43-1.08V12c0-2.19-.77-4.07-2.35-5.65S14.19 4 12 4s-4.07.77-5.65 2.35S4 9.81 4 12s.77 4.07 2.35 5.65S9.81 20 12 20h5v2h-5c-2.75 0-5.1-1-7.05-2.95S2 14.75 2 12s1-5.1 2.95-7.05S9.25 2 12 2"},null,-1)])])}const Lv=wn({name:"mdi-at",render:Mv}),Rv={class:"inline-block",viewBox:"0 0 24 24",width:"1em",height:"1em"};function $v(e,t){return z(),Q("svg",Rv,[...t[0]||(t[0]=[te("path",{fill:"currentColor",d:"M13 20h-2V8l-5.5 5.5l-1.42-1.42L12 4.16l7.92 7.92l-1.42 1.42L13 8z"},null,-1)])])}const Iv=wn({name:"mdi-arrow-up",render:$v}),Fv={class:"inline-block",viewBox:"0 0 24 24",width:"1em",height:"1em"};function Ov(e,t){return z(),Q("svg",Fv,[...t[0]||(t[0]=[te("path",{fill:"currentColor",d:"m19.36 2.72l1.42 1.42l-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32zM5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09l7.44 7.44l-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58"},null,-1)])])}const Nv=wn({name:"mdi-broom",render:Ov}),Pv={class:"inline-block",viewBox:"0 0 24 24",width:"1em",height:"1em"};function Bv(e,t){return z(),Q("svg",Pv,[...t[0]||(t[0]=[te("path",{fill:"currentColor",d:"M16 12a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2"},null,-1)])])}const zv=wn({name:"mdi-dots-horizontal",render:Bv}),Hv={class:"inline-block",viewBox:"0 0 24 24",width:"1em",height:"1em"};function jv(e,t){return z(),Q("svg",Hv,[...t[0]||(t[0]=[te("path",{fill:"currentColor",d:"M17.9 17.39c-.26-.8-1.01-1.39-1.9-1.39h-1v-3a1 1 0 0 0-1-1H8v-2h2a1 1 0 0 0 1-1V7h2a2 2 0 0 0 2-2v-.41a7.984 7.984 0 0 1 2.9 12.8M11 19.93c-3.95-.49-7-3.85-7-7.93c0-.62.08-1.22.21-1.79L9 15v1a2 2 0 0 0 2 2m1-16A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2"},null,-1)])])}const Vv=wn({name:"mdi-earth",render:jv}),Wv={class:"inline-block",viewBox:"0 0 24 24",width:"1em",height:"1em"};function qv(e,t){return z(),Q("svg",Wv,[...t[0]||(t[0]=[te("path",{fill:"currentColor",d:"M12 2a7 7 0 0 1 7 7c0 2.38-1.19 4.47-3 5.74V17a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1v-2.26C6.19 13.47 5 11.38 5 9a7 7 0 0 1 7-7M9 21v-1h6v1a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1m3-17a5 5 0 0 0-5 5c0 2.05 1.23 3.81 3 4.58V16h4v-2.42c1.77-.77 3-2.53 3-4.58a5 5 0 0 0-5-5"},null,-1)])])}const Uv=wn({name:"mdi-lightbulb-outline",render:qv}),Yv={class:"inline-block",viewBox:"0 0 24 24",width:"1em",height:"1em"};function Kv(e,t){return z(),Q("svg",Yv,[...t[0]||(t[0]=[te("path",{fill:"currentColor",d:"M11 9.47V11h3.76L13 14.53V13H9.24zM13 1L6 15h5v8l7-14h-5z"},null,-1)])])}const Zv=wn({name:"mdi-lightning-bolt-outline",render:Kv}),Gv={class:"chat-input-shell__footer"},Xv={class:"chat-input-shell__toolbar"},Qv={class:"chat-input-shell__context-trigger"},Jv={class:"chat-input-shell__actions"},ey=Se({__name:"chat-input-panel",props:{modelValue:{},currentSessionId:{},canSend:{type:Boolean},sending:{type:Boolean},contextResetPending:{type:Boolean},canToggleContextReset:{type:Boolean},contextResetLoading:{type:Boolean}},emits:["update:modelValue","send","markContextReset","clearContextReset"],setup(e,{emit:t}){const n=e,r=t,i=[{key:"idea",icon:Uv,title:"提示（占位）"},{key:"web",icon:Vv,title:"联网（占位）"},{key:"mention",icon:Lv,title:"@（占位）"},{key:"quick",icon:Zv,title:"快捷动作（占位）"},{key:"more",icon:zv,title:"更多（占位）"}],o=O(()=>!n.currentSessionId),l=O(()=>n.contextResetPending?"再次点击恢复上下文":"清除上下文");function a(){if(n.contextResetPending){r("clearContextReset");return}r("markContextReset")}return(s,c)=>(z(),Q("div",{class:Ft(["chat-input-shell",{"chat-input-shell--disabled":o.value}])},[ge(se(ar),{value:n.modelValue,type:"textarea",rows:5,autosize:{minRows:4,maxRows:12},"show-count":"",class:"chat-input-shell__textarea",placeholder:"在这里输入消息，按 Enter 发送",disabled:o.value,"onUpdate:value":c[0]||(c[0]=f=>r("update:modelValue",f)),onKeydown:c[1]||(c[1]=ng(Ef(f=>r("send"),["exact","prevent"]),["enter"]))},null,8,["value","disabled"]),te("div",Gv,[te("div",Xv,[ge(se(rg),{placement:"top"},{trigger:Ae(()=>[te("span",Qv,[ge(se(Xe),{circle:"",quaternary:"",size:"small",type:n.contextResetPending?"primary":"default",disabled:!n.canToggleContextReset,loading:n.contextResetLoading,"aria-label":l.value,"aria-pressed":n.contextResetPending,onClick:a},{icon:Ae(()=>[ge(se(Nv),{class:"chat-input-shell__tool-icon"})]),_:1},8,["type","disabled","loading","aria-label","aria-pressed"])])]),default:Ae(()=>[ot(" "+$e(l.value),1)]),_:1}),(z(),Q(Qe,null,gt(i,f=>ge(se(Xe),{key:f.key,circle:"",quaternary:"",size:"small",class:"chat-input-shell__tool",disabled:o.value,title:f.title,"aria-label":f.title},{icon:Ae(()=>[(z(),Ie(tn(f.icon),{class:"chat-input-shell__tool-icon"}))]),_:2},1032,["disabled","title","aria-label"])),64))]),te("div",Jv,[ge(se(Xe),{quaternary:"",size:"small",class:"chat-input-shell__aux",disabled:o.value,title:"输入设置（占位）","aria-label":"输入设置（占位）"},{default:Ae(()=>[...c[3]||(c[3]=[ot(" 更多 ",-1)])]),_:1},8,["disabled"]),ge(se(Xe),{circle:"",type:"primary",class:"chat-input-shell__send",disabled:!n.canSend,loading:n.sending,"aria-label":"发送消息",title:"发送消息",onClick:c[2]||(c[2]=f=>r("send"))},{icon:Ae(()=>[ge(se(Iv),{class:"chat-input-shell__send-icon"})]),_:1},8,["disabled","loading"])])])],2))}}),ty=gn(ey,[["__scopeId","data-v-7ddeeb7c"]]),ny={class:"user-message"},ry={class:"user-message__meta"},iy={class:"user-message__content"},oy=Se({__name:"chat-user-message",props:{message:{}},setup(e){function t(n){return n?Ql(n).format("YYYY-MM-DD HH:mm:ss"):"-"}return(n,r)=>(z(),Q("div",ny,[te("div",ry,[r[0]||(r[0]=te("span",null,"用户",-1)),te("span",null,$e(t(e.message.createdAt)),1)]),te("div",iy,$e(e.message.content),1)]))}}),ly=gn(oy,[["__scopeId","data-v-c9ef8052"]]),ay={class:"trace-timeline"},sy={class:"trace-timeline__header"},cy={class:"trace-timeline__list"},uy={class:"trace-timeline__meta"},dy={class:"trace-timeline__tool-name"},fy={key:0,class:"trace-timeline__node"},hy={class:"trace-timeline__time"},py={class:"trace-timeline__detail-section"},my={class:"trace-timeline__detail-code"},gy={class:"trace-timeline__detail-section"},vy={class:"trace-timeline__detail-code"},yy={key:0,class:"trace-timeline__detail-section"},ky={class:"trace-timeline__detail-code trace-timeline__detail-code--error"},by=Se({__name:"chat-trace-timeline-card",props:{block:{}},setup(e){const t=e,n=O(()=>{const{total:l,failed:a}=t.block.summary;return a>0?`执行轨迹 ${l} 步，其中 ${a} 步失败`:`执行轨迹 ${l} 步`});function r(l){return l?Ql(l).format("YYYY-MM-DD HH:mm:ss"):"-"}function i(l){return l==="finished"?"success":l==="failed"?"error":"warning"}function o(l){return l==="finished"?"完成":l==="failed"?"失败":"运行中"}return(l,a)=>{const s=oc;return z(),Q("div",ay,[te("div",sy,[te("span",null,$e(n.value),1)]),te("div",cy,[(z(!0),Q(Qe,null,gt(e.block.items,c=>(z(),Q("div",{key:c.toolCallId,class:"trace-timeline__item"},[te("div",uy,[te("span",dy,$e(c.toolDisplayName),1),ge(se(hi),{size:"small",bordered:!1,type:i(c.status)},{default:Ae(()=>[ot($e(o(c.status)),1)]),_:2},1032,["type"]),c.node?(z(),Q("span",fy,[ge(s,{icon:"mdi:source-branch",class:"trace-timeline__node-icon"}),ot(" "+$e(c.node),1)])):Ue("",!0),te("span",hy,$e(r(c.startedAt||c.finishedAt)),1)]),ge(se(Yf),{"arrow-placement":"right",class:"trace-timeline__details"},{default:Ae(()=>[ge(se(Kf),{name:"detail",title:"查看详情"},{default:Ae(()=>[te("div",py,[a[0]||(a[0]=te("div",{class:"trace-timeline__detail-label"},"输入",-1)),te("pre",my,$e(c.input||"-"),1)]),te("div",gy,[a[1]||(a[1]=te("div",{class:"trace-timeline__detail-label"},"输出",-1)),te("pre",vy,$e(c.output||"-"),1)]),c.errorMessage?(z(),Q("div",yy,[a[2]||(a[2]=te("div",{class:"trace-timeline__detail-label trace-timeline__detail-label--error"},"错误",-1)),te("pre",ky,$e(c.errorMessage),1)])):Ue("",!0)]),_:2},1024)]),_:2},1024)]))),128))])])}}}),_y=gn(by,[["__scopeId","data-v-e0fa5196"]]),wy=/<(thinking|think)>([\s\S]*?)<\/\1>/g,ih=/<(thinking|think)>([\s\S]*?)<\/\1>/;function _u(e){return e.replace(wy,"").trim()}function xy(e){const t=e.match(ih);return t?t[2].trim():null}function oh(e){return ih.test(e)}const Cy={key:0,class:"event-stream"},Sy={class:"event-stream__steps"},Ay={class:"event-stream__step-label"},Ty={key:0,class:"event-stream__step-arrow"},Dy={class:"event-stream__toggle"},Ey={key:0,class:"event-stream__details"},My={key:0,class:"event-stream__thinking"},Ly={class:"event-stream__thinking-content"},Ry=Se({__name:"assistant-event-stream",props:{blocks:{},streaming:{type:Boolean}},setup(e){const t=e,n=G(!1),r=O(()=>t.blocks.find(f=>f.type==="trace-timeline")??null),i=O(()=>{for(const f of t.blocks)if(f.type==="markdown"&&oh(f.content))return xy(f.content);return null}),o=O(()=>{const f=[];if(i.value&&f.push({key:"thinking",label:"思考中",status:"thinking"}),r.value){const u=[...r.value.items].sort((d,h)=>{const p=String(d.startedAt??d.finishedAt??""),m=String(h.startedAt??h.finishedAt??"");return p.localeCompare(m)});for(const d of u)f.push({key:d.toolCallId,label:d.toolDisplayName,status:d.status})}return f}),l=O(()=>o.value.length>0);function a(f){switch(f){case"running":return"event-stream__step-icon--running";case"finished":return"event-stream__step-icon--finished";case"failed":return"event-stream__step-icon--failed";case"thinking":return"event-stream__step-icon--thinking";default:return""}}function s(f){switch(f){case"finished":return"mdi:check-circle";case"failed":return"mdi:close-circle";case"running":return"mdi:loading";case"thinking":return"mdi:lightbulb-outline";default:return"mdi:circle-outline"}}function c(){n.value=!n.value}return(f,u)=>{const d=oc;return l.value?(z(),Q("div",Cy,[te("div",Sy,[(z(!0),Q(Qe,null,gt(o.value,(h,p)=>(z(),Q("div",{key:h.key,class:"event-stream__step"},[te("span",{class:Ft(["event-stream__step-icon",a(h.status)])},[ge(d,{icon:s(h.status)},null,8,["icon"])],2),te("span",Ay,$e(h.label),1),p<o.value.length-1?(z(),Q("span",Ty,[ge(d,{icon:"mdi:chevron-right"})])):Ue("",!0)]))),128))]),te("div",Dy,[ge(se(Xe),{text:"",size:"small",onClick:c},{icon:Ae(()=>[ge(d,{icon:n.value?"mdi:chevron-up":"mdi:chevron-down"},null,8,["icon"])]),default:Ae(()=>[ot($e(n.value?"收起详情":"展开详情")+" ",1)]),_:1})]),n.value?(z(),Q("div",Ey,[i.value?(z(),Q("div",My,[ge(se(Yf),{"arrow-placement":"right"},{default:Ae(()=>[ge(se(Kf),{name:"thinking",title:"思考过程"},{default:Ae(()=>[te("div",Ly,$e(i.value),1)]),_:1})]),_:1})])):Ue("",!0),r.value?(z(),Ie(_y,{key:1,block:r.value},null,8,["block"])):Ue("",!0)])):Ue("",!0)])):Ue("",!0)}}}),$y=gn(Ry,[["__scopeId","data-v-13702cf7"]]);var Iy=Object.create,yc=Object.defineProperty,Fy=Object.getOwnPropertyDescriptor,lh=Object.getOwnPropertyNames,Oy=Object.getPrototypeOf,Ny=Object.prototype.hasOwnProperty,ah=(e,t)=>function(){return t||(0,e[lh(e)[0]])((t={exports:{}}).exports,t),t.exports},sh=e=>{let t={};for(var n in e)yc(t,n,{get:e[n],enumerable:!0});return t},Py=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=lh(t),o=0,l=i.length,a;o<l;o++)a=i[o],!Ny.call(e,a)&&a!==n&&yc(e,a,{get:(s=>t[s]).bind(null,a),enumerable:!(r=Fy(t,a))||r.enumerable});return e},ch=(e,t,n)=>(n=e!=null?Iy(Oy(e)):{},Py(yc(n,"default",{value:e,enumerable:!0}),e));function By(e,t,n,r){const i=Number(e[t].meta.id+1).toString();let o="";return typeof r.docId=="string"&&(o=`-${r.docId}-`),o+i}function zy(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function Hy(e,t,n,r,i){const o=i.rules.footnote_anchor_name(e,t,n,r,i),l=i.rules.footnote_caption(e,t,n,r,i);let a=o;return e[t].meta.subId>0&&(a+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${o}" id="fnref${a}">${l}</a></sup>`}function jy(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
`:`<hr class="footnotes-sep">
`)+`<section class="footnotes">
<ol class="footnotes-list">
`}function Vy(){return`</ol>
</section>
`}function Wy(e,t,n,r,i){let o=i.rules.footnote_anchor_name(e,t,n,r,i);return e[t].meta.subId>0&&(o+=`:${e[t].meta.subId}`),`<li id="fn${o}" class="footnote-item">`}function qy(){return`</li>
`}function Uy(e,t,n,r,i){let o=i.rules.footnote_anchor_name(e,t,n,r,i);return e[t].meta.subId>0&&(o+=`:${e[t].meta.subId}`),` <a href="#fnref${o}" class="footnote-backref">↩︎</a>`}function Yy(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=Hy,e.renderer.rules.footnote_block_open=jy,e.renderer.rules.footnote_block_close=Vy,e.renderer.rules.footnote_open=Wy,e.renderer.rules.footnote_close=qy,e.renderer.rules.footnote_anchor=Uy,e.renderer.rules.footnote_caption=zy,e.renderer.rules.footnote_anchor_name=By;function r(a,s,c,f){const u=a.bMarks[s]+a.tShift[s],d=a.eMarks[s];if(u+4>d||a.src.charCodeAt(u)!==91||a.src.charCodeAt(u+1)!==94)return!1;let h;for(h=u+2;h<d;h++){if(a.src.charCodeAt(h)===32)return!1;if(a.src.charCodeAt(h)===93)break}if(h===u+2||h+1>=d||a.src.charCodeAt(++h)!==58)return!1;if(f)return!0;h++,a.env.footnotes||(a.env.footnotes={}),a.env.footnotes.refs||(a.env.footnotes.refs={});const p=a.src.slice(u+2,h-2);a.env.footnotes.refs[`:${p}`]=-1;const m=new a.Token("footnote_reference_open","",1);m.meta={label:p},m.level=a.level++,a.tokens.push(m);const v=a.bMarks[s],y=a.tShift[s],g=a.sCount[s],b=a.parentType,k=h,_=a.sCount[s]+h-(a.bMarks[s]+a.tShift[s]);let T=_;for(;h<d;){const S=a.src.charCodeAt(h);if(n(S))S===9?T+=4-T%4:T++;else break;h++}a.tShift[s]=h-k,a.sCount[s]=T-_,a.bMarks[s]=k,a.blkIndent+=4,a.parentType="footnote",a.sCount[s]<a.blkIndent&&(a.sCount[s]+=a.blkIndent),a.md.block.tokenize(a,s,c,!0),a.parentType=b,a.blkIndent-=4,a.tShift[s]=y,a.sCount[s]=g,a.bMarks[s]=v;const x=new a.Token("footnote_reference_close","",-1);return x.level=--a.level,a.tokens.push(x),!0}function i(a,s){const c=a.posMax,f=a.pos;if(f+2>=c||a.src.charCodeAt(f)!==94||a.src.charCodeAt(f+1)!==91)return!1;const u=f+2,d=t(a,f+1);if(d<0)return!1;if(!s){a.env.footnotes||(a.env.footnotes={}),a.env.footnotes.list||(a.env.footnotes.list=[]);const h=a.env.footnotes.list.length,p=[];a.md.inline.parse(a.src.slice(u,d),a.md,a.env,p);const m=a.push("footnote_ref","",0);m.meta={id:h},a.env.footnotes.list[h]={content:a.src.slice(u,d),tokens:p}}return a.pos=d+1,a.posMax=c,!0}function o(a,s){const c=a.posMax,f=a.pos;if(f+3>c||!a.env.footnotes||!a.env.footnotes.refs||a.src.charCodeAt(f)!==91||a.src.charCodeAt(f+1)!==94)return!1;let u;for(u=f+2;u<c;u++){if(a.src.charCodeAt(u)===32||a.src.charCodeAt(u)===10)return!1;if(a.src.charCodeAt(u)===93)break}if(u===f+2||u>=c)return!1;u++;const d=a.src.slice(f+2,u-1);if(typeof a.env.footnotes.refs[`:${d}`]>"u")return!1;if(!s){a.env.footnotes.list||(a.env.footnotes.list=[]);let h;a.env.footnotes.refs[`:${d}`]<0?(h=a.env.footnotes.list.length,a.env.footnotes.list[h]={label:d,count:0},a.env.footnotes.refs[`:${d}`]=h):h=a.env.footnotes.refs[`:${d}`];const p=a.env.footnotes.list[h].count;a.env.footnotes.list[h].count++;const m=a.push("footnote_ref","",0);m.meta={id:h,subId:p,label:d}}return a.pos=u,a.posMax=c,!0}function l(a){let s,c,f,u=!1;const d={};if(!a.env.footnotes||(a.tokens=a.tokens.filter(function(p){return p.type==="footnote_reference_open"?(u=!0,c=[],f=p.meta.label,!1):p.type==="footnote_reference_close"?(u=!1,d[":"+f]=c,!1):(u&&c.push(p),!u)}),!a.env.footnotes.list))return;const h=a.env.footnotes.list;a.tokens.push(new a.Token("footnote_block_open","",1));for(let p=0,m=h.length;p<m;p++){const v=new a.Token("footnote_open","",1);if(v.meta={id:p,label:h[p].label},a.tokens.push(v),h[p].tokens){s=[];const b=new a.Token("paragraph_open","p",1);b.block=!0,s.push(b);const k=new a.Token("inline","",0);k.children=h[p].tokens,k.content=h[p].content,s.push(k);const _=new a.Token("paragraph_close","p",-1);_.block=!0,s.push(_)}else h[p].label&&(s=d[`:${h[p].label}`]);s&&(a.tokens=a.tokens.concat(s));let y;a.tokens[a.tokens.length-1].type==="paragraph_close"?y=a.tokens.pop():y=null;const g=h[p].count>0?h[p].count:1;for(let b=0;b<g;b++){const k=new a.Token("footnote_anchor","",0);k.meta={id:p,subId:b,label:h[p].label},a.tokens.push(k)}y&&a.tokens.push(y),a.tokens.push(new a.Token("footnote_close","",-1))}a.tokens.push(new a.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",r,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",i),e.inline.ruler.after("footnote_inline","footnote_ref",o),e.core.ruler.after("inline","footnote_tail",l)}function Ky(e){function t(r,i){const o=r.pos,l=r.src.charCodeAt(o);if(i||l!==43)return!1;const a=r.scanDelims(r.pos,!0);let s=a.length;const c=String.fromCharCode(l);if(s<2)return!1;if(s%2){const f=r.push("text","",0);f.content=c,s--}for(let f=0;f<s;f+=2){const u=r.push("text","",0);u.content=c+c,!(!a.can_open&&!a.can_close)&&r.delimiters.push({marker:l,length:0,jump:f/2,token:r.tokens.length-1,end:-1,open:a.can_open,close:a.can_close})}return r.pos+=a.length,!0}function n(r,i){let o;const l=[],a=i.length;for(let s=0;s<a;s++){const c=i[s];if(c.marker!==43||c.end===-1)continue;const f=i[c.end];o=r.tokens[c.token],o.type="ins_open",o.tag="ins",o.nesting=1,o.markup="++",o.content="",o=r.tokens[f.token],o.type="ins_close",o.tag="ins",o.nesting=-1,o.markup="++",o.content="",r.tokens[f.token-1].type==="text"&&r.tokens[f.token-1].content==="+"&&l.push(f.token-1)}for(;l.length;){const s=l.pop();let c=s+1;for(;c<r.tokens.length&&r.tokens[c].type==="ins_close";)c++;c--,s!==c&&(o=r.tokens[c],r.tokens[c]=r.tokens[s],r.tokens[s]=o)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(r){const i=r.tokens_meta,o=(r.tokens_meta||[]).length;n(r,r.delimiters);for(let l=0;l<o;l++)i[l]&&i[l].delimiters&&n(r,i[l].delimiters)})}function Zy(e){function t(r,i){const o=r.pos,l=r.src.charCodeAt(o);if(i||l!==61)return!1;const a=r.scanDelims(r.pos,!0);let s=a.length;const c=String.fromCharCode(l);if(s<2)return!1;if(s%2){const f=r.push("text","",0);f.content=c,s--}for(let f=0;f<s;f+=2){const u=r.push("text","",0);u.content=c+c,!(!a.can_open&&!a.can_close)&&r.delimiters.push({marker:l,length:0,jump:f/2,token:r.tokens.length-1,end:-1,open:a.can_open,close:a.can_close})}return r.pos+=a.length,!0}function n(r,i){const o=[],l=i.length;for(let a=0;a<l;a++){const s=i[a];if(s.marker!==61||s.end===-1)continue;const c=i[s.end],f=r.tokens[s.token];f.type="mark_open",f.tag="mark",f.nesting=1,f.markup="==",f.content="";const u=r.tokens[c.token];u.type="mark_close",u.tag="mark",u.nesting=-1,u.markup="==",u.content="",r.tokens[c.token-1].type==="text"&&r.tokens[c.token-1].content==="="&&o.push(c.token-1)}for(;o.length;){const a=o.pop();let s=a+1;for(;s<r.tokens.length&&r.tokens[s].type==="mark_close";)s++;if(s--,a!==s){const c=r.tokens[s];r.tokens[s]=r.tokens[a],r.tokens[a]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(r){let i;const o=r.tokens_meta,l=(r.tokens_meta||[]).length;for(n(r,r.delimiters),i=0;i<l;i++)o[i]&&o[i].delimiters&&n(r,o[i].delimiters)})}const Gy=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function Xy(e,t){const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==126||t||r+2>=n)return!1;e.pos=r+1;let i=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){i=!0;break}e.md.inline.skipToken(e)}if(!i||r+1===e.pos)return e.pos=r,!1;const o=e.src.slice(r+1,e.pos);if(o.match(/(^|[^\\])(\\\\)*\s/))return e.pos=r,!1;e.posMax=e.pos,e.pos=r+1;const l=e.push("sub_open","sub",1);l.markup="~";const a=e.push("text","",0);a.content=o.replace(Gy,"$1");const s=e.push("sub_close","sub",-1);return s.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function Qy(e){e.inline.ruler.after("emphasis","sub",Xy)}const Jy=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function ek(e,t){const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==94||t||r+2>=n)return!1;e.pos=r+1;let i=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){i=!0;break}e.md.inline.skipToken(e)}if(!i||r+1===e.pos)return e.pos=r,!1;const o=e.src.slice(r+1,e.pos);if(o.match(/(^|[^\\])(\\\\)*\s/))return e.pos=r,!1;e.posMax=e.pos,e.pos=r+1;const l=e.push("sup_open","sup",1);l.markup="^";const a=e.push("text","",0);a.content=o.replace(Jy,"$1");const s=e.push("sup_close","sup",-1);return s.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function tk(e){e.inline.ruler.after("emphasis","sup",ek)}var nk=ah({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,v){v=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},v),m.core.ruler.after("inline","github-task-lists",function(y){for(var g=y.tokens,b=0,k=2;k<g.length;k++)i(g,k)&&(o(g[k],b,v,y.Token),b+=1,n(g[k-2],"class",v.liClass),n(g[r(g,k-2)],"class",v.ulClass))})};function n(m,v,y){var g=m.attrIndex(v),b=[v,y];g<0?m.attrPush(b):m.attrs[g]=b}function r(m,v){for(var y=m[v].level-1,g=v-1;g>=0;g--)if(m[g].level===y)return g;return-1}function i(m,v){return u(m[v])&&d(m[v-1])&&h(m[v-2])&&p(m[v])}function o(m,v,y,g){var b=y.idPrefix+v;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(a(b,g)),m.children.push(s(g)),m.children.unshift(l(m,b,y,g)),y.divWrap&&(m.children.unshift(c(y,g)),m.children.push(f(g)))}function l(m,v,y,g){var b=new g("checkbox_input","input",0);return b.attrs=[["type","checkbox"],["id",v]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&b.attrs.push(["checked","true"]),y.disabled===!0&&b.attrs.push(["disabled","true"]),b}function a(m,v){var y=new v("label_open","label",1);return y.attrs=[["for",m]],y}function s(m){return new m("label_close","label",-1)}function c(m,v){var y=new v("checkbox_open","div",0);return y.attrs=[["class",m.divClass]],y}function f(m){return new m("checkbox_close","div",-1)}function u(m){return m.type==="inline"}function d(m){return m.type==="paragraph_open"}function h(m){return m.type==="list_item_open"}function p(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),wu=ch(nk()),rk=Object.defineProperty,uh=e=>{let t={};for(var n in e)rk(t,n,{get:e[n],enumerable:!0});return t},dh=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,fh=/[\0-\x1F\x7F-\x9F]/,ik=/[\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]/,kc=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,hh=/[\$\+<->\^`\|~\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]/,ph=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,mh=sh({Any:()=>dh,Cc:()=>fh,Cf:()=>ik,P:()=>kc,S:()=>hh,Z:()=>ph});function ok(e){const t={};e=e||{},t.src_Any=dh.source,t.src_Cc=fh.source,t.src_Z=ph.source,t.src_P=kc.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><｜]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+`|[><｜]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|｜]|"+t.src_ZPCc+"))((?![$+<=>^`|｜])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|｜]|"+t.src_ZPCc+"))((?![$+<=>^`|｜])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function As(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function na(e){return Object.prototype.toString.call(e)}function lk(e){return na(e)==="[object String]"}function ak(e){return na(e)==="[object Object]"}function sk(e){return na(e)==="[object RegExp]"}function xu(e){return na(e)==="[object Function]"}function ck(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const gh={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function uk(e){return Object.keys(e||{}).reduce(function(t,n){return t||gh.hasOwnProperty(n)},!1)}const dk={"http:":{validate:function(e,t,n){const r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},fk="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]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",hk="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function pk(e){e.__index__=-1,e.__text_cache__=""}function mk(e){return function(t,n){const r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function Cu(){return function(e,t){t.normalize(e)}}function Ml(e){const t=e.re=ok(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(fk),n.push(t.src_xn),t.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");const i=[];e.__compiled__={};function o(a,s){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+s)}Object.keys(e.__schemas__).forEach(function(a){const s=e.__schemas__[a];if(s===null)return;const c={validate:null,link:null};if(e.__compiled__[a]=c,ak(s)){sk(s.validate)?c.validate=mk(s.validate):xu(s.validate)?c.validate=s.validate:o(a,s),xu(s.normalize)?c.normalize=s.normalize:s.normalize?o(a,s):c.normalize=Cu();return}if(lk(s)){i.push(a);return}o(a,s)}),i.forEach(function(a){e.__compiled__[e.__schemas__[a]]&&(e.__compiled__[a].validate=e.__compiled__[e.__schemas__[a]].validate,e.__compiled__[a].normalize=e.__compiled__[e.__schemas__[a]].normalize)}),e.__compiled__[""]={validate:null,normalize:Cu()};const l=Object.keys(e.__compiled__).filter(function(a){return a.length>0&&e.__compiled__[a]}).map(ck).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><｜]|"+t.src_ZPCc+"))("+l+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><｜]|"+t.src_ZPCc+"))("+l+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),pk(e)}function gk(e,t){const n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function Ts(e,t){const n=new gk(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Hn(e,t){if(!(this instanceof Hn))return new Hn(e,t);t||uk(e)&&(t=e,e={}),this.__opts__=As({},gh,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=As({},dk,e),this.__compiled__={},this.__tlds__=hk,this.__tlds_replaced__=!1,this.re={},Ml(this)}Hn.prototype.add=function(t,n){return this.__schemas__[t]=n,Ml(this),this};Hn.prototype.set=function(t){return this.__opts__=As(this.__opts__,t),this};Hn.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,r,i,o,l,a,s,c,f;if(this.re.schema_test.test(t)){for(s=this.re.schema_search,s.lastIndex=0;(n=s.exec(t))!==null;)if(o=this.testSchemaAt(t,n[2],s.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(r=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(l=r.index+r[1].length,(this.__index__<0||l<this.__index__)&&(this.__schema__="",this.__index__=l,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(f=t.indexOf("@"),f>=0&&(i=t.match(this.re.email_fuzzy))!==null&&(l=i.index+i[1].length,a=i.index+i[0].length,(this.__index__<0||l<this.__index__||l===this.__index__&&a>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=l,this.__last_index__=a))),this.__index__>=0};Hn.prototype.pretest=function(t){return this.re.pretest.test(t)};Hn.prototype.testSchemaAt=function(t,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,r,this):0};Hn.prototype.match=function(t){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(Ts(this,r)),r=this.__last_index__);let i=r?t.slice(r):t;for(;this.test(i);)n.push(Ts(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};Hn.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const r=this.testSchemaAt(t,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,Ts(this,0)):null};Hn.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(r,i,o){return r!==o[i-1]}).reverse(),Ml(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Ml(this),this)};Hn.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Hn.prototype.onCompile=function(){};var vh=Hn,vk=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTǇǋǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉ǲኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻ǲᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤĳạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ﬃɩᾹ\0\0᾽g;耀ﬀig;耀ﬄ;쀀𝔣lig;耀ﬁlig;쀀fjƀaltῙ῜ῡt;晭ig;耀ﬂns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒α‚‰‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସǳ⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗǈⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼ǲ㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),yk=new Uint16Array("Ȁaglq	\x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),$a;const kk=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]]),bk=($a=String.fromCodePoint)!==null&&$a!==void 0?$a:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function _k(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=kk.get(e))!==null&&t!==void 0?t:e}var Zt;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Zt||(Zt={}));const wk=32;var Nr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Nr||(Nr={}));function Ds(e){return e>=Zt.ZERO&&e<=Zt.NINE}function xk(e){return e>=Zt.UPPER_A&&e<=Zt.UPPER_F||e>=Zt.LOWER_A&&e<=Zt.LOWER_F}function Ck(e){return e>=Zt.UPPER_A&&e<=Zt.UPPER_Z||e>=Zt.LOWER_A&&e<=Zt.LOWER_Z||Ds(e)}function Sk(e){return e===Zt.EQUALS||Ck(e)}var Kt;(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"})(Kt||(Kt={}));var Or;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Or||(Or={}));var Ak=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Kt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Or.Strict}startEntity(e){this.decodeMode=e,this.state=Kt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Kt.EntityStart:return e.charCodeAt(t)===Zt.NUM?(this.state=Kt.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Kt.NamedEntity,this.stateNamedEntity(e,t));case Kt.NumericStart:return this.stateNumericStart(e,t);case Kt.NumericDecimal:return this.stateNumericDecimal(e,t);case Kt.NumericHex:return this.stateNumericHex(e,t);case Kt.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|wk)===Zt.LOWER_X?(this.state=Kt.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Kt.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){const i=n-t;this.result=this.result*Math.pow(r,i)+parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const r=e.charCodeAt(t);if(Ds(r)||xk(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const r=e.charCodeAt(t);if(Ds(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Zt.SEMI)this.consumed+=1;else if(this.decodeMode===Or.Strict)return 0;return this.emitCodePoint(_k(this.result),this.consumed),this.errors&&(e!==Zt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let r=n[this.treeIndex],i=(r&Nr.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const o=e.charCodeAt(t);if(this.treeIndex=Tk(n,r,this.treeIndex+Math.max(1,i),o),this.treeIndex<0)return this.result===0||this.decodeMode===Or.Attribute&&(i===0||Sk(o))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&Nr.VALUE_LENGTH)>>14,i!==0){if(o===Zt.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Or.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,r=(n[t]&Nr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~Nr.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case Kt.NamedEntity:return this.result!==0&&(this.decodeMode!==Or.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Kt.NumericDecimal:return this.emitNumericEntity(0,2);case Kt.NumericHex:return this.emitNumericEntity(0,3);case Kt.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Kt.EntityStart:return 0}}};function yh(e){let t="";const n=new Ak(e,r=>t+=bk(r));return function(i,o){let l=0,a=0;for(;(a=i.indexOf("&",a))>=0;){t+=i.slice(l,a),n.startEntity(o);const c=n.write(i,a+1);if(c<0){l=a+n.end();break}l=a+c,a=c===0?l+1:l}const s=t+i.slice(l);return t="",s}}function Tk(e,t,n,r){const i=(t&Nr.BRANCH_LENGTH)>>7,o=t&Nr.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){const s=r-o;return s<0||s>=i?-1:e[n+s]-1}let l=n,a=l+i-1;for(;l<=a;){const s=l+a>>>1,c=e[s];if(c<r)l=s+1;else if(c>r)a=s-1;else return e[s+i]}return-1}const Dk=yh(vk);yh(yk);function Ek(e,t=Or.Legacy){return Dk(e,t)}const Su={};function Mk(e){let t=Su[e];if(t)return t;t=Su[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);t.push(r)}for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}function ra(e,t){typeof t!="string"&&(t=ra.defaultChars);const n=Mk(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let o=0,l=r.length;o<l;o+=3){const a=parseInt(r.slice(o+1,o+3),16);if(a<128){i+=n[a];continue}if((a&224)===192&&o+3<l){const s=parseInt(r.slice(o+4,o+6),16);if((s&192)===128){const c=a<<6&1984|s&63;c<128?i+="��":i+=String.fromCharCode(c),o+=3;continue}}if((a&240)===224&&o+6<l){const s=parseInt(r.slice(o+4,o+6),16),c=parseInt(r.slice(o+7,o+9),16);if((s&192)===128&&(c&192)===128){const f=a<<12&61440|s<<6&4032|c&63;f<2048||f>=55296&&f<=57343?i+="���":i+=String.fromCharCode(f),o+=6;continue}}if((a&248)===240&&o+9<l){const s=parseInt(r.slice(o+4,o+6),16),c=parseInt(r.slice(o+7,o+9),16),f=parseInt(r.slice(o+10,o+12),16);if((s&192)===128&&(c&192)===128&&(f&192)===128){let u=a<<18&1835008|s<<12&258048|c<<6&4032|f&63;u<65536||u>1114111?i+="����":(u-=65536,i+=String.fromCharCode(55296+(u>>10),56320+(u&1023))),o+=9;continue}}i+="�"}return i})}ra.defaultChars=";/?:@&=+$,#";ra.componentChars="";var Es=ra;const Au={};function Lk(e){let t=Au[e];if(t)return t;t=Au[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?t.push(r):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function ia(e,t,n){typeof t!="string"&&(n=t,t=ia.defaultChars),typeof n>"u"&&(n=!0);const r=Lk(t);let i="";for(let o=0,l=e.length;o<l;o++){const a=e.charCodeAt(o);if(n&&a===37&&o+2<l&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3))){i+=e.slice(o,o+3),o+=2;continue}if(a<128){i+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&o+1<l){const s=e.charCodeAt(o+1);if(s>=56320&&s<=57343){i+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(e[o])}return i}ia.defaultChars=";/?:@&=+$,-_.!~*'()#";ia.componentChars="-_.!~*'()";var kh=ia;function bc(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 Ll(){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 Rk=/^([a-z0-9.+-]+:)/i,$k=/:[0-9]*$/,Ik=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Fk=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
`,"	"]),Ok=["'"].concat(Fk),Tu=["%","/","?",";","#"].concat(Ok),Du=["/","?","#"],Nk=255,Eu=/^[+a-z0-9A-Z_-]{0,63}$/,Pk=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Mu={javascript:!0,"javascript:":!0},Lu={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Bk(e,t){if(e&&e instanceof Ll)return e;const n=new Ll;return n.parse(e,t),n}Ll.prototype.parse=function(e,t){let n,r,i,o=e;if(o=o.trim(),!t&&e.split("#").length===1){const c=Ik.exec(o);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let l=Rk.exec(o);if(l&&(l=l[0],n=l.toLowerCase(),this.protocol=l,o=o.substr(l.length)),(t||l||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=o.substr(0,2)==="//",i&&!(l&&Mu[l])&&(o=o.substr(2),this.slashes=!0)),!Mu[l]&&(i||l&&!Lu[l])){let c=-1;for(let p=0;p<Du.length;p++)r=o.indexOf(Du[p]),r!==-1&&(c===-1||r<c)&&(c=r);let f,u;c===-1?u=o.lastIndexOf("@"):u=o.lastIndexOf("@",c),u!==-1&&(f=o.slice(0,u),o=o.slice(u+1),this.auth=f),c=-1;for(let p=0;p<Tu.length;p++)r=o.indexOf(Tu[p]),r!==-1&&(c===-1||r<c)&&(c=r);c===-1&&(c=o.length),o[c-1]===":"&&c--;const d=o.slice(0,c);o=o.slice(c),this.parseHost(d),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const p=this.hostname.split(/\./);for(let m=0,v=p.length;m<v;m++){const y=p[m];if(y&&!y.match(Eu)){let g="";for(let b=0,k=y.length;b<k;b++)y.charCodeAt(b)>127?g+="x":g+=y[b];if(!g.match(Eu)){const b=p.slice(0,m),k=p.slice(m+1),_=y.match(Pk);_&&(b.push(_[1]),k.unshift(_[2])),k.length&&(o=k.join(".")+o),this.hostname=b.join(".");break}}}}this.hostname.length>Nk&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=o.indexOf("#");a!==-1&&(this.hash=o.substr(a),o=o.slice(0,a));const s=o.indexOf("?");return s!==-1&&(this.search=o.substr(s),o=o.slice(0,s)),o&&(this.pathname=o),Lu[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Ll.prototype.parseHost=function(e){let t=$k.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 _c=Bk,bh=sh({decode:()=>Es,encode:()=>kh,format:()=>bc,parse:()=>_c}),zk=ah({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const u=/^xn--/,d=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=35,v=Math.floor,y=String.fromCharCode;function g(L){throw new RangeError(p[L])}function b(L,P){const I=[];let N=L.length;for(;N--;)I[N]=P(L[N]);return I}function k(L,P){const I=L.split("@");let N="";I.length>1&&(N=I[0]+"@",L=I[1]),L=L.replace(h,".");const V=b(L.split("."),P).join(".");return N+V}function _(L){const P=[];let I=0;const N=L.length;for(;I<N;){const V=L.charCodeAt(I++);if(V>=55296&&V<=56319&&I<N){const K=L.charCodeAt(I++);(K&64512)==56320?P.push(((V&1023)<<10)+(K&1023)+65536):(P.push(V),I--)}else P.push(V)}return P}const T=L=>String.fromCodePoint(...L),x=function(L){return L>=48&&L<58?26+(L-48):L>=65&&L<91?L-65:L>=97&&L<123?L-97:36},S=function(L,P){return L+22+75*(L<26)-((P!=0)<<5)},R=function(L,P,I){let N=0;for(L=I?v(L/700):L>>1,L+=v(L/P);L>m*26>>1;N+=36)L=v(L/m);return v(N+(m+1)*L/(L+38))},W=function(L){const P=[],I=L.length;let N=0,V=128,K=72,$=L.lastIndexOf("-");$<0&&($=0);for(let H=0;H<$;++H)L.charCodeAt(H)>=128&&g("not-basic"),P.push(L.charCodeAt(H));for(let H=$>0?$+1:0;H<I;){const re=N;for(let ne=1,de=36;;de+=36){H>=I&&g("invalid-input");const be=x(L.charCodeAt(H++));be>=36&&g("invalid-input"),be>v((2147483647-N)/ne)&&g("overflow"),N+=be*ne;const Te=de<=K?1:de>=K+26?26:de-K;if(be<Te)break;const pe=36-Te;ne>v(2147483647/pe)&&g("overflow"),ne*=pe}const Z=P.length+1;K=R(N-re,Z,re==0),v(N/Z)>2147483647-V&&g("overflow"),V+=v(N/Z),N%=Z,P.splice(N++,0,V)}return String.fromCodePoint(...P)},w=function(L){const P=[];L=_(L);const I=L.length;let N=128,V=0,K=72;for(const re of L)re<128&&P.push(y(re));const $=P.length;let H=$;for($&&P.push("-");H<I;){let re=2147483647;for(const ne of L)ne>=N&&ne<re&&(re=ne);const Z=H+1;re-N>v((2147483647-V)/Z)&&g("overflow"),V+=(re-N)*Z,N=re;for(const ne of L)if(ne<N&&++V>2147483647&&g("overflow"),ne===N){let de=V;for(let be=36;;be+=36){const Te=be<=K?1:be>=K+26?26:be-K;if(de<Te)break;const pe=de-Te,ke=36-Te;P.push(y(S(Te+pe%ke,0))),de=v(pe/ke)}P.push(y(S(de,0))),K=R(V,Z,H===$),V=0,++H}++V,++N}return P.join("")},M={version:"2.3.1",ucs2:{decode:_,encode:T},decode:W,encode:w,toASCII:function(L){return k(L,function(P){return d.test(P)?"xn--"+w(P):P})},toUnicode:function(L){return k(L,function(P){return u.test(P)?W(P.slice(4).toLowerCase()):P})}};t.exports=M})}),_h=ch(zk()),Hk=uh({arrayReplaceAt:()=>Kk,assign:()=>Uk,countLines:()=>zt,escapeHtml:()=>ib,escapeRE:()=>lb,fromCodePoint:()=>xh,has:()=>qk,isMdAsciiPunct:()=>$l,isPunctChar:()=>Rl,isPunctCode:()=>Ms,isSpace:()=>Yk,isString:()=>Vk,isValidEntityCode:()=>wh,isWhiteSpace:()=>wo,lib:()=>ab,mdurl:()=>bh,normalizeReference:()=>oa,ucmicro:()=>mh,unescapeAll:()=>Jk,unescapeMd:()=>Qk});function jk(e){return Object.prototype.toString.call(e)}function Vk(e){return jk(e)==="[object String]"}const Wk=Object.prototype.hasOwnProperty;function qk(e,t){return Wk.call(e,t)}function Uk(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(r=>{e[r]=n[r]})}}),e}function Yk(e){return e===9||e===32}function wo(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 Rl(e){return kc.test(e)||hh.test(e)}const Ru=new Map;function Ms(e){if($l(e))return!0;const t=Ru.get(e);if(t!==void 0)return t;const n=Rl(String.fromCharCode(e));return Ru.set(e,n),n}function $l(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 oa(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Kk(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function wh(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 xh(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 Ch=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Zk=new RegExp(`${Ch.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Gk=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Xk(e,t){if(t.charCodeAt(0)===35&&Gk.test(t)){const r=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return wh(r)?xh(r):e}const n=Ek(e);return n!==e?n:e}function Qk(e){return e.includes("\\")?e.replace(Ch,"$1"):e}function Jk(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Zk,(t,n,r)=>n||Xk(t,r))}const eb=/[&<>"]/,tb=/[&<>"]/g,nb={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function rb(e){return nb[e]}function ib(e){return eb.test(e)?e.replace(tb,rb):e}const ob=/[.?*+^$[\]\\(){}|-]/g;function lb(e){return e.replace(ob,"\\$&")}const ab={mdurl:bh,ucmicro:mh};function zt(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
`,n+1))!==-1;)t++;return t}function wc(e,t,n){let r,i=t;const o={ok:!1,pos:0,str:""};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return o;if(r===62)return o.pos=i+1,o.str=e.slice(t+1,i),o.ok=!0,o;if(r===92&&i+1<n){i+=2;continue}i++}return o}let l=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(l++,l>32))return o;if(r===41){if(l===0)break;l--}i++}return t===i||l!==0||(o.str=e.slice(t,i),o.pos=i,o.ok=!0),o}var Sh=wc;const ol=-2;function sb(e,t,n){let r=t+1;for(;r<n;){const i=e.charCodeAt(r);if(i===93)return r;if(i===92){r+=2;continue}if(i===96||i===60||i===33&&r+1<n&&e.charCodeAt(r+1)===91||i===91)return ol;r++}return-1}function xc(e,t,n){let r=1,i=!1,o,l;const a=e.src,s=e.posMax,c=e.pos,f=e.__mdtsLinkLabelNoCloseFrom;if(typeof f=="number"&&t+1>=f)return-1;const u=a.indexOf("]",t+1);if(u<0||u>=s)return e.__mdtsLinkLabelNoCloseFrom=t+1,-1;const d=sb(a,t,s);if(d!==ol)return d;for(e.pos=t+1;e.pos<s;){if(o=a.charCodeAt(e.pos),o===93&&(r--,r===0)){i=!0;break}if(l=e.pos,e.md.inline.skipToken(e),o===91){if(l===e.pos-1)r++;else if(n)return e.pos=c,-1}}let h=-1;return i&&(h=e.pos),e.pos=c,h}var Il=xc;function Cc(e,t,n,r){let i,o=t;const l={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)l.str=r.str,l.marker=r.marker;else{if(o>=n)return l;let a=e.charCodeAt(o);if(a!==34&&a!==39&&a!==40)return l;t++,o++,a===40&&(a=41),l.marker=a}for(;o<n;){if(i=e.charCodeAt(o),i===l.marker)return l.pos=o+1,l.str+=e.slice(t,o),l.ok=!0,l;if(i===40&&l.marker===41)return l;i===92&&o+1<n&&o++,o++}return l.can_continue=!0,l.str+=e.slice(t,o),l}var Ah=Cc;function la(e,t){if(!e.attrs)return-1;for(let n=0;n<e.attrs.length;n++)if(e.attrs[n][0]===t)return n;return-1}function Sc(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function cb(e,t,n){const r=la(e,t),i=[t,n];r<0?Sc(e,i):e.attrs[r]=i}function ub(e,t){const n=la(e,t);return n>=0?e.attrs[n][1]:null}function db(e,t,n){const r=la(e,t);r<0?Sc(e,[t,n]):e.attrs[r][1]=`${e.attrs[r][1]} ${n}`}var fb=uh({attrGet:()=>ub,attrIndex:()=>la,attrJoin:()=>db,attrPush:()=>Sc,attrSet:()=>cb,parseLinkDestination:()=>wc,parseLinkLabel:()=>xc,parseLinkTitle:()=>Cc});const hb=/^(?:vbscript|javascript|file|data):/,pb=/^data:image\/(?:gif|png|jpeg|webp);/,Th=["http:","https:","mailto:"];function Dh(e){const t=e.trim().toLowerCase();return hb.test(t)?pb.test(t):!0}function Eh(e){const t=_c(e,!0);if(t.hostname&&(!t.protocol||Th.includes(t.protocol)))try{t.hostname=_h.default.toASCII(t.hostname)}catch{}return kh(bc(t))}function Mh(e){const t=_c(e,!0);if(t.hostname&&(!t.protocol||Th.includes(t.protocol)))try{t.hostname=_h.default.toUnicode(t.hostname)}catch{}return Es(bc(t),`${Es.defaultChars}%`)}function sn(e,t){if(e)try{e.__mdtsStrategyInfo=t}catch{}}var en=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,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=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}`}};function mb(e){return e.includes("\r")||e.includes("\0")}function Lh(e){return typeof e=="string"?e:e.toString()}function gb(e){if(e.inlineMode){const t=new en("inline","",0);t.content=Lh(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 vb=/^([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])?)*)$/,yb=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function kb(e,t){let n=e.pos;const r=e.src;if(r.charCodeAt(n)!==60)return!1;const i=n,o=e.posMax;for(;;){if(++n>=o)return!1;const a=r.charCodeAt(n);if(a===60)return!1;if(a===62)break}const l=r.slice(i+1,n);if(yb.test(l)){const a=e.md.normalizeLink(l);if(!e.md.validateLink(a))return!1;if(!t){const s=e.push("link_open","a",1);s.attrs=[["href",a]],s.markup="autolink",s.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="autolink",f.info="auto"}return e.pos+=l.length+2,!0}if(vb.test(l)){const a=e.md.normalizeLink(`mailto:${l}`);if(!e.md.validateLink(a))return!1;if(!t){const s=e.push("link_open","a",1);s.attrs=[["href",a]],s.markup="autolink",s.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="autolink",f.info="auto"}return e.pos+=l.length+2,!0}return!1}var bb=kb;function _b(e,t){const n=e.src;let r=e.pos;if(n.charCodeAt(r)!==96)return!1;const i=r;r++;const o=e.posMax;for(;r<o&&n.charCodeAt(r)===96;)r++;const l=n.slice(i,r),a=l.length;if(e.backticksScanned&&(e.backticks[a]||0)<=i)return t||(e.pending+=l),e.pos+=a,!0;let s=r,c;for(;(c=n.indexOf("`",s))!==-1;){for(s=c+1;s<o&&n.charCodeAt(s)===96;)s++;const f=s-c;if(f===a){if(!t){const u=e.push("code_inline","code",0);u.markup=l;let d=n.slice(r,c);d.includes(`
`)&&(d=d.replace(/\n/g," ")),d.length>2&&d.charCodeAt(0)===32&&d.charCodeAt(d.length-1)===32&&(d=d.slice(1,-1)),u.content=d}return e.pos=s,!0}e.backticks[f]=c}return e.backticksScanned=!0,t||(e.pending+=l),e.pos+=a,!0}var wb=_b;function $u(e){const t={},n=e.length;if(!n)return;let r=0,i=-2;const o=[];for(let l=0;l<n;l++){const a=e[l];if(o.push(0),(e[r].marker!==a.marker||i!==a.token-1)&&(r=l),i=a.token,a.length=a.length||0,!a.close)continue;Object.prototype.hasOwnProperty.call(t,a.marker)||(t[a.marker]=[-1,-1,-1,-1,-1,-1]);const s=t[a.marker][(a.open?3:0)+a.length%3];let c=r-o[r]-1,f=c;for(;c>s;c-=o[c]+1){const u=e[c];if(u.marker===a.marker&&u.open&&u.end<0){let d=!1;if((u.close||a.open)&&(u.length+a.length)%3===0&&(u.length%3!==0||a.length%3!==0)&&(d=!0),!d){const h=c>0&&!e[c-1].open?o[c-1]+1:0;o[l]=l-c+h,o[c]=h,a.open=!1,u.end=l,u.close=!1,f=-1,i=-2;break}}}f!==-1&&(t[a.marker][(a.open?3:0)+(a.length||0)%3]=f)}}function xb(e){const t=e.tokens_meta,n=e.tokens_meta.length;$u(e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&$u(t[r].delimiters)}var Cb=xb;function Sb(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;const i=e.scanDelims(e.pos,r===42);if(!i||i.length===0)return!1;for(let o=0;o<i.length;o++){const l=e.push("text","",0);l.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function Iu(e,t){const n=t.length;for(let r=n-1;r>=0;r--){const i=t[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const o=t[i.end],l=r>0&&t[r-1].end===i.end+1&&t[r-1].marker===i.marker&&t[r-1].token===i.token-1&&t[i.end+1].token===o.token+1,a=String.fromCharCode(i.marker),s=e.tokens[i.token];s.type=l?"strong_open":"em_open",s.tag=l?"strong":"em",s.nesting=1,s.markup=l?a+a:a,s.content="";const c=e.tokens[o.token];c.type=l?"strong_close":"em_close",c.tag=l?"strong":"em",c.nesting=-1,c.markup=l?a+a:a,c.content="",l&&(e.tokens[t[r-1].token].content="",e.tokens[t[i.end+1].token].content="",r--)}}function Ab(e){const t=e.tokens_meta,n=e.tokens_meta.length;Iu(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&Iu(e,t[r].delimiters)}const Fu={tokenize:Sb,postProcess:Ab},Ou={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};function Tb(e){return!(e>=55296&&e<=57343||e>=1114111)}function Nu(e){return String.fromCodePoint(e)}function Rh(e){if(e.length>=4&&e.charCodeAt(0)===38&&e.charCodeAt(e.length-1)===59){const t=e.slice(1,-1).toLowerCase();if(Ou[t])return Ou[t]}return e}function Ac(e){return e>=48&&e<=57}function Db(e){const t=e|32;return Ac(e)||t>=97&&t<=102}function $h(e){const t=e|32;return t>=97&&t<=122}function Eb(e){return $h(e)||Ac(e)}function Mb(e,t,n){let r=t+2;if(r>=n)return null;let i=!1,o=7,l=r;for((e.charCodeAt(r)|32)===120&&(i=!0,o=6,r++,l=r);r<n&&r-l<o;){const a=e.charCodeAt(r);if(!(i?Db(a):Ac(a)))break;r++}return r===l||r>=n||e.charCodeAt(r)!==59?null:e.slice(t,r+1)}function Lb(e,t,n){let r=t+1;if(r>=n||!$h(e.charCodeAt(r)))return null;for(r++;r<n&&r-t-1<32&&Eb(e.charCodeAt(r));)r++;if(r-t-1<2||r>=n||e.charCodeAt(r)!==59)return null;const i=e.slice(t,r+1);return Rh(i)!==i?i:null}function Rb(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const i=Mb(e.src,n,r);if(i){if(!t){const o=(i.charCodeAt(2)|32)===120?Number.parseInt(i.slice(3,-1),16):Number.parseInt(i.slice(2,-1),10),l=e.push("text_special","",0);l.content=Tb(o)?Nu(o):Nu(65533),l.markup=i,l.info="entity"}return e.pos+=i.length,!0}}else{const i=Lb(e.src,n,r);if(i){const o=Rh(i);if(!t){const l=e.push("text_special","",0);l.content=o,l.markup=i,l.info="entity"}return e.pos+=i.length,!0}}return!1}var $b=Rb;const Ih=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),Ls=new Array(128),Fh=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);Ls[e]=`\\${t}`,Fh[e]=Ih[e]?t:Ls[e]}function Pu(e,t,n){e.pending&&e.pushPending();const r=new en("text_special","",0);r.level=e.level,r.content=t,r.markup=n,r.info="escape",e.pendingLevel=e.level,e.tokens.push(r),e.tokens_meta.push(null)}function Ib(e,t){let n=e.pos;const r=e.posMax,i=e.src;if(i.charCodeAt(n)!==92||(n++,n>=r))return!1;let o=i.charCodeAt(n);if(o===10){for(t||e.push("hardbreak","br",0),n++;n<r&&(o=i.charCodeAt(n),!(o!==9&&o!==32));)n++;return e.pos=n,!0}if(o<128)return t?(e.pos=n+1,!0):(Pu(e,Fh[o],Ls[o]),e.pos=n+1,!0);if(t){if(o>=55296&&o<=56319&&n+1<r){const s=i.charCodeAt(n+1);s>=56320&&s<=57343&&n++}return e.pos=n+1,!0}let l=i.charAt(n);if(o>=55296&&o<=56319&&n+1<r){const s=i.charCodeAt(n+1);s>=56320&&s<=57343&&(l+=i.charAt(n+1),n++)}const a=`\\${l}`;return Pu(e,o<256&&Ih[o]?l:a,a),e.pos=n+1,!0}var Fb=Ib;function Ob(e){let t,n,r=0;const i=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++){const l=i[t];l&&(l.nesting&&l.nesting<0&&r--,l.level=r,l.nesting&&l.nesting>0&&r++,l.type==="text"&&t+1<o&&i[t+1]?.type==="text"?i[t+1].content=l.content+i[t+1].content:(t!==n&&(i[n]=l),n++))}t!==n&&(i.length=n)}var Nb=Ob;const Oh=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Nh="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Pb=new RegExp(`^(?:${Oh}|${Nh}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Bb=new RegExp(`^(?:${Oh}|${Nh})`);function Ph(e){return e===32||e===9||e===10||e===12||e===13}function zb(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||Ph(t)}function Hb(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<e.length;t++){const n=e.charCodeAt(t);if(n===62)return!0;if(!Ph(n))return!1}return!1}function jb(e){const t=e|32;return t>=97&&t<=122}function Vb(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos,i=e.src;if(i.charCodeAt(r)!==60||r+2>=n)return!1;const o=i.charCodeAt(r+1);if(o!==33&&o!==63&&o!==47&&!jb(o))return!1;const l=i.slice(r).match(Pb);if(!l)return!1;const a=l[0];if(!t){const s=e.pushSimple("html_inline","");s.content=a,zb(a)&&e.linkLevel++,Hb(a)&&e.linkLevel--}return e.pos+=a.length,!0}var Wb=Vb;function qb(e,t){let n,r,i,o,l,a,s,c,f="";const u=e.pos,d=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=Il(e,e.pos+1,!1);if(p<0)return!1;if(o=p+1,o<d&&e.src.charCodeAt(o)===40){for(o++;o<d&&(n=e.src.charCodeAt(o),!(n!==32&&n!==10));o++);if(o>=d)return!1;if(a=Sh(e.src,o,e.posMax),a.ok){for(f=e.md.normalizeLink(a.str),e.md.validateLink(f)?o=a.pos:f="",c=o;o<d&&(n=e.src.charCodeAt(o),!(n!==32&&n!==10));o++);if(a=Ah(e.src,o,e.posMax),o<d&&c!==o&&a.ok)for(s=a.str,o=a.pos;o<d&&(n=e.src.charCodeAt(o),!(n!==32&&n!==10));o++);else s=""}if(o>=d||e.src.charCodeAt(o)!==41)return e.pos=u,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o<d&&e.src.charCodeAt(o)===91?(c=o+1,o=Il(e,o),o>=0?i=e.src.slice(c,o++):o=p+1):o=p+1,i||(i=e.src.slice(h,p)),l=e.env.references[oa(i)],!l)return e.pos=u,!1;f=l.href,s=l.title}if(!t){r=e.src.slice(h,p);const m=[];e.md.inline.parse(r,e.md,e.env,m);const v=e.push("image","img",0);v.attrs=[["src",f],["alt",""]],v.children=m,v.content=r,s&&v.attrs.push(["title",s])}return e.pos=o,e.posMax=d,!0}var Ub=qb;function Yb(e,t){let n,r,i,o,l="",a="",s=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const f=e.pos,u=e.posMax,d=e.pos+1,h=Il(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<u&&e.src.charCodeAt(p)===40){for(c=!1,p++;p<u&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(p>=u)return!1;if(i=Sh(e.src,p,e.posMax),i.ok){for(l=e.md.normalizeLink(i.str),e.md.validateLink(l)?p=i.pos:l="",s=p;p<u&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(i=Ah(e.src,p,e.posMax),p<u&&s!==p&&i.ok)for(a=i.str,p=i.pos;p<u&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);}(p>=u||e.src.charCodeAt(p)!==41)&&(c=!0),p++}if(c){if(typeof e.env.references>"u")return!1;if(p<u&&e.src.charCodeAt(p)===91?(s=p+1,p=Il(e,p),p>=0?r=e.src.slice(s,p++):p=h+1):p=h+1,r||(r=e.src.slice(d,h)),o=e.env.references[oa(r)],!o)return e.pos=f,!1;l=o.href,a=o.title}if(!t){e.pos=d,e.posMax=h;const m=e.push("link_open","a",1),v=[["href",l]];m.attrs=v,a&&v.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=u,!0}var Kb=Yb;function Bh(e){const t=e|32;return t>=97&&t<=122}function Zb(e){return e>=48&&e<=57}function Gb(e){return Bh(e)||Zb(e)||e===43||e===45||e===46}function Xb(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&Gb(e.charCodeAt(t));)t--;return t++,t>=e.length||!Bh(e.charCodeAt(t))?null:e.slice(t)}function Qb(e,t,n){let r=t;for(;r<n;){const i=e.charCodeAt(r);if(i<=32||i===127||i===60)break;r++}return e.slice(t,r)}function Jb(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const i=Xb(e.pending);if(!i)return!1;const o=Qb(e.src,n-i.length,r),l=e.md.linkify.matchAtStart(o);if(!l)return!1;let a=l.url;if(a.length<=i.length)return!1;a=a.replace(/\*+$/,"");const s=e.md.normalizeLink(a);if(!e.md.validateLink(s))return!1;if(!t){e.pending=e.pending.slice(0,-i.length);const c=e.push("link_open","a",1);c.attrs=[["href",s]],c.markup="linkify",c.info="auto";const f=e.push("text","",0);f.content=e.md.normalizeLinkText(a);const u=e.push("link_close","a",-1);u.markup="linkify",u.info="auto"}return e.pos+=a.length-i.length,!0}function e_(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n<i;){const o=e.src.charCodeAt(n);if(o!==9&&o!==32)break;n++}return e.pos=n,!0}var t_=e_;function n_(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;const i=e.scanDelims(e.pos,!0);if(!i)return!1;let o=i.length;const l=String.fromCharCode(r);if(o<2)return!1;let a;o%2&&(a=e.push("text","",0),a.content=l,o--);for(let s=0;s<o;s+=2)a=e.push("text","",0),a.content=l+l,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function Bu(e,t){let n;const r=[],i=t.length;for(let o=0;o<i;o++){const l=t[o];if(l.marker!==126||l.end===-1)continue;const a=t[l.end];n=e.tokens[l.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[a.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[a.token-1].type==="text"&&e.tokens[a.token-1].content==="~"&&r.push(a.token-1)}for(;r.length;){const o=r.pop();let l=o+1;for(;l<e.tokens.length&&e.tokens[l].type==="s_close";)l++;l--,o!==l&&(n=e.tokens[l],e.tokens[l]=e.tokens[o],e.tokens[o]=n)}}function r_(e){const t=e.delimiters;Bu(e,t);const n=e.tokens_meta;if(n)for(let r=0;r<n.length;r++)n[r]&&n[r].delimiters&&Bu(e,n[r].delimiters)}const zu={tokenize:n_,postProcess:r_};function Hu(e){switch(e){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!0;default:return!1}}function i_(e,t){const n=e.src,r=e.pos,i=e.posMax;if(r>=i||Hu(n.charCodeAt(r)))return!1;let o=r+1;for(;o<i&&!Hu(n.charCodeAt(o));)o++;return t||(e.pending+=o===r+1?n.charAt(r):n.slice(r,o)),e.pos=o,!0}var o_=i_,ju=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const r=this.rules.findIndex(i=>i.name===e);r>=0&&this.rules.splice(r,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e){return this.rules.find(t=>t.name===e)}before(e,t,n,r){const i=this.rules.findIndex(l=>l.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(l=>l.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i,0,{name:t,fn:n,alt:r?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,r){const i=this.rules.findIndex(l=>l.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(l=>l.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i+1,0,{name:t,fn:n,alt:r?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],r=[];for(const i of n){const o=this.rules.findIndex(l=>l.name===i);if(o<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}this.rules[o].enabled||(this.rules[o].enabled=!0,r.push(i))}return r.length&&this.invalidateCache(),r}disable(e,t){const n=Array.isArray(e)?e:[e],r=[];for(const i of n){const o=this.rules.findIndex(l=>l.name===i);if(o<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}this.rules[o].enabled&&(this.rules[o].enabled=!1,r.push(i))}return r.length&&this.invalidateCache(),r}enableOnly(e){const t=new Set(e);let n=!1;for(const r of this.rules){const i=t.has(r.name);r.enabled!==i&&(r.enabled=i,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 r of this.rules)if(r.enabled&&r.alt)for(const i of r.alt)e.add(i);const t=new Map,n=new Map;for(const r of e){const i=[],o=[];for(const l of this.rules)l.enabled&&(r!==""&&!l.alt?.includes(r)||(i.push(l.fn),o.push({name:l.name,fn:l.fn})));t.set(r,i),n.set(r,o)}this.cache=t,this.namedCache=n}},zh=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;maxNesting;constructor(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.tokens_meta=new Array(r.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.maxNesting=t.options.maxNesting}pushPending(){const e=new en("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 en(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 r=new en(e,t,n);let i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r}scanDelims(e,t){const{src:n,posMax:r}=this,i=n.charCodeAt(e);let o=e;for(;o<r&&n.charCodeAt(o)===i;)o++;const l=o-e,a=e>0?n.charCodeAt(e-1):32,s=o<r?n.charCodeAt(o):32,c=wo(a),f=wo(s),u=Ms(a),d=Ms(s),h=!f&&(!d||c||u),p=!c&&(!u||f||d);return{can_open:h&&(t||!p||u),can_close:p&&(t||!h||d),length:l}}};zh.prototype.Token=en;function Tc(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function l_(e){if(e.length===0)return 0;const t=e.slice().sort((r,i)=>r-i),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function a_(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 Hh(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,r={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:Tc(),records:Object.create(null)};return t.__mdtsRuleProfile=r,r}function Ii(e,t,n,r,i,o){const l=Hh(e);if(!l)return;const a=`${t}:${n}`,s=l.records[a]??(l.records[a]=a_(t,n));s.calls++,s.inclusiveMs+=r,r>s.maxMs&&(s.maxMs=r),s.samples.push(r),o?(s.silentCalls++,i&&s.silentHits++):(s.normalCalls++,i&&s.normalHits++),i&&s.hits++,l.completedAt=Tc()}function s_(e){const t=Hh(e);if(!t)return null;const n=Object.keys(t.records);for(let r=0;r<n.length;r++){const i=t.records[n[r]];i.medianMs=l_(i.samples)}return t.completedAt=Tc(),t}function c_(e){switch(e){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!0;default:return!1}}function jh(e){for(let t=0;t<e.length;t++)if(c_(e.charCodeAt(t)))return!1;return!0}var u_=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];constructor(){this.ruler=new ju,this.ruler2=new ju,this.ruler.push("text",o_),this.ruler.push("linkify",Jb),this.ruler.push("newline",t_),this.ruler.push("escape",Fb),this.ruler.push("backticks",wb),this.ruler.push("strikethrough",zu.tokenize),this.ruler.push("emphasis",Fu.tokenize),this.ruler.push("link",Kb),this.ruler.push("image",Ub),this.ruler.push("autolink",bb),this.ruler.push("html_inline",Wb),this.ruler.push("entity",$b),this.ruler2.push("balance_pairs",Cb),this.ruler2.push("strikethrough",zu.postProcess),this.ruler2.push("emphasis",Fu.postProcess),this.ruler2.push("fragments_join",Nb)}skipToken(e){const t=e.pos,n=this.getRules(),r=this.ruler.getNamedRules(""),i=n.length,o=e.cache,l=o[t],a=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(l!==void 0){e.pos=l;return}let s=!1;if(e.level<e.maxNesting)for(let c=0;c<i;c++){if(e.level++,!a)s=n[c](e,!0);else{const f=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();s=r[c].fn(e,!0);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Ii(e.env,"inline",r[c].name,u-f,!!s,!0)}if(e.level--,s){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;s||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=this.ruler.getNamedRules(""),r=t.length,i=e.posMax,o=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));for(;e.pos<i;){const l=e.pos;let a=!1;if(e.level<e.maxNesting)for(let s=0;s<r;s++){if(!o)a=t[s](e,!1);else{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();a=n[s].fn(e,!1);const f=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Ii(e.env,"inline",n[s].name,f-c,!!a,!1)}if(a){if(l>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(a){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}parseSource(e,t,n,r){if(typeof e=="string"&&e.length>0&&jh(e)){const c=new en("text","",0);c.content=e,r.push(c);return}const i=new zh(e,t,n,r);this.tokenize(i);const o=this.getRules2(),l=this.ruler2.getNamedRules(""),a=o.length,s=!!i.env&&(Object.prototype.hasOwnProperty.call(i.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(i.env,"__mdtsProfileRules"));for(let c=0;c<a;c++)if(!s)o[c](i,!1);else{const f=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l[c].fn(i,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Ii(i.env,"inline2",l[c].name,u-f,!0,!1)}}parse(e,t,n,r){this.parseSource(e,t,n,r)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(""),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function d_(e){const t=e.tokens;for(let n=0,r=t.length;n<r;n++){const i=t[n];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),i.content.length>0&&jh(i.content)){const o=new en("text","",0);o.content=i.content,i.children.push(o);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const f_=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,h_=/[0-9a-z]/i;function p_(e){return/^<a[>\s]/i.test(e)}function m_(e){return/^<\/a\s*>/i.test(e)}function g_(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const r=t.raw[n-1],i=t.raw[n];if(!f_.test(r)||!h_.test(i))continue;const o=t.raw.slice(n),l=e.match(o)?.[0];if(!(!l||l.index!==0||l.lastIndex!==o.length))return{...l,index:t.index+n,lastIndex:t.index+n+l.lastIndex}}return t}function v_(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const r=t[n];if(r.type!=="inline"||!e.md.linkify.pretest(r.content))continue;let i=r.children;i||(i=[],r.children=i);let o=0;for(let l=i.length-1;l>=0;l--){const a=i[l];if(a.type==="link_close"){for(l--;l>=0&&i[l].level!==a.level&&i[l].type!=="link_open";)l--;continue}if(a.type==="html_inline"&&(p_(a.content)&&o>0&&o--,m_(a.content)&&o++),o>0||a.type!=="text"||!e.md.linkify.test(a.content))continue;const s=a.content;let c=(e.md.linkify.match(s)||[]).map(h=>g_(e.md.linkify,h));if(c.length===0)continue;const f=[];let u=a.level,d=0;c.length>0&&c[0].index===0&&l>0&&i[l-1].type==="text_special"&&(c=c.slice(1));for(let h=0;h<c.length;h++){const p=c[h],m=e.md.normalizeLink(p.url);if(!e.md.validateLink(m))continue;let v=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(v)?v=e.md.normalizeLinkText(`mailto:${v}`).replace(/^mailto:/,""):v=e.md.normalizeLinkText(v):v=e.md.normalizeLinkText(`http://${v}`).replace(/^http:\/\//,"");const y=p.index;if(y>d){const _=new en("text","",0);_.content=s.slice(d,y),_.level=u,f.push(_)}const g=new en("link_open","a",1);g.attrs=[["href",m]],g.level=u++,g.markup="linkify",g.info="auto",f.push(g);const b=new en("text","",0);b.content=v,b.level=u,f.push(b);const k=new en("link_close","a",-1);k.level=--u,k.markup="linkify",k.info="auto",f.push(k),d=p.lastIndex}if(d!==0){if(d<s.length){const h=new en("text","",0);h.content=s.slice(d),h.level=u,f.push(h)}i.splice(l,1,...f)}}}}const y_=/\r\n?|\n/g,k_=/\0/g;function b_(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),r=t.includes("\0");if(!n&&!r)return;let i=t;n&&(i=i.replace(y_,`
`)),r&&(i=i.replace(k_,"�")),e.src=i}const Vh=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,__=/\((?:c|tm|r)\)/i,w_=/\((c|tm|r)\)/gi,x_={c:"©",r:"®",tm:"™"};function C_(e,t){return x_[t.toLowerCase()]}function S_(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&(r.content=r.content.replace(w_,C_)),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function A_(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&Vh.test(r.content)&&(r.content=r.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–")),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function T_(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 r=n.content||(Array.isArray(n.children)?n.children.map(i=>i.type==="text"?i.content:"").join(""):"");__.test(r)&&S_(n.children||[]),Vh.test(r)&&A_(n.children||[])}}var D_=class{rules=[];cache=null;namedCache=null;invalidateCache(){this.cache=null,this.namedCache=null}push(e,t){const n=this.rules.findIndex(r=>r.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(r=>r.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 r=this.rules.findIndex(o=>o.name===e);if(r<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(o=>o.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(r,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const r=this.rules.findIndex(o=>o.name===e);if(r<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(o=>o.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(r+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],r=[];for(const i of n){const o=this.rules.findIndex(l=>l.name===i);if(o<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}this.rules[o].enabled||(this.rules[o].enabled=!0,r.push(i))}return r.length&&this.invalidateCache(),r}disable(e,t){const n=Array.isArray(e)?e:[e],r=[];for(const i of n){const o=this.rules.findIndex(l=>l.name===i);if(o<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}this.rules[o].enabled&&(this.rules[o].enabled=!1,r.push(i))}return r.length&&this.invalidateCache(),r}enableOnly(e){const t=new Set(e);let n=!1;for(const r of this.rules){const i=t.has(r.name);r.enabled!==i&&(r.enabled=i,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 E_=/['"]/,Vu=/['"]/g,Wu="’";function Uo(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function M_(e,t){let n;const r=[],i=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let o=0;o<e.length;o++){const l=e[o],a=e[o].level;for(n=r.length-1;n>=0&&!(r[n].level<=a);n--);if(r.length=n+1,l.type!=="text")continue;let s=l.content,c=0,f=s.length;e:for(;c<f;){Vu.lastIndex=c;const u=Vu.exec(s);if(!u)break;let d=!0,h=!0;c=u.index+1;const p=u[0]==="'";let m=32;if(u.index-1>=0)m=s.charCodeAt(u.index-1);else for(n=o-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let v=32;if(c<f)v=s.charCodeAt(c);else for(n=o+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){v=e[n].content.charCodeAt(0);break}const y=$l(m)||Rl(String.fromCharCode(m)),g=$l(v)||Rl(String.fromCharCode(v)),b=wo(m),k=wo(v);if(k?d=!1:g&&(b||y||(d=!1)),b?h=!1:y&&(k||g||(h=!1)),v===34&&u[0]==='"'&&m>=48&&m<=57&&(h=d=!1),d&&h&&(d=y,h=g),!d&&!h){p&&(l.content=Uo(l.content,u.index,Wu));continue}if(h)for(n=r.length-1;n>=0;n--){let _=r[n];if(r[n].level<a)break;if(_.single===p&&r[n].level===a){_=r[n];let T,x;p?(T=i[2]||"‘",x=i[3]||"’"):(T=i[0]||"“",x=i[1]||"”"),l.content=Uo(l.content,u.index,x),e[_.token].content=Uo(e[_.token].content,_.pos,T),c+=x.length-1,_.token===o&&(c+=T.length-1),s=l.content,f=s.length,r.length=n;continue e}}d?r.push({token:o,pos:u.index,single:p,level:a}):h&&p&&(l.content=Uo(l.content,u.index,Wu))}}}function L_(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 r=typeof n.content=="string"?n.content:(n.children||[]).map(i=>i.content||"").join("");!E_.test(r)||!n.children||M_(n.children,e)}}function R_(e){const t=e.tokens||[],n=t.length;for(let r=0;r<n;r++){const i=t[r];if(i.type!=="inline"||!Array.isArray(i.children))continue;const o=i.children,l=o.length;for(let c=0;c<l;c++)o[c].type==="text_special"&&(o[c].type="text");let a=0,s=0;for(;s<l;s++)o[s].type==="text"&&s+1<l&&o[s+1].type==="text"?o[s+1].content=o[s].content+o[s+1].content:(s!==a&&(o[a]=o[s]),a++);s!==a&&(o.length=a)}}function $_(e){switch(e){case 9:case 32:return!0}return!1}function I_(e,t,n,r){const i=e.src,o=e.bMarks,l=e.eMarks,a=e.tShift,s=e.sCount,c=e.bsCount;let f=o[t]+a[t],u=l[t];const d=e.lineMax;if(s[t]-e.blkIndent>=4||i.charCodeAt(f)!==62)return!1;if(r)return!0;const h=[],p=[],m=[],v=[],y=e.md.block.ruler.getRulesForState(e,"blockquote"),g=e.parentType;e.parentType="blockquote";let b=!1,k;for(k=t;k<n;k++){const R=s[k]<e.blkIndent;if(f=o[k]+a[k],u=l[k],f>=u)break;if(i.charCodeAt(f++)===62&&!R){let w=s[k]+1,C,A;i.charCodeAt(f)===32?(f++,w++,A=!1,C=!0):i.charCodeAt(f)===9?(C=!0,(c[k]+w)%4===3?(f++,w++,A=!1):A=!0):C=!1;let M=w;for(h.push(o[k]),o[k]=f;f<u;){const L=i.charCodeAt(f);if($_(L))L===9?M+=4-(M+c[k]+(A?1:0))%4:M++;else break;f++}b=f>=u,p.push(c[k]),c[k]=s[k]+1+(C?1:0),m.push(s[k]),s[k]=M-w,v.push(a[k]),a[k]=f-o[k];continue}if(b)break;let W=!1;for(let w=0,C=y.length;w<C;w++)if(y[w](e,k,n,!0)){W=!0;break}if(W){e.lineMax=k,e.blkIndent!==0&&(h.push(o[k]),p.push(c[k]),v.push(a[k]),m.push(s[k]),s[k]-=e.blkIndent);break}h.push(o[k]),p.push(c[k]),v.push(a[k]),m.push(s[k]),s[k]=-1}const _=e.blkIndent;e.blkIndent=0;const T=e.push("blockquote_open","blockquote",1);T.markup=">";const x=[t,0];T.map=x,e.md.block.tokenize(e,t,k);const S=e.push("blockquote_close","blockquote",-1);S.markup=">",e.lineMax=d,e.parentType=g,x[1]=e.line;for(let R=0;R<v.length;R++)o[R+t]=h[R],a[R+t]=v[R],s[R+t]=m[R],c[R+t]=p[R];return e.blkIndent=_,!0}function F_(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;const o=e.push("code_block","code",0);return o.content=`${e.getLines(t,i,4+e.blkIndent,!1)}
`,o.map=[t,e.line],!0}function O_(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>o)return!1;const l=e.src.charCodeAt(i);if(l!==126&&l!==96)return!1;let a=i;i=e.skipChars(i,l);let s=i-a;if(s<3)return!1;const c=e.src.slice(a,i),f=e.src.slice(i,o);if(l===96&&f.includes(String.fromCharCode(l)))return!1;if(r)return!0;let u=t,d=!1;for(;u++,!(u>=n||(i=a=e.bMarks[u]+e.tShift[u],o=e.eMarks[u],i<o&&e.sCount[u]<e.blkIndent));)if(e.src.charCodeAt(i)===l&&!(e.sCount[u]-e.blkIndent>=4)&&(i=e.skipChars(i,l),!(i-a<s)&&(i=e.skipSpaces(i),!(i<o)))){d=!0;break}s=e.sCount[t],e.line=u+(d?1:0);const h=e.push("fence","code",0);return h.info=f,h.content=e.getLines(t+1,u,s,!0),h.markup=c,h.map=[t,e.line],!0}const qu=["","h1","h2","h3","h4","h5","h6"],Uu=["","#","##","###","####","#####","######"];function Yu(e){switch(e){case 9:case 32:return!0}return!1}function N_(e,t,n,r){const i=e.src,o=e.bMarks,l=e.tShift,a=e.eMarks;let s=o[t]+l[t];const c=a[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let f=i.charCodeAt(s);if(f!==35||s>=c)return!1;let u=1;for(f=i.charCodeAt(++s);f===35&&s<c&&u<=6;)u++,f=i.charCodeAt(++s);if(u>6||s<c&&!Yu(f))return!1;if(r)return!0;let d=s;for(;d<c&&(f=i.charCodeAt(d),!(f!==9&&f!==32));)d++;let h=c;if(h>d&&(f=i.charCodeAt(h-1),f===9||f===32||f===35)){for(;h>d&&(f=i.charCodeAt(h-1),!(f!==9&&f!==32));)h--;let y=h;for(;y>d&&i.charCodeAt(y-1)===35;)y--;for(y>d&&Yu(i.charCodeAt(y-1))&&(h=y);h>d&&(f=i.charCodeAt(h-1),!(f!==9&&f!==32));)h--}e.line=t+1;const p=e.push("heading_open",qu[u],1);p.markup=Uu[u],p.map=[t,e.line];const m=e.push("inline","",0);m.content=i.slice(d,h),m.map=[t,e.line],m.children=[];const v=e.push("heading_close",qu[u],-1);return v.markup=Uu[u],!0}function P_(e){switch(e){case 9:case 32:return!0}return!1}function B_(e,t,n,r){const i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const l=e.src.charCodeAt(o++);if(l!==42&&l!==45&&l!==95)return!1;let a=1;for(;o<i;){const c=e.src.charCodeAt(o++);if(c!==l&&!P_(c))return!1;c===l&&a++}if(a<3)return!1;if(r)return!0;e.line=t+1;const s=e.push("hr","hr",0);return s.map=[t,e.line],s.markup=new Array(a+1).join(String.fromCharCode(l)),!0}const xi=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${["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"].join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${Bb.source}\\s*$`),/^$/,!1]];function z_(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let l=e.src.slice(i,o),a=0;for(;a<xi.length&&!xi[a][0].test(l);a++);if(a===xi.length)return!1;if(r)return xi[a][2];let s=t+1;if(!xi[a][1].test(l)){for(;s<n&&!(e.sCount[s]<e.blkIndent);s++)if(i=e.bMarks[s]+e.tShift[s],o=e.eMarks[s],l=e.src.slice(i,o),xi[a][1].test(l)){l.length!==0&&s++;break}}e.line=s;const c=e.push("html_block","",0);return c.map=[t,s],c.content=e.getLines(t,s,e.blkIndent,!0),!0}function H_(e,t,n){for(let r=t;r<n;r++)if(e.charCodeAt(r)===124)return!0;return!1}function Wh(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function qh(e,t,n){if(t>=n)return!1;const r=e.charCodeAt(t);switch(r){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return r>=48&&r<=57?!0:H_(e,t,n)}const Ku=["","h1","h2"];function j_(e,t,n){const r=e.md.block.ruler.getRulesForState(e,"paragraph"),i=e.src,o=e.bMarks,l=e.tShift,a=e.eMarks,s=e.sCount,c=e.blkIndent,f=Wh(e);if(s[t]-c>=4)return!1;const u=e.parentType;e.parentType="paragraph";let d=0,h,p=t+1;for(;p<n;p++){const k=o[p]+l[p],_=a[p];if(k>=_)break;if(s[p]-c>3)continue;if(s[p]>=c&&(h=i.charCodeAt(k),h===45||h===61)){let x=k+1,S=x;for(;x<_&&i.charCodeAt(x)===h;)x++;for(S=x;x<_;){const R=i.charCodeAt(x);if(R!==9&&R!==32)break;x++}if(x>=_){d=h===61?1:2;break}if(S-k>1)continue}if(s[p]<0||f&&!qh(i,k,_))continue;let T=!1;for(let x=0,S=r.length;x<S;x++)if(r[x](e,p,n,!0)){T=!0;break}if(T)break}if(!d)return!1;let m;if(p===t+1){const k=o[t]+l[t];let _=a[t];for(;_>k;){const T=i.charCodeAt(_-1);if(T!==9&&T!==32)break;_--}m=i.slice(k,_)}else m=e.getLines(t,p,c,!1).trim();e.line=p+1;const v=h===61?"=":"-",y=e.push("heading_open",Ku[d],1);y.markup=v,y.map=[t,e.line];const g=e.push("inline","",0);g.content=m,g.map=[t,e.line-1],g.children=[];const b=e.push("heading_close",Ku[d],-1);return b.markup=v,e.parentType=u,!0}function Uh(e){switch(e){case 9:case 32:return!0}return!1}function Zu(e,t){const n=e.eMarks,r=e.bMarks,i=e.tShift,o=e.src,l=n[t];let a=r[t]+i[t];const s=o.charCodeAt(a++);return s!==42&&s!==45&&s!==43||a<l&&!Uh(o.charCodeAt(a))?-1:a}function Gu(e,t){const n=e.bMarks,r=e.tShift,i=e.eMarks,o=e.src,l=n[t]+r[t],a=i[t];let s=l;if(s+1>=a)return-1;let c=o.charCodeAt(s++);if(c<48||c>57)return-1;for(;;){if(s>=a)return-1;if(c=o.charCodeAt(s++),c>=48&&c<=57){if(s-l>=10)return-1;continue}if(c===41||c===46)break;return-1}return s<a&&(c=o.charCodeAt(s),!Uh(c))?-1:s}function V_(e,t,n){const r=e.bMarks,i=e.tShift,o=e.src,l=r[t]+i[t];let a=0;for(let s=l;s<n-1;s++)a=a*10+o.charCodeAt(s)-48;return a}const W_=["0","1","2","3","4","5","6","7","8","9"];function q_(e,t){const n=e.level+2,r=e.tokens;for(let i=t+2,o=r.length-2;i<o;i++){const l=r[i];if(l.level===n){if(l.type==="paragraph_open"){l.hidden=!0,r[i+2].hidden=!0,i+=2;continue}if(l.nesting===1){let a=1;for(;a>0&&++i<o;)a+=r[i].nesting}}}}function U_(e,t,n,r){let i,o,l=0,a=t,s=!0;if(e.sCount[a]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[a]-e.listIndent>=4&&e.sCount[a]<e.blkIndent)return!1;let c=!1;r&&e.parentType==="paragraph"&&e.sCount[a]>=e.blkIndent&&(c=!0);let f,u,d;const h=e.src,p=e.bMarks,m=e.tShift,v=e.eMarks,y=e.sCount,g=e.bsCount,b=p[a]+m[a];if(b>=v[a])return!1;const k=h.charCodeAt(b);if(k>=48&&k<=57){if(d=Gu(e,a),d<0||(f=!0,l=b,u=V_(e,a,d),c&&u!==1))return!1}else if(k===42||k===45||k===43){if(d=Zu(e,a),d<0)return!1;f=!1}else return!1;if(c&&e.skipSpaces(d)>=v[a])return!1;if(r)return!0;const _=h.charCodeAt(d-1),T=String.fromCharCode(_);if(f){const C=e.push("ordered_list_open","ol",1);u!==void 0&&u!==1&&(C.attrs=[["start",String(u)]])}else e.push("bullet_list_open","ul",1);const x=[a,0];e.tokens[e.tokens.length-1].map=x,e.tokens[e.tokens.length-1].markup=T;let S=!1;const R=e.tokens.length-1,W=e.md.block.ruler.getRulesForState(e,"list"),w=e.parentType;for(e.parentType="list";a<n;){o=d,i=v[a];const C=y[a]+d-(p[a]+m[a]);let A=C;for(;o<i;){const Z=h.charCodeAt(o);if(Z===9)A+=4-(A+g[a])%4;else if(Z===32)A++;else break;o++}const M=o;let L;M>=i?L=1:L=A-C,L>4&&(L=1);const P=C+L,I=e.push("list_item_open","li",1);I.markup=T;const N=[a,0];I.map=N,f&&(I.info=d-l-1===1?W_[h.charCodeAt(l)-48]:h.slice(l,d-1));const V=e.tight,K=e.tShift[a],$=e.sCount[a],H=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=P,e.tight=!0,e.tShift[a]=M-p[a],e.sCount[a]=A,M>=i&&e.isEmpty(a+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,a,n,!0),(!e.tight||S)&&(s=!1),S=e.line-a>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=H,e.tShift[a]=K,e.sCount[a]=$,e.tight=V,e.push("list_item_close","li",-1).markup=T,a=e.line,N[1]=a,a>=n||e.sCount[a]<e.blkIndent||e.sCount[a]-e.blkIndent>=4)break;if(!f){const Z=p[a]+m[a],ne=v[a];if(Z<ne&&h.charCodeAt(Z)===_){const de=Z+1;if(de>=ne){d=de;continue}const be=h.charCodeAt(de);if(be===9||be===32){if(_!==45){d=de;continue}let Te=de+1;for(;Te<ne;){const pe=h.charCodeAt(Te);if(pe!==9&&pe!==32)break;Te++}if(Te>=ne||h.charCodeAt(Te)!==45){d=de;continue}}}}let re=!1;for(let Z=0,ne=W.length;Z<ne;Z++)if(W[Z](e,a,n,!0)){re=!0;break}if(re)break;if(f){if(d=Gu(e,a),d<0)break;l=p[a]+m[a]}else if(d=Zu(e,a),d<0)break;if(_!==h.charCodeAt(d-1))break}return f?e.push("ordered_list_close","ol",-1).markup=T:e.push("bullet_list_close","ul",-1).markup=T,x[1]=a,e.line=a,e.parentType=w,s&&q_(e,R),!0}function Xu(e){return e===9||e===32}function Y_(e,t,n){const r=e.md.block.ruler.getRulesForState(e,"paragraph"),i=e.parentType,o=e.src,l=e.bMarks,a=e.tShift,s=e.eMarks,c=e.sCount,f=e.blkIndent,u=Wh(e);let d=t+1;for(e.parentType="paragraph";d<n&&!e.isEmpty(d);d++){if(c[d]-f>3||c[d]<0)continue;if(i==="list"&&c[d]>=f){const b=l[d]+a[d],k=s[d];if(b<k){const _=o.charCodeAt(b);if(_===42||_===45||_===43){if(b+1>=k||Xu(o.charCodeAt(b+1)))break}else if(_>=48&&_<=57&&b+1<k){let T=b+1;for(;;){if(T>=k){T=-1;break}const x=o.charCodeAt(T++);if(x>=48&&x<=57){if(T-b>=10){T=-1;break}continue}if((x===41||x===46)&&(T>=k||Xu(o.charCodeAt(T))))break;T=-1;break}if(T>=0)break}}}const v=l[d]+a[d],y=s[d];if(u&&!qh(o,v,y))continue;let g=!1;for(let b=0,k=r.length;b<k;b++)if(r[b](e,d,n,!0)){g=!0;break}if(g)break}const h=e.getLines(t,d,f,!1).trim();e.line=d;const p=e.push("paragraph_open","p",1);p.map=[t,e.line];const m=e.push("inline","",0);return m.content=h,m.map=[t,e.line],m.children=[],e.push("paragraph_close","p",-1),e.parentType=i,!0}function Yo(e){switch(e){case 9:case 32:return!0}return!1}function K_(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],l=t+1;const a=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function s(b){const k=e.lineMax;if(b>=k||e.isEmpty(b))return null;let _=!1;if(e.sCount[b]-e.blkIndent>3&&(_=!0),e.sCount[b]<0&&(_=!0),!_){const S=e.parentType;e.parentType="reference";let R=!1;for(let W=0,w=a.length;W<w;W++)if(a[W](e,b,k,!0)){R=!0;break}if(e.parentType=S,R)return null}const T=e.bMarks[b]+e.tShift[b],x=e.eMarks[b];return e.src.slice(T,x+1)}let c=e.src.slice(i,o+1);o=c.length;let f=-1;for(i=1;i<o;i++){const b=c.charCodeAt(i);if(b===91)return!1;if(b===93){f=i;break}else if(b===10){const k=s(l);k!==null&&(c+=k,o=c.length,l++)}else if(b===92&&(i++,i<o&&c.charCodeAt(i)===10)){const k=s(l);k!==null&&(c+=k,o=c.length,l++)}}if(f<0||c.charCodeAt(f+1)!==58)return!1;for(i=f+2;i<o;i++){const b=c.charCodeAt(i);if(b===10){const k=s(l);k!==null&&(c+=k,o=c.length,l++)}else if(!Yo(b))break}const u=e.md.helpers.parseLinkDestination(c,i,o);if(!u.ok)return!1;const d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;const h=i,p=l,m=i;for(;i<o;i++){const b=c.charCodeAt(i);if(b===10){const k=s(l);k!==null&&(c+=k,o=c.length,l++)}else if(!Yo(b))break}let v=e.md.helpers.parseLinkTitle(c,i,o);for(;v.can_continue;){const b=s(l);if(b===null)break;c+=b,i=o,o=c.length,l++,v=e.md.helpers.parseLinkTitle(c,i,o,v)}let y;for(i<o&&m!==i&&v.ok?(y=v.str,i=v.pos):(y="",i=h,l=p);i<o&&Yo(c.charCodeAt(i));)i++;if(i<o&&c.charCodeAt(i)!==10&&y)for(y="",i=h,l=p;i<o&&Yo(c.charCodeAt(i));)i++;if(i<o&&c.charCodeAt(i)!==10)return!1;const g=oa(c.slice(1,f));return g?(r||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[g]>"u"&&(e.env.references[g]={title:y,href:d}),e.line=l),!0):!1}function Ia(e){switch(e){case 9:case 32:return!0}return!1}const Z_=65536;function Fa(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function G_(e,t){for(let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];n<r;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function Qu(e){const t=[],n=e.length;let r=0,i=e.charCodeAt(r),o=!1,l=0,a="";for(;r<n;)i===124&&(o?(a+=e.substring(l,r-1),l=r):(t.push(a+e.substring(l,r)),a="",l=r+1)),o=i===92,r++,i=e.charCodeAt(r);return t.push(a+e.substring(l)),t}function X_(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let o=e.bMarks[i]+e.tShift[i];if(o>=e.eMarks[i])return!1;const l=e.src.charCodeAt(o++);if(l!==124&&l!==45&&l!==58||o>=e.eMarks[i])return!1;const a=e.src.charCodeAt(o++);if(a!==124&&a!==45&&a!==58&&!Ia(a)||l===45&&Ia(a)||!G_(e,t))return!1;for(;o<e.eMarks[i];){const k=e.src.charCodeAt(o);if(k!==124&&k!==45&&k!==58&&!Ia(k))return!1;o++}let s=Fa(e,t+1),c=s.split("|");const f=[];for(let k=0;k<c.length;k++){const _=c[k].trim();if(!_){if(k===0||k===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(_))return!1;_.charCodeAt(_.length-1)===58?f.push(_.charCodeAt(0)===58?"center":"right"):_.charCodeAt(0)===58?f.push("left"):f.push("")}if(s=Fa(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=Qu(s),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const u=c.length;if(u===0||u!==f.length)return!1;if(r)return!0;const d=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),p=e.push("table_open","table",1),m=[t,0];p.map=m;const v=e.push("thead_open","thead",1);v.map=[t,t+1];const y=e.push("tr_open","tr",1);y.map=[t,t+1];for(let k=0;k<c.length;k++){const _=e.push("th_open","th",1);f[k]&&(_.attrs=[["style",`text-align:${f[k]}`]]);const T=e.push("inline","",0);T.content=c[k].trim(),T.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let g,b=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let k=!1;for(let T=0,x=h.length;T<x;T++)if(h[T](e,i,n,!0)){k=!0;break}if(k||(s=Fa(e,i).trim(),!s)||e.sCount[i]-e.blkIndent>=4||(c=Qu(s),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),b+=u-c.length,b>Z_))break;if(i===t+2){const T=e.push("tbody_open","tbody",1);T.map=g=[t+2,0]}const _=e.push("tr_open","tr",1);_.map=[i,i+1];for(let T=0;T<u;T++){const x=e.push("td_open","td",1);f[T]&&(x.attrs=[["style",`text-align:${f[T]}`]]);const S=e.push("inline","",0);S.content=c[T]?c[T].trim():"",S.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return g&&(e.push("tbody_close","tbody",-1),g[1]=i),e.push("table_close","table",-1),m[1]=i,e.parentType=d,e.line=i,!0}var Q_=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,r){const i=this._rules.findIndex(l=>l.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this._rules.findIndex(l=>l.name===t);o>=0&&this._rules.splice(o,1),this._rules.splice(i,0,{name:t,enabled:!0,fn:n,alt:r?.alt||[]}),this.invalidateCache()}after(e,t,n,r){const i=this._rules.findIndex(l=>l.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this._rules.findIndex(l=>l.name===t);o>=0&&this._rules.splice(o,1),this._rules.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:r?.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:r,fn:i})=>(o,l,a,s)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),f=i(o,l,a,s),u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return Ii(o?.env,"block",r,u-c,f,!!s),f}):this.getRules(t)}at(e,t,n){const r=this._rules.findIndex(i=>i.name===e);if(r===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[r].fn=t,n?.alt&&(this._rules[r].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],r=[];return n.forEach(i=>{const o=this._rules.findIndex(l=>l.name===i);if(o===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}this._rules[o].enabled||(this._rules[o].enabled=!0,r.push(i))}),r.length&&this.invalidateCache(),r}disable(e,t){const n=Array.isArray(e)?e:[e],r=[];return n.forEach(i=>{const o=this._rules.findIndex(l=>l.name===i);if(o===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}this._rules[o].enabled&&(this._rules[o].enabled=!1,r.push(i))}),r.length&&this.invalidateCache(),r}enableOnly(e){const t=new Set(e);let n=!1;for(const r of this._rules){const i=t.has(r.name);r.enabled!==i&&(r.enabled=i,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const r of this._rules)if(r.enabled)for(const i of r.alt)e.add(i);const t=Object.create(null),n=Object.create(null);for(const r of e){const i=[],o=[];for(const l of this._rules)l.enabled&&(r!==""&&!l.alt.includes(r)||(i.push(l.fn),o.push({name:l.name,fn:l.fn})));t[r]=i,n[r]=o}this.cache=t,this.namedCache=n}};function Ju(e){switch(e){case 9:case 32:return!0}return!1}var Yh=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r;const i=this.src;let o=0,l=0,a=0,s=!1;for(let c=0,f=i.length;c<f;c++){const u=i.charCodeAt(c);if(!s)if(Ju(u)){o++,u===9?l+=4-l%4:l++;continue}else s=!0;(u===10||c===f-1)&&(u!==10&&c++,this.bMarks.push(a),this.eMarks.push(c),this.tShift.push(o),this.sCount.push(l),this.bsCount.push(0),s=!1,o=0,l=0,a=c+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const i=new en(e,t,0);return i.block=!0,i.level=this.level,this.tokens.push(i),i}const r=new en(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,r=this.eMarks;for(let i=this.lineMax;e<i&&!(t[e]+n[e]<r[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const r=t.charCodeAt(e);if(r!==9&&r!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const r=n.charCodeAt(--e);if(r!==9&&r!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let r=n.length;e<r&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const r=this.src;for(;e>n;)if(t!==r.charCodeAt(--e))return e+1;return e}getLines(e,t,n,r){if(e>=t)return"";if(e+1===t){const f=e,u=this.bMarks[f];let d=u;const h=r?this.eMarks[f]+1:this.eMarks[f];let p=0;const m=this.src,v=this.bsCount,y=this.tShift;for(;d<h&&p<n;){const g=m.charCodeAt(d);if(g===9||g===32)g===9?p+=4-(p+v[f])%4:p++;else if(d-u<y[f])p++;else break;d++}return p>n?new Array(p-n+1).join(" ")+m.slice(d,h):m.slice(d,h)}const i=new Array(t-e),o=this.src,l=this.bMarks,a=this.eMarks,s=this.bsCount,c=this.tShift;for(let f=0,u=e;u<t;u++,f++){let d=0;const h=l[u];let p=h,m;for(u+1<t||r?m=a[u]+1:m=a[u];p<m&&d<n;){const v=o.charCodeAt(p);if(Ju(v))v===9?d+=4-(d+s[u])%4:d++;else if(p-h<c[u])d++;else break;p++}d>n?i[f]=new Array(d-n+1).join(" ")+o.slice(p,m):i[f]=o.slice(p,m)}return i.join("")}};Yh.prototype.Token=en;const Ko=[["table",X_,["paragraph","reference"]],["code",F_],["fence",O_,["paragraph","reference","blockquote","list"]],["blockquote",I_,["paragraph","reference","blockquote","list"]],["hr",B_,["paragraph","reference","blockquote","list"]],["list",U_,["paragraph","reference","blockquote"]],["reference",K_],["html_block",z_,["paragraph","reference","blockquote"]],["heading",N_,["paragraph","reference","blockquote"]],["lheading",j_],["paragraph",Y_]];var J_=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Q_;for(let e=0;e<Ko.length;e++)this.ruler.push(Ko[e][0],Ko[e][1],{alt:(Ko[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const r=this.getRules(),i=this.ruler.getNamedRules(""),o=r.length,l=e.md.options.maxNesting,a=e.bMarks,s=e.tShift,c=e.eMarks,f=e.sCount;let u=t,d=!1;const h=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));for(;u<n;){for(;u<n&&a[u]+s[u]>=c[u];)u++;if(e.line=u,u>=n||f[u]<e.blkIndent)break;if(e.level>=l){e.line=n;break}const p=e.line;let m=!1;for(let v=0;v<o;v++){if(!h)m=r[v](e,u,n,!1);else{const y=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();m=i[v].fn(e,u,n,!1);const g=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Ii(e.env,"block",i[v].name,g-y,m,!1)}if(m){if(p>=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,a[e.line-1]+s[e.line-1]>=c[e.line-1]&&(d=!0),u=e.line,u<n&&a[u]+s[u]>=c[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,r){if(!e||e.length===0)return;const i=new Yh(e,t,n,r);this.tokenize(i,i.line,i.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},Kh=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}};Kh.prototype.Token=en;const ed=[["normalize",b_],["block",gb],["inline",d_],["linkify",v_],["replacements",T_],["smartquotes",L_],["text_join",R_]],ew={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},tw={parseLinkLabel:xc,parseLinkDestination:wc,parseLinkTitle:Cc};function nw(){return{...ew}}function rw(){return{...tw}}var iw=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRules=null;constructor(){this.block=new J_,this.inline=new u_,this.ruler=new D_;for(let e=0;e<ed.length;e++){const[t,n]=ed[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:nw(),helpers:rw(),normalizeLink:Eh,normalizeLinkText:Mh,validateLink:Dh,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new vh),this.fallbackParser.block!==this.block&&(this.fallbackParser.block=this.block),this.fallbackParser.inline!==this.inline&&(this.fallbackParser.inline=this.inline),this.fallbackParser.core=this,this.fallbackParser.linkify=this.linkifyInstance,this.fallbackParser)}createState(e,t={},n){return new Kh(e,this.resolveParser(n),t)}process(e){const t=this.cachedCoreRules??(this.cachedCoreRules=this.ruler.getRules("")),n=this.ruler.getNamedRules(""),r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));for(let i=0;i<t.length;i++){if(!r){t[i](e);continue}const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();n[i].fn(e);const l=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Ii(e.env,"core",n[i].name,l-o,!0,!1)}s_(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&mb(e))return this.parse(Lh(e),t,n);const r=this.createState(e,t,n);return this.process(r),this.lastState=r,r}parse(e,t={},n){if(typeof e!="string")throw new TypeError("Input data should be a String");return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}},ow={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1}},lw={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},aw={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"]}}};const sw=/[&<>"]/,td=/[&<>"]/g,cw=/&/g,uw=/[<>"]/g,dw={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Oa(e){return dw[e]||e}function Ct(e){if(e.length===0)return"";if(e.length<32)return sw.test(e)?e.replace(td,Oa):e;const t=e.includes("&"),n=e.includes("<"),r=e.includes(">"),i=e.includes('"');return!t&&!n&&!r&&!i?e:t&&!n&&!r&&!i?e.replace(cw,"&amp;"):t?e.replace(td,Oa):e.replace(uw,Oa)}const fw=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),hw=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function Zh(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(fw,(t,n,r)=>{if(n)return n;if(hw.test(r)){const i=r[1].toLowerCase()==="x"?Number.parseInt(r.slice(2),16):Number.parseInt(r.slice(1),10);return i>=55296&&i<=57343||i>=128&&i<=159?"�":String.fromCodePoint(i)}return t})}function aa(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function ll(e,t){if(aa(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const nd=e=>aa(e)?e:Promise.resolve(e);function so(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 Ct(e)}}function Vr(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${so(t[0])}="${Ct(t[1])}"`;for(let r=1;r<e.length;r++){const i=e[r];n+=` ${so(i[0])}="${Ct(i[1])}"`}return n}function Gh(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const r=e.charCodeAt(t);if(r===32||r===9||r===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const r=e.charCodeAt(n);if(r!==32&&r!==9&&r!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function co(e,t,n,r,i){if(t.indexOf("<pre")===0)return`${t}
`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${Ct(`${i.langPrefix??"language-"}${r}`)}">${t}</code></pre>
`;const o=e.attrIndex("class"),l=e.attrs?e.attrs.slice():[],a=`${i.langPrefix??"language-"}${r}`;return o<0?l.push(["class",a]):(l[o]=l[o].slice(),l[o][1]+=` ${a}`),`<pre><code${Vr(l)}>${t}</code></pre>
`}return`<pre><code${Vr(e.attrs)}>${t}</code></pre>
`}function Fl(e){return!e.attrs||e.attrs.length===0?`<code>${Ct(e.content)}</code>`:`<code${Vr(e.attrs)}>${Ct(e.content)}</code>`}function Rs(e){const t=Ct(e.content);return e.attrs?`<pre${Vr(e.attrs)}><code>${t}</code></pre>
`:`<pre><code>${t}</code></pre>
`}function pw(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}<p>`;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}<td>`;case"th_open":return`${t}<th>`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}<td style="${Ct(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${Ct(n[0][1])}">`}return null}function rd(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${so(t[0][0])}="${Ct(t[0][1])}">`:t.length===2?`<a ${so(t[0][0])}="${Ct(t[0][1])}" ${so(t[1][0])}="${Ct(t[1][1])}">`:`<a${Vr(t)}>`}function mw(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 id(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 Ol(e,t){if(e.hidden)return"";const n=e.attrs,r=e.nesting,i=e.tag;if(!n||n.length===0)return r===0?t?`<${i} />`:`<${i}>`:r===-1?`</${i}>`:`<${i}>`;let o=(r===-1?"</":"<")+i+Vr(n);return r===0&&t&&(o+=" /"),`${o}>`}const gw={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Zo=Object.prototype.hasOwnProperty,mt={code_inline(e,t){return Fl(e[t])},code_block(e,t){return Rs(e[t])},fence(e,t,n,r,i){const o=e[t],l=o.info?Zh(o.info).trim():"",{langName:a,langAttrs:s}=Gh(l),c=n.highlight,f=Ct(o.content);if(!c)return co(o,f,l,a,n);const u=c(o.content,a,s);return aa(u)?u.then(d=>co(o,d||f,l,a,n)):co(o,u||f,l,a,n)},image(e,t,n,r,i){const o=e[t],l=i.renderInlineAsText(o.children||[],n,r),a=o.attrIndex("alt");return a>=0&&o.attrs?o.attrs[a][1]=l:o.attrs?o.attrs.push(["alt",l]):o.attrs=[["alt",l]],Ol(o,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
`:`<br>
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
`:`<br>
`:`
`},text(e,t){return Ct(e[t].content)},text_special(e,t){return Ct(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function od(e,t,n){const r=e.info?Zh(e.info).trim():"",{langName:i,langAttrs:o}=Gh(r),l=t.highlight,a=Ct(e.content);if(!l)return co(e,a,r,i,t);const s=l(e.content,i,o);if(aa(s))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return co(e,s||a,r,i,t)}function Go(e,t,n,r,i,o,l){const a=e[0];switch(a.type){case"text":if(i.text===mt.text)return a.content.length===0?"":Ct(a.content);break;case"text_special":if(i.text_special===mt.text_special)return a.content.length===0?"":Ct(a.content);break;case"softbreak":if(i.softbreak===mt.softbreak)return l;break;case"hardbreak":if(i.hardbreak===mt.hardbreak)return o;break;case"html_inline":if(i.html_inline===mt.html_inline)return a.content;break;case"code_inline":if(i.code_inline===mt.code_inline)return Fl(a);break}const s=i[a.type];if(!s)return Ol(a,t.xhtmlOut===!0);const c=s(e,0,t,n,r);return typeof c=="string"?c:ll(c,a.type)}var vw=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...mt}}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 r=this.mergeOptions(t),i=n??{},o=this.rules,l=r.xhtmlOut===!0;let a,s,c,f,u,d,h="",p="",m=!1,v="";for(let y=0;y<e.length;y++){const g=e[y],b=g.type,k=y>0&&e[y-1].hidden?`
`:"";if(b==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&y+3<e.length){const x=e[y+1],S=e[y+2],R=e[y+3];if(x.type==="paragraph_open"&&x.hidden&&S.type==="inline"&&R.type==="paragraph_close"&&R.hidden){v+=`${k}<li>${this.renderInlineTokens(S.children||[],r,i)}`,y+=3;continue}}if(y+2<e.length){const x=e[y+1],S=e[y+2];if(x.type==="inline"&&S.nesting===-1&&S.tag===g.tag&&!S.hidden){const R=pw(g,k);if(R!==null){v+=`${R+this.renderInlineTokens(x.children||[],r,i)}</${g.tag}>
`,y+=2;continue}}}if(b==="inline"){const x=g.children||[];if(x.length===1){m||(a=o.text,s=o.text_special,c=o.softbreak,f=o.hardbreak,u=o.html_inline,d=o.code_inline,h=r.xhtmlOut?`<br />
`:`<br>
`,p=r.breaks?h:`
`,m=!0);const S=x[0];switch(S.type){case"text":if(a===mt.text){v+=Ct(S.content);continue}break;case"text_special":if(s===mt.text_special){v+=Ct(S.content);continue}break;case"softbreak":if(c===mt.softbreak){v+=p;continue}break;case"hardbreak":if(f===mt.hardbreak){v+=h;continue}break;case"html_inline":if(u===mt.html_inline){v+=S.content;continue}break;case"code_inline":if(d===mt.code_inline){v+=Fl(S);continue}break}}v+=this.renderInlineTokens(x,r,i);continue}const _=o[b];if(!_){const x=g.attrs;if(!g.hidden){if(!x||x.length===0)switch(b){case"hr":v+=l?`<hr />
`:`<hr>
`;continue;case"heading_open":v+=`<${g.tag}>`;continue;case"heading_close":v+=`</${g.tag}>
`;continue;case"paragraph_open":v+=`${k}<p>`;continue;case"paragraph_close":v+=`</p>
`;continue;case"list_item_open":{const S=e[y+1];v+=k+(S&&(S.type==="inline"||S.hidden||S.nesting===-1&&S.tag==="li")?"<li>":`<li>
`);continue}case"list_item_close":v+=`</li>
`;continue;case"bullet_list_open":v+=`${k}<ul>
`;continue;case"bullet_list_close":v+=`</ul>
`;continue;case"blockquote_open":v+=k+(e[y+1]&&e[y+1].nesting===-1&&e[y+1].tag==="blockquote"?"<blockquote>":`<blockquote>
`);continue;case"blockquote_close":v+=`</blockquote>
`;continue;case"ordered_list_open":v+=`${k}<ol>
`;continue;case"ordered_list_close":v+=`</ol>
`;continue;case"table_open":v+=`${k}<table>
`;continue;case"table_close":v+=`</table>
`;continue;case"thead_open":v+=`${k}<thead>
`;continue;case"thead_close":v+=`</thead>
`;continue;case"tbody_open":v+=`${k}<tbody>
`;continue;case"tbody_close":v+=`</tbody>
`;continue;case"tr_open":v+=`${k}<tr>
`;continue;case"tr_close":v+=`</tr>
`;continue;case"td_open":v+=`${k}<td>`;continue;case"td_close":v+=`</td>
`;continue;case"th_open":v+=`${k}<th>`;continue;case"th_close":v+=`</th>
`;continue}else if(x.length===1){const S=x[0];if(b==="ordered_list_open"&&S[0]==="start"){v+=`${k}<ol start="${Ct(S[1])}">
`;continue}if(b==="td_open"&&S[0]==="style"){v+=`${k}<td style="${Ct(S[1])}">`;continue}if(b==="th_open"&&S[0]==="style"){v+=`${k}<th style="${Ct(S[1])}">`;continue}}}v+=this.renderToken(e,y,r);continue}if(b==="code_block"&&_===mt.code_block){v+=Rs(g);continue}if(b==="fence"&&_===mt.fence){v+=od(g,r);continue}if(b==="html_block"&&_===mt.html_block){v+=g.content;continue}const T=_(e,y,r,i,this);typeof T=="string"?v+=T:v+=ll(T,g.type)}return v}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const r=this.mergeOptions(t),i=n??{},o=this.rules;let l="";for(let a=0;a<e.length;a++){const s=e[a];if(s.type==="inline"){l+=await this.renderInlineTokensAsync(s.children||[],r,i);continue}const c=o[s.type];c?l+=await nd(c(e,a,r,i,this)):l+=this.renderToken(e,a,r)}return l}renderInline(e,t,n){const r=this.mergeOptions(t),i=n??{};return this.renderInlineTokens(e,r,i)}async renderInlineAsync(e,t,n){const r=this.mergeOptions(t),i=n??{};return this.renderInlineTokensAsync(e,r,i)}renderInlineAsText(e,t,n){const r=this.mergeOptions(t),i=n??{};return this.renderInlineAsTextInternal(e,r,i)}renderAttrs(e){return Vr(e.attrs)}renderToken(e,t,n){const r=e[t];if(r.hidden)return"";const i=r.block,o=r.nesting,l=r.tag,a=r.attrs;let s=!1;if(i&&(s=!0,o===1&&t+1<e.length)){const d=e[t+1];(d.type==="inline"||d.hidden||d.nesting===-1&&d.tag===l)&&(s=!1)}const c=i&&o!==-1&&t>0&&e[t-1].hidden?`
`:"",f=s?`>
`:">";if(!a||a.length===0)return o===0?n.xhtmlOut?`${c}<${l} /${f}`:`${c}<${l}${f}`:o===-1?`${c}</${l}${f}`:`${c}<${l}${f}`;let u=c+(o===-1?"</":"<")+l+Vr(a);return o===0&&n.xhtmlOut&&(u+=" /"),u+f}mergeOptions(e){const t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null;const r=()=>(n||(n={...t}),n);if(Zo.call(e,"highlight")&&e.highlight!==t.highlight&&(r().highlight=e.highlight),Zo.call(e,"langPrefix")){const i=e.langPrefix;i!==t.langPrefix&&(r().langPrefix=i)}if(Zo.call(e,"xhtmlOut")){const i=e.xhtmlOut;i!==t.xhtmlOut&&(r().xhtmlOut=i)}if(Zo.call(e,"breaks")){const i=e.breaks;i!==t.breaks&&(r().breaks=i)}return n||t}buildNormalizedBase(){return Object.freeze({...gw,...this.baseOptions})}renderSingleToken(e,t,n,r){const i=this.rules,o=t.type;if(o==="code_block"&&i.code_block===mt.code_block)return Rs(t);if(o==="html_block"&&i.html_block===mt.html_block)return t.content;const l=this.mergeOptions(n),a=r??{};if(o==="inline")return this.renderInlineTokens(t.children||[],l,a);const s=i[o];if(!s)return t.block?this.renderToken(e,0,l):Ol(t,l.xhtmlOut===!0);if(o==="fence"&&s===mt.fence)return od(t,l);const c=s(e,0,l,a,this);return typeof c=="string"?c:ll(c,o)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const r=this.rules,i=r.text,o=r.text_special,l=r.softbreak,a=r.hardbreak,s=r.html_inline,c=r.code_inline,f=r.link_open,u=r.link_close,d=r.em_open,h=r.em_close,p=r.strong_open,m=r.strong_close,v=t.xhtmlOut===!0,y=v?`<br />
`:`<br>
`,g=t.breaks?y:`
`;if(e.length===1)return Go(e,t,n,this,r,y,g);let b="";for(let k=0;k<e.length;k++){const _=e[k];if(_.type==="link_open"&&!f&&!u&&k+2<e.length){const S=e[k+1];if(e[k+2].type==="link_close"&&mw(S)){const R=`${rd(_)+Go([S],t,n,this,r,y,g)}</a>`;if(l===mt.softbreak&&k+3<e.length&&e[k+3].type==="softbreak"){b+=R+g,k+=3;continue}b+=R,k+=2;continue}}if(_.type==="link_open"&&!f&&!u&&k+1<e.length&&e[k+1].type==="link_close"){b+=`${rd(_)}</a>`,k+=1;continue}if(_.type==="em_open"&&!d&&!h&&k+2<e.length){const S=e[k+1];if(e[k+2].type==="em_close"&&id(S)){b+=`<em>${Go([S],t,n,this,r,y,g)}</em>`,k+=2;continue}}if(_.type==="strong_open"&&!p&&!m&&k+2<e.length){const S=e[k+1];if(e[k+2].type==="strong_close"&&id(S)){b+=`<strong>${Go([S],t,n,this,r,y,g)}</strong>`,k+=2;continue}}switch(_.type){case"text":if(i===mt.text){const S=_.content.length===0?"":Ct(_.content);if(s===mt.html_inline&&k+1<e.length&&e[k+1].type==="html_inline"){for(b+=S+e[++k].content;k+1<e.length&&e[k+1].type==="html_inline";)b+=e[++k].content;continue}b+=S;continue}break;case"text_special":if(o===mt.text_special){_.content.length!==0&&(b+=Ct(_.content));continue}break;case"softbreak":if(l===mt.softbreak){b+=g;continue}break;case"hardbreak":if(a===mt.hardbreak){b+=y;continue}break;case"html_inline":if(s===mt.html_inline){for(b+=_.content;k+1<e.length&&e[k+1].type==="html_inline";)b+=e[++k].content;continue}break;case"code_inline":if(c===mt.code_inline){b+=Fl(_);continue}break}const T=r[_.type];if(!T){b+=_.block?this.renderToken(e,k,t):Ol(_,v);continue}const x=T(e,k,t,n,this);typeof x=="string"?b+=x:b+=ll(x,_.type)}return b}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const r=this.rules;let i="";for(let o=0;o<e.length;o++){const l=r[e[o].type];l?i+=await nd(l(e,o,t,n,this)):i+=this.renderToken(e,o,t)}return i}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let r="";for(let i=0;i<e.length;i++){const o=e[i];switch(o.type){case"text":case"text_special":r+=o.content;break;case"image":r+=this.renderInlineAsTextInternal(o.children||[],t,n);break;case"html_inline":case"html_block":r+=o.content;break;case"softbreak":case"hardbreak":r+=`
`;break}}return r}},yw=vw;const kw={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0};function Nl(e,t,n={},r){const i={...kw,...r||{}};let o=al(t,i);i.maxChunks&&o.length>i.maxChunks&&(o=ww(o,i.maxChunks));let l=0;const a=[];try{n.__mdtsChunkInfo={count:o.length,maxChunkChars:i.maxChunkChars,maxChunkLines:i.maxChunkLines}}catch{}for(let s=0;s<o.length;s++){const c=o[s],f=t.slice(c.start,c.end),u=e.core.parse(f,n,e).tokens;l!==0&&u.length&&bw(u,l),_w(a,u),l+=c.lineCount}return a}function al(e,t,n=!0){const r=[];let i=0,o=0,l=0,a=0,s=0,c=0,f=null;function u(d){d<=l||(r.push({start:l,end:d,lineCount:a}),l=d,i=0,o=0,a=0)}for(let d=0;d<e.length;){let h=e.indexOf(`
`,d),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const m=xw(e,d,h);if(t.fenceAware){let g=d;for(;g<h;){const k=e.charCodeAt(g);if(k===32||k===9)g++;else break}const b=e[g];if(b==="`"||b==="~"){let k=g;for(;k<h&&e[k]===b;)k++;const _=k-g;_>=3&&(f?f.marker===b&&_>=f.length&&(f=null):f={marker:b,length:_})}}const v=p-d;i+=v,o+=1,a+=1,m?(s=0,c=0):(s+=1,c+=v);const y=m;if((i>=t.maxChunkChars||o>=t.maxChunkLines)&&!f)if(y)u(p);else{const g=Math.max(10,Math.floor(t.maxChunkLines*.5)),b=Math.max(t.maxChunkChars,8e3);(s>=g||c>=b)&&u(p)}d=p}return n&&u(e.length),r}function bw(e,t){if(t===0)return;const n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);for(;n.length;){const r=n.pop();if(r.map&&(r.map[0]+=t,r.map[1]+=t),r.children)for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}}function _w(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function ww(e,t){if(e.length<=t)return e;const n=[];let r=0;for(let i=0;i<t;i++){const o=t-i,l=e.length-r,a=Math.ceil(l/o),s=e.slice(r,r+a);let c=0;for(let f=0;f<s.length;f++)c+=s[f].lineCount;n.push({start:s[0].start,end:s[s.length-1].end,lineCount:c}),r+=a}return n}function xw(e,t,n){for(let r=t;r<n;r++){const i=e.charCodeAt(r);if(i!==32&&i!==9&&i!==13)return!1}return!0}const Fi=(e,t,n)=>e<t?t:e>n?n:e,ld=[{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"}],ad=[{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 Xh(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function Cw(e,t=Math.max(0,e/40|0),n={}){const r=n.fullChunkFenceAware??!0,i=n.fullChunkTargetChunks??8,o=n.fullChunkAdaptive!==!1;for(let l=0;l<ld.length;l++){const a=ld[l];if(e<=a.max){if(a.strategy!=="adaptive")return Xh(r,a);break}}return e>5e6?{strategy:"plain",fenceAware:r,notes:">5M plain"}:o?{strategy:"adaptive",maxChunkChars:Fi(Math.ceil(e/i),8e3,64e3),maxChunkLines:Fi(Math.ceil(t/i),150,700),maxChunks:Fi(Math.ceil(e/64e3),i,16),fenceAware:r,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:n.fullChunkSizeChars??1e4,maxChunkLines:n.fullChunkSizeLines??200,fenceAware:r,maxChunks:n.fullChunkMaxChunks}}function sd(e,t=Math.max(0,e/40|0),n={}){const r=n.streamChunkFenceAware??!0,i=n.streamChunkTargetChunks??8,o=n.streamChunkAdaptive!==!1;for(let l=0;l<ad.length;l++){const a=ad[l];if(e<=a.max){if(a.strategy!=="adaptive")return Xh(r,a);break}}return e>5e6?{strategy:"plain",fenceAware:r,notes:">5M plain"}:o?{strategy:"adaptive",maxChunkChars:Fi(Math.ceil(e/i),8e3,64e3),maxChunkLines:Fi(Math.ceil(t/i),150,700),maxChunks:Fi(Math.ceil(e/64e3),i,32),fenceAware:r,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:n.streamChunkSizeChars??1e4,maxChunkLines:n.streamChunkSizeLines??200,maxChunks:n.streamChunkMaxChunks,fenceAware:r}}const Qh=4e6,Jh=8e4,Sw=1e4,Aw=200,Tw=1e4,Dw=200;function ep(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Ew(e,t){if(t===0)return;const n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);for(;n.length;){const r=n.pop();if(r.map&&(r.map[0]+=t,r.map[1]+=t),r.children)for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}}function Ci(e){return e.length===0?0:zt(e)+(e.charCodeAt(e.length-1)===10?0:1)}function Mw(e,t,n){for(let r=t;r<n;r++){const i=e.charCodeAt(r);if(i!==32&&i!==9&&i!==13)return!1}return!0}function Lw(e,t){if(!t||e.length===0)return!1;let n=null;for(let r=0;r<e.length;){let i=e.indexOf(`
`,r);i===-1&&(i=e.length);let o=r;for(;o<i;){const a=e.charCodeAt(o);if(a===32||a===9)o++;else break}const l=e[o];if(l==="`"||l==="~"){let a=o;for(;a<i&&e[a]===l;)a++;const s=a-o;s>=3&&(n?n.marker===l&&s>=n.length&&(n=null):n={marker:l,length:s})}r=i===e.length?e.length:i+1}return n!==null}function Rw(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 Mw(e,n+1,e.length-1)?!Lw(e,t):!1}function $w(e,t,n,r={}){const i=r.mode??"full",o=r.fenceAware??(i==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(r.maxChunkChars!==void 0||r.maxChunkLines!==void 0||r.autoTune===!1){const l=r.maxChunkChars??(i==="stream"?e.options.streamChunkSizeChars??Tw:e.options.fullChunkSizeChars??Sw),a=r.maxChunkLines??(i==="stream"?e.options.streamChunkSizeLines??Dw:e.options.fullChunkSizeLines??Aw);return{maxChunkChars:l,maxChunkLines:a,holdBelowChars:l,holdBelowLines:a,fenceAware:o}}return i==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:o}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:o}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:o}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:o}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:o}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:o}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:o}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:o}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:o}}var Mo=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;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=Ci(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const r=al(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!r.length)return this.updateEnvDiagnostics(e,t,n),null;const i=this.commitRanges(r,e);return this.pending=this.pending.slice(i),this.updateEnvDiagnostics(e,t,Ci(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!Rw(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,Ci(this.pending)),null;const n=al(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);return n.length?(this.commitRanges(n,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens):(this.updateEnvDiagnostics(e,t,Ci(this.pending)),null)}flushForce(e={}){if(!this.pending){const r=this.resolveWindow();return this.updateEnvDiagnostics(e,r,0),this.tokens}const t=this.resolveWindow(),n=al(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);return n.length&&(this.commitRanges(n,e),this.pending=""),this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending="",this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??"full",fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:Ci(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+Ci(this.pending);return $w(this.md,e,t,this.options)}commitRanges(e,t){if(!e.length)return 0;let n=0;for(let r=0;r<e.length;r++){const i=e[r],o=this.pending.slice(i.start,i.end),l=this.md.core.parse(o,t,this.md).tokens,a=this.committedChars,s=this.committedLines;s!==0&&l.length&&Ew(l,s),this.options.retainTokens!==!1&&ep(this.tokens,l),this.committedChars+=o.length,this.committedLines+=i.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(l,{chunkIndex:this.parsedChunks,chunkChars:o.length,chunkLines:i.lineCount,tokenCount:l.length,startOffset:a,endOffset:this.committedChars,startLine:s,endLine:this.committedLines}),n=i.end}return n}updateEnvDiagnostics(e,t,n){try{e.__mdtsUnboundedInfo={mode:this.options.mode??"full",maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:n,fedChunks:this.fedChunks,parsedChunks:this.parsedChunks}}catch{}}};function Iw(e,t,n={},r={}){const i=new Mo(e,{mode:"full",...r});for(const o of t)i.feed(o),i.flushAvailable(n);return i.flushForce(n)}async function Fw(e,t,n={},r={}){const i=new Mo(e,{mode:"full",...r});for await(const o of t)i.feed(o),i.flushAvailable(n);return i.flushForce(n)}function Ow(e,t,n,r={},i={}){const o=new Mo(e,{mode:"full",...i,retainTokens:!1,onChunkTokens:n});for(const l of t)o.feed(l),o.flushAvailable(r);return o.flushForce(r),o.stats()}async function Nw(e,t,n,r={},i={}){const o=new Mo(e,{mode:"full",...i,retainTokens:!1,onChunkTokens:n});for await(const l of t)o.feed(l),o.flushAvailable(r);return o.flushForce(r),o.stats()}function tp(e,t,n){if(e.options.autoUnbounded===!1)return!1;const r=e.options.autoUnboundedThresholdChars??Qh,i=e.options.autoUnboundedThresholdLines??Jh;return t>=r||n>=i}function np(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??Qh))return"yes";const r=e.options.autoUnboundedThresholdLines??Jh;return n!==void 0?n>=r?"yes":"no":t+1<r?"no":"need-lines"}function uo(e,t,n={},r={}){const i=[],o=new Mo(e,{mode:"full",...r,retainTokens:!1,onChunkTokens(l){ep(i,l)}});return o.feed(t),o.flushForce(n),i}const Pw=[];function cd(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var Bw=class{core;cache=null;stats=cd();MIN_SIZE_FOR_OPTIMIZATION=1e3;DEFAULT_SKIP_CACHE_CHARS=1e6;DEFAULT_SKIP_CACHE_LINES=1e5;IMPLICIT_STREAM_CHUNK_MIN_CHARS=16e4;MIN_LIST_LINES_FOR_MERGE=80;MIN_LIST_CHARS_FOR_MERGE=800;MIN_TABLE_LINES_FOR_MERGE=48;MIN_TABLE_CHARS_FOR_MERGE=1200;MIN_UNBOUNDED_APPEND_TOTAL_CHARS=5e5;MIN_UNBOUNDED_APPEND_CHARS=64e3;MIN_UNBOUNDED_APPEND_LINES=700;constructor(e){this.core=e}reset(){this.cache=null,this.stats.resets+=1,this.stats.lastMode="reset"}resetStats(){const{resets:e}=this.stats;this.stats=cd(),this.stats.resets=e}parse(e,t,n){const r=t,i=this.cache;if(!i||r&&r!==i.env){const S=r??{},R=!!n.__explicitStreamChunkFallbackSetting,W=!!n.options?.streamChunkedFallback,w=!R,C=W||w,A=n.options?.streamChunkAdaptive!==!1,M=n.options?.streamChunkTargetChunks??8,L=n.options?.streamChunkSizeChars,P=n.options?.streamChunkSizeLines,I=n.options?.streamChunkMaxChunks,N=!!n.__explicitStreamChunkConfig,V=n.options?.autoTuneChunks!==!1,K=n.options?.streamChunkFenceAware??!0,$=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,H=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let re,Z=e.length>=$;if(!Z&&H!==void 0&&(re=zt(e),Z=re>=H),Z){const de=this.parseFullDocument(e,S,n,re,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",sn(S,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!S.__mdtsUnboundedInfo}),de.tokens}else if(C){const de=(Je,bt,vt)=>Je<bt?bt:Je>vt?vt:Je;re===void 0&&(re=zt(e));const be=V&&!N?sd(e.length,re,n.options):null,Te=be?.maxChunkChars??(A?de(Math.ceil(e.length/M),8e3,64e3):L??1e4),pe=be?.maxChunkLines??(A?de(Math.ceil(re/M),150,700):P??200),ke=be?.maxChunks??(A?de(Math.ceil(e.length/64e3),M,32):I),Me=e.length>0&&e.charCodeAt(e.length-1)===10,et=w&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&be?.strategy!=="plain";if((W||et)&&(e.length>=Te*2||re>=pe*2)&&Me){const Je=Nl(n,e,S,{maxChunkChars:Te,maxChunkLines:pe,fenceAware:be?.fenceAware??K,maxChunks:ke});return this.cache={src:e,tokens:Je,env:S,lineCount:re,lastSegment:void 0},this.updateCacheLineCount(this.cache,re),this.stats.total+=1,this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",sn(S,{area:"stream",path:"stream-chunked",chunked:!0,reason:W?"explicit-initial-large-doc":"default-initial-large-doc"}),Je}}const ne=this.parseFullDocument(e,S,n,re);return re=ne.lineCount,this.cache={src:e,tokens:ne.tokens,env:S,lineCount:re,lastSegment:void 0},this.updateCacheLineCount(this.cache,re),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",sn(S,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!S.__mdtsUnboundedInfo}),ne.tokens}if(e===i.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",sn(i.env,{area:"stream",path:"stream-cache",reason:"same-source"}),i.tokens;const o=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(i.src.length<o&&e.length<o*1.5&&!e.startsWith(i.src)){const S=r??i.env,R=this.parseFullDocument(e,S,n),W=R.tokens,w=R.lineCount;return this.cache={src:e,tokens:W,env:S,lineCount:w,lastSegment:void 0},this.updateCacheLineCount(this.cache,w),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",sn(S,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!S.__mdtsUnboundedInfo}),W}const l=this.getAppendedSegment(i.src,e);if(l&&!this.shouldPreferTailReparseForAppend(i)){let M=function($){const H=$.length;let re=0;for(;re<=H;){let Z=$.indexOf(`
`,re);Z===-1&&(Z=H);const ne=Z<H;let de=re,be=0;for(;de<Z;){const Te=$.charCodeAt(de);if(Te===32){if(be++,de++,be>=4)return!0;continue}if(Te===9){if(be+=4-be%4,de++,be>=4)return!0;continue}break}if(de<Z){const Te=$.charCodeAt(de);switch(Te){case 35:{let pe=de;for(;pe<Z&&$.charCodeAt(pe)===35;)pe++;const ke=pe-de;if(ke>0&&ke<=6){if(pe<Z){const Me=$.charCodeAt(pe);if(Me===32||Me===9||Me===13)return!0}else if(pe===Z&&ne)return!0}break}case 62:{const pe=de+1;if(pe<Z){const ke=$.charCodeAt(pe);if(ke===32||ke===9||ke===13)return!0}else if(pe===Z&&ne)return!0;break}case 45:case 42:case 43:{const pe=de+1;if(pe<Z){const ke=$.charCodeAt(pe);if(ke===32||ke===9||ke===13)return!0}else if(pe===Z&&ne)return!0;break}case 96:case 126:{let pe=de;for(;pe<Z&&$.charCodeAt(pe)===Te;)pe++;if(pe-de>=3)return!0;break}default:if(Te>=48&&Te<=57){let pe=de+1;for(;pe<Z;){const ke=$.charCodeAt(pe);if(ke<48||ke>57)break;pe++}if(pe<Z&&$.charCodeAt(pe)===46){const ke=pe+1;if(ke<Z){const Me=$.charCodeAt(ke);if(Me===32||Me===9||Me===13)return!0}else if(ke===Z&&ne)return!0}}break}}if(Z===H)break;re=Z+1}return!1};const S=i.lineCount??zt(i.src);let R=3;l.length>5e3?R=8:l.length>1e3?R=6:l.length>200&&(R=4),R=Math.min(R,S);let W=null;const w=n.options?.streamContextParseStrategy??"chars",C=n.options?.streamContextParseMinChars??200,A=n.options?.streamContextParseMinLines??2;let L=null;const P=()=>(L===null&&(L=zt(l)),L),I=this.canDirectlyParseAppend(i),N=I&&this.shouldUseUnboundedAppend(e,i,l);let V=!1;if(!I)switch(w){case"lines":V=P()>=A;break;case"constructs":if(l.length>=C){V=!0;break}if(M(l)){V=!0;break}V=P()>=A;break;default:V=l.length>=C}if(R>0&&V){const $=this.getTailLines(i.src,R)+l;try{const H=this.core.parse($,i.env,n).tokens,re=H.findIndex(Z=>Z.map&&typeof Z.map[1]=="number"&&Z.map[1]>=R);if(re!==-1){const Z=H.slice(re),ne=S-R;ne!==0&&this.shiftTokenLines(Z,ne),W={tokens:Z}}}catch{W=null}}else W=null;if(!W){const $=S;if(N)W={tokens:uo(n,l,i.env,{mode:"stream"})},$>0&&this.shiftTokenLines(W.tokens,$);else{const H=this.core.parse(l,i.env,n);$>0&&this.shiftTokenLines(H.tokens,$),W=H}}if(i.tokens.length>0&&W.tokens.length>0){const $=i.tokens[i.tokens.length-1],H=W.tokens[0];try{$.type==="inline"&&H.type==="inline"&&(H.children&&H.children.length>0&&($.children||($.children=[]),this.appendTokens($.children,H.children)),$.content=($.content||"")+(H.content||""),W.tokens.shift())}catch{}}const K=i.tokens.length;if(W.tokens.length>0){let Z=function(de,be){return!de||!be||de.type!==be.type?!1:de.type==="inline"?(de.content||"")===(be.content||""):!0};const $=i.tokens,H=W.tokens,re=Math.min($.length,H.length);let ne=0;for(let de=re;de>0;de--){let be=!0;for(let Te=0;Te<de;Te++){const pe=$[$.length-de+Te],ke=H[Te];if(!Z(pe,ke)){be=!1;break}}if(be){ne=de;break}}ne>0&&H.splice(0,ne),H.length>0&&this.appendTokens(i.tokens,H)}if(i.src=e,i.lineCount=S+(L??zt(l)),i.tokens.length>K){const $=this.getLastSegment(i.tokens.slice(K),e);$?i.lastSegment={tokenStart:K+$.tokenStart,tokenEnd:K+$.tokenEnd,lineStart:$.lineStart,lineEnd:$.lineEnd,srcOffset:$.srcOffset}:i.lastSegment=void 0}else i.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,N&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",sn(i.env,{area:"stream",path:N?"stream-unbounded-append":"stream-append",reason:N?"large-delta":"safe-append",unbounded:N}),i.tokens}const a=r??i.env,s=this.tryTailSegmentReparse(e,i,a,n);if(s)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",sn(a,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),s;const c=!!n.__explicitStreamChunkFallbackSetting,f=!!n.options?.streamChunkedFallback,u=!c&&!l,d=f||u,h=n.options?.streamChunkAdaptive!==!1,p=n.options?.streamChunkTargetChunks??8,m=n.options?.streamChunkSizeChars,v=n.options?.streamChunkSizeLines,y=n.options?.streamChunkMaxChunks,g=!!n.__explicitStreamChunkConfig,b=n.options?.autoTuneChunks!==!1,k=n.options?.streamChunkFenceAware??!0;let _=i.lineCount;if(d){_===void 0&&(_=zt(e));const S=(L,P,I)=>L<P?P:L>I?I:L,R=b&&!g?sd(e.length,_,n.options):null,W=R?.maxChunkChars??(h?S(Math.ceil(e.length/p),8e3,64e3):m??1e4),w=R?.maxChunkLines??(h?S(Math.ceil(_/p),150,700):v??200),C=R?.maxChunks??(h?S(Math.ceil(e.length/64e3),p,32):y),A=e.length>0&&e.charCodeAt(e.length-1)===10,M=u&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&R?.strategy!=="plain";if((f||M)&&(e.length>=W*2||_>=w*2)&&A){const L=Nl(n,e,a,{maxChunkChars:W,maxChunkLines:w,fenceAware:R?.fenceAware??k,maxChunks:C});return this.cache={src:e,tokens:L,env:a,lineCount:_,lastSegment:void 0},this.updateCacheLineCount(this.cache,_),this.stats.total+=1,this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",sn(a,{area:"stream",path:"stream-chunked",chunked:!0,reason:f?"explicit-fallback-large-doc":"default-fallback-large-doc"}),L}}const T=this.parseFullDocument(e,a,n,_),x=T.tokens;return _=T.lineCount,this.cache={src:e,tokens:x,env:a,lineCount:_,lastSegment:void 0},this.updateCacheLineCount(this.cache,_),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",sn(a,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!a.__mdtsUnboundedInfo}),x}parseFullDocument(e,t,n,r,i=!0){const o=np(n,e.length,r);if(o==="yes")return sn(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:uo(n,e,t),lineCount:r??(i?zt(e):0)};let l=r;return o==="need-lines"&&(l=zt(e),tp(n,e.length,l))?(sn(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:uo(n,e,t),lineCount:l}):(l===void 0&&(l=i?zt(e):0),{tokens:this.core.parse(e,t,n).tokens,lineCount:l})}shouldUseUnboundedAppend(e,t,n){return!n||e.length<this.MIN_UNBOUNDED_APPEND_TOTAL_CHARS&&n.length<this.MIN_UNBOUNDED_APPEND_CHARS?!1:n.length>=this.MIN_UNBOUNDED_APPEND_CHARS?!0:zt(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t){if(!t.startsWith(e)||!e.endsWith(`
`))return null;const n=t.slice(e.length);if(!n)return null;const r=n.length;if(n.charCodeAt(r-1)!==10)return null;let i=0,o=-1;for(let a=0;a<r&&!(n.charCodeAt(a)===10&&(o===-1&&(o=a),i++,i>=2));a++);if(i<2)return null;const l=(o===-1?n:n.slice(0,o)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),s=a.lastIndexOf(`
`);if(a.slice(s+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(n)?null:n}tryTailSegmentReparse(e,t,n,r){const i=this.ensureLastSegment(t);if(!i||i.srcOffset<=0&&i.tokenStart<=0)return null;const o=t.src.slice(0,i.srcOffset);if(!e.startsWith(o))return null;const l=t.src.slice(i.srcOffset),a=e.slice(i.srcOffset);if(a===l)return null;const s=e.startsWith(t.src)?e.slice(t.src.length):null;if(s){const c=this.tryContainerTailAppendMerge(e,t,n,r,i,s);if(c)return c}if(this.mayContainReferenceDefinition(l)||this.mayContainReferenceDefinition(a))return null;try{const c=this.core.parse(a,n,r),f=this.getLastSegment(c.tokens,a);return i.lineStart>0&&this.shiftTokenLines(c.tokens,i.lineStart),t.src=e,t.env=n,t.tokens.length=i.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=zt(e),f?t.lastSegment={tokenStart:i.tokenStart+f.tokenStart,tokenEnd:i.tokenStart+f.tokenEnd,lineStart:i.lineStart+f.lineStart,lineEnd:i.lineStart+f.lineEnd,srcOffset:i.srcOffset+f.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let r=e.length-1;r>=0;r--)if(e.charCodeAt(r)===10&&(n--,n===0))return e.slice(r+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,r=e.slice(n),i=r.length;let o=null,l=0;for(;l<=i;){let a=r.indexOf(`
`,l);a===-1&&(a=i);let s=l;for(;s<a;){const c=r.charCodeAt(s);if(c===32||c===9)s++;else break}if(s<a){const c=r.charCodeAt(s);if(c===96||c===126){let f=s;for(;f<a&&r.charCodeAt(f)===c;)f++;const u=f-s;u>=3&&(o?o.marker===c&&u>=o.length&&(o=null):o={marker:c,length:u})}}if(a===i)break;l=a+1}return o!==null}peek(){return this.cache?.tokens??Pw}getStats(){return{...this.stats}}appendTokens(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}updateCacheLineCount(e,t){e.lineCount=t??zt(e.src),e.lastSegment=void 0}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t){if(e.length===0)return null;let n=Number.POSITIVE_INFINITY,r=-1,i=0;for(let o=e.length-1;o>=0;o--){const l=e[o];if(l.map&&(l.map[0]<n&&(n=l.map[0]),l.map[1]>r&&(r=l.map[1])),l.nesting<0){i+=-l.nesting;continue}if(l.nesting>0){if(i-=l.nesting,l.level===0&&i<=0){const a=Number.isFinite(n)?n:l.map?.[0]??0,s=r>=a?r:l.map?.[1]??a;return{tokenStart:o,tokenEnd:e.length,lineStart:a,lineEnd:s,srcOffset:this.getLineStartOffset(t,a)}}continue}if(l.level===0&&i===0){const a=Number.isFinite(n)?n:l.map?.[0]??0,s=r>=a?r:l.map?.[1]??a;return{tokenStart:o,tokenEnd:e.length,lineStart:a,lineEnd:s,srcOffset:this.getLineStartOffset(t,a)}}}return null}getLineStartOffset(e,t){if(t<=0)return 0;let n=t,r=-1;for(;n>0;){if(r=e.indexOf(`
`,r+1),r===-1)return e.length;n--}return r+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,r,i,o){if(!o||this.mayContainReferenceDefinition(o))return null;const l=t.tokens[i.tokenStart];switch(l?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,r,i,o,l);case"table_open":return this.tryTableTailAppendMerge(e,t,n,r,i,o,l);default:return null}}tryListTailAppendMerge(e,t,n,r,i,o,l){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const a=i.lineEnd-i.lineStart,s=t.src.length-i.srcOffset;if(a<this.MIN_LIST_LINES_FOR_MERGE&&s<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=l.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let f;try{f=this.core.parse(o,n,r).tokens}catch{return null}if(!this.isSingleTopLevelContainer(f,l.type,c,l.markup))return null;const u=f.slice(1,-1);if(u.length===0)return null;const d=t.lineCount??zt(t.src);d>0&&this.shiftTokenLines(u,d);const h=this.getListParagraphMode(t.tokens,i.tokenStart,t.tokens.length,l.level),p=this.getListParagraphMode(f,0,f.length,0);return(h==="loose"||p==="loose"||this.endsWithBlankLine(t.src)||(f[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,i.tokenStart,t.tokens.length,l.level,!1),this.setListParagraphVisibility(u,0,u.length,l.level,!1)),t.tokens.splice(t.tokens.length-1,0,...u),t.src=e,t.env=n,t.lineCount=zt(e),l.map&&(l.map[1]=this.getDocLineCount(e)),t.lastSegment={tokenStart:i.tokenStart,tokenEnd:t.tokens.length,lineStart:i.lineStart,lineEnd:this.getDocLineCount(e),srcOffset:i.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,r,i,o,l){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(o))return null;const a=i.lineEnd-i.lineStart,s=t.src.length-i.srcOffset;if(a<this.MIN_TABLE_LINES_FOR_MERGE&&s<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(i.srcOffset));if(!c)return null;const f=`${c}${o}`;let u;try{u=this.core.parse(f,n,r).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,"table_open","table_close")||(u[0]?.map?.[1]??-1)!==this.getDocLineCount(f))return null;const d=this.getTableBodySection(u,0,u.length,0),h=this.getTableBodySection(t.tokens,i.tokenStart,t.tokens.length,l.level);if(!d||!h||d.tbodyOpenIndex<0||d.tbodyCloseIndex<0)return null;const p=h.tbodyOpenIndex>=0?u.slice(d.tbodyOpenIndex+1,d.tbodyCloseIndex):u.slice(d.tbodyOpenIndex,d.tbodyCloseIndex+1);if(p.length===0)return null;const m=i.lineEnd-2;m!==0&&this.shiftTokenLines(p,m);const v=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex;t.tokens.splice(v,0,...p),t.src=e,t.env=n,t.lineCount=zt(e);const y=this.getDocLineCount(e);if(l.map&&(l.map[1]=y),h.tbodyOpenIndex>=0){const g=t.tokens[h.tbodyOpenIndex];g?.map&&(g.map[1]=y)}return t.lastSegment={tokenStart:i.tokenStart,tokenEnd:t.tokens.length,lineStart:i.lineStart,lineEnd:y,srcOffset:i.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,r){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let i=-1;for(let a=n-1;a>t;a--){const s=e[a];if(s.type==="table_close"&&s.level===r){i=a;break}}if(i<0)return null;let o=-1,l=-1;for(let a=t+1;a<i;a++){const s=e[a];if(s.type==="tbody_open"&&s.level===r+1){o=a;break}}if(o>=0){for(let a=i-1;a>o;a--){const s=e[a];if(s.type==="tbody_close"&&s.level===r+1){l=a;break}}if(l<0)return null}return{tableCloseIndex:i,tbodyOpenIndex:o,tbodyCloseIndex:l}}isSingleTopLevelContainer(e,t,n,r){if(e.length<2)return!1;const i=e[0],o=e[e.length-1];if(i.type!==t||o.type!==n||i.level!==0||o.level!==0||r!==void 0&&i.markup!==r)return!1;let l=0;for(let a=0;a<e.length;a++){const s=e[a];if(s.level===0&&a>0&&a<e.length-1&&l===0)return!1;(s.nesting>0||s.nesting<0)&&(l+=s.nesting)}return l===0}getListParagraphMode(e,t,n,r){let i=!1,o=!1;const l=r+2;for(let a=t;a<n;a++){const s=e[a];if(!(s.type!=="paragraph_open"||s.level!==l)&&(s.hidden?i=!0:o=!0,i&&o))return"loose"}return o?"loose":i?"tight":"none"}setListParagraphVisibility(e,t,n,r,i){const o=r+2;for(let l=t;l<n;l++){const a=e[l];(a.type==="paragraph_open"||a.type==="paragraph_close")&&a.level===o&&(a.hidden=i)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const r=e.charCodeAt(n);if(r===32||r===9){n--;continue}return r===10}return!0}getDocLineCount(e){const t=zt(e);return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;const n=[...e];for(;n.length>0;){const r=n.pop();if(r.map&&(r.map[0]+=t,r.map[1]+=t),r.children)for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}}};const ud={default:lw,zero:aw,commonmark:ow};function dd(e,t,n){const r=(i,o)=>!!i&&Object.prototype.hasOwnProperty.call(i,o)&&i[o]!==void 0;for(let i=0;i<n.length;i++){const o=n[i];if(r(t,o)||r(e,o))return!0}return!1}function fd(e,t,n){return!!t&&Object.prototype.hasOwnProperty.call(t,n)||!!e&&Object.prototype.hasOwnProperty.call(e,n)}function zw(e,t){let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamChunkedFallback:!1,streamChunkSizeChars:1e4,streamChunkSizeLines:200,streamChunkFenceAware:!0,streamChunkAdaptive:!0,streamChunkTargetChunks:8,streamChunkMaxChunks:void 0,streamSkipCacheAboveChars:1e6,streamSkipCacheAboveLines:1e5,fullChunkedFallback:!1,fullChunkThresholdChars:2e4,fullChunkThresholdLines:400,fullChunkSizeChars:1e4,fullChunkSizeLines:200,fullChunkFenceAware:!0,fullChunkAdaptive:!0,fullChunkTargetChunks:8,fullChunkMaxChunks:void 0,autoTuneChunks:!0,autoUnbounded:!0,autoUnboundedThresholdChars:4e6,autoUnboundedThresholdLines:8e4},r="default",i;!t&&typeof e!="string"?(i=e,r="default"):typeof e=="string"&&(r=e,i=t);const o=ud[r];if(!o)throw new Error(`Wrong \`markdown-it\` preset "${r}", check name`);if(o?.options&&(n={...n,...o.options}),i&&(n={...n,...i}),typeof n.quotes=="string"){const g=n.quotes;g.length>=4?n.quotes=[g[0],g[1],g[2],g[3]]:n.quotes=["“","”","‘","’"]}let l=dd(o?.options,i,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),a=dd(o?.options,i,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),s=fd(o?.options,i,"fullChunkedFallback"),c=fd(o?.options,i,"streamChunkedFallback");const f=new iw;let u=null;const d=()=>(u||(u=new yw(n)),u);let h=null;const p=()=>(h||(h=new Bw(f)),h);let m=null;const v=()=>(m||(m=new vh),m),y={core:f,block:f.block,inline:f.inline,get linkify(){const g=v();return Object.defineProperty(this,"linkify",{value:g,writable:!0,configurable:!0}),g},get renderer(){const g=d();return Object.defineProperty(this,"renderer",{value:g,writable:!0,configurable:!0}),g},options:n,__explicitFullChunkConfig:l,__explicitStreamChunkConfig:a,__explicitFullChunkFallbackSetting:s,__explicitStreamChunkFallbackSetting:c,set(g){return this.options={...this.options,...g},(g.fullChunkSizeChars!==void 0||g.fullChunkSizeLines!==void 0||g.fullChunkMaxChunks!==void 0)&&(l=!0,this.__explicitFullChunkConfig=!0),(g.streamChunkSizeChars!==void 0||g.streamChunkSizeLines!==void 0||g.streamChunkMaxChunks!==void 0)&&(a=!0,this.__explicitStreamChunkConfig=!0),Object.prototype.hasOwnProperty.call(g,"fullChunkedFallback")&&(s=!0,this.__explicitFullChunkFallbackSetting=!0),Object.prototype.hasOwnProperty.call(g,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),u&&u.set(g),typeof g.stream=="boolean"&&(this.stream.enabled=g.stream,h&&(h.reset(),h.resetStats())),this},configure(g){const b=typeof g=="string"?ud[g]:g;if(!b)throw new Error("Wrong `markdown-it` preset, can't be empty");if(b.options&&this.set(b.options),b.components){const k=b.components;k.core?.rules&&this.core.ruler.enableOnly(k.core.rules),k.block?.rules&&this.block.ruler.enableOnly(k.block.rules),k.inline?.rules&&this.inline.ruler.enableOnly(k.inline.rules),k.inline2?.rules&&this.inline.ruler2.enableOnly(k.inline2.rules)}return this},enable(g,b){const k=Array.isArray(g)?g:[g],_=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2];let T=0;for(const x of _){if(!x)continue;const S=x.enable(k,!0);T+=S.length}if(!b&&T<k.length)throw new Error("Rules manager: invalid rule name in list");return this},disable(g,b){const k=Array.isArray(g)?g:[g],_=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2];let T=0;for(const x of _){if(!x)continue;const S=x.disable(k,!0);T+=S.length}if(!b&&T<k.length)throw new Error("Rules manager: invalid rule name in list");return this},use(g,...b){const k=typeof g=="function"?g:g&&typeof g.default=="function"?g.default:void 0;if(!k)throw new TypeError("MarkdownIt.use: plugin must be a function");const _=[this,...b],T=g;return k.apply(T,_),this},render(g,b={}){const k=this.parse(g,b);return d().render(k,this.options,b)},async renderAsync(g,b={}){const k=this.parse(g,b);return d().renderAsync(k,this.options,b)},renderIterable(g,b={}){const k=this.parseIterable(g,b);return d().render(k,this.options,b)},async renderAsyncIterable(g,b={}){const k=await this.parseAsyncIterable(g,b);return d().renderAsync(k,this.options,b)},renderInline(g,b={}){const k=this.parseInline(g,b);return d().render(k,this.options,b)},validateLink:Dh,normalizeLink:Eh,normalizeLinkText:Mh,utils:Hk,helpers:{...fb},parse(g,b={}){if(typeof g!="string")throw new TypeError("Input data should be a String");let k;if(!this.stream.enabled&&!this.options.fullChunkedFallback){const _=np(this,g.length);if(_==="yes")return sn(b,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),uo(this,g,b);_==="need-lines"&&(k=zt(g))}if(!this.stream.enabled){const _=g.length,T=k??zt(g),x=this.options.autoTuneChunks!==!1,S=l,R=!s,W=!!this.options.fullChunkedFallback,w=R&&_>=2e5,C=x&&!S?Cw(_,T,this.options):null;if((W||w)&&(W?_>=(this.options.fullChunkThresholdChars??2e4)||T>=(this.options.fullChunkThresholdLines??400):w)){if(C&&C.strategy!=="plain")return sn(b,{area:"parse",path:"full-chunk",chunked:!0,reason:W?"explicit-full-chunk":"default-large-string"}),Nl(this,g,b,{maxChunkChars:C.maxChunkChars,maxChunkLines:C.maxChunkLines,fenceAware:C.fenceAware,maxChunks:C.maxChunks});if(W){const A=($,H,re)=>$<H?H:$>re?re:$,M=this.options.fullChunkAdaptive!==!1,L=this.options.fullChunkTargetChunks??8,P=A(Math.ceil(_/L),8e3,64e3),I=A(Math.ceil(T/L),150,700),N=M?P:this.options.fullChunkSizeChars??1e4,V=M?I:this.options.fullChunkSizeLines??200,K=M?A(Math.ceil(_/64e3),L,32):this.options.fullChunkMaxChunks;return sn(b,{area:"parse",path:"full-chunk",chunked:!0,reason:"explicit-full-chunk"}),Nl(this,g,b,{maxChunkChars:N,maxChunkLines:V,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:K})}}if(k!==void 0&&tp(this,_,T))return sn(b,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),uo(this,g,b)}return sn(b,{area:"parse",path:"plain",reason:"default-plain"}),f.parse(g,b,this).tokens},parseIterable(g,b={}){return Iw(this,g,b)},parseAsyncIterable(g,b={}){return Fw(this,g,b)},parseIterableToSink(g,b,k={}){return Ow(this,g,b,k)},parseAsyncIterableToSink(g,b,k={}){return Nw(this,g,b,k)},parseInline(g,b={}){if(typeof g!="string")throw new TypeError("Input data should be a String");const k=f.createState(g,b,this);return k.inlineMode=!0,f.process(k),k.tokens}};if(y.stream={enabled:!!n.stream,parse(g,b){return y.stream.enabled?p().parse(g,b,y):y.parse(g,b??{})},reset(){p().reset()},peek(){return h?h.peek():[]},stats(){return h?h.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){h&&h.resetStats()}},r==="zero"&&o?.components){const g=o.components;g.core?.rules&&y.core.ruler.enableOnly(g.core.rules),g.block?.rules&&y.block.ruler.enableOnly(g.block.rules),g.inline?.rules&&y.inline.ruler.enableOnly(g.inline.rules),g.inline2?.rules&&y.inline.ruler2.enableOnly(g.inline2.rules)}return y}var Hw=zw;function jw(e,t,n){function r(d){return d.trim().split(" ",2)[0]===t}function i(d,h,p,m,v){return d[h].nesting===1&&d[h].attrJoin("class",t),v.renderToken(d,h,p,m,v)}n=n||{};const o=3,l=n.marker||":",a=l.charCodeAt(0),s=l.length,c=n.validate||r,f=n.render||i;function u(d,h,p,m){let v,y=!1,g=d.bMarks[h]+d.tShift[h],b=d.eMarks[h];if(a!==d.src.charCodeAt(g))return!1;for(v=g+1;v<=b&&l[(v-g)%s]===d.src[v];v++);const k=Math.floor((v-g)/s);if(k<o)return!1;v-=(v-g)%s;const _=d.src.slice(g,v),T=d.src.slice(v,b);if(!c(T,_))return!1;if(m)return!0;let x=h;for(;x++,!(x>=p||(g=d.bMarks[x]+d.tShift[x],b=d.eMarks[x],g<b&&d.sCount[x]<d.blkIndent));)if(a===d.src.charCodeAt(g)&&!(d.sCount[x]-d.blkIndent>=4)){for(v=g+1;v<=b&&l[(v-g)%s]===d.src[v];v++);if(!(Math.floor((v-g)/s)<k)&&(v-=(v-g)%s,v=d.skipSpaces(v),!(v<b))){y=!0;break}}const S=d.parentType,R=d.lineMax;d.parentType="container",d.lineMax=x;const W=d.push("container_"+t+"_open","div",1);W.markup=_,W.block=!0,W.info=T,W.map=[h,x],d.md.block.tokenize(d,h+1,x);const w=d.push("container_"+t+"_close","div",-1);return w.markup=d.src.slice(g,v),w.block=!0,d.parentType=S,d.lineMax=R,d.line=x+(y?1:0),!0}e.block.ruler.before("fence","container_"+t,u,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules["container_"+t+"_open"]=f,e.renderer.rules["container_"+t+"_close"]=f}function Vw(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const r=[];let i="",o=!1,l=!1;for(let s=0;s<n.length;s++){const c=n[s];if(c==="\\"){i+=c,s+1<n.length&&(i+=n[s+1],s++);continue}if(!l&&c==="'"){o=!o,i+=c;continue}if(!o&&c==='"'){l=!l,i+=c;continue}if(!o&&!l&&c===","){r.push(i.trim()),i="";continue}i+=c}i.trim()&&r.push(i.trim());const a={};for(const s of r){if(!s)continue;let c=!1,f=!1,u=-1;for(let v=0;v<s.length;v++){const y=s[v];if(y==="\\"){v++;continue}if(!f&&y==="'"){c=!c;continue}if(!c&&y==='"'){f=!f;continue}if(!c&&!f&&y===":"){u=v;break}}if(u===-1)return null;const d=s.slice(0,u).trim(),h=s.slice(u+1).trim();if(!d)return null;let p=d;if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{p=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(p))return null;let m;if(!h)m="";else if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{m=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{m=h}else/^-?\d+(?:\.\d+)?$/.test(h)?m=Number(h):h==="true"||h==="false"?m=h==="true":h==="null"?m=null:m=h;a[p]=m}return a}function Ww(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(jw,t,{render(n,r){return n[r].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,r,i)=>{const o=t,l=o.bMarks[n]+o.tShift[n],a=o.eMarks[n],s=o.src.slice(l,a),c=s.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const f=c[1];if(!f.trim())return!1;const u=s.slice(c[0].length).trim();let d,h;const p=u.indexOf("{"),m=p>=0?u.slice(p).trimStart():void 0;if(p===-1)d=u||void 0;else{if(d=u.slice(0,p).trim()||void 0,m?.startsWith("{")){let _=0,T=-1;for(let x=0;x<m.length;x++)if(m[x]==="{"?_++:m[x]==="}"&&_--,_===0){T=x+1;break}T>0&&(h=m.slice(0,T))}h||(d=u||void 0)}if(i)return!0;const v=!!o.env?.__markstreamFinal;let y=n+1,g=!1;for(;y<=r;){const _=o.bMarks[y]+o.tShift[y],T=o.eMarks[y];if(o.src.slice(_,T).trim()===":::"){g=!0;break}y++}g||(y=r);const b=o.push("vmr_container_open","div",1);if(b.attrSet("class",`vmr-container vmr-container-${f}`),b.meta={...b.meta,unclosed:!g&&!v},d&&b.attrSet("data-args",d),h)try{const _=JSON.parse(h);for(const[T,x]of Object.entries(_)){const S=x!=null&&typeof x=="object";b.attrSet(`data-${T}`,S?JSON.stringify(x):String(x))}}catch{const _=Vw(h);if(_)for(const[T,x]of Object.entries(_)){const S=x!=null&&typeof x=="object";b.attrSet(`data-${T}`,S?JSON.stringify(x):String(x))}else b.attrSet("data-attrs",h)}const k=[];for(let _=n+1;_<y;_++){const T=o.bMarks[_]+o.tShift[_],x=o.eMarks[_];k.push(o.src.slice(T,x))}if(k.some(_=>_.trim().length>0)){let _=k.join(`
`);_.endsWith(`
`)||(_+=`
`),_.endsWith(`

`)||(_+=`
`);const T=o.tokens[o.tokens.length-1];T&&(T.raw=_);const x=[];o.md.block.parse(_,o.md,o.env,x),o.tokens.push(...x)}return g&&o.push("vmr_container_close","div",-1),o.line=g?y+1:y,!0},{alt:["paragraph","reference","blockquote","list"]})}const rp=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],qw=["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"],ip=["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"],Uw=["svg","g","path"],Yw=["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"],Kw=["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"],Zw=["href","src","srcset","xlink:href","formaction"],Gw=["script"],Lo=new Set(rp),Xw=new Set(ip),Pl=new Set([...rp,...qw,...ip,...Uw]),Qw=new Set([...Pl,...Yw]),Jw=new Set(Kw),ex=new Set(Zw),tx=new Set(Gw);function nx(e){let t="";for(const n of e){const r=n.charCodeAt(0);r<=31||r===127||/\s/u.test(n)||(t+=n)}return t}function rx(e){const t=nx(e).toLowerCase();return t.startsWith("javascript:")||t.startsWith("vbscript:")?!0:t.startsWith("data:")?!(t.startsWith("data:image/")||t.startsWith("data:video/")||t.startsWith("data:audio/")):!1}const op=Lo,ix=Pl,lp=new Set(Xw);lp.delete("details");const ox=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,lx=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,$s=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,ax=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function ap(e){return(e.match($s)?.[1]??"").toLowerCase()}function sp(e){return/^\s*<\s*\//.test(e)}function cp(e,t){return op.has(t)||/\/\s*>\s*$/.test(e)}function up(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function sx(e,t){let n=0;for(let r=0;r<e.length;r++){const i=e[r];if(!i||i.type!=="html_inline")continue;const o=String(i.content??""),l=ap(o);if(l===t){if(sp(o)){if(n===0)return r;n--;continue}cp(o,l)||n++}}return-1}function cx(e,t){let n=0;for(const r of e){if(!r||r.type!=="html_inline")continue;const i=String(r.content??""),o=ap(i);if(o===t){if(sp(i)){n>0&&n--;continue}cp(i,o)||n++}}return n}function hd(e,t,n=0){const r=new RegExp(String.raw`<\s*(\/?)\s*${up(t)}(?=[\s>/])[^>]*>`,"gi");r.lastIndex=Math.max(0,n);let i=0,o;for(;(o=r.exec(e))!==null;){const l=o[0]??"",a=!!o[1],s=!a&&/\/\s*>$/.test(l);if(a){if(i===0)return{start:o.index,end:o.index+l.length};i--;continue}s||i++}return null}function ux(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${up(t)}(?=[\s>/])[^>]*>`,"gi");let r=0,i;for(;(i=n.exec(e))!==null;){const o=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(o);if(l){r>0&&r--;continue}a||r++}return r}function ui(e){let t=!1,n=!1;for(let r=0;r<e.length;r++){const i=e[r];if(i==='"'&&!t){n=!n;continue}if(i==="'"&&!n){t=!t;continue}if(i===">"&&!t&&!n)return r}return-1}function pd(e){const t=e;return String(t.raw??t.content??t.markup??"")}function dx(e){const t=new Set(ix);if(e&&Array.isArray(e))for(const n of e){const r=String(n??"").trim();if(!r)continue;const i=r.match(/^[<\s/]*([A-Z][\w-]*)/i);i&&t.add(i[1].toLowerCase())}return t}function md(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function fx(e,t){let n=null;for(const o of e.matchAll(ox)){const l=o.index??-1;if(l<0)continue;const a=(o[1]??"").toLowerCase();md(a,t)&&ui(e.slice(l))===-1&&(!n||l<n.index)&&(n={index:l,tag:a,closing:!1})}for(const o of e.matchAll(lx)){const l=o.index??-1;if(l<0)continue;const a=(o[1]??"").toLowerCase();md(a,t)&&ui(e.slice(l))===-1&&(!n||l<n.index)&&(n={index:l,tag:a,closing:!0})}const r=/<\/\s*$/.exec(e);if(r&&typeof r.index=="number"){const o=r.index;!e.slice(o).includes(">")&&(!n||o<n.index)&&(n={index:o,tag:"",closing:!0})}const i=/<\s*$/.exec(e);if(i&&typeof i.index=="number"){const o=i.index,l=e.slice(o);!l.startsWith("</")&&!l.includes(">")&&(!n||o<n.index)&&(n={index:o,tag:"",closing:!1})}return n}function hx(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function px(e,t){if(!e.length)return{children:e};const n=[];let r=null,i=null;function o(s,c){s&&(c?n.push(hx(c,s)):n.push({type:"text",content:s,raw:s}))}function l(s,c){let f=0;for(;f<s.length;){const u=s.indexOf("<",f);if(u===-1){o(s.slice(f),c);break}o(s.slice(f,u),c);const d=s.slice(u),h=d.match($s);if(!h){o("<",c),f=u+1;continue}const p=ui(d);if(p===-1){o("<",c),f=u+1;continue}const m=d.slice(0,p+1),v=(h[1]??"").toLowerCase();t.has(v)?n.push({type:"html_inline",tag:"",content:m,raw:m}):o(m,c),f=u+m.length}}function a(s,c){if(!s)return;const f=fx(s,t);if(!f){l(s,c);return}const u=s.slice(0,f.index);u&&l(u,c),r={tag:f.tag,buffer:s.slice(f.index),closing:f.closing},i=r.buffer}for(const s of e){if(r){r.buffer+=pd(s),i=r.buffer;const c=ui(r.buffer);if(c===-1)continue;const f=r.buffer.slice(0,c+1),u=r.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:f,raw:f}),r=null,i=null,u&&a(u);continue}if(s.type==="html_inline"){const c=pd(s),f=(c.match($s)?.[1]??"").toLowerCase();if(f&&t.has(f)&&ui(c)===-1){r={tag:f,buffer:c,closing:/^<\s*\//.test(c)},i=r.buffer;continue}}if(s.type==="text"){const c=String(s.content??"");if(!c.includes("<")){n.push(s);continue}a(c,s);continue}n.push(s)}return{children:n,pendingBuffer:i??void 0}}function mx(e,t={}){const n=dx(t.customHtmlTags),r=new Set(["a","span","strong","em","b","i","u"]),i=new Set;if(t.customHtmlTags?.length)for(const s of t.customHtmlTags){const c=String(s??"").trim();if(!c)continue;const f=c.match(/^[<\s/]*([A-Z][\w-]*)/i);if(!f)continue;const u=f[1].toLowerCase();i.add(u),r.add(u)}const o=s=>i.has(s)||!n.has(s)||lp.has(s),l=s=>{if(s.type==="html_block")return String(s.content??"");if(s.type!=="inline"||!Array.isArray(s.children)||s.children.length!==1)return"";const c=s.children[0];return c?.type!=="html_block"?"":String(s.content??c.content??"")},a=(s,c)=>{s.type="html_block",s.content=c,s.raw=c,s.children=[]};e.core.ruler.after("inline","fix_html_inline_streaming",s=>{const c=s.tokens??[];for(const f of c){const u=f;if(u.type!=="inline"||!Array.isArray(u.children))continue;const d=String(u.content??""),h=u.children.length?u.children:d.includes("<")?[{type:"text",content:d,raw:d}]:null;if(h)try{const p=px(h,n);if(u.children=p.children,p.pendingBuffer){const m=d.lastIndexOf(p.pendingBuffer);if(m!==-1){const v=d.slice(0,m);u.content=v,typeof u.raw=="string"&&(u.raw=v)}}}catch(p){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",p)}}}),e.core.ruler.push("fix_html_inline_tokens",s=>{const c=s.tokens??[],f=[];for(let u=0;u<c.length;u++){const d=c[u];if(f.length>0){const[p,m]=f[f.length-1];if(u!==m){if(d.type==="paragraph_open"||d.type==="paragraph_close"){c.splice(u,1),u--;continue}const v=String(d.content??d.raw??"");if(v){const y=c[m],g=`${String(y.content||"")}
${v}`,b=ui(g),k=b===-1?null:hd(g,p,b+1);if(k){const _=g.slice(0,k.end),T=g.slice(k.end);y.content=_,y.loading=!1;const x=T.replace(/^\s+/,"");c.splice(u,1),f.pop(),x&&c.splice(u,0,x.startsWith("<")?{type:"html_block",content:x}:{type:"inline",content:x,children:[{type:"text",content:x,raw:x}]}),u--;continue}y.content=g,y.loading!==!1&&(y.loading=!0)}c.splice(u,1),u--;continue}}const h=l(d);if(h){const p=(h.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),m=/^\s*<\s*\//.test(h);if(!p||!o(p))continue;if(a(d,h),!m)p&&!new RegExp(`^\\s*<\\s*${p}\\b[^>]*\\/\\s*>`,"i").test(h)&&ux(h,p)>0&&f.push([p,u]);else if(f.length>0&&p&&f[f.length-1][0]===p){const[,v]=f[f.length-1],y=c[v];y.content=`${String(y.content||"")}
${h}`,y.loading=!1,f.pop(),c.splice(u,1),u--}continue}else if(f.length>0){if(d.type==="paragraph_open"||d.type==="paragraph_close"){c.splice(u,1),u--;continue}const p=d.content||"",m=new RegExp(`<\\s*\\/\\s*${f[f.length-1][0]}\\s*>`,"i").test(p);if(p){const[,v]=f[f.length-1],y=c[v];y.content=`${y.content||""}
${p}`,y.loading!==!1&&(y.loading=!m)}m&&f.pop(),c.splice(u,1),u--}else continue}if(i.size>0){const u=new Map,d=new Map,h=v=>{let y=u.get(v);return y||(y=new RegExp(`<\\s*${v}\\b`,"i"),u.set(v,y)),y},p=v=>{let y=d.get(v);return y||(y=new RegExp(`<\\s*\\/\\s*${v}\\s*>`,"i"),d.set(v,y)),y},m=[];for(let v=0;v<c.length;v++){const y=c[v],g=String(y.content??"");if(m.length>0){const k=m[m.length-1],_=c[k.index];if(y.type==="html_block"&&p(k.tag).test(g)){_.content=`${String(_.content??"")}
${g}`,Array.isArray(_.children)&&_.children.push({type:"html_inline",content:`</${k.tag}>`,raw:`</${k.tag}>`}),c.splice(v,1),v--,m.pop();continue}if(y.type!=="inline")continue;const T=Array.isArray(y.children)?y.children:[],x=sx(T,k.tag);if(x!==-1){const S=T.slice(0,x+1),R=T.slice(x+1),W=S.map(w=>String(w?.content??w?.raw??"")).join("");if(_.content=`${String(_.content??"")}
${W}`,Array.isArray(_.children)&&_.children.push(...S),R.length){const w=R.map(C=>String(C.content??C.raw??"")).join("");if(w.trim()){const C=w.replace(/^\s+/,"");C.startsWith("<")?c.splice(v,1,{type:"html_block",content:C}):c.splice(v,1,{type:"paragraph_open",tag:"p",nesting:1},{type:"inline",tag:"",nesting:0,content:w,children:[{type:"text",content:w,raw:w}]},{type:"paragraph_close",tag:"p",nesting:-1})}else c.splice(v,1),v--}else c.splice(v,1),v--;m.pop();continue}_.content=`${String(_.content??"")}
${g}`,Array.isArray(_.children)&&_.children.push(...T),c.splice(v,1),v--;continue}if(y.type!=="inline")continue;const b=Array.isArray(y.children)?y.children:[];for(const k of i)if((b.length?cx(b,k):h(k).test(g)&&!p(k).test(g)?1:0)>0){m.push({tag:k,index:v});break}}}{let u=0;for(let d=0;d<c.length;d++){const h=c[d];if(h.type==="paragraph_open"){u++;continue}h.type==="paragraph_close"&&(u>0?u--:(c.splice(d,1),d--))}}for(let u=0;u<c.length;u++){const d=c[u];if(d.type==="html_block"){const y=(d.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(y.startsWith("!")||y.startsWith("?")){d.loading=!1;continue}if(i.has(y)){const S=String(d.content??""),R=ui(S),W=R===-1?null:hd(S,y,R+1);d.loading=W?!1:d.loading!==void 0?d.loading:!0;const w=W?.start??-1,C=W?W.end-W.start:0;if(w!==-1){const A=S.slice(0,w+C);let M="";R!==-1&&R<w&&(M=S.slice(R+1,w)),d.children=[{type:y,content:M,raw:A,attrs:[],tag:y,loading:!1}],d.content=A,d.raw=A;const L=(S.slice(w+C)||"").replace(/^\s+/,"");L&&c.splice(u+1,0,L.startsWith("<")?{type:"html_block",content:L}:{type:"text",content:L,raw:L})}else d.children=[{type:y,content:"",raw:S,attrs:[],tag:y,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(y))continue;d.type="inline";const g=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let b;for(;(b=g.exec(d.content||""))!==null;)b[1],b[2]||b[3]||b[4];const k=String(d.content??""),_=new RegExp(`<\\/\\s*${y}\\s*>`,"i").exec(k),T=_?_.index:-1,x=_?_[0].length:0;if(T!==-1){const S=k.slice(0,T+x),R=(k.slice(T+x)||"").replace(/^\s+/,"");d.children=[{type:"html_block",content:S,tag:y,loading:!1}],d.content=S,d.raw=S,R&&c.splice(u+1,0,R.startsWith("<")?{type:"html_block",content:R}:{type:"text",content:R,raw:R})}else d.children=[{type:"html_block",content:d.content,tag:y,loading:!0}];continue}if(!d||d.type!=="inline")continue;if(d.children.length===2&&d.children[0].type==="html_inline"){const y=(d.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),g=d.children[1],b=String(g?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(g?.type==="html_inline"&&b===y)continue;r.has(y)?(d.children[0].loading=!0,d.children[0].tag=y,d.children.push({type:"html_inline",tag:y,loading:!0,content:`</${y}>`})):d.children=[{type:"html_block",loading:!0,tag:y,content:d.children[0].content+d.children[1].content}];continue}else if(d.children.length===3&&d.children[0].type==="html_inline"&&d.children[2].type==="html_inline"){const y=(d.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(r.has(y))continue;d.children=[{type:"html_block",loading:!1,tag:y,content:d.children.map(g=>g.content).join("")}];continue}if(!d.content?.startsWith("<")||d.children?.length!==1)continue;const h=String(d.content),p=d,m=p.children[0];if(m?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(h)&&(p.children.length=0);continue}const v=String(m.content??h).match(ax)?.[1]?.toLowerCase()??"";if(v){if(/\/\s*>\s*$/.test(h)||op.has(v)){p.children=[{type:"html_inline",content:h}];continue}p.children.length=0}}})}function gx(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 vx(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const r=n.tokens;for(let i=0;i<r.length;i++){const o=r[i];if(o.type!=="code_block")continue;const l=String(o.content??"").trim();if(!l)continue;const a=l.split(/\r?\n/).filter(s=>s.trim().length>0);if(a.length===1&&!gx(a[0]??"")){const s=a[0]??"";r.splice(i,1,{type:"paragraph_open",tag:"p",nesting:1,level:o.level},{type:"inline",tag:"",nesting:0,level:o.level,content:s,children:[{type:"text",content:s,level:o.level+1}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:o.level}),i+=2}}})}const gd=["！"];function Ln(e){return{type:"text",content:e,raw:e}}function ei(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 ti(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 Rr(e,t,n){let r="";if(t.includes('"')){const i=t.split('"');t=i[0].trim(),r=i[1].trim()}return{type:"link",loading:n,href:t,title:r,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function yx(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(Ln(t))}}function vd(e,t){let n=-1;for(const r of t){const i=e.indexOf(r);i!==-1&&(n===-1||i<n)&&(n=i)}return n}function kx(e){const t=e?.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function bx(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(r=>r?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function _x(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let r=0;r<n.length;r++){const i=n[r];if(i&&i.type==="inline"&&Array.isArray(i.children))try{i.children=wx(i.children)}catch(o){console.error("[applyFixLinkTokens] failed to fix inline children",o)}}})}function wx(e){if(e.length<3||e.some(t=>t.type==="code_inline"))return e;for(let t=0;t<=e.length-1;t++){t<0&&(t=0);const n=e[t];if(!n)break;if(n.type==="link_open"&&(n.markup==="linkify"||n.markup==="autolink")){let r=-1;for(let i=t+1;i<e.length;i++)if(e[i]?.type==="link_close"){r=i;break}if(r!==-1){const i=kx(n),o=vd(i,gd);for(let l=t+1;l<r;l++){const a=e[l];if(a?.type!=="text"||typeof a.content!="string")continue;const s=vd(a.content,gd);if(s===-1)continue;const c=a.content[s],f=a.content.slice(0,s);let u=a.content.slice(s);for(let p=l+1;p<r;p++){const m=e[p];m?.type==="text"&&typeof m.content=="string"&&(u+=m.content)}a.content=f,a.raw=f;const d=r-(l+1);d>0&&(e.splice(l+1,d),r=l+1);let h=i;if(o!==-1)h=i.slice(0,o);else if(u){const p=encodeURI(u);if(p&&i.endsWith(p))h=i.slice(0,i.length-p.length);else{const m=c?encodeURI(c):"",v=m?i.indexOf(m):-1;v!==-1&&(h=i.slice(0,v))}}h!==i&&bx(n,h),u&&e.splice(r+1,0,Ln(u));break}}}if(n?.type==="em_open"&&e[t-1]?.type==="text"&&e[t-1].content?.endsWith("*")){const r=e[t-1].content?.replace(/(\*+)$/,"")||"";e[t-1].content=r,n.type="strong_open",n.tag="strong",n.markup="**";for(let i=t+1;i<e.length;i++)if(e[i]?.type==="em_close"){e[i].type="strong_close",e[i].tag="strong",e[i].markup="**";break}}else if(n?.type==="text"&&n.content?.endsWith("(")&&e[t+1]?.type==="link_open"){const r=n.content.match(/\[([^\]]+)\]/);if(r){let i=n.content.slice(0,r.index);const o=i.match(/(\*+)$/),l=[];if(o){i=i.slice(0,o.index),i&&l.push(Ln(i));const a=r[1],s=o[1].length;ei(l,s);let c=e[t+2]?.content||"";if(e[t+4]?.type==="text"&&!e[t+4].content?.startsWith(")")&&(c+=e[t+4]?.content||"",e[t+4].content=""),l.push(Rr(a,c,!e[t+4]?.content?.startsWith(")"))),ti(l,s),e[t+4]?.type==="text"){const f=e[t+4].content?.replace(/^\)\**/,"");f&&l.push(Ln(f)),e.splice(t,5,...l)}else e.splice(t,4,...l)}else{i&&l.push(Ln(i));let a=r[1];const s=a.match(/^\*+/);if(s){const f=s[0].length;a=a.replace(/^\*+/,"").replace(/\*+$/,"");let u=e[t+2]?.content||"";if(e[t+4]?.type==="text"&&!e[t+4].content?.startsWith(")")&&(u+=e[t+4]?.content||"",e[t+4].content=""),ei(l,f),l.push(Rr(a,u,!e[t+4]?.content?.startsWith(")"))),ti(l,f),e[t+4]?.type==="text"){const d=e[t+4].content?.replace(/^\)/,"");d&&l.push(Ln(d)),e.splice(t,5,...l)}else e.splice(t,4,...l);t===0?t=l.length-1:t-=l.length+1;continue}let c=e[t+2]?.content||"";if(e[t+4]?.type==="text"&&!e[t+4].content?.startsWith(")")&&(c+=e[t+4]?.content||"",e[t+4].content=""),l.push(Rr(a,c,!e[t+4]?.content?.startsWith(")"))),e[t+4]?.type==="text"){const f=e[t+4].content?.replace(/^\)/,"");f&&l.push(Ln(f)),e.splice(t,5,...l)}else e.splice(t,4,...l)}t-=l.length+1;continue}}else if(n.type==="link_open"&&n.markup==="linkify"&&e[t-1]?.type==="text"&&e[t-1].content?.endsWith("(")){if(e[t-2]?.type==="link_close"){const r=[],i=e[t-3].content||"";let o=n.attrs?.find(l=>l[0]==="href")?.[1]||"";if(e[t+3]?.type==="text"){const l=(e[t+3]?.content??"").indexOf(")"),a=l===-1;l===-1&&(o+=e[t+3]?.content?.slice(0,l)||"",e[t+3].content=""),r.push(Rr(i,o,a));const s=e[t+3].content?.replace(/^\)\**/,"");s&&r.push(Ln(s)),e.splice(t-4,8,...r)}else r.push({type:"link",loading:!0,href:o,title:"",text:i,children:[{type:"text",content:o,raw:o}],raw:`[${i}](${o})`}),e.splice(t-4,7,...r);continue}else if(e[t-1].content==="]("&&e[t-3]?.type==="text"&&e[t-3].content?.endsWith(")"))if(e[t-2]?.type==="strong_open"){const[r,i]=e[t-3].content?.split("[**")||[];e[t+1].content=i||"",e[t-3].content=r||"",e[t-1].content=""}else if(e[t-2]?.type==="em_open"){const[r,i]=e[t-3].content?.split("[*")||[];e[t+1].content=i||"",e[t-3].content=r||"",e[t-1].content=""}else{const[r,i]=e[t-3].content?.split("[")||[];e[t+1].content=i||"",e[t-3].content=r||"",e[t-1].content=""}}if(n.type==="link_close"&&n.nesting===-1&&e[t-2]?.type==="link_open"&&e[t+1]?.type==="text"&&e[t-1]?.type==="text"){const r=e[t-1].content||"",i=e[t-2].attrs||[],o=i.find(u=>u[0]==="href")?.[1]||"",l=i.find(u=>u[0]==="title")?.[1]||"";let a=3,s=2;const c=(e[t-3]?.content||"").match(/^(\*+)$/),f=[];if(c){s+=1;const u=c[1].length;ei(f,u)}if(n.markup!=="linkify"&&e[t+1].type==="text"&&e[t+1]?.content?.startsWith("](")){a+=1;for(let u=t+1;u<e.length;u++){const d=c?c[1].length:e[t-3].markup.length,h=e[u];if(d===1&&h.type==="em_close")break;if(d===2&&h.type==="strong_close")break;if(d===3&&(h.type==="em_close"||h.type==="strong_close"))break;a+=1}}if(f.push({type:"link",loading:!1,href:o,title:l,text:r,children:[{type:"text",content:r,raw:r}],raw:`[${r}](${o})`}),c){const u=c[1].length;ti(f,u)}e.splice(t-s,a,...f),t-=f.length+1;continue}else if(n.content?.startsWith("](")&&e[t-1].markup?.includes("*")&&e[t-4]?.type==="text"&&e[t-4].content?.endsWith("[")){const r=e[t-1].markup.length,i=[],o=e[t-4].content.slice(0,e[t-4].content.length-r);o&&i.push(Ln(o)),ei(i,r);const l=e[t-2].content||"";let a=n.content.slice(2),s=!0;if(e[t+1]?.type==="text"){const c=(e[t+1]?.content??"").indexOf(")");s=c===-1,c===-1&&(a+=e[t+1]?.content?.slice(0,c)||"",e[t+1].content="")}if(i.push(Rr(l,a,s)),ti(i,r),e[t+1]?.type==="text"){const c=e[t+1].content?.replace(/^\)\**/,"");c&&i.push(Ln(c)),e.splice(t-4,8,...i)}else e[t+1]?.type==="link_open"?e.splice(t-4,10,...i):e.splice(t-4,7,...i);t-=i.length+1;continue}else if(n.content?.startsWith("](")&&e[t-1].type==="strong_close"&&e[t-4]?.type==="text"&&e[t-4]?.content?.includes("**[")){const r=[],i=e[t-4].content.split("**[")[0];i&&r.push(Ln(i)),ei(r,2);const o=e[t-2].content||"";let l=n.content.slice(2),a=!0;if(e[t+1]?.type==="text"){const s=(e[t+1]?.content??"").indexOf(")");a=s===-1,s===-1&&(l+=e[t+1]?.content?.slice(0,s)||"",e[t+1].content="")}if(r.push(Rr(o,l,a)),ti(r,2),e[t+1]?.type==="text"){const s=e[t+1].content?.replace(/^\)\**/,"");s&&r.push(Ln(s)),e.splice(t-4,8,...r)}else e[t+1]?.type==="link_open"?e.splice(t-4,10,...r):e.splice(t-4,7,...r);t-=r.length+1;continue}else if(n.type==="strong_close"&&e[t+1]?.type==="text"&&e[t+1].content?.includes("](")&&e[t-1].type==="text"&&/\[.*$/.test(e[t-1].content||"")){const r=[],[i,o]=e[t-1].content?.split("[")||["",""];i&&r.push(Ln(i)),ei(r,2);let[l,a]=e[t+1].content.split("](");l=o+l;let s=4;if(e[t+2]?.type==="link_open"){const f=e[t+2].attrs?.find(u=>u[0]==="href")?.[1];e[t+5]?.type==="text"&&e[t+5].content==="."?(a=(f||a)+e[t+5].content,e[t+5].content=""):a=f||a,s+=3}let c=!0;if(n.nesting===-1&&(l=l.replace(/\*+$/,"")),e[t+2]?.type==="text"){const f=(e[t+2]?.content??"").indexOf(")");c=f===-1,f===-1&&(a+=e[t+2]?.content?.slice(0,f)||"",e[t+2].content="")}r.push(Rr(l,a,c)),ti(r,2),e.splice(t-2,s,...r)}if(n.type==="text"&&/\*+\[[^\]]*$/.test(n.content||"")&&e[t+1]?.type==="strong_open"&&e[t+2]?.type==="text"&&e[t+2].content==="]("&&e[t+3]?.type==="link_open"&&e[t+5]?.type==="link_close"&&e[t+6]?.type==="text"&&e[t+6].content===")"&&e[t+7]?.type==="strong_close"){const r=(n.content||"").match(/^(\*+)\[(.*)$/);if(r){const i=(r[2]||"")+r[1];let o=e[t+3]?.attrs?.find(a=>a[0]==="href")?.[1]||"";!o&&e[t+4]?.type==="text"&&(o=e[t+4].content||"");const l=[];ei(l,2),l.push(Rr(i,o,!1)),ti(l,2),e.splice(t,9,...l),t-=l.length-1;continue}}}for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];if(n?.type!=="link"||r?.type!=="text"||typeof r.content!="string"||!r.content.startsWith("!"))continue;const i=String(n.href??"");if(String(n.text??"")!==i||!i.endsWith("=")&&!i.endsWith("#"))continue;yx(n,"!");const o=r.content.slice(1);o?(r.content=o,r.raw=o):e.splice(t+1,1)}return e}function xx(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let r=0;r<n.length;r++){const i=n[r];if(i&&i.type==="inline"&&Array.isArray(i.children))try{i.children=Cx(i.children)}catch(o){console.error("[applyFixListItem] failed to fix inline children",o)}}})}function Cx(e){const t=e[e.length-1],n=String(t?.content??"");return t?.type==="text"&&/^\s*\d+\.\s*$/.test(n)&&e[e.length-2]?.tag==="br"&&e.splice(e.length-1,1),e}function Sx(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let r=0;r<n.length;r++){const i=n[r];if(i&&i.type==="inline"&&Array.isArray(i.children))try{i.children=Ax(i.children)}catch(o){console.error("[applyFixStrongTokens] failed to fix inline children",o)}}})}function Ax(e){let t=0;const n=new Set,r=new Set;let i=0;for(let f=0;f<e.length;f++){const u=e[f],d=u.type;if(d==="strong_open"){t++;const h=String(u.markup??"");let p=f-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const m=e[p];let v=f+1;for(;v<e.length&&e[v].type==="text"&&e[v].content==="";)v++;const y=e[v];h==="__"&&(m?.content?.endsWith("_")||y?.content?.startsWith("_")||y?.markup?.includes("_"))&&(u.type="text",u.tag="",u.content=h,u.raw=h,u.markup="",u.attrs=null,u.map=null,u.info="",u.meta=null,n.add(t))}else if(d==="strong_close")n.has(t)&&u.markup==="__"&&(u.type="text",u.content=u.markup,u.raw=String(u.markup??""),u.tag="",u.markup="",u.attrs=null,u.map=null,u.info="",u.meta=null),t--,t<0&&(t=0);else if(d==="em_open"){i++;const h=String(u.markup??"");let p=f-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const m=e[p];let v=f+1;for(;v<e.length&&e[v].type==="text"&&e[v].content==="";)v++;const y=e[v];h==="_"&&(m?.content?.endsWith("_")||y?.content?.startsWith("_")||y?.markup?.includes("_"))&&(u.type="text",u.tag="",u.content=h,u.raw=h,u.markup="",u.attrs=null,u.map=null,u.info="",u.meta=null,r.add(i))}else d==="em_close"&&(r.has(i)&&u.markup==="_"&&(u.type="text",u.content=u.markup,u.raw=String(u.markup??""),u.tag="",u.markup="",u.attrs=null,u.map=null,u.info="",u.meta=null),i--,i<0&&(i=0))}if(e.length<5)return e;const o=e.length-4,l=e[o];let a=[...e];const s=e[o+1],c=String(l.content??"");if(l.type==="link_open"&&e[o-1]?.type==="em_open"&&e[o-2]?.type==="text"&&e[o-2].content?.endsWith("*")){const f=String(e[o-2].content??"").slice(0,-1),u=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[o],e[o+1],e[o+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];f&&u.unshift({type:"text",content:f,raw:f}),a.splice(o-2,6,...u)}else if(l.type==="text"&&c.endsWith("*")&&s.type==="em_open"){const f=e[o+2],u=f?.type==="text"?4:3,d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:f?.type==="text"?String(f.content??""):"",raw:f?.type==="text"?String(f.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],h=c.slice(0,-1);h&&d.unshift({type:"text",content:h,raw:h}),a.splice(o,u,...d)}return a=Tx(a),a}function Tx(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const r=e[n],i=e[n+1],o=e[n+2],l=e[n+3],a=e[n+4],s=e[n+5],c=e[n+6];if(r?.type==="strong_open"&&i?.type==="text"&&o?.type==="strong_close"&&l?.type==="strong_open"&&a?.type==="math_inline"&&s?.type==="strong_close"&&c?.type==="text"){const f=String(c.content??""),u=f.indexOf("**");if(u!==-1){const d=f.slice(0,u),h=f.slice(u+2);t.push(r),t.push(i),t.push(a),d&&t.push({...c,type:"text",content:d,raw:d}),t.push(s),h&&t.push({...c,type:"text",content:h,raw:h}),n+=6;continue}}t.push(r)}return t}function Dx(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const r=Fx(n.tokens??[]);Array.isArray(r)&&(n.tokens=r)}catch(r){console.error("[applyFixTableTokens] failed to fix table tokens",r)}})}function yd(){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 kd(){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 bd(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 Dc(e,t){if(!e.startsWith("|")||e.includes(`
`)||t&&!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(r=>r.length>0)?n:null}function Ex(e){return Dc(e,!1)!==null}function Mx(e){return Dc(e,!0)!==null}function Lx(e){return/^:?-+:?$/.test(e.trim())}function Rx(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(Lx)}function $x(e){return e==="|"||e==="|:"}function Ix(e){const t=Dc(e,!0);return t!==null&&t.every(n=>!n.includes(":"))}function Fx(e){const t=[...e];if(e.length<3)return t;const n=e.length-2,r=e[n];if(r.type==="inline"){const i=String(r.content??""),o=i.split(`
`)[0]??"",[l="",a="",...s]=i.split(`
`);if(!i.includes(`
`)&&Ex(i)){const c=o.slice(1).split("|").map(u=>u.trim()).filter(Boolean).flatMap(u=>bd(u)),f=[...yd(),...c,...kd()];t.splice(n-1,3,...f)}else if(i.includes(`
`)&&s.length===0&&Mx(l)&&Rx(a)){const c=o.slice(1,-1).split("|").map(u=>u.trim()).flatMap(u=>bd(u)),f=[...yd(),...c,...kd()];t.splice(n-1,3,...f)}else i.includes(`
`)&&s.length===0&&Ix(l)&&$x(a)&&(r.content=i.slice(0,-2),r.children.splice(2,1))}return t}function Ox(e,t,n,r){const i=e.length;if(n==="$$"&&r==="$$"){let c=t;for(;c<i-1;){if(e[c]==="$"&&e[c+1]==="$"){let f=c-1,u=0;for(;f>=0&&e[f]==="\\";)u++,f--;if(u%2===0)return c}c++}return-1}const o=n[n.length-1],l=r;let a=0,s=t;for(;s<i;){if(e.slice(s,s+l.length)===l){let f=s-1,u=0;for(;f>=0&&e[f]==="\\";)u++,f--;if(u%2===0){if(a===0)return s;a--,s+=l.length;continue}}const c=e[s];if(c==="\\"){s+=2;continue}c===o?a++:c===l[l.length-1]&&a>0&&a--,s++}return-1}var Nx=Ox;const Px=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Bl=Px.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),Bx=/\\[a-z]+/i,dp="(?:\\\\|\\u0008)",zx=new RegExp(String.raw`${dp}(?:${Bl})\s*\{[^}]+\}`,"i"),Hx=new RegExp(String.raw`(?:${dp})?(?:${Bl})\s*\{`,"i"),jx=/\\(?:text|frac|left|right|times)/,Vx=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,Wx=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,qx=/[A-Z]+\s*\([^)]+\)/i,Ux=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,Yx=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,Kx={"\b":"\\b","\v":"\\v","\f":"\\f"};function Zx(e){let t="";for(const n of e)t+=Kx[n]??n;return t}function lo(e){if(!e)return!1;const t=Zx(e),n=t.trim();if(Yx.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const r=Bx.test(t),i=zx.test(t),o=Hx.test(t),l=jx.test(t),a=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),s=Vx.test(t)&&!Wx.test(t),c=qx.test(t),f=Ux.test(t),u=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),d=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return r||i||o||l||a||s||c||f||u||d}const fp=["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"],Gx=["cdot","mathbf{","partial","mu_{"],hp=fp.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),pp="[	\r\b\f\v]",Xx=new RegExp(`([^\\\\])(${Gx.map(e=>e).join("|")})+`,"g"),Qx=/span\{([^}]+)\}/,Jx=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,eC=/(^|[^\\])\\\r?\n/g,tC=/(^|[^\\])\\$/g,nC=new RegExp(`(${pp})|(${hp})\\b`,"g"),_d=new Map,wd=new Map;function rC(e){if(!e)return nC;const t=[...e];t.sort((l,a)=>a.length-l.length);const n=t.join(""),r=_d.get(n);if(r)return r;const i=`(?:${t.map(l=>l.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,o=new RegExp(`(${pp})|(${i})\\b`,"g");return _d.set(n,o),o}function iC(e,t){const n=e?[]:[...t??[]];e||n.sort((a,s)=>s.length-a.length);const r=e?"__default__":n.join(""),i=wd.get(r);if(i)return i;const o=e?[Bl,hp].filter(Boolean).join("|"):[n.map(a=>a.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Bl].filter(Boolean).join("|"),l=new RegExp(`(^|[^\\\\\\w])(${o})\\s*\\{`,"g");return wd.set(r,l),l}const xd={"	":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function Cd(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Sd(e){const t=/(^|[^\\])(__|\*\*)/g;let n,r=null;for(;(n=t.exec(e))!==null;)r={marker:n[2],index:n.index+(n[1]?.length??0)};return r}function $r(e,t){const n=t?.commands??fp,r=t?.escapeExclamation??!0,i=t?.commands==null,o=rC(i?void 0:n);let l=e.replace(o,(c,f,u,d,h)=>{if(f!==void 0&&xd[f]!==void 0)return`\\${xd[f]}`;if(u&&n.includes(u)){const p=h&&typeof d=="number"?h[d-1]:void 0;return p==="\\"||p&&/\w/.test(p)?c:`\\${u}`}return c});r&&(l=l.replace(/(^|[^\\])!/g,"$1\\!"));let a=l;const s=iC(i,i?void 0:n);return a=a.replace(s,(c,f,u)=>`${f}\\${u}{`),a=a.replace(Qx,"span\\{$1\\}").replace(Jx,"\\operatorname{span}\\{$1\\}"),a=a.replace(eC,`$1\\\\
`),a=a.replace(tC,"$1\\\\"),a=a.replace(Xx,"$1\\$2"),a}function Ad(e){const t=e.trim();return!(!lo(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 oC(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const r=n;let i=1;for(;r+i<e.length&&e[r+i]==="`";)i++;let o=r+i,l=-1;for(;o<e.length;){if(e[o]!=="`"){o++;continue}let a=1;for(;o+a<e.length&&e[o+a]==="`";)a++;if(a===i){l=o;break}o+=a}if(l!==-1){t.push([r,l+i]),n=l+i;continue}n=r+i}return t}function lC(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function mp(e,t){let n=t-1,r=0;for(;n>=0&&e[n]==="\\";)r++,n--;return r%2===1}function Is(e,t){let n=t;for(;n<e.length;){const r=e.indexOf("$",n);if(r===-1)return-1;if(mp(e,r)){n=r+1;continue}return r}return-1}function Na(e,t){let n=t;for(;n<e.length;){const r=Is(e,n);if(r===-1)return-1;if(r>0&&e[r-1]==="$"||r+1<e.length&&e[r+1]==="$"){n=r+1;continue}return r}return-1}function Pa(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~～-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function Ba(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function aC(e,t){const n=(i,o)=>{const l=i,a=!!t?.strictDelimiters,s=!l?.env?.__markstreamFinal;if(/^\*[^*]+/.test(l.src))return!1;const c=[["$$","$$"],["$","$"],["\\(","\\)"]],f=String(l.pending??""),u=Math.max(0,l.pos-f.length);let d=u,h=u;const p=u;for(const[m,v]of c){const y=l.src,g=oC(y);let b=!1;m==="$$"&&d!==p&&(d=p);let k=-1,_=-1,T=0;const x=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){l.pos=l.pos+S.length,d=l.pos;return}if(S==="\\)"||S==="\\("){const w=l.push("text_special","",0);w.content=S==="\\)"?")":"(",w.markup=S,l.pos=l.pos+S.length,d=l.pos;return}if(!S)return;if(m==="$$"&&S.includes("$")){let w=0;for(;w<S.length;){const C=Is(S,w);if(C===-1){const H=S.slice(w);if(H){const re=l.push("text","",0);re.content=H,l.pos=l.pos+H.length,d=l.pos}break}if(C>0&&S[C-1]==="$"||C+1<S.length&&S[C+1]==="$"){const H=S.slice(w,C+1);if(H){const re=l.push("text","",0);re.content=H,l.pos=l.pos+H.length,d=l.pos}w=C+1;continue}const A=S.slice(w,C);if(A){const H=l.push("text","",0);H.content=A,l.pos=l.pos+A.length,d=l.pos}const M=Na(S,C+1);if(M===-1){const H=S.slice(C),re=l.push("text","",0);re.content=H,l.pos=l.pos+H.length,d=l.pos;break}const L=S.slice(C+1,M),P=L.includes("`"),I=!L||!L.trim(),N=S[M+1],V=Pa(L,N),K=Ba(L);if(!P&&!I&&!V&&!K){const H=l.push("math_inline","math",0);H.content=$r(L,t),H.markup="$",H.raw=`$${L}$`,H.loading=!1,l.pos=l.pos+(M-C+1),d=l.pos,w=M+1;continue}const $=l.push("text","",0);$.content="$",l.pos=l.pos+1,d=l.pos,w=C+1}return}const R=S.indexOf("![");if(R!==-1){if(R>0){const A=S.slice(0,R),M=l.push("text","",0);M.content=A,l.pos=l.pos+A.length,d=l.pos}const w=S.slice(R).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(w){const[,A,M]=w,L=M.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),P=L?L[1]:M,I=L&&L[2]?L[2]:null,N=l.push("image","img",0);N.attrs=[["src",P],["alt",A]],I&&N.attrs.push(["title",I]),N.content=A,N.children=[{type:"text",content:A,tag:""}],l.pos=l.pos+w[0].length,d=l.pos;const V=S.slice(R+w[0].length);V&&x(V);return}const C=l.push("text","",0);C.content=S,l.pos=l.pos+S.length,d=l.pos;return}const W=l.push("text","",0);W.content=S,l.pos=l.pos+S.length,d=l.pos};for(;!(d>=y.length);){const S=y.indexOf(m,d);if(S===-1)break;if(mp(y,S)){d=S+Math.max(1,m.length);continue}const R=lC(g,S);if(R){d=R[1];continue}if(S===k&&d===_){if(T++,T>2){d=S+Math.max(1,m.length);continue}}else T=0,k=S,_=d;if(m==="("&&S>0){let N=S-1;for(;N>=0&&y[N]===" ";)N--;if(N>=0&&y[N]==="]"){d=S+m.length;continue}}if(m==="$"&&S>0&&y[S-1]==="$"){d=S+1;continue}if(m==="$"&&S<y.length-1&&y[S+1]==="$"){d=S+2;continue}const W=m==="$"?Na(y,S+m.length):Nx(y,S+m.length,m,v);if(W===-1){const N=y.slice(S+m.length);if(N.includes(m)){d=y.indexOf(m,S+m.length);continue}if(W===-1){if(s&&!a&&lo(N)&&!N.includes("`")){if(d=S+m.length,b=!0,!o){l.pending="";const V=h?y.slice(h,d):y.slice(0,d),K=Cd(V)%2===1;if(h)x(y.slice(h,d));else{let $=y.slice(0,d);$.endsWith(m)&&($=$.slice(0,$.length-m.length)),x($)}if(K){const $=Sd(V)?.marker??"**",H=l.push("strong_open","",0);H.markup=$;const re=l.push("math_inline","math",0);re.content=$r(N,t),re.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",re.raw=`${m}${N}${v}`,re.loading=!0,H.content=N,l.push("strong_close","",0)}else{const $=l.push("math_inline","math",0);$.content=$r(N,t),$.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",$.raw=`${m}${N}${v}`,$.loading=!0}l.pos=y.length}d=y.length,h=d}break}}const w=y.slice(S+m.length,W),C=w.includes("`"),A=!w||!w.trim(),M=m==="$",L=y[W+v.length],P=M&&Pa(w,L),I=M&&Ba(w);if(a?C||A||P||I:C||A||P||I||!M&&!lo(w)){d=W+v.length;const N=y.slice(l.pos,d);l.pending||(x(N),h=d);continue}if(b=!0,!o){const N=y.slice(l.pos-l.pending.length,S);let V=y.slice(0,d)?y.slice(h,S):N;const K=Cd(V)%2===1;S!==l.pos&&K&&(V=l.pending+y.slice(l.pos,S));const $=K?Sd(V):null,H=$?.marker??"**";if(l.pending!==V)if(l.pending="",K)if($){const re=V.slice($.index+H.length);x(V.slice(0,$.index));const Z=l.push("strong_open","",0);Z.markup=H;const ne=l.push("text","",0);ne.content=re,l.push("strong_close","",0)}else x(V);else x(V);if(K){const re=l.push("strong_open","",0);re.markup=H;const Z=l.push("math_inline","math",0);Z.content=$r(w,t),Z.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",Z.raw=`${m}${w}${v}`,Z.loading=!1;const ne=y.slice(W+v.length).startsWith(H);ne&&l.push("strong_close","",0),l.pos=W+v.length,d=l.pos,h=d,ne||l.push("strong_close","",0);continue}else{const re=l.push("math_inline","math",0);re.content=$r(w,t),re.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",re.raw=`${m}${w}${v}`,re.loading=!1}}d=W+v.length,h=d,l.pos=d}if(b){if(o)l.pos=d;else{if(m==="$$"&&d<y.length&&y.slice(d).includes("$")){let S=d;for(;!(S>=y.length);){const R=Is(y,S);if(R===-1)break;if(R+1<y.length&&y[R+1]==="$"){S=R+2;continue}if(R>0&&y[R-1]==="$"){S=R+1;continue}const W=Na(y,R+1);if(W===-1)break;const w=y.slice(R+1,W),C=w.includes("`"),A=!w||!w.trim(),M=y[W+1],L=Pa(w,M),P=Ba(w);if(!C&&!A&&!L&&!P){const I=y.slice(d,R);I&&x(I);const N=l.push("math_inline","math",0);N.content=$r(w,t),N.markup="$",N.raw=`$${w}$`,N.loading=!1,d=W+1,S=W+1}else x("$"),S=R+1}S<y.length&&x(y.slice(S))}else d<y.length&&x(y.slice(d));l.pos=y.length}return!0}}return!1},r=(i,o,l,a)=>{const s=i,c=!s?.env?.__markstreamFinal,f=t?.strictDelimiters,u=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],d=s.bMarks[o]+s.tShift[o];let h=s.src.slice(d,s.eMarks[o]).trim(),p=!1,m="",v="",y=!1;for(const[S,R]of u)if(h.startsWith(S))if(S.includes("["))if(t?.strictDelimiters){if(h.replace("\\","")==="["){if(o+1<l){p=!0,m=S,v=R;break}continue}}else if(h.replace("\\","")==="["){if(o+1<l){p=!0,m=S,v=R;break}continue}else{const W=s.tokens[s.tokens.length-1];if(W&&W.type==="list_item_open"&&W.mark==="-"&&h.slice(S.length,h.indexOf("]")).trim()==="x")continue;if(h.replace("\\","").startsWith("[")&&!h.includes("](")){const w=h.indexOf("]");if(h.slice(w).trim()!=="]")continue;const C=h.slice(S.length,w);if(S==="["?Ad(C):lo(C)){p=!0,m=S,v=R;break}continue}}else{p=!0,m=S,v=R;break}else if(S==="$$"&&h.endsWith(S)&&!h.slice(0,h.length-S.length).trim().includes(S)&&o+1<l){s.push("text","",0).content=h.slice(0,h.length-S.length);const W=s.bMarks[o+1]+s.tShift[o+1];h=s.src.slice(W,s.eMarks[o+1]).trim(),y=!0,p=!0,m=S,v=R;break}if(!p)return!1;if(a)return!0;if(h.includes(v)&&h.indexOf(v)>m.length){const S=h.indexOf(m),R=h.indexOf(v,S+m.length),W=h.slice(S+m.length,R),w=s.push("math_block","math",0);return w.content=$r(W),w.markup=m==="$$"?"$$":m==="["?"[]":"\\[\\]",w.map=[o,o+1],w.raw=`${m}${W}${v}`,w.block=!0,w.loading=!1,s.line=o+1,!0}let g=o,b="",k=!1;const _=h===m?"":h.slice(m.length);if(_.includes(v)){const S=_.indexOf(v);b=_.slice(0,S),k=!0,g=o}else for(_&&!y&&(b=_),g=o+1;g<l;g++){const S=s.bMarks[g]+s.tShift[g],R=s.eMarks[g],W=s.src.slice(S-1,R);if(W.trim()===v){k=!0;break}else if(W.includes(v)){k=!0;const w=W.indexOf(v);b+=(b?`
`:"")+W.slice(0,w);break}b+=(b?`
`:"")+W}if((!c||f)&&!k)return!1;const T=/^\s*!\[/.test(b);if(!(m==="$$"?!T:m==="["?Ad(b):lo(b)))return!1;const x=s.push("math_block","math",0);return x.content=$r(b),x.markup=m==="$$"?"$$":m==="["?"[]":"\\[\\]",x.raw=`${m}${b}${b.startsWith(`
`)?`
`:""}${v}`,x.map=[o,g+1],x.block=!0,x.loading=!k,s.line=g+1,!0};e.inline.ruler.before("escape","math",n),e.block.ruler.before("paragraph","math_block",r,{alt:["paragraph","reference","blockquote","list"]})}function sC(e){const t=e.renderer.rules.image||function(n,r,i,o,l){const a=n,s=l;return s.renderToken?s.renderToken(a,r,i):""};e.renderer.rules.image=(n,r,i,o,l)=>{const a=n;return a[r].attrSet?.("loading","lazy"),t(a,r,i,o,l)},e.renderer.rules.fence=e.renderer.rules.fence||((n,r)=>{const i=n[r],o=String(i.info??"").trim();return`<pre class="${o?`language-${e.utils.escapeHtml(o.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(i.content??""))}</code></pre>`})}function cC(e={}){const t=new Hw({html:!0,linkify:!0,typographer:!0,stream:!0,...e.markdownItOptions??{}});return(e.enableMath??!0)&&aC(t,{...e.mathOptions??{}}),(e.enableContainers??!0)&&Ww(t),e.enableFixIndentedCodeBlock!==!1&&vx(t),_x(t),Sx(t),xx(t),Dx(t),sC(t),mx(t,{customHtmlTags:e.customHtmlTags}),t}function uC(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function dC(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,r=n===""||n==="true";return{type:"checkbox_input",checked:r,raw:r?"[x]":"[ ]"}}function fC(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Xo(e,t,n){const r=[];let i="",o=t+1;const l=[];for(;o<e.length&&e[o].type!=="em_close";)i+=String(e[o].content??e[o]?.text??""),l.push(e[o]),o++;return r.push(...It(l,void 0,void 0,n)),{node:{type:"emphasis",children:r,raw:`*${i}*`},nextIndex:o<e.length?o+1:e.length}}const Td=/\r?\n[ \t]*`+\s*$/,hC=["diff ","index ","--- ","+++ ","@@ "],pC=/\r?\n/;function mC(e){const t=[],n=[];for(const r of e.split(pC)){const i=r;hC.some(o=>i.startsWith(o))||(i.length>=2&&i[0]==="-"&&i[1]===" "?t.push(` ${i.slice(1)}`):i.length>=2&&i[0]==="+"&&i[1]===" "?n.push(` ${i.slice(1)}`):(t.push(i),n.push(i)))}return{original:t.join(`
`),updated:n.join(`
`)}}function Ec(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},r=typeof n.closed=="boolean"?n.closed:void 0,i=String(e.info??""),o=i.startsWith("diff"),l=o?(()=>{const s=i,c=s.indexOf(" ");return c===-1?"":String(s.slice(c+1)??"")})():i;let a=String(e.content??"");if(Td.test(a)&&(a=a.replace(Td,"")),o){const{original:s,updated:c}=mC(a);return{type:"code_block",language:l,code:String(c??""),raw:String(a??""),diff:o,loading:r===!0?!1:r===!1?!0:!t,originalCode:s,updatedCode:c}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:o,loading:r===!0?!1:r===!1?!0:!t}}function gC(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function vC(){return{type:"hardbreak",raw:`\\
`}}function yC(e,t,n){const r=[];let i="",o=t+1;const l=[];for(;o<e.length&&e[o].type!=="mark_close";)i+=String(e[o].content??""),l.push(e[o]),o++;return r.push(...It(l,void 0,void 0,n)),{node:{type:"highlight",children:r,raw:`==${i}==`},nextIndex:o<e.length?o+1:e.length}}let za=null;const Ha=new WeakMap;function Dd(){return za||(za={customTagSet:null,allowedTagSet:ca()}),za}function gp(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function vp(e){return/^<\s*\//.test(e)}function yp(e,t){return/\/\s*>\s*$/.test(t)||Lo.has(e)}function kC(e){const t=String(e??"").trim();if(!t)return"";const n=t.match(/^[<\s/]*([A-Z][\w-]*)/i);return n?n[1].toLowerCase():""}function bC(e){if(!e||e.length===0)return Dd();const t=Ha.get(e);if(t)return t;const n=e.map(kC).filter(Boolean);if(!n.length){const i=Dd();return Ha.set(e,i),i}const r={customTagSet:new Set(n),allowedTagSet:ca({customHtmlTags:e})};return Ha.set(e,r),r}function kp(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function _C(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let r;for(;(r=n.exec(e))!==null;){const i=r[1];if(!i)continue;const o=r[2]||r[3]||r[4]||"";t.push([i,o])}return t}function zl(e,t){const n=t.toLowerCase();for(let r=e.length-1;r>=0;r--){const[i,o]=e[r];if(String(i).toLowerCase()===n)return o}}function wC(e,t,n){const r=e.slice();return zl(r,"href")||r.push(["href",t]),n!=null&&!zl(r,"title")&&r.push(["title",n]),r}function Fs(e){return e.map(kp).join("")}function xC(e,t,n){let r=0;for(let i=t;i<e.length;i++){const o=e[i];if(o.type!=="html_inline")continue;const l=String(o.content??""),a=gp(l),s=vp(l),c=yp(a,l);if(!s&&!c&&a===n){r++;continue}if(s&&a===n){if(r===0)return i;r--}}return-1}function ja(e,t,n){const r=[e[t]];let i=[],o=t+1,l=!1;const a=n?xC(e,t+1,n):-1;return a!==-1?(i=e.slice(t+1,a),r.push(...i,e[a]),o=a+1,l=!0):(i=e.slice(t+1),i.length&&r.push(...i),o=e.length),{closed:l,html:Fs(r),innerTokens:i,nextIndex:o}}function CC(e,t,n,r,i,o,l){const a=String(e.content??""),s=gp(a),{customTagSet:c,allowedTagSet:f}=bC(l?.customHtmlTags);if(!s)return[{type:"inline_code",code:a,raw:a},n+1];if(!f.has(s)&&!ja(t,n,s).closed){const _=kp(e);return[{type:"text",content:_,raw:_},n+1]}if(s==="br")return[{type:"hardbreak",raw:a},n+1];const u=vp(a),d=yp(s,a);if(u)return[{type:"html_inline",tag:s,content:a,children:[],raw:a,loading:!1},n+1];if(s==="a"){const _=ja(t,n,s),T=_C(a),x=_.innerTokens,S=String(zl(T,"href")??""),R=zl(T,"title"),W=R==null?null:String(R),w=wC(T,S,W),C=x.length?r(x,i,o,l):[],A=x.length?Fs(x):S||"";return!C.length&&A&&C.push({type:"text",content:A,raw:A}),[{type:"link",href:S,title:W,text:A,attrs:w,children:C,loading:!_.closed,raw:_.html||a},_.nextIndex]}if(d)return[{type:c?.has(s)?s:"html_inline",tag:s,content:a,children:[],raw:a,loading:!1},n+1];const h=ja(t,n,s);if(s==="p"||s==="div")return[{type:"paragraph",children:h.innerTokens.length?r(h.innerTokens,i,o,l):[],raw:h.html},h.nextIndex];const p=h.innerTokens.length?r(h.innerTokens,i,o,l):[];let m=h.html||a,v=!h.closed,y=!1;if(!h.closed){const _=`</${s}>`;m.toLowerCase().includes(_.toLowerCase())||(m+=_),y=!0,v=!0}const g=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let k;for(;(k=b.exec(a))!==null;){const _=k[1],T=k[2]||k[3]||k[4]||"";g.push([_,T])}return c?.has(s)?[{type:s,tag:s,attrs:g,content:h.innerTokens.length?Fs(h.innerTokens):"",children:h.innerTokens.length?r(h.innerTokens,i,o,l):[],raw:m,loading:e.loading||v,autoClosed:y},h.nextIndex]:[{type:"html_inline",tag:s,attrs:g,content:m,children:p,raw:m,loading:v,autoClosed:y},h.nextIndex]}function Ed(e,t=!1){let n=e.attrs??[],r=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const f of e.children){const u=f?.attrs;if(Array.isArray(u)&&u.length>0){n=u,r=f;break}}const i=String(n.find(f=>f[0]==="src")?.[1]??""),o=n.find(f=>f[0]==="alt")?.[1];let l="";o!=null&&String(o).length>0?l=String(o):r?.content!=null&&String(r.content).length>0?l=String(r.content):Array.isArray(r?.children)&&r.children[0]?.content?l=String(r.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(f=>f[0]==="title")?.[1]??null,s=a===null?null:String(a),c=String(e.content??"");return{type:"image",src:i,alt:l,title:s,raw:c,loading:t}}function SC(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function AC(e,t,n){const r=[];let i="",o=t+1;const l=[];for(;o<e.length&&e[o].type!=="ins_close";)i+=String(e[o].content??""),l.push(e[o]),o++;return r.push(...It(l,void 0,void 0,n)),{node:{type:"insert",children:r,raw:`++${String(i)}++`},nextIndex:o<e.length?o+1:e.length}}function TC(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const r=n?.[0];r&&t.push([String(r),String(n?.[1]??"")])}return t}function Hl(e,t){const n=t.toLowerCase();for(let r=e.length-1;r>=0;r--){const[i,o]=e[r];if(String(i).toLowerCase()===n)return o}}function DC(e,t,n){const r=e.slice();return Hl(r,"href")||r.push(["href",t]),n!=null&&!Hl(r,"title")&&r.push(["title",n]),r}function EC(e,t,n){const r=e[t],i=TC(r.attrs),o=String(Hl(i,"href")??""),l=Hl(i,"title"),a=l==null?null:String(l),s=DC(i,o,a);let c=t+1;const f=[];let u=!0;for(;c<e.length&&e[c].type!=="link_close";)f.push(e[c]),c++;e[c]?.type==="link_close"&&(u=!1);const d=It(f,void 0,void 0,n),h=d.map(p=>{const m=p;return"content"in p?String(m.content??""):String(m.raw??"")}).join("");return{node:{type:"link",href:o,title:a,text:h,children:d,raw:`[${h}](${o}${a?` "${a}"`:""})`,loading:u,attrs:s},nextIndex:c<e.length?c+1:e.length}}function Md(e){const t=e.content??"",n=e.raw==="$$"?`$${t}$`:e.raw||"";return{type:"math_inline",content:t,loading:!!e.loading,raw:n,markup:e.markup}}function MC(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function Ld(e,t,n){const r=[];let i="",o=t+1;const l=[];for(;o<e.length&&e[o].type!=="s_close";)i+=String(e[o].content??""),l.push(e[o]),o++;return r.push(...It(l,void 0,void 0,n)),{node:{type:"strikethrough",children:r,raw:`~~${i}~~`},nextIndex:o<e.length?o+1:e.length}}const LC=/\\([\\()[\]`$|*_\-!])/g;function RC(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(LC,"$1")===t))return n}function Qo(e,t,n,r){const i=[];let o="",l=t+1;const a=[];let s=1;for(;l<e.length;){if(e[l].type==="strong_close"){if(s===1)break;s--}e[l].type==="strong_open"&&s++,o+=String(e[l].content??""),a.push(e[l]),l++}return i.push(...It(a,RC(n,o),void 0,r)),{node:{type:"strong",children:i,raw:`**${String(o)}**`},nextIndex:l<e.length?l+1:e.length}}function $C(e,t,n){const r=[];let i="",o=t+1;const l=[];for(;o<e.length&&e[o].type!=="sub_close";)i+=String(e[o].content??""),l.push(e[o]),o++;r.push(...It(l,void 0,void 0,n));const a=String(e[t].content??""),s=i||a;return{node:{type:"subscript",children:r.length>0?r:[{type:"text",content:s,raw:s}],raw:`~${s}~`},nextIndex:o<e.length?o+1:e.length}}function IC(e,t,n){const r=[];let i="",o=t+1;const l=[];for(;o<e.length&&e[o].type!=="sup_close";)i+=String(e[o].content??""),l.push(e[o]),o++;return r.push(...It(l,void 0,void 0,n)),{node:{type:"superscript",children:r.length>0?r:[{type:"text",content:i||String(e[t].content??""),raw:i||String(e[t].content??"")}],raw:`^${i||String(e[t].content??"")}^`},nextIndex:o<e.length?o+1:e.length}}function FC(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const OC=/\*\*([\s\S]*?)\*\*/,NC=/[^~]*~{2,}[^~]+/,PC=/\*\*/,BC=/\*\*\*|___|\*\*|__|\*|_|~~/,zC=/\\([\\()[\]`$|*_\-!])/g,bp=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),HC=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,jC=/:\/\//;function VC(e){let t=0,n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="*"){n+=2;continue}e[n]==="*"&&t++,n++}return t}function Rd(e,t=0){if(!e)return-1;let n=0;for(let r=0;r<e.length;r++){const i=e[r],o=e[r+1];if(i==="\\"&&o&&bp.has(o)){if(o==="*"&&n>=t){n++,r++;continue}n++,r++;continue}if(i==="*"&&n>=t)return n;n++}return-1}function WC(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let r=0;for(;n+r<e.length&&e[n+r]==="\\";)r++;const i=e[n+r];if(t+="\\".repeat(Math.floor(r/2)),r%2===1){if(i&&bp.has(i)){t+=i,n+=r+1;continue}t+="\\"}n+=r}return t}const qC=/[\p{L}\p{N}]/u,UC=/^[\p{L}\p{N}]+$/u;function Os(e){return e?qC.test(e):!1}function YC(e){return e?UC.test(e):!1}function Va(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const r=t>0?e[t-1]:void 0,i=n<e.length?e[n]:void 0;return{len:n-t,prev:r,next:i,intraword:Os(r)&&Os(i)}}function KC(e){return e?HC.test(e)||jC.test(e):!1}function ZC(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function It(e,t,n,r){if(!e||e.length===0)return[];const i=[];let o=null,l=0;const a=r?.requireClosingStrong;function s(){o=null}function c(w,C){const A=e.length===1?t:String(C.content??""),M=[];if(NC.test(w)){const P=w.indexOf("~~");P!==-1&&M.push({type:"strikethrough",index:P})}if(PC.test(w)){const P=w.indexOf("**");P!==-1&&M.push({type:"strong",index:P})}if(/[^*]*\*[^*]+/.test(w)){const P=A?Rd(A,0):w.indexOf("*");if(A&&P===-1)return!1;P!==-1&&M.push({type:"emphasis",index:P})}M.sort((P,I)=>P.index!==I.index?P.index-I.index:P.type===I.type?0:P.type==="strong"?-1:I.type==="strong"?1:0);const L=M[0];if(!L)return!1;if(L.type==="strikethrough"){const P=L.index,I=P>-1?w.slice(0,P):"";if(I&&m(I,I),P===-1)return l++,!0;const N=w.indexOf("~~",P+2),V=N===-1?w.slice(P+2):w.slice(P+2,N),K=N===-1?"":w.slice(N+2),{node:$}=Ld([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:V,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,r);return s(),p($),K&&(g({type:"text",content:K,raw:K}),l--),l++,!0}if(L.type==="strong"){const P=L.index,I=P>-1?w.slice(0,P):"";if(I&&m(I,I),P===-1)return l++,!0;if(t&&P===0){let re=!1,Z=0;for(;Z<w.length&&w[Z]==="*";)Z++;if(t.startsWith("\\*")&&(re=!0),re){let ne=0,de=0;for(;de<t.length&&ne<Z;)if(t[de]==="\\"&&de+1<t.length&&t[de+1]==="*")ne+=1,de+=2;else{if(t[de]==="*")break;de++}if(ne>=2)return m(w,w),l++,!0}}if(t&&(w.match(/\*/g)||[]).length>VC(t))return m(w.slice(I.length),w.slice(I.length)),l++,!0;const N=Va(w,P),V=OC.exec(w);let K="",$="";if(V&&typeof V.index=="number"){K=V[1],$=w.slice(V.index+V[0].length);const re=Va(w,V.index+V[0].length-2);if(N.intraword&&re.intraword&&!YC(K)||!K&&N.len>=4&&N.intraword)return m(w.slice(I.length),w.slice(I.length)),l++,!0}else{if(a||N.intraword)return m(w.slice(I.length),w.slice(I.length)),l++,!0;K=w.slice(P+2),$=""}if(!K&&/^\*+$/.test($))return m(w,w),l++,!0;const{node:H}=Qo([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:K,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,r);return s(),p(H),$&&(g({type:"text",content:$,raw:$}),l--),l++,!0}if(L.type==="emphasis"){let P=L.index;P===-1&&(P=0);const I=w.slice(0,P);I&&m(I,I);const N=Va(w,P),V=A?Rd(A,P+1):w.indexOf("*",P+1),K=e[l+1];if(r?.final&&K?.type==="em_open"&&V!==-1&&w.slice(P+1,V).trim()!==w.slice(P+1,V)||V===-1&&(r?.final||N.intraword||!Os(w[P+1])))return m(w.slice(P),w.slice(P)),l++,!0;const{node:$}=Xo([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:w.slice(P,V>-1?V+1:void 0).replace(/\*/g,""),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,r);if(s(),p($),V!==-1&&V<w.length-1){const H=w.slice(V+1);H&&(g({type:"text",content:H,raw:H}),l--)}return l++,!0}return!1}function f(w,C){if(!w.includes("`"))return!1;const M=(H=>{for(let re=0;re<H.length;re++){if(H[re]!=="`")continue;let Z=0;for(let ne=re-1;ne>=0&&H[ne]==="\\";ne--)Z++;if(Z%2===0)return re}return-1})(w);if(M===-1)return!1;let L=1;for(let H=M+1;H<w.length&&w[H]==="`";H++)L++;const P="`".repeat(L),I=M+L,N=w.indexOf(P,I);if(N===-1){if(L===1){const re=w.slice(0,M),Z=w.slice(M+1);return re&&(c(re,C)?l--:m(re,re)),d({type:"inline_code",code:Z,raw:String(Z)}),l++,!0}let H=w;for(let re=l+1;re<e.length;re++)H+=String((e[re].content??"")+(e[re].markup??""));return l=e.length-1,m(H,H),l++,!0}s();const V=w.slice(0,M),K=w.slice(M+L,N),$=w.slice(N+L);return V&&(c(V,C)?l--:m(V,V)),d({type:"inline_code",code:K,raw:String(K??"")}),$&&(g({type:"text",content:$,raw:$}),l--),l++,!0}function u(w){const C=r?.__markdownIt;if(!C||!r?.final||e.length<=1||!e.some(P=>P?.type==="math_inline")||!BC.test(w))return null;const A=C.parseInline(w,{__markstreamFinal:!0});if(!Array.isArray(A)||A.length===0)return null;const M=(A.find(P=>P?.type==="inline")?.children??[]).filter(P=>!(P?.type==="text"&&String(P.content??"")===""));if(!M.length||!M.some(P=>P?.type!=="text")||M.length===1&&M[0]?.type==="text"&&String(M[0].content??"")===w)return null;const L=It(M,w,n,r);return L.length?L:null}function d(w){s(),i.push(w)}function h(w){s(),i.push(w)}function p(w){d(w)}function m(w,C){o?(o.content+=w,o.raw+=C??w):(o={type:"text",content:String(w??""),raw:String(C??w??"")},i.push(o))}function v(w,C){return String(w.markup??"").startsWith(C)}function y(w,C){let A=w;const M=String(C.content??"");return A.endsWith("\\")&&!v(C,"\\\\")&&!M.endsWith("\\\\")&&(A=A.slice(0,-1)),A.endsWith("(")&&!v(C,"\\(")&&!M.endsWith("\\(")&&(A=A.slice(0,-1)),/\*+$/.test(A)&&!v(C,"\\*")&&!M.endsWith("\\*")&&(A=A.replace(/\*+$/,"")),A}for(;l<e.length;){const w=e[l];g(w)}function g(w){switch(w.type){case"text":k(w);break;case"softbreak":o?(o.content+=`
`,o.raw+=`
`):(o={type:"text",content:`
`,raw:`
`},i.push(o)),l++;break;case"code_inline":p(SC(w)),l++;break;case"html_inline":{const[C,A]=CC(w,e,l,It,t,n,r);p(C),l=A;break}case"link_open":_(w);break;case"image":s(),p(Ed(w)),l++;break;case"strong_open":{s();const{node:C,nextIndex:A}=Qo(e,l,w.content,r);p(C),l=A;break}case"em_open":{s();const{node:C,nextIndex:A}=Xo(e,l,r);p(C),l=A;break}case"s_open":{s();const{node:C,nextIndex:A}=Ld(e,l,r);p(C),l=A;break}case"mark_open":{s();const{node:C,nextIndex:A}=yC(e,l,r);p(C),l=A;break}case"ins_open":{s();const{node:C,nextIndex:A}=AC(e,l,r);p(C),l=A;break}case"sub_open":{s();const{node:C,nextIndex:A}=$C(e,l,r);p(C),l=A;break}case"sup_open":{s();const{node:C,nextIndex:A}=IC(e,l,r);p(C),l=A;break}case"sub":s(),p({type:"subscript",children:[{type:"text",content:String(w.content??""),raw:String(w.content??"")}],raw:`~${String(w.content??"")}~`}),l++;break;case"sup":s(),p({type:"superscript",children:[{type:"text",content:String(w.content??""),raw:String(w.content??"")}],raw:`^${String(w.content??"")}^`}),l++;break;case"emoji":{s();const C=e[l-1];C?.type==="text"&&/\|:-+/.test(String(C.content??""))?m("",""):p(fC(w)),l++;break}case"checkbox":s(),p(uC(w)),l++;break;case"checkbox_input":s(),p(dC(w)),l++;break;case"footnote_ref":s(),p(gC(w)),l++;break;case"footnote_anchor":{s();const C=w.meta??{};d({type:"footnote_anchor",id:String(C.label??w.content??""),raw:String(w.content??"")}),l++;break}case"hardbreak":s(),p(vC()),l++;break;case"fence":s(),p(Ec(e[l])),l++;break;case"math_inline":s(),!w.content&&w.markup==="$"&&e[l+1]?.type==="text"&&e[l+2]?.type==="math_inline"?(p(Md({...w,content:e[l+1].content})),l+=2):p(Md(w)),l++;break;case"reference":T(w);break;case"text_special":m(String(w.content??""),String(w.content??"")),l++;break;default:if(w.type==="link"&&w.href!=null&&r?.validateLink&&!r.validateLink(w.href)){s();const C=String(w.text??"");m(C,C),l++}else x(w)||h(w),l++;break}}function b(w,C,A,M){const L=FC({...C,content:w});if(o){o.content+=y(L.content,C),o.raw+=L.raw;return}const P=A?.tag==="br"&&e[l-2]?.content==="[";M||(L.content=y(L.content,C)),o=L,o.center=P,i.push(o)}function k(w){const C=String(w.content??""),A=e.length===1&&C.includes("\\")&&typeof t=="string"?String(t):"";let M=A?WC(A):C.replace(zC,"$1");if(w.content==="<"||M==="1"&&e[l-1]?.tag==="br"){l++;return}const L=M.indexOf("$");L!==-1&&L===M.lastIndexOf("$")&&M.endsWith("$")&&(M=M.slice(0,-1)),M.endsWith("undefined")&&!t?.endsWith("undefined")&&(M=M.slice(0,-9));let P=i.length,I="";for(let $=i.length-1;$>=0;$--){const H=i[$];if(H.type!=="text")break;P=$,I=String(H.content??"")+I}P<i.length&&(M.startsWith(I)?(o=null,i.length=P):o=i[i.length-1]);const N=e[l+1];if(n?.type==="list_item_open"&&/^\d$/.test(M)){l++;return}if((M==="`"||M==="|"||M==="$")&&!v(w,`\\${M}`)||/^\*+$/.test(M)&&!v(w,"\\*")){l++;return}if(!N&&/[^\]]\s*\(\s*$/.test(M)&&(M=M.replace(/\(\s*$/,"")),!M){l++;return}if(!(M.includes("*")||M.includes("_")||M.includes("~")||M.includes("`")||M.includes("[")||M.includes("!")||M.includes("$")||M.includes("|")||M.includes("("))){b(M,w,e[l-1],N),l++;return}if(W(M))return;const V=e[l-1];if(M==="["&&!N?.markup?.includes("*")||M==="]"&&!V?.markup?.includes("*")){l++;return}if(f(C,w)||R(M,w)||e[l+1]?.type!=="link_open"&&S(M))return;const K=u(C);if(K){s();for(const $ of K)p($);l++;return}c(M,w)||(b(M,w,V,N),l++)}function _(w){s();const{node:C,nextIndex:A}=EC(e,l,r);l=A;const M=C.children.length===1&&C.children[0]?.type==="text";if(C.loading&&t&&C.text===C.href&&M){const I=ZC(t,C.href);I&&(C.text=I,C.children=[{type:"text",content:I,raw:I}],C.raw=`[${I}](${C.href}${C.title?` "${C.title}"`:""})`)}if(r?.validateLink&&!r.validateLink(C.href)){m(C.text,C.text);return}const L=w.attrs?.find(([I])=>I==="href")?.[1],P=String(L??"");if(t&&P){const I=t.indexOf("](");if(I!==-1){const N=t.indexOf(")",I+2);N===-1?C.loading=!0:C.loading&&t.slice(I+2,N).includes(P)&&(C.loading=!1)}}x(C)||d(C)}function T(w){s(),p(MC(w)),l++}function x(w){if(w.type!=="link")return!1;const C=i[i.length-1];if(!C||C.type!=="text")return!1;const A=String(C.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!A)return!1;const M=w,L=String(M.href??""),P=String(M.text??""),I=String(A[2]??""),N=L.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!L||!(P===L||P===N||KC(P)))return!1;const V=String(A[1]??"");return V?(C.content=V,C.raw=V):i.pop(),d({...w,text:I,children:[{type:"text",content:I,raw:I}],raw:`[${I}](${L}${M.title?` "${M.title}"`:""})`}),!0}function S(w,C){const A=w.indexOf("[");if(A===-1)return!1;let M=w.slice(0,A);const L=w.indexOf("](",A);if(L!==-1){const P=e[l+2];let I=w.slice(A+1,L);if(I.includes("[")){const Z=I.indexOf("[");M+=w.slice(0,A+Z+1);const ne=A+Z+1;I=w.slice(ne+1,L)}const N=e[l+1];if(w.endsWith("](")&&N?.type==="link_open"&&P){const Z=e[l+4];let ne=4,de=!0;Z?.type==="text"&&Z.content===")"?(ne++,de=!1):Z?.type==="text"&&Z.content==="."&&l++,M&&m(M,M);const be=String(P.content??"");return r?.validateLink&&!r.validateLink(be)?m(I,I):d({type:"link",href:be,title:null,text:I,children:[{type:"text",content:I,raw:I}],loading:de}),l+=ne,!0}const V=w.indexOf(")",L),K=V!==-1?w.slice(L+2,V):"",$=V===-1;let H=M.match(/\*+$/);if(H&&(M=M.replace(/\*+$/,"")),M&&m(M,M),H||(H=I.match(/^\*+/)),!a&&H){const Z=H[0].length;I=I.replace(/^\*+/,"").replace(/\*+$/,"");const ne=[];if(Z===1?ne.push({type:"em_open",tag:"em",nesting:1}):Z===2?ne.push({type:"strong_open",tag:"strong",nesting:1}):Z===3&&(ne.push({type:"strong_open",tag:"strong",nesting:1}),ne.push({type:"em_open",tag:"em",nesting:1})),ne.push({type:"link",href:K,title:null,text:I,children:[{type:"text",content:I,raw:I}],loading:$}),Z===1){ne.push({type:"em_close",tag:"em",nesting:-1});const{node:de}=Xo(ne,0,r);p(de)}else if(Z===2){ne.push({type:"strong_close",tag:"strong",nesting:-1});const{node:de}=Qo(ne,0,void 0,r);p(de)}else if(Z===3){ne.push({type:"em_close",tag:"em",nesting:-1}),ne.push({type:"strong_close",tag:"strong",nesting:-1});const{node:de}=Qo(ne,0,void 0,r);p(de)}else{const{node:de}=Xo(ne,0,r);p(de)}}else r?.validateLink&&!r.validateLink(K)?m(I,I):d({type:"link",href:K,title:null,text:I,children:[{type:"text",content:I,raw:I}],loading:$});const re=V!==-1?w.slice(V+1):"";return re&&(g({type:"text",content:re,raw:re}),l--),l++,!0}return!1}function R(w,C){const A=w.indexOf("![");if(A===-1)return!1;const M=w.slice(0,A);return o?o.content+=M:o={type:"text",content:M,raw:M},i.push(o),o=null,d(Ed(C,!0)),l++,!0}function W(w){if(!(w?.startsWith("[")&&n?.type==="list_item_open"))return!1;const C=w.slice(1).match(/[^\s\]]/);if(C===null)return l++,!0;if(C&&/x/i.test(C[0])){const A=C[0]==="x"||C[0]==="X";return d({type:"checkbox_input",checked:A,raw:A?"[x]":"[ ]"}),l++,!0}return!1}return i}function GC(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const r=e.children;if(!(!Array.isArray(r)||r.length===0))for(;r.length;){const i=r[r.length-1];if(!i){r.pop();continue}if(i.type==="softbreak"||i.type==="hardbreak"){r.pop();continue}if(i.type==="text"){const o=String(i.content??""),l=o.replace(/[ \t\r\n]+$/g,"");if(l===o)break;if(l){i.content=l;break}r.pop();continue}break}}function XC(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 r=e.children;if(!(!Array.isArray(r)||r.length===0))for(;r.length;){const i=r[r.length-1];if(!i){r.pop();continue}if(i.type==="softbreak"||i.type==="hardbreak"){r.pop();continue}if(i.type==="text"){const o=String(i.content??"");if(/^[ \t\r\n\d.)]*$/.test(o)){r.pop();continue}const l=o.replace(/[ \t\r\n\d.)]+$/g,"");l!==o&&(l?i.content=l:r.pop())}break}}function Xi(e,t,n){const r=e[t],i=[];let o=t+1;for(;o<e.length&&e[o].type!=="bullet_list_close"&&e[o].type!=="ordered_list_close";)if(e[o].type==="list_item_open"){const l=[];let a=o+1;for(;a<e.length&&e[a].type!=="list_item_close";)if(e[a].type==="paragraph_open"){const s=e[a+1],c=e[a-1];XC(s),GC(s),l.push({type:"paragraph",children:It(s.children||[],String(s.content??""),c,n),raw:String(s.content??"")}),a+=3}else if(e[a].type==="blockquote_open"){const[s,c]=Qi(e,a,n);l.push(s),a=c}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[s,c]=Xi(e,a,n);l.push(s),a=c}else{const s=Lc(e,a,n,Mc);s?(l.push(s[0]),a=s[1]):a+=1}i.push({type:"list_item",children:l,raw:l.map(s=>s.raw).join("")}),o=a+1}else o+=1;return[{type:"list",ordered:r.type==="ordered_list_open",start:(()=>{if(r.attrs&&r.attrs.length){const l=r.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:i,raw:i.map(l=>l.raw).join(`
`)},o+1]}function QC(e,t,n,r){const i=String(n[1]??"note"),o=String(n[2]??i.charAt(0).toUpperCase()+i.slice(1)),l=[];let a=t+1;for(;a<e.length&&e[a].type!=="container_close";)if(e[a].type==="paragraph_open"){const s=e[a+1];s&&l.push({type:"paragraph",children:It(s.children||[],String(s.content??""),void 0,r),raw:String(s.content??"")}),a+=3}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[s,c]=Xi(e,a,r);l.push(s),a=c}else if(e[a].type==="blockquote_open"){const[s,c]=Qi(e,a,r);l.push(s),a=c}else{const s=sa(e,a,r);s?(l.push(s[0]),a=s[1]):a++}return[{type:"admonition",kind:i,title:o,children:l,raw:`:::${i} ${o}
${l.map(s=>s.raw).join(`
`)}
:::`},a+1]}const JC=new Set(["warning","info","note","tip","danger","caution"]);function e2(e){let t=0;for(;t<e.length&&t<3&&e[t]===":";)t++;if(t===0||e[t]===":")return null;const n=e.slice(t).trimStart();if(!n)return null;const r=n.search(/\s/),i=(r===-1?n:n.slice(0,r)).toLowerCase();return JC.has(i)?{kind:i,title:r===-1?"":n.slice(r).trim()}:null}function t2(e,t,n){const r=e[t];let i="note",o="";const l=r.type.match(/^container_(\w+)_open$/);if(l){i=l[1];const f=String(r.info??"").trim();if(f&&!f.startsWith(":::")&&f.toLowerCase().startsWith(i)){const u=f.slice(i.length).trim();u&&(o=u)}}else{const f=e2(String(r.info??"").trim());f&&(i=f.kind,o=f.title)}o||(o=i.charAt(0).toUpperCase()+i.slice(1));const a=[];let s=t+1;const c=new RegExp(`^container_${i}_close$`);for(;s<e.length&&e[s].type!=="container_close"&&!c.test(e[s].type);)if(e[s].type==="paragraph_open"){const f=e[s+1];if(f){const u=f.children||[];let d=-1;for(let p=u.length-1;p>=0;p--){const m=u[p];if(m.type==="text"&&/:+/.test(m.content)){d=p;break}}const h=d!==-1?u.slice(0,d):u;a.push({type:"paragraph",children:It(h||[],void 0,void 0,n),raw:String(f.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")})}s+=3}else if(e[s].type==="bullet_list_open"||e[s].type==="ordered_list_open"){const[f,u]=Xi(e,s,n);a.push(f),s=u}else if(e[s].type==="blockquote_open"){const[f,u]=Qi(e,s,n);a.push(f),s=u}else{const f=sa(e,s,n);f?(a.push(f[0]),s=f[1]):s++}return[{type:"admonition",kind:i,title:o,children:a,raw:`:::${i} ${o}
${a.map(f=>f.raw).join(`
`)}
:::`},s+1]}const n2=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function r2(e,t,n){const r=e[t];if(r.type!=="container_open")return null;const i=n2.exec(String(r.info??""));return i?QC(e,t,i,n):null}const Mc={parseContainer:(e,t,n)=>t2(e,t,n),matchAdmonition:r2};function Qi(e,t,n){const r=[];let i=t+1;for(;i<e.length&&e[i].type!=="blockquote_close";)switch(e[i].type){case"paragraph_open":{const o=e[i+1];r.push({type:"paragraph",children:It(o.children||[],String(o.content??""),void 0,n),raw:String(o.content??"")}),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[o,l]=Xi(e,i,n);r.push(o),i=l;break}case"blockquote_open":{const[o,l]=Qi(e,i,n);r.push(o),i=l;break}default:{const o=Lc(e,i,n,Mc);o?(r.push(o[0]),i=o[1]):i++;break}}return[{type:"blockquote",children:r,raw:r.map(o=>o.raw).join(`
`)},i+1]}function i2(e){if(e.info?.startsWith("diff"))return Ec(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);n?.[1]&&(e.content=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const r=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:String(e.content??""),raw:String(e.content??""),loading:!r}}function o2(e,t,n){const r=[];let i=t+1,o=[],l=[];for(;i<e.length&&e[i].type!=="dl_close";)if(e[i].type==="dt_open"){const a=e[i+1];o=It(a.children||[],void 0,void 0,n),i+=3}else if(e[i].type==="dd_open"){let a=i+1;for(l=[];a<e.length&&e[a].type!=="dd_close";)if(e[a].type==="paragraph_open"){const s=e[a+1];l.push({type:"paragraph",children:It(s.children||[],String(s.content??""),void 0,n),raw:String(s.content??"")}),a+=3}else a++;o.length>0&&(r.push({type:"definition_item",term:o,definition:l,raw:`${o.map(s=>s.raw).join("")}: ${l.map(s=>s.raw).join(`
`)}`}),o=[]),i=a+1}else i++;return[{type:"definition_list",items:r,raw:r.map(a=>a.raw).join(`
`)},i+1]}function l2(e,t,n){const r=e[t].meta??{},i=String(r?.label??"0"),o=[];let l=t+1;for(;l<e.length&&e[l].type!=="footnote_close";)if(e[l].type==="paragraph_open"){const a=e[l+1],s=a.children||[];e[l+2].type==="footnote_anchor"&&s.push(e[l+2]),o.push({type:"paragraph",children:It(a.children||[],String(a.content??""),void 0,n),raw:String(a.content??"")}),l+=3}else l++;return[{type:"footnote",id:i,children:o,raw:`[^${i}]: ${o.map(a=>a.raw).join(`
`)}`},l+1]}function a2(e,t,n){const r=e[t],i=r?.attrs,o=Array.isArray(i)&&i.length?Object.fromEntries(i.filter(f=>Array.isArray(f)&&f.length>=1&&f[0]).map(([f,u])=>[String(f),u==null||u===""?!0:String(u)])):void 0,l=String(r.tag?.substring(1)??"1"),a=Number.parseInt(l,10),s=e[t+1],c=String(s.content??"");return{type:"heading",level:a,text:c,...o?{attrs:o}:{},children:It(s.children||[],c,void 0,n),raw:c}}function Ns(e){let t=!1,n=!1;for(let r=0;r<e.length;r++){const i=e[r];if(i==="\\"){r++;continue}if(!n&&i==="'"){t=!t;continue}if(!t&&i==='"'){n=!n;continue}if(!t&&!n&&i===">")return r}return-1}function s2(e,t,n){const r=t.toLowerCase(),i=new RegExp(String.raw`^<\s*${r}(?=\s|>|/)`,"i"),o=new RegExp(String.raw`^<\s*\/\s*${r}(?=\s|>)`,"i");let l=0,a=Math.max(0,n);for(;a<e.length;){const s=e.indexOf("<",a);if(s===-1)return-1;const c=e.slice(s);if(o.test(c)){const f=Ns(c);if(f===-1)return-1;if(l===0)return s+f+1;l--,a=s+f+1;continue}if(i.test(c)){const f=Ns(c);if(f===-1)return-1;const u=c.slice(0,f+1);/\/\s*>$/.test(u)||l++,a=s+f+1;continue}a=s+1}return-1}function _p(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let r;for(;(r=n.exec(e))!==null;){const i=r[1];if(!i)continue;const o=r[2]||r[3]||r[4]||"";t.push([i,o])}return t}function wp(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const r=Ns(t),i=r===-1?t:t.slice(0,r+1),o=r!==-1&&/\/\s*>$/.test(i),l=Lo.has(n),a=_p(i),s=(r===-1?-1:s2(t,n,r+1))!==-1,c=!(l||o||s);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
</${n}>`:t,raw:t,tag:n,attrs:a.length?a:void 0,loading:c}}function c2(e){const t=String(e.content??""),n=e.raw==="$$"?`$$${t}$$`:String(e.raw??"");return{type:"math_block",content:t,loading:!!e.loading,raw:n,markup:e.markup}}function u2(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,r]=t;if(!r)continue;const i=String(r).trim().toLowerCase();if(n==="style"){const o=/text-align\s*:\s*(left|right|center)/i.exec(i);if(o)return o[1].toLowerCase()}}return"left"}function d2(e,t,n){let r=t+1,i=null;const o=[];let l=!1;for(;r<e.length&&e[r].type!=="table_close";)if(e[r].type==="thead_open")l=!0,r++;else if(e[r].type==="thead_close")l=!1,r++;else if(e[r].type==="tbody_open"||e[r].type==="tbody_close")r++;else if(e[r].type==="tr_open"){const a=[];let s=r+1;for(;s<e.length&&e[s].type!=="tr_close";)if(e[s].type==="th_open"||e[s].type==="td_open"){const f=e[s].type==="th_open",u=e[s+1],d=String(u.content??""),h=u2(e[s].attrs);a.push({type:"table_cell",header:f||l,children:It(u.children||[],d,void 0,n),raw:d,align:h}),s+=3}else s++;const c={type:"table_row",cells:a,raw:a.map(f=>f.raw).join("|")};l?i=c:o.push(c),r=s+1}else r++;return i||(i={type:"table_row",cells:[],raw:""}),[{type:"table",header:i,rows:o,loading:e[t].loading??!1,raw:[i,...o].map(a=>a.raw).join(`
`)},r+1]}function f2(){return{type:"thematic_break",raw:"---"}}let Wa=null;const qa=new WeakMap;function $d(){return Wa||(Wa={allowedTagSet:ca(),customTagSet:null}),Wa}function h2(e){const t=String(e??"").trim();if(!t)return"";const n=t.match(/^[<\s/]*([A-Z][\w-]*)/i);return n?n[1].toLowerCase():""}function p2(e){if(!e||e.length===0)return $d();const t=qa.get(e);if(t)return t;const n=e.map(h2).filter(Boolean);if(!n.length){const i=$d();return qa.set(e,i),i}const r={allowedTagSet:ca({customHtmlTags:e}),customTagSet:new Set(n)};return qa.set(e,r),r}function m2(e,t,n){const r=e[t],i=r.attrs;let o="";const l={};if(i){for(const[d,h]of i)if(d==="class"){const p=h.match(/(?:\s|^)vmr-container-(\S+)/);p&&(o=p[1])}else if(d.startsWith("data-")){const p=d.slice(5);try{l[p]=JSON.parse(h)}catch{l[p]=h}}}const a=[];let s=t+1;for(;s<e.length&&e[s].type!=="vmr_container_close";)if(e[s].type==="paragraph_open"){const d=e[s+1];if(d){const h=d.children||[];a.push({type:"paragraph",children:It(h||[],void 0,void 0,n),raw:String(d.content??"")})}s+=3}else if(e[s].type==="bullet_list_open"||e[s].type==="ordered_list_open"){const[d,h]=Xi(e,s,n);a.push(d),s=h}else if(e[s].type==="blockquote_open"){const[d,h]=Qi(e,s,n);a.push(d),s=h}else{const d=sa(e,s,n);d?(a.push(d[0]),s=d[1]):s++}const c=s<e.length&&e[s].type==="vmr_container_close",f=c||!!n?.final;let u=`::: ${o}`;return Object.keys(l).length>0&&(u+=` ${JSON.stringify(l)}`),u+=`
`,a.length>0&&(u+=r.raw??a.map(d=>d.raw).join(`
`),u+=`
`),u+=":::",[{type:"vmr_container",name:o,loading:!f,attrs:Object.keys(l).length>0?l:void 0,children:a,raw:u},c?s+1:s]}function xo(e){let t=!1,n=!1;for(let r=0;r<e.length;r++){const i=e[r];if(i==="\\"){r++;continue}if(!n&&i==="'"){t=!t;continue}if(!t&&i==='"'){n=!n;continue}if(!t&&!n&&i===">")return r}return-1}function g2(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function v2(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function Id(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function y2(e,t,n){if(!e||!t)return null;const r=t.toLowerCase(),i=new RegExp(String.raw`^<\s*${Id(r)}(?=\s|>|/)`,"i"),o=new RegExp(String.raw`^<\s*\/\s*${Id(r)}(?=\s|>)`,"i");let l=0,a=Math.max(0,n);for(;a<e.length;){const s=e.indexOf("<",a);if(s===-1)break;const c=e.slice(s);if(o.test(c)){const f=xo(c);if(f===-1)return null;if(l===0)return{start:s,end:s+f+1};l--,a=s+f+1;continue}if(i.test(c)){const f=xo(c);if(f===-1)return null;const u=c.slice(0,f+1);/\/\s*>$/.test(u)||l++,a=s+f+1;continue}a=s+1}return null}function k2(e,t,n){if(!e||!t)return null;const r=t.toLowerCase(),i=new RegExp(String.raw`<\s*${r}(?=\s|>|/)`,"gi");i.lastIndex=Math.max(0,n||0);const o=i.exec(e);if(!o||o.index==null)return null;const l=o.index,a=e.slice(l),s=xo(a);if(s===-1)return null;const c=l+s;if(/\/\s*>\s*$/.test(a.slice(0,s+1))){const p=c+1;return{raw:e.slice(l,p),end:p}}let f=1,u=c+1;const d=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*${r}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${r}(?=\s|>)`,"i").test(m)};for(;u<e.length;){const p=e.indexOf("<",u);if(p===-1)return{raw:e.slice(l),end:e.length};if(h(p)){const m=e.indexOf(">",p);if(m===-1)return null;if(f--,f===0){const v=m+1;return{raw:e.slice(l,v),end:v}}u=m+1;continue}if(d(p)){const m=xo(e.slice(p));if(m===-1)return null;f++,u=p+m+1;continue}u=p+1}return{raw:e.slice(l),end:e.length}}function Ps(e){return Number.isFinite(e)&&e>0?e:0}function b2(e,t){const n=Ps(t);if(!e||n<=0)return 0;let r=0;for(let i=0;i<e.length;i++)if(e[i]===`
`&&(r++,r===n))return i+1;return e.length}function sa(e,t,n){const r=e[t];switch(r.type){case"heading_open":return[a2(e,t,n),t+3];case"code_block":return[i2(r),t+1];case"fence":return[Ec(r),t+1];case"math_block":return[c2(r),t+1];case"html_block":{const i=wp(r),o=i.tag?p2(n?.customHtmlTags):null;if(i.tag&&i.loading&&o&&!o.allowedTagSet.has(i.tag)){const l=String(r?.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:l?[{type:"text",content:l,raw:l}]:[],raw:l},t+1]}if(i.tag&&o?.customTagSet?.has(i.tag)){const l=i.tag,a=String(n?.__sourceMarkdown??""),s=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(r.map)?b2(a,Number(r.map?.[0]??0)):0,f=k2(a,l,Math.max(Ps(s),Ps(c)));f&&(n.__customHtmlBlockCursor=f.end);const u=String(f?.raw??i.raw??""),d=xo(u),h=d!==-1?u.slice(0,d+1):u,p=d!==-1&&/\/\s*>\s*$/.test(h),m=d===-1?null:y2(u,l,d+1),v=m?.start??-1;let y="";d!==-1&&(v!==-1&&d<v?y=u.slice(d+1,v):y=u.slice(d+1)),v===-1&&(y=v2(y,l));const g=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let k;for(;(k=b.exec(h))!==null;){const T=k[1];if(!T||T.toLowerCase()===l)continue;const x=k[2]||k[3]||k[4]||"";g.push([T,x])}const _=!n?.final&&!p&&m==null;return[{type:l,tag:l,content:g2(y),raw:String(f?.raw??i.raw??u),loading:_,attrs:g.length?g:void 0},t+1]}return[i,t+1]}case"table_open":{const[i,o]=d2(e,t,n);return[i,o]}case"dl_open":{const[i,o]=o2(e,t,n);return[i,o]}case"footnote_open":{const[i,o]=l2(e,t,n);return[i,o]}case"hr":return[f2(),t+1]}return null}function Lc(e,t,n,r){const i=sa(e,t,n);if(i)return i;switch(e[t].type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(r?.parseContainer)return r.parseContainer(e,t,n);break;case"container_open":if(r?.matchAdmonition){const o=r.matchAdmonition(e,t,n);if(o)return o}break;case"vmr_container_open":return m2(e,t,n)}return null}function _2(){return{type:"hardbreak",raw:`\\
`}}function w2(e,t,n){const r=e[t+1],i=String(r.content??"");return{type:"paragraph",children:It(r.children||[],i,void 0,n),raw:i}}function xp(e){const t=String(e??"").trim();if(!t)return"";const n=t.match(/^[<\s/]*([A-Z][\w-]*)/i);return n?n[1].toLowerCase():""}function x2(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=t.map(xp).filter(Boolean);return n.length?new Set(n):null}function ca(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Pl;const n=new Set(Pl);for(const r of t){const i=xp(r);i&&n.add(i)}return n}function C2(e){const t=e?.raw;if(typeof t=="string")return t;const n=e?.content;return typeof n=="string"?n:e?.type==="hardbreak"?"<br>":""}function Fd(e){return{type:"paragraph",children:e,raw:e.map(C2).join("")}}function Od(e,t){if(e.type!=="paragraph")return null;const n=Array.isArray(e.children)?e.children:[];if(n.length===0)return null;const r=x2(t);if(!r?.size)return null;let i=-1;for(let c=0;c<n.length;c++){const f=n[c];if(!r.has(String(f?.type??"").toLowerCase()))continue;const u=n.slice(0,c);if(String(f?.content??"").trim()&&u.some(d=>d?.type==="hardbreak")){i=c;break}}if(i===-1)return null;const o=n.slice(0,i),l=n[i];if(!l)return null;const a=[];o.length&&a.push(Fd(o)),a.push(l);const s=n.slice(i+1);return s.length&&a.push(Fd(s)),a}function S2(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),r=/<\/html>\s*$/i.test(t);return!n||!r?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function sl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oi(e){let t=!1,n=!1;for(let r=0;r<e.length;r++){const i=e[r];if(i==="\\"){r++;continue}if(!n&&i==="'"){t=!t;continue}if(!t&&i==='"'){n=!n;continue}if(!t&&!n&&i===">")return r}return-1}function fo(e){const t=e?.raw;if(typeof t=="string")return t;const n=e?.content;return typeof n=="string"?n:""}const A2=new Set(["article","aside","blockquote","div","figcaption","figure","footer","h1","h2","h3","h4","h5","h6","header","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"]);function Rc(e,t,n){if(!e||!t)return null;const r=t.toLowerCase(),i=new RegExp(String.raw`<\s*${sl(r)}(?=\s|>|/)`,"gi");i.lastIndex=Math.max(0,n);const o=i.exec(e);if(!o||o.index==null)return null;const l=o.index,a=Oi(e.slice(l));if(a===-1)return null;const s=l+a,c=e.slice(l,s+1);if(Lo.has(r)||/\/\s*>$/.test(c))return{raw:c,start:l,end:s+1,closed:!0};let f=1,u=s+1;const d=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*${sl(r)}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${sl(r)}(?=\s|>)`,"i").test(m)};for(;u<e.length;){const p=e.indexOf("<",u);if(p===-1)return{raw:e.slice(l),start:l,end:e.length,closed:!1};if(h(p)){const m=Oi(e.slice(p));if(m===-1)return null;f--;const v=p+m+1;if(f===0)return{raw:e.slice(l,v),start:l,end:v,closed:!0};u=v;continue}if(d(p)){const m=Oi(e.slice(p));if(m===-1)return null;const v=e.slice(p,p+m+1);/\/\s*>$/.test(v)||f++,u=p+m+1;continue}u=p+1}return{raw:e.slice(l),start:l,end:e.length,closed:!1}}function T2(e,t){if(!t)return 0;let n=0,r=0;for(;n<e.length&&r<t.length;){if(e[n]===t[r]){n++,r++;continue}if(e[n]==="\r"||e[n]===`
`){n++;continue}return-1}return r===t.length?n:-1}function D2(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
</${t}>`}function E2(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]==="	");)n++;return e[n]==="\r"?(n++,e[n]===`
`&&n++,n):e[n]===`
`?n+1:t}function Nd(e){if(e.type!=="html_block"||String(e.tag??"").toLowerCase()!=="details")return!1;const t=String(e.raw??e.content??"");return/^\s*<details\b/i.test(t)}function M2(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function Cp(e,t){const n=new RegExp(String.raw`<\s*\/\s*${sl(t)}(?=\s|>)`,"gi");let r=-1,i;for(;(i=n.exec(e))!==null;)r=i.index;return r}function L2(e,t){return{final:t,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}function cl(e,t,n){return e.trim()?Ap(e,t,n):[]}function R2(e,t,n){const r=wp({content:e}),i=Oi(e),o=Cp(e,"summary");if(i!==-1&&o!==-1&&o>=i+1){const l=cl(e.slice(i+1,o),t,n);l.length>0&&(r.children=l)}return r.raw=e,r}function $2(e,t,n){const r=Oi(e);if(r===-1)return[];const i=e.slice(r+1);if(!i.trim())return[];const o=Rc(i,"summary",0);if(!o)return cl(i,t,n);const l=i.slice(0,o.start),a=i.slice(o.end);return[...cl(l,t,n),R2(o.raw,t,n),...cl(a,t,n)]}function Sp(e,t,n,r,i,o=0){const l=[];let a=o;for(let s=0;s<e.length;s++){const c=e[s],f=fo(c);let u=-1;if(f&&(u=t.indexOf(f,a),u!==-1&&(a=u+f.length)),!Nd(c)){l.push(c);continue}const d=String(c.raw??fo(c)??""),h=u!==-1?u:t.indexOf(d,Math.max(0,a-d.length));if(h===-1){l.push(c);continue}let p=1,m=-1;for(let V=s+1;V<e.length;V++){const K=e[V];if(Nd(K)){p++;continue}if(M2(K)&&(p--,p===0)){m=V;break}}const v=Rc(t,"details",h),y=m===-1&&v?.closed===!0,g=y?(()=>{const V=Cp(d,"details");return V!==-1?d.slice(0,V):d})():d,[b]=Sp(y?[]:m===-1?e.slice(s+1):e.slice(s+1,m),t,n,r,i,h+d.length),k=$2(g,n,L2(r,i)),_=m===-1?"</details>":String(e[m]?.raw??fo(e[m])??"</details>"),T=y||m!==-1&&v?.closed===!0,x=_.replace(/[\t\r\n ]+$/,""),S=T?(()=>{const V=(v?.raw??"").lastIndexOf(x);return V===-1?t.length:h+V})():t.length,R=Oi(d),W=y&&R!==-1?h+R+1:h+d.length,w=t.slice(W,S===-1?t.length:S),C=n.parse(w,{__markstreamFinal:i}),A=n.renderer.render(C,n.options,{__markstreamFinal:i}),M=S+x.length,L=T?Math.max(S+_.length,E2(t,M)):t.length,P=T?t.slice(S,L):_,I=T?t.slice(h,L):t.slice(h),N=y&&R!==-1?d.slice(0,R+1):d;if(l.push({...c,tag:"details",attrs:_p(d.slice(0,R+1)),raw:I,content:`${N}${A}${P}`,children:[...k,...b],loading:!i&&!T}),a=T?L:t.length,m===-1&&!y)break;m!==-1&&(s=m)}return[l,a]}function I2(e,t,n){if(!n)return e;const r=e.slice();let i=0;for(let o=0;o<r.length;o++){const l=r[o];if(l?.type!=="html_block")continue;const a=String(l?.tag??"").toLowerCase();if(!a||!A2.has(a))continue;const s=Rc(n,a,i);if(!s)continue;i=s.end;const c=String(l?.content??fo(l)),f=String(l?.raw??c),u=D2(s.raw,a,s.closed),d=!t&&!s.closed,h=c!==u||f!==s.raw||!!l?.loading!==d;if(l.content=u,l.raw=s.raw,l.loading=d,!h)continue;let p=T2(s.raw,c);p===-1&&(p=0);const m=o+1;for(;m<r.length;){const v=fo(r[m]);if(!v)break;const y=s.raw.indexOf(v,p);if(y===-1)break;p=y+v.length,r.splice(m,1)}}return r}function F2(e){const t=a=>a===" "||a==="	"||a===`
`||a==="\r",n=a=>{if(!a||a[0]!=="<"||a.includes(">"))return!1;let s=1;if(s<a.length&&t(a[s])||a[s]==="/"&&(s++,s<a.length&&t(a[s])))return!1;const c=m=>{const v=m.charCodeAt(0);return v>=65&&v<=90||v>=97&&v<=122},f=m=>{const v=m.charCodeAt(0);return v>=48&&v<=57},u=m=>m==="!"||c(m),d=m=>c(m)||f(m)||m===":"||m==="-",h=m=>c(m)||f(m)||m==="_"||m==="."||m===":"||m==="-",p=h;if(s>=a.length||!u(a[s]))return!1;for(s++;s<a.length&&d(a[s]);)s++;for(;s<a.length;){for(;s<a.length&&t(a[s]);)s++;if(s>=a.length)return!0;if(a[s]==="/"){for(s++;s<a.length&&t(a[s]);)s++;return s>=a.length}if(!h(a[s]))return!1;for(s++;s<a.length&&p(a[s]);)s++;for(;s<a.length&&t(a[s]);)s++;if(s<a.length&&a[s]==="="){for(s++;s<a.length&&t(a[s]);)s++;if(s>=a.length)return!0;const m=a[s];if(m==='"'||m==="'"){for(s++;s<a.length&&a[s]!==m;)s++;if(s>=a.length)return!0;s++}else{for(;s<a.length;){const v=a[s];if(t(v)||v==="<"||v===">"||v==='"'||v==="'"||v==="`")break;s++}if(s>=a.length)return!0}}}return!0},r=(a,s)=>{let c=!1,f="",u=0;const d=g=>g===" "||g==="	",h=g=>{let b=0;for(;b<g.length&&d(g[b]);)b++;const k=g[b];if(k!=="`"&&k!=="~")return null;let _=b;for(;_<g.length&&g[_]===k;)_++;const T=_-b;return T<3?null:{markerChar:k,markerLen:T,rest:g.slice(_)}},p=g=>{let b=0;for(;b<g.length&&d(g[b]);)b++;let k=!1;for(;b<g.length&&g[b]===">";)for(k=!0,b++;b<g.length&&d(g[b]);)b++;return k?g.slice(b):null},m=g=>{const b=h(g);if(b)return b;const k=p(g);return k==null?null:h(k)};let v=0;const y=a.split(/\r?\n/);for(const g of y){const b=v,k=v+g.length;if(s<b)break;const _=m(g);if(_){const T=_.markerChar,x=_.markerLen;c?T===f&&x>=u&&/^\s*$/.test(_.rest)&&(c=!1,f="",u=0):(c=!0,f=T,u=x)}if(s<=k)break;v=k+1}return c},i=String(e??""),o=i.lastIndexOf("<");if(o===-1||r(i,o))return i;if(o>0){const a=i[o-1],s=a===" "||a==="	"||a===`
`||a==="\r",c=i[o-2];if(!s&&!((a==="n"||a==="r")&&c==="\\"))return i}const l=i.slice(o);return l.includes(">")||l.length>1&&(l[1]===" "||l[1]==="	"||l[1]===`
`||l[1]==="\r")||!n(l)?i:i.slice(0,o)}function O2(e,t){if(!e||!t.length)return e;const n=new Set(t.map(p=>String(p??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const r=p=>p===" "||p==="	",i=p=>{const m=p.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||p==="_"||p==="-"||p===":"},o=p=>{if(!p)return!1;if(p[0]==="	")return!0;let m=0;for(let v=0;v<p.length;v++){const y=p[v];if(y===" "){if(m++,m>=4)return!0;continue}if(y==="	")return!0;break}return!1},l=p=>{let m=!1,v=!1;for(let y=0;y<p.length;y++){const g=p[y];if(g==="\\"){y++;continue}if(!v&&g==="'"){m=!m;continue}if(!m&&g==='"'){v=!v;continue}if(!m&&!v&&g===">")return y}return-1},a=p=>{let m=0;for(;m<p.length&&r(p[m]);)m++;const v=p[m];if(v!=="`"&&v!=="~")return null;let y=m;for(;y<p.length&&p[y]===v;)y++;const g=y-m;return g<3?null:{markerChar:v,markerLen:g,rest:p.slice(y)}},s=(p,m)=>{if(o(p))return-1;const v=p.replace(/^[ \t]+/,"");if(!v||v.startsWith(">")||v.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(v))return-1;let y=!1,g=0;for(;g<p.length;){const b=p[g];if(b!=="<"){r(b)||(y=!0),g++;continue}const k=l(p.slice(g));if(k===-1){y=!0,g++;continue}const _=p.slice(g,g+k+1);let T=1;for(;T<_.length&&r(_[T]);)T++;if(T>=_.length){y=!0,g++;continue}const x=_[T];if(x==="!"||x==="?"){y=!0,g+=k+1;continue}if(x==="/"){y=!0,g+=k+1;continue}const S=T;for(;T<_.length&&i(_[T]);)T++;if(T===S){y=!0,g++;continue}const R=_.slice(S,T).toLowerCase(),W=_[T];if(W&&W!==" "&&W!=="	"&&W!==">"&&W!=="/"){y=!0,g++;continue}const w=new RegExp(String.raw`<\s*\/\s*${R}\s*>`,"i"),C=/\/\s*>$/.test(_),A=w.test(p.slice(g+k+1)),M=w.test(e.slice(m+g+k+1)),L=/[\r\n]/.test(e.slice(m+g+k+1));if(y&&n.has(R)&&!C&&!A&&(M||L))return g;y=!0,g+=k+1}return-1};let c=!1,f="",u=0,d="",h=0;for(;h<e.length;){const p=e.indexOf(`
`,h),m=p!==-1,v=m&&p>h&&e[p-1]==="\r",y=m?v?p-1:p:e.length,g=e.slice(h,y),b=m?v?`\r
`:`
`:"",k=a(g);let _=g;if(!c&&!k){const T=s(g,h);if(T!==-1){const x=b||`
`;_=`${g.slice(0,T).replace(/[ \t]+$/,"")}${x}${x}${g.slice(T).replace(/^[ \t]+/,"")}`}}d+=_,d+=b,k&&(c?k.markerChar===f&&k.markerLen>=u&&/^\s*$/.test(k.rest)&&(c=!1,f="",u=0):(c=!0,f=k.markerChar,u=k.markerLen)),h=m?p+1:e.length}return d}function N2(e,t){if(!e||!t.length)return e;const n=new Set(t.map(u=>String(u??"").toLowerCase()));if(!n.size)return e;const r=u=>u===" "||u==="	",i=u=>{const d=u.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||u==="_"||u==="-"},o=u=>{let d=0;for(;d<u.length&&r(u[d]);)d++;return u.slice(d)},l=u=>{let d=!1,h=!1;for(let p=0;p<u.length;p++){const m=u[p];if(m==="\\"){p++;continue}if(!h&&m==="'"){d=!d;continue}if(!d&&m==='"'){h=!h;continue}if(!d&&!h&&m===">")return p}return-1},a=(u,d,h)=>{const p=h.toLowerCase();let m=u.indexOf("<",d);for(;m!==-1;){let v=m+1;for(;v<u.length&&r(u[v]);)v++;if(v>=u.length||u[v]!=="/"){m=u.indexOf("<",m+1);continue}for(v++;v<u.length&&r(u[v]);)v++;if(v+p.length>u.length){m=u.indexOf("<",m+1);continue}let y=!0;for(let b=0;b<p.length;b++){const k=u[v+b];if((k>="A"&&k<="Z"?String.fromCharCode(k.charCodeAt(0)+32):k)!==p[b]){y=!1;break}}if(!y){m=u.indexOf("<",m+1);continue}let g=v+p.length;if(g<u.length&&i(u[g])){m=u.indexOf("<",m+1);continue}for(;g<u.length&&r(u[g]);)g++;if(g<u.length&&u[g]===">")return!0;m=u.indexOf("<",m+1)}return!1},s=u=>{let d=0;for(;d<u.length&&r(u[d]);)d++;if(d>=u.length||u[d]!=="<")return u;for(d++;d<u.length&&r(u[d]);)d++;if(d>=u.length||u[d]==="/")return u;const h=d;for(;d<u.length&&i(u[d]);)d++;if(d===h)return u;const p=u.slice(h,d).toLowerCase();if(!n.has(p))return u;const m=l(u.slice(d));if(m===-1)return u;const v=d+m;if(a(u,v+1,p))return u;const y=o(u.slice(v+1));return y?`${u.slice(0,v+1)}
${y}`:u};let c="",f=0;for(;f<e.length;){const u=e.indexOf(`
`,f);if(u===-1){c+=s(e.slice(f));break}const d=u>f&&e[u-1]==="\r",h=d?u-1:u,p=e.slice(f,h);c+=s(p),c+=d?`\r
`:`
`,f=u+1}return c}function P2(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const r=d=>d===" "||d==="	",i=d=>{let h=0,p=!1,m=0;for(;h<d.length;){for(;h<d.length&&r(d[h]);)h++;if(h>=d.length||d[h]!==">")break;for(p=!0,h++;h<d.length&&r(d[h]);)h++;m=h}return p?{prefix:d.slice(0,m),content:d.slice(m)}:null},o=d=>{let h=0;for(;h<d.length&&r(d[h]);)h++;const p=d[h];if(p!=="`"&&p!=="~")return null;let m=h;for(;m<d.length&&d[m]===p;)m++;const v=m-h;return v<3?null:{markerChar:p,markerLen:v,rest:d.slice(m)}},l=Array.from(n).map(d=>new RegExp(String.raw`(<\s*\/\s*${d}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let a=!1,s="",c=0,f="",u=0;for(;u<e.length;){const d=e.indexOf(`
`,u),h=d!==-1,p=h&&d>u&&e[d-1]==="\r",m=h?p?d-1:d:e.length,v=e.slice(u,m),y=h?p?`\r
`:`
`:"",g=i(v),b=g?.prefix??"",k=g?.content??v,_=o(k);_&&(a?_.markerChar===s&&_.markerLen>=c&&/^\s*$/.test(_.rest)&&(a=!1,s="",c=0):(a=!0,s=_.markerChar,c=_.markerLen));let T=k;if(!a&&T.includes("</"))for(const x of l)T=T.replace(x,(S,R,W,w)=>{if(w.replace(/^[\t ]+/,"").startsWith("|"))return S;const C=w.slice(0,W).replace(/^[\t ]+/,"");if(C.length>0){const A=R.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",M=C.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!A||!M||A!==M)return S}return`${R}

`});if(b){const x=b+T.split(`
`).join(`
${b}`);f+=x}else f+=T;f+=y,u=h?d+1:e.length}return f}function B2(e,t){if(!e||!t.length)return e;const n=new Set(t.map(C=>String(C??"").toLowerCase()));if(!n.size)return e;const r=C=>C===" "||C==="	",i=C=>{if(!C)return!1;if(C[0]==="	")return!0;let A=0;for(let M=0;M<C.length;M++){const L=C[M];if(L===" "){if(A++,A>=4)return!0;continue}if(L==="	")return!0;break}return!1},o=C=>{const A=C.charCodeAt(0);return A>=65&&A<=90||A>=97&&A<=122||A>=48&&A<=57||C==="_"||C==="-"||C===":"},l=C=>{let A=0;for(;A<C.length&&r(C[A]);)A++;return C.slice(A)},a=C=>{let A=0,M=!1,L=0;for(;A<C.length;){for(;A<C.length&&r(C[A]);)A++;if(A>=C.length||C[A]!==">")break;for(M=!0,A++;A<C.length&&r(C[A]);)A++;L=A}if(!M)return null;const P=C.slice(0,L);return{prefix:P,key:P.replace(/[ \t]+$/,""),content:C.slice(L)}},s=C=>l(C).startsWith("<"),c=C=>{for(let A=0;A<C.length;A++){const M=C[A];if(M!==" "&&M!=="	")return!1}return!0},f=C=>{if(i(C))return"";const A=l(C);if(!A.startsWith("<"))return"";let M=1;for(;M<A.length&&r(A[M]);)M++;if(M>=A.length||A[M]==="/"||A[M]==="!"||A[M]==="?")return"";const L=M;for(;M<A.length&&o(A[M]);)M++;if(M===L)return"";const P=A.slice(L,M).toLowerCase();if(!n.has(P))return"";const I=A[M];return I&&I!==" "&&I!=="	"&&I!==">"&&I!=="/"?"":P},u=C=>{if(i(C))return null;const A=l(C);if(!A.startsWith("<"))return null;let M=1;for(;M<A.length&&r(A[M]);)M++;if(M>=A.length)return null;const L=A[M]==="/";if(L)for(M++;M<A.length&&r(A[M]);)M++;const P=A[M];if(!P||P==="!"||P==="?")return null;const I=M;for(;M<A.length&&o(A[M]);)M++;if(M===I)return null;const N=A.slice(I,M).toLowerCase();if(!n.has(N))return null;const V=A[M];if(V&&V!==" "&&V!=="	"&&V!==">"&&V!=="/")return null;if(L)return{type:"close",name:N};if(/\/\s*>\s*$/.test(A))return{type:"open",name:N,complete:!0};const K=A.indexOf(">",M);if(K!==-1){const $=A.slice(K+1);if(new RegExp(`<\\s*\\/\\s*${N}\\s*>`,"i").test($))return{type:"open",name:N,complete:!0}}return{type:"open",name:N,complete:!1}},d=C=>{if(i(C))return null;const A=l(C).replace(/[ \t]+$/,"");if(!A.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(A))return null;const M=A.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(M?.[1])return M[1].toLowerCase();const L=A.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!L?.[1]||!L[2])return null;const P=L[1].toLowerCase();return P===L[2].toLowerCase()?P:null};let h=!1,p="",m=0;const v=C=>{let A=0;for(;A<C.length&&r(C[A]);)A++;const M=C[A];if(M!=="`"&&M!=="~")return null;let L=A;for(;L<C.length&&C[L]===M;)L++;const P=L-A;return P<3?null:{markerChar:M,markerLen:P,rest:C.slice(L)}},y=C=>v(C),g=C=>{const A=l(C);return A?i(C)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(A):!1},b=(C,A,M)=>{let L=C,P=0;for(;L<e.length;){const I=e.indexOf(`
`,L),N=I!==-1,V=N&&I>L&&e[I-1]==="\r",K=N?V?I-1:I:e.length,$=e.slice(L,K),H=a($),re=H?.key??"";if(P>0&&A&&re!==A)break;const Z=H?.content??$,ne=u(Z);if(ne?.name===M){if(ne.type==="open")ne.complete||P++;else if(P>0&&(P--,P===0))return!1}else if(P>0&&(c(Z)||g(Z)))return!0;if(N)L=I+1;else break}return!1};let k="",_=0,T=!0,x=!1,S=!1,R=`
`;const W=[];let w="";for(;_<e.length;){const C=e.indexOf(`
`,_),A=C!==-1,M=A&&C>_&&e[C-1]==="\r",L=A?M?C-1:C:e.length,P=e.slice(_,L),I=A?M?`\r
`:`
`:"",N=a(P),V=N?.key??"",K=N?.content??P,$=y(K);$&&(h?$.markerChar===p&&$.markerLen>=m&&/^\s*$/.test($.rest)&&(h=!1,p="",m=0):(h=!0,p=$.markerChar,m=$.markerLen));const H=W.length>0;if(!h&&!H){const Z=f(K),ne=!!Z&&!T&&x&&S&&b(_,V,Z);Z&&!T&&(!x||ne)&&(V&&w&&V===w?k+=`${V}${R}`:V||(k+=R))}if(k+=P,k+=I,I&&(R=I),!h){const Z=u(K);if(Z){if(Z.type==="open")Z.complete||W.push(Z.name);else for(let ne=W.length-1;ne>=0;ne--)if(W[ne]===Z.name){W.length=ne;break}}}const re=c(K);T=re,x=!re&&s(K),S=!re&&!!d(K),w=V,_=A?C+1:e.length}return k}function Ap(e,t,n={}){const r=!!n.final;let i=(e??"").toString().replace(/([^\\])\r(ight|ho)/g,"$1\\r$2").replace(/([^\\])\n(abla|eq|ot|exists)/g,"$1\\n$2");if(r||(i.endsWith("- *")&&(i=i.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(i)?i=i.replace(/(?:^|\n)\s*-\s*$/,p=>p.startsWith(`
`)?`
`:""):/(?:^|\n)\s*--\s*$/.test(i)?i=i.replace(/(?:^|\n)\s*--\s*$/,p=>p.startsWith(`
`)?`
`:""):/(?:^|\n)\s*>\s*$/.test(i)?i=i.replace(/(?:^|\n)\s*>\s*$/,p=>p.startsWith(`
`)?`
`:""):/\n\s*[*+]\s*$/.test(i)?i=i.replace(/\n\s*[*+]\s*$/,`
`):/(?:^|\n)\s*\d+\s*$/.test(i)?/^\d+$/.test(i.trim())||(i=i.replace(/(?:^|\n)\s*\d+\s*$/,p=>p.startsWith(`
`)?`
`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(i)?i=i.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(p,m,v)=>`${m}${v.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(i)?i=i.replace(/(?:^|\n)\s*\d+[.)]\s*$/,p=>p.startsWith(`
`)?`
`:""):/\n[[(]\n*$/.test(i)&&(i=i.replace(/(\n\[|\n\()+\n*$/g,`
`))),n.customHtmlTags?.length&&i.includes("<")){const p=n.customHtmlTags.map(m=>String(m??"").trim()).filter(Boolean).map(m=>(m.match(/^[<\s/]*([A-Z][\w-]*)/i)?.[1]??"").toLowerCase()).filter(Boolean);if(p.length&&(i=O2(i,p),i=N2(i,p),i=B2(i,p),i=P2(i,p),i.includes("</")))for(const m of p){const v=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${m}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");i=i.replace(v,"$1$2$2")}}r||(i=F2(i));const o=S2(i);if(o){const p=n.preTransformTokens,m=n.postTransformTokens;if(typeof p=="function"||typeof m=="function"){const v=t.parse(i,{__markstreamFinal:r}),y=typeof p=="function"&&p(v)||v;typeof m=="function"&&m(y)}return o}const l=t.parse(i,{__markstreamFinal:r});if(!l||!Array.isArray(l))return[];const a=n.preTransformTokens,s=n.postTransformTokens;let c=l;a&&typeof a=="function"&&(c=a(c)||c);const f=t,u=n.validateLink??f.options?.validateLink??(typeof f.validateLink=="function"?f.validateLink:void 0),d={...n,validateLink:u,__markdownIt:t,__sourceMarkdown:i,__customHtmlBlockCursor:0};let h=Pd(c,d);if(s&&typeof s=="function"){const p=s(c);if(Array.isArray(p)){const m=p[0],v=m?.type;m&&typeof v=="string"?h=Pd(p):h=p}}if(h=I2(h,r,i),h=Sp(h,i,t,n,r)[0],r){const p=new WeakSet,m=v=>{if(!v||typeof v!="object"||p.has(v))return;if(p.add(v),Array.isArray(v)){for(const g of v)m(g);return}const y=v;y.type==="html_block"&&y.loading===!0&&(y.loading=!1);for(const g of Object.values(y))m(g)};m(h)}return n.debug&&console.log("Parsed Markdown Tree Structure:",h),h}function Pd(e,t){if(!e||!Array.isArray(e))return[];const n=[];let r=0;for(;r<e.length;){const i=Lc(e,r,t,Mc);if(i){n.push(i[0]),r=i[1];continue}const o=e[r];switch(o.type){case"paragraph_open":{const l=w2(e,r,t),a=Od(l,t);a?n.push(...a):n.push(l),r+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=Xi(e,r,t);n.push(l),r=a;break}case"blockquote_open":{const[l,a]=Qi(e,r,t);n.push(l),r=a;break}case"footnote_anchor":{const l=o.meta??{},a=String(l.label??o.content??"");n.push({type:"footnote_anchor",id:a,raw:String(o.content??"")}),r++;break}case"hardbreak":n.push(_2()),r++;break;case"text":{const l=String(o.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),r++;break}case"inline":{const l=It(o.children||[],String(o.content??""),void 0,t);if(l.length!==0)if(l.every(a=>a.type==="html_block"))n.push(...l);else{const a={type:"paragraph",raw:String(o.content??""),children:l},s=Od(a,t);s?n.push(...s):n.push(a)}}r+=1;break;default:r+=1;break}}return n}const Bd=[];function zd(e=`editor-${Date.now()}`,t={}){const n=cC(t),r={"common.copy":"Copy"};let i;if(typeof t.i18n=="function")i=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const u=t.i18n;i=d=>u[d]??r[d]??d}else i=u=>r[u]??u;if(Array.isArray(t.plugin))for(const u of t.plugin){const d=u;if(Array.isArray(d)){const h=d[0],p=d[1];typeof h=="function"&&n.use(h,p)}else typeof d=="function"&&n.use(d)}if(Array.isArray(t.apply))for(const u of t.apply)try{u(n)}catch(d){console.error("[getMarkdown] apply function threw an error",d)}if(Bd.length)for(const u of Bd)if(Array.isArray(u)){const d=u[0],h=u[1];typeof d=="function"&&n.use(d,h)}else typeof u=="function"&&n.use(u);n.use(Qy),n.use(tk),n.use(Zy);const o=wu.default??wu;n.use(o),n.use(Ky),n.use(Yy),n.core.ruler.after("block","mark_fence_closed",u=>{const d=u,h=d.src,p=!!d.env?.__markstreamFinal,m=h.split(/\r?\n/);for(const v of d.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const y=v.map[0],g=v.map[1],b=v.markup,k=b[0],_=b.length,T=m[Math.max(0,g-1)]??"";let x=0;for(;x<T.length&&(T[x]===" "||T[x]==="	");)x++;let S=0;for(;x+S<T.length&&T[x+S]===k;)S++;let R=x+S;for(;R<T.length&&(T[R]===" "||T[R]==="	");)R++;const W=p?!0:g>y+1&&S>=_&&R===T.length,w=v;w.meta=w.meta??{},w.meta.unclosed=!W,w.meta.closed=!!W}});const l=(u,d)=>{const h=u,p=h.pos;if(h.src[p]!=="~")return!1;const m=h.src[p-1],v=h.src[p+1];if(/\d/.test(m)&&/\d/.test(v)){if(!d){const y=h.push("text","",0);y.content="~"}return h.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(u,d)=>{const h=u[d],p=String(h.info??"").trim(),m=String(h.content??""),v=btoa(unescape(encodeURIComponent(m))),y=String(p??"text");return`<div class="code-block" data-code="${v}" data-lang="${y}" id="${`editor-${e}-${d}-${y}`}">
      <div class="code-header">
        <span class="code-lang">${y.toUpperCase()}</span>
        <button class="copy-button" data-code="${v}">${i("common.copy")}</button>
      </div>
      <div class="code-editor"></div>
    </div>`};const a=/^\[(\d+)\]/,s=/^\[([^\]\n]+)\]/,c=u=>{if(!u.startsWith("["))return!1;const d=s.exec(u);if(!d)return u!=="["&&!/^\[\d+$/.test(u);const h=String(d[1]??"");return u.slice(d[0].length).startsWith("(")?!1:!/^\d+$/.test(h)},f=(u,d)=>{const h=u;if(h.src[h.pos]!=="[")return!1;const p=a.exec(h.src.slice(h.pos));if(!p)return!1;const m=h.src.slice(Math.max(0,h.pos-120),h.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(m))return!1;const v=h.src.slice(h.pos+p[0].length);if(v.startsWith("](")||v.startsWith("(")||c(v))return!1;if(!d){const y=p[1],g=h.push("reference","span",0);g.content=y,g.markup=p[0]}return h.pos+=p[0].length,!0};return n.inline.ruler.before("escape","reference",f),n.renderer.rules.reference=(u,d)=>{const p=String(u[d].content??"");return`<span class="reference-link" data-reference-id="${p}" role="button" tabindex="0" title="Click to view reference">${p}</span>`},n}const jl=Math.min,di=Math.max,Vl=Math.round,Jo=Math.floor,or=e=>({x:e,y:e}),z2={left:"right",right:"left",bottom:"top",top:"bottom"};function Hd(e,t,n){return di(e,jl(t,n))}function ua(e,t){return typeof e=="function"?e(t):e}function mi(e){return e.split("-")[0]}function da(e){return e.split("-")[1]}function Tp(e){return e==="x"?"y":"x"}function Dp(e){return e==="y"?"height":"width"}function Pr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ep(e){return Tp(Pr(e))}function H2(e,t,n){n===void 0&&(n=!1);const r=da(e),i=Ep(e),o=Dp(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Wl(l)),[l,Wl(l)]}function j2(e){const t=Wl(e);return[Bs(e),t,Bs(t)]}function Bs(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const jd=["left","right"],Vd=["right","left"],V2=["top","bottom"],W2=["bottom","top"];function q2(e,t,n){switch(e){case"top":case"bottom":return n?t?Vd:jd:t?jd:Vd;case"left":case"right":return t?V2:W2;default:return[]}}function U2(e,t,n,r){const i=da(e);let o=q2(mi(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(Bs)))),o}function Wl(e){const t=mi(e);return z2[t]+e.slice(t.length)}function Y2(e){return{top:0,right:0,bottom:0,left:0,...e}}function K2(e){return typeof e!="number"?Y2(e):{top:e,right:e,bottom:e,left:e}}function ql(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Wd(e,t,n){let{reference:r,floating:i}=e;const o=Pr(t),l=Ep(t),a=Dp(l),s=mi(t),c=o==="y",f=r.x+r.width/2-i.width/2,u=r.y+r.height/2-i.height/2,d=r[a]/2-i[a]/2;let h;switch(s){case"top":h={x:f,y:r.y-i.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:u};break;case"left":h={x:r.x-i.width,y:u};break;default:h={x:r.x,y:r.y}}switch(da(t)){case"start":h[l]-=d*(n&&c?-1:1);break;case"end":h[l]+=d*(n&&c?-1:1);break}return h}async function Z2(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:l,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:d=!1,padding:h=0}=ua(t,e),p=K2(h),v=a[d?u==="floating"?"reference":"floating":u],y=ql(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:s})),g=u==="floating"?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),k=await(o.isElement==null?void 0:o.isElement(b))?await(o.getScale==null?void 0:o.getScale(b))||{x:1,y:1}:{x:1,y:1},_=ql(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:b,strategy:s}):g);return{top:(y.top-_.top+p.top)/k.y,bottom:(_.bottom-y.bottom+p.bottom)/k.y,left:(y.left-_.left+p.left)/k.x,right:(_.right-y.right+p.right)/k.x}}const G2=50,X2=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,a=l.detectOverflow?l:{...l,detectOverflow:Z2},s=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:u}=Wd(c,r,s),d=r,h=0;const p={};for(let m=0;m<o.length;m++){const v=o[m];if(!v)continue;const{name:y,fn:g}=v,{x:b,y:k,data:_,reset:T}=await g({x:f,y:u,initialPlacement:r,placement:d,strategy:i,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});f=b??f,u=k??u,p[y]={...p[y],..._},T&&h<G2&&(h++,typeof T=="object"&&(T.placement&&(d=T.placement),T.rects&&(c=T.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):T.rects),{x:f,y:u}=Wd(c,d,s)),m=-1)}return{x:f,y:u,placement:d,strategy:i,middlewareData:p}},Q2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:l,initialPlacement:a,platform:s,elements:c}=t,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...v}=ua(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const y=mi(i),g=Pr(a),b=mi(a)===a,k=await(s.isRTL==null?void 0:s.isRTL(c.floating)),_=d||(b||!m?[Wl(a)]:j2(a)),T=p!=="none";!d&&T&&_.push(...U2(a,m,p,k));const x=[a,..._],S=await s.detectOverflow(t,v),R=[];let W=((r=o.flip)==null?void 0:r.overflows)||[];if(f&&R.push(S[y]),u){const M=H2(i,l,k);R.push(S[M[0]],S[M[1]])}if(W=[...W,{placement:i,overflows:R}],!R.every(M=>M<=0)){var w,C;const M=(((w=o.flip)==null?void 0:w.index)||0)+1,L=x[M];if(L&&(!(u==="alignment"?g!==Pr(L):!1)||W.every(N=>Pr(N.placement)===g?N.overflows[0]>0:!0)))return{data:{index:M,overflows:W},reset:{placement:L}};let P=(C=W.filter(I=>I.overflows[0]<=0).sort((I,N)=>I.overflows[1]-N.overflows[1])[0])==null?void 0:C.placement;if(!P)switch(h){case"bestFit":{var A;const I=(A=W.filter(N=>{if(T){const V=Pr(N.placement);return V===g||V==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(V=>V>0).reduce((V,K)=>V+K,0)]).sort((N,V)=>N[1]-V[1])[0])==null?void 0:A[0];I&&(P=I);break}case"initialPlacement":P=a;break}if(i!==P)return{reset:{placement:P}}}return{}}}},J2=new Set(["left","top"]);async function eS(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=mi(n),a=da(n),s=Pr(n)==="y",c=J2.has(l)?-1:1,f=o&&s?-1:1,u=ua(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),s?{x:h*f,y:d*c}:{x:d*c,y:h*f}}const tS=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:a}=t,s=await eS(t,e);return l===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+s.x,y:o+s.y,data:{...s,placement:l}}}}},nS=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:l=!0,crossAxis:a=!1,limiter:s={fn:y=>{let{x:g,y:b}=y;return{x:g,y:b}}},...c}=ua(e,t),f={x:n,y:r},u=await o.detectOverflow(t,c),d=Pr(mi(i)),h=Tp(d);let p=f[h],m=f[d];if(l){const y=h==="y"?"top":"left",g=h==="y"?"bottom":"right",b=p+u[y],k=p-u[g];p=Hd(b,p,k)}if(a){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",b=m+u[y],k=m-u[g];m=Hd(b,m,k)}const v=s.fn({...t,[h]:p,[d]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:l,[d]:a}}}}}};function fa(){return typeof window<"u"}function Ji(e){return Mp(e)?(e.nodeName||"").toLowerCase():"#document"}function In(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sr(e){var t;return(t=(Mp(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Mp(e){return fa()?e instanceof Node||e instanceof In(e).Node:!1}function Qn(e){return fa()?e instanceof Element||e instanceof In(e).Element:!1}function wr(e){return fa()?e instanceof HTMLElement||e instanceof In(e).HTMLElement:!1}function qd(e){return!fa()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof In(e).ShadowRoot}function Ro(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Jn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function rS(e){return/^(table|td|th)$/.test(Ji(e))}function ha(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const iS=/transform|translate|scale|rotate|perspective|filter/,oS=/paint|layout|strict|content/,ni=e=>!!e&&e!=="none";let Ua;function $c(e){const t=Qn(e)?Jn(e):e;return ni(t.transform)||ni(t.translate)||ni(t.scale)||ni(t.rotate)||ni(t.perspective)||!Ic()&&(ni(t.backdropFilter)||ni(t.filter))||iS.test(t.willChange||"")||oS.test(t.contain||"")}function lS(e){let t=Wr(e);for(;wr(t)&&!Gi(t);){if($c(t))return t;if(ha(t))return null;t=Wr(t)}return null}function Ic(){return Ua==null&&(Ua=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ua}function Gi(e){return/^(html|body|#document)$/.test(Ji(e))}function Jn(e){return In(e).getComputedStyle(e)}function pa(e){return Qn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Wr(e){if(Ji(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qd(e)&&e.host||sr(e);return qd(t)?t.host:t}function Lp(e){const t=Wr(e);return Gi(t)?e.ownerDocument?e.ownerDocument.body:e.body:wr(t)&&Ro(t)?t:Lp(t)}function Co(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Lp(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=In(i);if(o){const a=zs(l);return t.concat(l,l.visualViewport||[],Ro(i)?i:[],a&&n?Co(a):[])}else return t.concat(i,Co(i,[],n))}function zs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Rp(e){const t=Jn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=wr(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,a=Vl(n)!==o||Vl(r)!==l;return a&&(n=o,r=l),{width:n,height:r,$:a}}function Fc(e){return Qn(e)?e:e.contextElement}function Ni(e){const t=Fc(e);if(!wr(t))return or(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Rp(t);let l=(o?Vl(n.width):n.width)/r,a=(o?Vl(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const aS=or(0);function $p(e){const t=In(e);return!Ic()||!t.visualViewport?aS:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sS(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==In(e)?!1:t}function gi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Fc(e);let l=or(1);t&&(r?Qn(r)&&(l=Ni(r)):l=Ni(e));const a=sS(o,n,r)?$p(o):or(0);let s=(i.left+a.x)/l.x,c=(i.top+a.y)/l.y,f=i.width/l.x,u=i.height/l.y;if(o){const d=In(o),h=r&&Qn(r)?In(r):r;let p=d,m=zs(p);for(;m&&r&&h!==p;){const v=Ni(m),y=m.getBoundingClientRect(),g=Jn(m),b=y.left+(m.clientLeft+parseFloat(g.paddingLeft))*v.x,k=y.top+(m.clientTop+parseFloat(g.paddingTop))*v.y;s*=v.x,c*=v.y,f*=v.x,u*=v.y,s+=b,c+=k,p=In(m),m=zs(p)}}return ql({width:f,height:u,x:s,y:c})}function ma(e,t){const n=pa(e).scrollLeft;return t?t.left+n:gi(sr(e)).left+n}function Ip(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ma(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function cS(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=sr(r),a=t?ha(t.floating):!1;if(r===l||a&&o)return n;let s={scrollLeft:0,scrollTop:0},c=or(1);const f=or(0),u=wr(r);if((u||!u&&!o)&&((Ji(r)!=="body"||Ro(l))&&(s=pa(r)),u)){const h=gi(r);c=Ni(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const d=l&&!u&&!o?Ip(l,s):or(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+f.x+d.x,y:n.y*c.y-s.scrollTop*c.y+f.y+d.y}}function uS(e){return Array.from(e.getClientRects())}function dS(e){const t=sr(e),n=pa(e),r=e.ownerDocument.body,i=di(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=di(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+ma(e);const a=-n.scrollTop;return Jn(r).direction==="rtl"&&(l+=di(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:a}}const Ud=25;function fS(e,t){const n=In(e),r=sr(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,a=0,s=0;if(i){o=i.width,l=i.height;const f=Ic();(!f||f&&t==="fixed")&&(a=i.offsetLeft,s=i.offsetTop)}const c=ma(r);if(c<=0){const f=r.ownerDocument,u=f.body,d=getComputedStyle(u),h=f.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,p=Math.abs(r.clientWidth-u.clientWidth-h);p<=Ud&&(o-=p)}else c<=Ud&&(o+=c);return{width:o,height:l,x:a,y:s}}function hS(e,t){const n=gi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=wr(e)?Ni(e):or(1),l=e.clientWidth*o.x,a=e.clientHeight*o.y,s=i*o.x,c=r*o.y;return{width:l,height:a,x:s,y:c}}function Yd(e,t,n){let r;if(t==="viewport")r=fS(e,n);else if(t==="document")r=dS(sr(e));else if(Qn(t))r=hS(t,n);else{const i=$p(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ql(r)}function Fp(e,t){const n=Wr(e);return n===t||!Qn(n)||Gi(n)?!1:Jn(n).position==="fixed"||Fp(n,t)}function pS(e,t){const n=t.get(e);if(n)return n;let r=Co(e,[],!1).filter(a=>Qn(a)&&Ji(a)!=="body"),i=null;const o=Jn(e).position==="fixed";let l=o?Wr(e):e;for(;Qn(l)&&!Gi(l);){const a=Jn(l),s=$c(l);!s&&a.position==="fixed"&&(i=null),(o?!s&&!i:!s&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Ro(l)&&!s&&Fp(e,l))?r=r.filter(f=>f!==l):i=a,l=Wr(l)}return t.set(e,r),r}function mS(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?ha(t)?[]:pS(t,this._c):[].concat(n),r],a=Yd(t,l[0],i);let s=a.top,c=a.right,f=a.bottom,u=a.left;for(let d=1;d<l.length;d++){const h=Yd(t,l[d],i);s=di(h.top,s),c=jl(h.right,c),f=jl(h.bottom,f),u=di(h.left,u)}return{width:c-u,height:f-s,x:u,y:s}}function gS(e){const{width:t,height:n}=Rp(e);return{width:t,height:n}}function vS(e,t,n){const r=wr(t),i=sr(t),o=n==="fixed",l=gi(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const s=or(0);function c(){s.x=ma(i)}if(r||!r&&!o)if((Ji(t)!=="body"||Ro(i))&&(a=pa(t)),r){const h=gi(t,!0,o,t);s.x=h.x+t.clientLeft,s.y=h.y+t.clientTop}else i&&c();o&&!r&&i&&c();const f=i&&!r&&!o?Ip(i,a):or(0),u=l.left+a.scrollLeft-s.x-f.x,d=l.top+a.scrollTop-s.y-f.y;return{x:u,y:d,width:l.width,height:l.height}}function Ya(e){return Jn(e).position==="static"}function Kd(e,t){if(!wr(e)||Jn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return sr(e)===n&&(n=n.ownerDocument.body),n}function Op(e,t){const n=In(e);if(ha(e))return n;if(!wr(e)){let i=Wr(e);for(;i&&!Gi(i);){if(Qn(i)&&!Ya(i))return i;i=Wr(i)}return n}let r=Kd(e,t);for(;r&&rS(r)&&Ya(r);)r=Kd(r,t);return r&&Gi(r)&&Ya(r)&&!$c(r)?n:r||lS(e)||n}const yS=async function(e){const t=this.getOffsetParent||Op,n=this.getDimensions,r=await n(e.floating);return{reference:vS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function kS(e){return Jn(e).direction==="rtl"}const bS={convertOffsetParentRelativeRectToViewportRelativeRect:cS,getDocumentElement:sr,getClippingRect:mS,getOffsetParent:Op,getElementRects:yS,getClientRects:uS,getDimensions:gS,getScale:Ni,isElement:Qn,isRTL:kS};function Np(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _S(e,t){let n=null,r;const i=sr(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function l(a,s){a===void 0&&(a=!1),s===void 0&&(s=1),o();const c=e.getBoundingClientRect(),{left:f,top:u,width:d,height:h}=c;if(a||t(),!d||!h)return;const p=Jo(u),m=Jo(i.clientWidth-(f+d)),v=Jo(i.clientHeight-(u+h)),y=Jo(f),b={rootMargin:-p+"px "+-m+"px "+-v+"px "+-y+"px",threshold:di(0,jl(1,s))||1};let k=!0;function _(T){const x=T[0].intersectionRatio;if(x!==s){if(!k)return l();x?l(!1,x):r=setTimeout(()=>{l(!1,1e-7)},1e3)}x===1&&!Np(c,e.getBoundingClientRect())&&l(),k=!1}try{n=new IntersectionObserver(_,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(_,b)}n.observe(e)}return l(!0),o}function Zd(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,c=Fc(e),f=i||o?[...c?Co(c):[],...t?Co(t):[]]:[];f.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const u=c&&a?_S(c,n):null;let d=-1,h=null;l&&(h=new ResizeObserver(y=>{let[g]=y;g&&g.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),c&&!s&&h.observe(c),t&&h.observe(t));let p,m=s?gi(e):null;s&&v();function v(){const y=gi(e);m&&!Np(m,y)&&n(),m=y,p=requestAnimationFrame(v)}return n(),()=>{var y;f.forEach(g=>{i&&g.removeEventListener("scroll",n),o&&g.removeEventListener("resize",n)}),u?.(),(y=h)==null||y.disconnect(),h=null,s&&cancelAnimationFrame(p)}}const wS=tS,xS=nS,CS=Q2,SS=(e,t,n)=>{const r=new Map,i={platform:bS,...n},o={...i.platform,_c:r};return X2(e,t,{...i,platform:o})};var AS=Object.defineProperty,TS=Object.defineProperties,DS=Object.getOwnPropertyDescriptors,Gd=Object.getOwnPropertySymbols,ES=Object.prototype.hasOwnProperty,MS=Object.prototype.propertyIsEnumerable,Hs=(e,t,n)=>t in e?AS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ye=(e,t)=>{for(var n in t||(t={}))ES.call(t,n)&&Hs(e,n,t[n]);if(Gd)for(var n of Gd(t))MS.call(t,n)&&Hs(e,n,t[n]);return e},lr=(e,t)=>TS(e,DS(t)),Ka=(e,t,n)=>Hs(e,typeof t!="symbol"?t+"":t,n),tt=(e,t,n)=>new Promise((r,i)=>{var o=s=>{try{a(n.next(s))}catch(c){i(c)}},l=s=>{try{a(n.throw(s))}catch(c){i(c)}},a=s=>s.done?r(s.value):Promise.resolve(s.value).then(o,l);a((n=n.apply(e,t)).next())});const LS=["cite"],it=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},ul=it(Se({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,r)=>(z(),Q("blockquote",{class:"blockquote",dir:"auto",cite:e.node.cite},[ge(se(Rn),{"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,onCopy:r[0]||(r[0]=i=>n.$emit("copy",i))},null,8,["index-key","nodes","custom-id","typewriter"])],8,LS))}}),[["__scopeId","data-v-6d8bbd17"]]);ul.install=e=>{e.component(ul.__name,ul)};const RS={class:"checkbox-node"},$S=["checked"],Gn=it(Se({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(z(),Q("span",RS,[te("input",{type:"checkbox",checked:e.node.checked,disabled:"",class:"checkbox-input"},null,8,$S)]))}),[["__scopeId","data-v-8dc6c46f"]]);Gn.install=e=>{e.component(Gn.__name,Gn)};const IS={class:"definition-list"},FS={class:"definition-term"},OS={class:"definition-desc"},dl=it(Se({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,r)=>(z(),Q("dl",IS,[(z(!0),Q(Qe,null,gt(t.node.items,(i,o)=>(z(),Q(Qe,{key:o},[te("dt",FS,[ge(se(Rn),{"index-key":`definition-term-${t.indexKey}-${o}`,nodes:i.term,"custom-id":t.customId,typewriter:t.typewriter,onCopy:r[0]||(r[0]=l=>n.$emit("copy",l))},null,8,["index-key","nodes","custom-id","typewriter"])]),te("dd",OS,[ge(se(Rn),{"index-key":`definition-desc-${t.indexKey}-${o}`,nodes:i.definition,"custom-id":t.customId,typewriter:t.typewriter,onCopy:r[1]||(r[1]=l=>n.$emit("copy",l))},null,8,["index-key","nodes","custom-id","typewriter"])])],64))),128))]))}}),[["__scopeId","data-v-f88691d6"]]);dl.install=e=>{e.component(dl.__name,dl)};const NS={class:"emoji-node"},Fn=it(Se({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(z(),Q("span",NS,$e(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Fn.install=e=>{e.component(Fn.__name,Fn)};const PS="__global__",Za="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",js=(()=>{const e=globalThis;if(e[Za])return e[Za];const t={scopedCustomComponents:{},revision:Jl(0)};return e[Za]=t,t})(),$o=js.revision;function vn(e){const t=js.scopedCustomComponents[PS]||{};if(!e)return t;const n=js.scopedCustomComponents[e]||{};return t&&Object.keys(t).length!==0?n&&Object.keys(n).length!==0?Ye(Ye({},t),n):t:n}const BS=["id"],zS=["title"],On=it(Se({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#footnote-${e.node.id}`;function n(){if(typeof document>"u")return;const r=document.querySelector(t);r?r.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(r,i)=>(z(),Q("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[te("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+$e(e.node.id)+"]",9,zS)],8,BS))}}),[["__scopeId","data-v-01af0fee"]]);On.install=e=>{e.component(On.__name,On)};const Xd=/<([a-z][a-z0-9-]*)\b[^>]*>/gi,Pp=(()=>{try{return!1}catch{}return!1})();function Ga(e){Pp&&console.warn(e)}function Qd(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Bp(e,t){const n=e.toLowerCase();return!Qw.has(n)&&(Qd(t,n)||Qd(t,e))}function zp(e){const t={};for(const[n,r]of Object.entries(e)){const i=n.toLowerCase();Jw.has(i)||ex.has(i)&&r&&rx(r)||(t[n]=r)}return t}function HS(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 r=Number(e);if(e!==""&&!Number.isNaN(r))return r}return e}function Jd(e){return e.trim().length>0}function Xa(e,t,n,r,i){if(tx.has(e.toLowerCase()))return null;const o=zp(t),l=o.key,a=l!=null&&l!==""?l:i;if(Bp(e,r)){const s=r[e]||r[e.toLowerCase()],c=(function(f){const u={};for(const[d,h]of Object.entries(f))u[d]=HS(h,d);return u})(o);return E(s,lr(Ye({},c),{key:a}),n.length>0?n:void 0)}return E(e,lr(Ye({},o),{innerHTML:void 0,key:a}),n.length>0?n:void 0)}function Hp(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;let n;for(Xd.lastIndex=0;(n=Xd.exec(e))!==null;)if(Bp(n[1],t))return!0;return!1}function Ul(e,t){if(!e)return[];try{return(function(i,o){let l=0;const a=[],s=[];for(const c of i)if(c.type==="text")(a.length>0?a[a.length-1].children:s).push(c.content);else if(c.type==="self_closing"){const f=Xa(c.tagName,c.attrs||{},[],o,"ms-html-"+l++),u=a.length>0?a[a.length-1].children:s;f!=null&&u.push(f)}else if(c.type==="tag_open")a.push({tagName:c.tagName,children:[],attrs:c.attrs,autoKey:"ms-html-"+l++});else if(c.type==="tag_close"){const f=c.tagName.toLowerCase();let u=-1;for(let d=a.length-1;d>=0;d--)if(a[d].tagName.toLowerCase()===f){u=d;break}if(u!==-1)for(;a.length>u;){const d=a.pop(),h=Xa(d.tagName,d.attrs||{},d.children,o,d.autoKey);a.length>0?h!=null&&a[a.length-1].children.push(h):h!=null&&s.push(h),d.tagName.toLowerCase()!==f&&a.length>u&&Ga(`Auto-closing unclosed tag: <${d.tagName}>`)}else Ga(`Ignoring closing tag with no matching opening tag: </${c.tagName}>`)}for(;a.length>0;){const c=a.pop(),f=Xa(c.tagName,c.attrs||{},c.children,o,c.autoKey);a.length>0?f!=null&&a[a.length-1].children.push(f):f!=null&&s.push(f),Ga(`Auto-closing unclosed tag: <${c.tagName}>`)}return s})((function(i){var o,l,a;const s=[];let c=0;for(;c<i.length;){if(i.startsWith("<!--",c)){const m=i.indexOf("-->",c);if(m!==-1){c=m+3;continue}break}const f=i.indexOf("<",c);if(f===-1){if(c<i.length){const m=i.slice(c);Jd(m)&&s.push({type:"text",content:m})}break}if(f>c){const m=i.slice(c,f);Jd(m)&&s.push({type:"text",content:m})}if(i.startsWith("![CDATA[",f+1)){const m=i.indexOf("]]>",f);if(m!==-1){s.push({type:"text",content:i.slice(f,m+3)}),c=m+3;continue}break}if(i.startsWith("!",f+1)){const m=i.indexOf(">",f);if(m!==-1){c=m+1;continue}break}const u=i.indexOf(">",f);if(u===-1)break;const d=i.slice(f+1,u).trim(),h=d.startsWith("/"),p=d.endsWith("/");if(h){const m=d.slice(1).trim();s.push({type:"tag_close",tagName:m})}else{const m=d.indexOf(" ");let v,y="";m===-1?v=p?d.slice(0,-1).trim():d.trim():(v=d.slice(0,m).trim(),y=d.slice(m+1));const g={};if(y){const b=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let k;for(;(k=b.exec(y))!==null;){const _=k[1],T=(a=(l=(o=k[2])!=null?o:k[3])!=null?l:k[4])!=null?a:"";_&&!_.endsWith("/")&&(g[_]=T)}}s.push({type:p||Lo.has(v.toLowerCase())?"self_closing":"tag_open",tagName:v,attrs:g})}c=u+1}return s})(e),t)}catch(r){return n=r,Pp&&console.error("Failed to parse HTML to VNodes:",n),null}var n}const jS=["innerHTML"],Nn=it(Se({__name:"HtmlInlineNode",props:{node:{},customId:{}},setup(e){const t=e,n=O(()=>($o.value,vn(t.customId))),r=Se({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),i=O(()=>{const o=t.node.content;if(!o)return{mode:"html",content:""};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:o};if(t.node.loading&&t.node.autoClosed){const a=Ul(o,n.value);if(a!==null)return{mode:"dynamic",nodes:a}}if(!Hp(o,n.value))return{mode:"html",content:o};const l=Ul(o,n.value);return l===null?{mode:"html",content:o}:{mode:"dynamic",nodes:l}});return(o,l)=>i.value.mode==="dynamic"?(z(),Q("span",{key:0,class:Ft(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[ge(se(r),{nodes:i.value.nodes},null,8,["nodes"])],2)):i.value.mode==="text"?(z(),Q("span",{key:1,class:Ft(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},$e(i.value.content),3)):(z(),Q("span",{key:2,class:Ft(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:i.value.content},null,10,jS))}}),[["__scopeId","data-v-71cd1a9f"]]);Nn.install=e=>{e.component(Nn.__name,Nn)};const VS={class:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},WS={key:0},mn=it(Se({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=ea(),r=$n("markstreamTypewriter",void 0),i=$n("markstreamTextStreamState",void 0),o=O(()=>{const m=n.typewriter;return m===""||m===!0||m==="true"||m!==!1&&m!=="false"&&void 0}),l=O(()=>typeof o.value=="boolean"?o.value:typeof r?.value!="boolean"||r.value),a=O(()=>{var m;const v=(m=n["index-key"])!=null?m:n.indexKey;return v==null||v===""?"":String(v)}),s=G(t.node.code),c=G(""),f=G(0);function u(){return s.value+c.value}function d(m){s.value=m,c.value=""}function h(){c.value&&(s.value=u(),c.value="")}Oe([()=>t.node.code,a,l],([m])=>{const v=String(m??""),y=u(),g=a.value,b=g?i?.get(g):void 0,k=b??y;return l.value?v===k?(d(v),void(g&&(i==null||i.set(g,v)))):k&&v.startsWith(k)&&v.length>k.length?(s.value=k,c.value=v.slice(k.length),f.value+=1,void(g&&(i==null||i.set(g,v)))):(d(v),void(g&&(i==null||i.set(g,v)))):(d(v),void(g&&(i==null||i.set(g,v))))},{immediate:!0}),Oe(l,m=>{m||d(u())});const p=O(()=>f.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(m,v)=>(z(),Q("code",VS,[s.value?(z(),Q("span",WS,$e(s.value),1)):Ue("",!0),c.value?(z(),Q("span",{key:1,class:Ft(["inline-code-stream-delta",[p.value]]),onAnimationend:h},$e(c.value),35)):Ue("",!0)]))}}),[["__scopeId","data-v-ffb68151"]]);mn.install=e=>{e.component(mn.__name,mn)};const qS={class:"markstream-vue"},US=["id"],fl=it(Se({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(e){const t=e,n=O(()=>{if(t.isDark!==void 0&&t.isDark!==null)return!!t.isDark;if(typeof document<"u")try{if(document.documentElement.classList.contains("dark")||window?.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches)return!0}catch{}return!1}),r=G(null),i=G({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),o=G(!1);let l=null;function a(){return tt(this,null,function*(){var s,c;if(!t.anchorEl||!r.value)return;const f=[wS((s=t.offset)!=null?s:8),CS(),xS({padding:8})],{x:u,y:d}=yield SS(t.anchorEl,r.value,{placement:(c=t.placement)!=null?c:"top",middleware:f,strategy:"fixed"});i.value.transform=`translate3d(${Math.round(u)}px, ${Math.round(d)}px, 0)`,i.value.left="0px",i.value.top="0px"})}return Oe(()=>t.visible,s=>tt(null,null,function*(){if(s)if(o.value=!1,yield pn(),t.anchorEl&&r.value)try{const c=t.anchorEl.getBoundingClientRect();yield a();const f=i.value.transform;if(t.originX!=null&&t.originY!=null){const u=Math.abs(Number(t.originX)-c.left),d=Math.abs(Number(t.originY)-c.top);Math.hypot(u,d)>120?(i.value.transform=`translate3d(${Math.round(t.originX)}px, ${Math.round(t.originY)}px, 0)`,yield pn(),o.value=!0,yield pn(),i.value.transform=f):o.value=!0}else o.value=!0;l=Zd(t.anchorEl,r.value,a)}catch{yield a(),o.value=!0,l=Zd(t.anchorEl,r.value,a)}else o.value=!0;else o.value=!1,l&&(l(),l=null)})),Oe([()=>t.anchorEl,()=>t.placement,()=>t.content],()=>tt(null,null,function*(){t.visible&&t.anchorEl&&r.value&&(yield pn(),yield a())})),To(()=>{l&&l()}),(s,c)=>(z(),Ie(og,{to:"body"},[te("div",qS,[ge(Ur,{name:"tooltip",appear:""},{default:Ae(()=>[jr(te("div",{id:t.id,ref_key:"tooltip",ref:r,style:br({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform}),class:Ft(["z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border",[n.value?"bg-gray-900 text-white border-gray-700 border is-dark":"bg-white text-gray-900 border-gray-200 border"]]),role:"tooltip"},$e(e.content),15,US),[[bo,e.visible&&o.value]])]),_:1})])]))}}),[["__scopeId","data-v-d524cc01"]]),Vs=G(!1),ef=G(""),tf=G("top"),ho=G(null),po=G(null),Ws=G(null),qs=G(null),nf=G(null);let hl=null,pl=null;function jp(){hl&&(clearTimeout(hl),hl=null),pl&&(clearTimeout(pl),pl=null)}let Qa=!1;function ml(e,t,n="top",r=!1,i,o){if(!e)return;(function(){if(!Qa&&typeof document<"u")try{Qa=!0;const a=document.createElement("div");a.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(a),lg({setup:()=>()=>{var s;return E(fl,{visible:Vs.value,"anchor-el":ho.value,content:ef.value,placement:tf.value,id:po.value,originX:Ws.value,originY:qs.value,isDark:(s=nf.value)!=null?s:void 0})}}).mount(a)}catch(a){Qa=!1,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",a)}})(),jp();const l=()=>{var a,s;po.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,ho.value=e,ef.value=t,tf.value=n,Ws.value=(a=i?.x)!=null?a:null,qs.value=(s=i?.y)!=null?s:null,nf.value=typeof o=="boolean"?o:null,Vs.value=!0;try{e.setAttribute("aria-describedby",po.value)}catch{}};r?l():hl=setTimeout(l,80)}function Us(e=!1){jp();const t=()=>{if(ho.value&&po.value)try{ho.value.removeAttribute("aria-describedby")}catch{}Vs.value=!1,ho.value=null,po.value=null,Ws.value=null,qs.value=null};e?t():pl=setTimeout(t,120)}const YS={"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.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."};function Vp(){try{const e=globalThis.$vueI18nUse||null;if(e&&typeof e=="function")try{const t=e();if(t&&typeof t.t=="function")return{t:t.t.bind(t)}}catch{}}catch{}return tt(null,null,function*(){try{const e=yield Cn(()=>import("./index-DSCno0m2.js").then(n=>n.cU),__vite__mapDeps([0,1])),t=e.useI18n||e.default&&e.default.useI18n;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")try{globalThis.$vueI18nUse=()=>n}catch{}}catch{}}catch{}}),{t:e=>{var t;return(t=YS[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,r=>r.toUpperCase()).trim()})(e)}}}const KS=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],ZS={key:"placeholder",class:"placeholder-layer placeholder-layer--inline inline-flex items-center justify-center gap-2"},GS={class:"text-sm whitespace-nowrap"},XS={key:1,class:"text-sm text-gray-500"},QS={key:"error",class:"image-node__error image-node__error--inline px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},JS={class:"text-sm whitespace-nowrap"},zr=it(Se({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,r=t,i=G(!1),o=G(!1),l=G(!1),a=O(()=>o.value&&n.fallbackSrc?n.fallbackSrc:n.node.src),s=O(()=>!n.lazy);function c(){n.fallbackSrc&&!l.value?(l.value=!0,o.value=!0):(o.value=!0,r("error",n.node.src))}function f(){i.value=!0,o.value=!1,r("load",a.value)}function u(h){h.preventDefault(),i.value&&!o.value&&r("click",[h,a.value])}const{t:d}=Vp();return Oe(a,()=>{i.value=!1,o.value=!1}),(h,p)=>(z(),Ie(Ur,{name:"img-switch",mode:"out-in"},{default:Ae(()=>{var m,v,y,g,b;return[e.node.loading||o.value?o.value?e.node.loading||n.fallbackSrc?Ue("",!0):(z(),Q("span",QS,[ci(h.$slots,"error",{node:n.node,displaySrc:a.value,imageLoaded:i.value,hasError:o.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[p[1]||(p[1]=te("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[te("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)),te("span",JS,$e(se(d)("image.loadError")),1)],!0)])):(z(),Q("span",ZS,[n.usePlaceholder?ci(h.$slots,"placeholder",{key:0,node:n.node,displaySrc:a.value,imageLoaded:i.value,hasError:o.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[p[0]||(p[0]=te("div",{class:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin","aria-hidden":"true"},null,-1)),te("span",GS,$e(se(d)("image.loading")),1)],!0):(z(),Q("span",XS,$e(e.node.raw),1))])):(z(),Q("img",{key:"image",src:a.value,alt:String((v=(m=n.node.alt)!=null?m:n.node.title)!=null?v:""),title:String((g=(y=n.node.title)!=null?y:n.node.alt)!=null?g:""),class:Ft(["image-node__img h-auto rounded-lg image-node__img--inline",{"transition-opacity duration-200 ease-in-out":!s.value,"opacity-0":!s.value&&!i.value,"opacity-100":s.value||i.value,"cursor-pointer":i.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:s.value?"high":void 0,decoding:s.value?"sync":"async",tabindex:i.value?0:-1,"aria-label":(b=n.node.alt)!=null?b:se(d)("image.preview"),onError:c,onLoad:f,onClick:u},null,42,KS))]}),_:3}))}}),[["__scopeId","data-v-03adbc6f"]]);zr.install=e=>{e.component(zr.__name,zr)};let Wn=null,Ja=!1,Oc=Wp;function ga(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function Nc(){try{const e=globalThis;return ga(e?.katex)}catch{return null}}function Wp(){return tt(null,null,function*(){const e=Nc();if(e)return e;const t=yield Cn(()=>import("./__vite-optional-peer-dep_katex_markstream-vue_false-D5LAkEfu.js"),[]);try{yield Cn(()=>import("./mhchem_markstream-vue_false-AlZdupcq.js"),[])}catch{}return ga(t)})}function qp(){return typeof Oc=="function"}function oD(){var e;const t=Nc();if(t)return Wn=t,Wn;if(Wn)return Wn;const n=Oc;if(!n||n===Wp)return null;try{const r=n();return r&&typeof r?.then!="function"?(Wn=(e=ga(r))!=null?e:r,Wn):null}catch{return null}}function Pc(){return tt(this,null,function*(){var e;const t=Nc();if(t)return Wn=t,Wn;if(Wn)return Wn;if(Ja)return null;const n=Oc;if(!n)return Ja=!0,null;try{const r=yield n();if(r)return Wn=(e=ga(r))!=null?e:r,Wn}catch{}return Ja=!0,null})}const es=Jl(!1);let rf=null;const eA={key:0},Vt=it(Se({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(rf||(rf=Pc().then(y=>{es.value=!!y}).catch(()=>{es.value=!1})),ig(es)),r=ea(),i=$n("markstreamTypewriter",void 0),o=$n("markstreamTextStreamState",void 0),l=$n("markstreamStreamVersion",void 0),a=O(()=>{const y=r.typewriter;return y===""||y===!0||y==="true"||y!==!1&&y!=="false"&&void 0}),s=O(()=>typeof a.value=="boolean"?a.value:typeof i?.value!="boolean"||i.value),c=O(()=>{var y;const g=(y=r["index-key"])!=null?y:r.indexKey;return g==null||g===""?"":String(g)}),f=G(t.node.content),u=G(""),d=G(0);function h(){return f.value+u.value}function p(y){f.value=y,u.value=""}function m(){u.value&&(f.value=h(),u.value="")}Oe([()=>t.node.content,c,s,()=>l?.value],([y])=>{const g=String(y??""),b=h(),k=c.value,_=k?o?.get(k):void 0,T=_??b;return s.value?g===T?(u.value?m():b!==g&&p(g),void(k&&(o==null||o.set(k,g)))):T&&g.startsWith(T)&&g.length>T.length?(f.value=T,u.value=g.slice(T.length),d.value+=1,void(k&&(o==null||o.set(k,g)))):(p(g),void(k&&(o==null||o.set(k,g)))):(p(g),void(k&&(o==null||o.set(k,g))))},{immediate:!0}),Oe(s,y=>{y||p(h())});const v=O(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(y,g)=>(z(),Q("span",{class:Ft([[se(n)&&e.node.center?"text-node-center":""],"whitespace-pre-wrap break-words text-node"])},[f.value?(z(),Q("span",eA,$e(f.value),1)):Ue("",!0),u.value?(z(),Q("span",{key:1,class:Ft(["text-node-stream-delta",[v.value]]),onAnimationend:m},$e(u.value),35)):Ue("",!0)],2))}}),[["__scopeId","data-v-03641323"]]);Vt.install=e=>{e.component(Vt.__name,Vt)};const er=Mi(()=>tt(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,r,i,o;return E(Vt,lr(Ye({},t),{node:{type:"text",content:(r=t.node.raw)!=null?r:`$${(n=t.node.content)!=null?n:""}$`,raw:(o=t.node.raw)!=null?o:`$${(i=t.node.content)!=null?i:""}$`}}))};try{if(yield Pc())return(yield Cn(()=>import("./index2-C7YGxbrO.js"),__vite__mapDeps([2,0,1,3,4,5,6,7,8]))).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,r,i,o;return E(Vt,lr(Ye({},t),{node:{type:"text",content:(r=t.node.raw)!=null?r:`$${(n=t.node.content)!=null?n:""}$`,raw:(o=t.node.raw)!=null?o:`$${(i=t.node.content)!=null?i:""}$`}}))}})),Up=Mi(()=>tt(null,null,function*(){try{if(yield Pc())return(yield Cn(()=>import("./index3-taFg7ef2.js"),__vite__mapDeps([9,0,1,3,4,5,6,7,8]))).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,r,i;return E(Vt,lr(Ye({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(i=e.node.raw)!=null?i:`$$${(r=e.node.content)!=null?r:""}$$`}}))}})),Sn=Se({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(z(),Q("span",{class:"reference-node cursor-pointer bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))]",role:"button",tabindex:"0",onClick:n[0]||(n[0]=r=>t.$emit("click",r,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=r=>t.$emit("mouseEnter",r,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=r=>t.$emit("mouseLeave",r,e.node.id,e.messageId,e.threadId))},$e(e.node.id),33))});Sn.install=e=>{e.component(Sn.__name,Sn)};const tA={class:"superscript-node"},nA={key:1},Pn=it(Se({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vn(t.customId),r=Ye({text:Vt,inline_code:mn,link:Dn,html_inline:Nn,strong:An,emphasis:En,footnote_reference:On,strikethrough:Tn,highlight:Un,insert:zn,subscript:Bn,emoji:Fn,math_inline:er,reference:Sn},n);return(i,o)=>(z(),Q("sup",tA,[(z(!0),Q(Qe,null,gt(e.node.children,(l,a)=>(z(),Q(Qe,{key:`${e.indexKey||"superscript"}-${a}`},[r[l.type]?(z(),Ie(tn(r[l.type]),{key:0,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${a}`},null,8,["node","custom-id","index-key"])):(z(),Q("span",nA,$e(l.content||l.raw),1))],64))),128))]))}}),[["__scopeId","data-v-6dc1e3ba"]]);Pn.install=e=>{e.component(Pn.__name,Pn)};const rA={class:"subscript-node"},iA={key:1},Bn=it(Se({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vn(t.customId),r=Ye({text:Vt,inline_code:mn,link:Dn,html_inline:Nn,strong:An,emphasis:En,footnote_reference:On,strikethrough:Tn,highlight:Un,insert:zn,superscript:Pn,emoji:Fn,math_inline:er,reference:Sn},n);return(i,o)=>(z(),Q("sub",rA,[(z(!0),Q(Qe,null,gt(e.node.children,(l,a)=>(z(),Q(Qe,{key:`${e.indexKey||"subscript"}-${a}`},[r[l.type]?(z(),Ie(tn(r[l.type]),{key:0,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${a}`},null,8,["node","custom-id","index-key"])):(z(),Q("span",iA,$e(l.content||l.raw),1))],64))),128))]))}}),[["__scopeId","data-v-69de9b81"]]);Bn.install=e=>{e.component(Bn.__name,Bn)};const oA={class:"strong-node"},An=it(Se({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vn(t.customId),r=Ye({text:Vt,inline_code:mn,link:Dn,html_inline:Nn,emphasis:En,strikethrough:Tn,highlight:Un,insert:zn,subscript:Bn,superscript:Pn,emoji:Fn,footnote_reference:On,math_inline:er,reference:Sn},n);return(i,o)=>(z(),Q("strong",oA,[(z(!0),Q(Qe,null,gt(e.node.children,(l,a)=>(z(),Ie(tn(r[l.type]),{key:`${e.indexKey||"strong"}-${a}`,"index-key":`${e.indexKey||"strong"}-${a}`,node:l,"custom-id":t.customId},null,8,["index-key","node","custom-id"]))),128))]))}}),[["__scopeId","data-v-af3ce037"]]);An.install=e=>{e.component(An.__name,An)};const lA={class:"strikethrough-node"},Tn=it(Se({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vn(t.customId),r=Ye({text:Vt,inline_code:mn,link:Dn,html_inline:Nn,strong:An,emphasis:En,highlight:Un,insert:zn,subscript:Bn,superscript:Pn,emoji:Fn,footnote_reference:On,math_inline:er,reference:Sn},n);return(i,o)=>(z(),Q("del",lA,[(z(!0),Q(Qe,null,gt(e.node.children,(l,a)=>(z(),Ie(tn(r[l.type]),{key:`${e.indexKey||"strikethrough"}-${a}`,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${a}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-904d5bd1"]]);Tn.install=e=>{e.component(Tn.__name,Tn)};const aA=["href","title","aria-label","aria-hidden"],sA=["aria-hidden"],cA={class:"link-text-wrapper relative inline-flex"},uA={class:"leading-[normal] link-text"},Dn=it(Se({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=$n("markstreamShowTooltips",void 0),r=O(()=>{const d=n?.value;return typeof d=="boolean"?d:t.showTooltip}),i=O(()=>{var d,h,p,m,v,y;const g=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",b=(d=t.animationOpacity)!=null?d:.35,k=Math.max(.12,Math.min(.5*b,b));return{"--link-color":(h=t.color)!=null?h:"#0366d6","--underline-height":`${(p=t.underlineHeight)!=null?p:2}px`,"--underline-bottom":g,"--underline-opacity":String(b),"--underline-rest-opacity":String(k),"--underline-duration":`${(m=t.animationDuration)!=null?m:1.6}s`,"--underline-timing":(v=t.animationTiming)!=null?v:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(y=t.animationIteration)!=null?y:"infinite"}}),o={text:Vt,strong:An,strikethrough:Tn,emphasis:En,image:zr,html_inline:Nn,inline_code:mn},l=O(()=>($o.value,vn(t.customId))),a=ea(),s=O(()=>{var d,h;const p=(d=t.node)==null?void 0:d.attrs;if(!p||typeof p!="object")return{};const m={};if(Array.isArray(p))for(const v of p)Array.isArray(v)&&v[0]&&(m[String(v[0])]=String((h=v[1])!=null?h:""));else for(const[v,y]of Object.entries(p))v&&y!=null&&y!==!1&&(m[v]=y===!0?"":String(y));return zp(m)}),c=O(()=>{const d=Ye(Ye({},a),s.value);return delete d.title,d});function f(){r.value&&Us()}const u=O(()=>{var d,h,p;const m=(d=t.node)==null?void 0:d.title;return typeof m=="string"&&m.trim().length>0?m:String((p=(h=t.node)==null?void 0:h.href)!=null?p:"")});return(d,h)=>{var p,m;return e.node.loading?(z(),Q("span",Xn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},se(a),{style:i.value}),[te("span",cA,[te("span",uA,[ge(se(Vt),{class:"leading-[normal] link-text",node:{type:"text",content:String((p=e.node.text)!=null?p:""),raw:String((m=e.node.text)!=null?m:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),h[1]||(h[1]=te("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,sA)):(z(),Q("a",Xn({key:0,class:"link-node",href:e.node.href,title:r.value?"":u.value,"aria-label":`Link: ${u.value}`,"aria-hidden":e.node.loading?"true":"false",target:"_blank",rel:"noopener noreferrer"},c.value,{style:i.value,onMouseenter:h[0]||(h[0]=v=>(function(y){var g,b,k;if(!r.value)return;const _=y,T=_?.clientX!=null&&_?.clientY!=null?{x:_.clientX,y:_.clientY}:void 0,x=((g=t.node)==null?void 0:g.title)||((b=t.node)==null?void 0:b.href)||((k=t.node)==null?void 0:k.text)||"";ml(y.currentTarget,x,"top",!1,T)})(v)),onMouseleave:f}),[(z(!0),Q(Qe,null,gt(e.node.children,(v,y)=>(z(),Ie(tn((function(g){return l.value[g.type]||o[g.type]||null})(v)),{key:`${e.indexKey||"emphasis"}-${y}`,node:v,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${y}`},null,8,["node","custom-id","index-key"]))),128))],16,aA))}}}),[["__scopeId","data-v-a4831c9e"]]);Dn.install=e=>{e.component(Dn.__name,Dn)};const dA={class:"insert-node"},zn=it(Se({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vn(t.customId),r=Ye({text:Vt,inline_code:mn,link:Dn,html_inline:Nn,strong:An,emphasis:En,strikethrough:Tn,highlight:Un,subscript:Bn,superscript:Pn,emoji:Fn,footnote_reference:On,math_inline:er,reference:Sn},n);return(i,o)=>(z(),Q("ins",dA,[(z(!0),Q(Qe,null,gt(e.node.children,(l,a)=>(z(),Ie(tn(r[l.type]),{key:`${e.indexKey||"insert"}-${a}`,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${a}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-ab1ec9bc"]]);zn.install=e=>{e.component(zn.__name,zn)};const fA={class:"highlight-node"},Un=it(Se({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vn(t.customId),r=Ye({text:Vt,inline_code:mn,link:Dn,html_inline:Nn,strong:An,emphasis:En,strikethrough:Tn,insert:zn,subscript:Bn,superscript:Pn,emoji:Fn,footnote_reference:On,math_inline:er,reference:Sn},n);return(i,o)=>(z(),Q("mark",fA,[(z(!0),Q(Qe,null,gt(e.node.children,(l,a)=>(z(),Ie(tn(r[l.type]),{key:`${e.indexKey||"highlight"}-${a}`,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${a}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-38e31bf6"]]);Un.install=e=>{e.component(Un.__name,Un)};const hA={class:"emphasis-node"},En=it(Se({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vn(t.customId),r=Ye({text:Vt,inline_code:mn,link:Dn,html_inline:Nn,strong:An,strikethrough:Tn,highlight:Un,insert:zn,subscript:Bn,superscript:Pn,emoji:Fn,footnote_reference:On,math_inline:er,reference:Sn},n);return(i,o)=>(z(),Q("em",hA,[(z(!0),Q(Qe,null,gt(e.node.children,(l,a)=>(z(),Ie(tn(r[l.type]),{key:`${e.indexKey||"emphasis"}-${a}`,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${a}`},null,8,["node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-8264674d"]]);En.install=e=>{e.component(En.__name,En)};const pA=["href","title"],mo=it(Se({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(r){var i;if(r.preventDefault(),typeof document>"u")return;const o=`fnref-${String((i=t.node.id)!=null?i:"")}`,l=document.getElementById(o);l&&l.scrollIntoView({behavior:"smooth"})}return(r,i)=>(z(),Q("a",{class:"footnote-anchor text-sm text-[#0366d6] hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,pA))}}),[["__scopeId","data-v-4756ce0d"]]);mo.install=e=>{e.component(mo.__name,mo)};const mA=["id"],gA={class:"flex-1"},gl=Se({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,r)=>(z(),Q("div",{id:`fnref--${e.node.id}`,class:"flex mt-2 mb-2 text-sm leading-relaxed border-t border-[#eaecef] pt-2"},[te("div",gA,[ge(se(Rn),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,onCopy:r[0]||(r[0]=i=>n.$emit("copy",i))},null,8,["index-key","nodes","custom-id","typewriter"])])],8,mA))}});gl.install=e=>{e.component(gl.__name,gl)};const vA={class:"hard-break"},fi=it(Se({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(z(),Q("br",vA))}),[["__scopeId","data-v-50c58f70"]]);fi.install=e=>{e.component(fi.__name,fi)};const Ys=it(Se({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vn(t.customId),r=Ye({text:Vt,inline_code:mn,link:Dn,image:zr,strong:An,emphasis:En,strikethrough:Tn,highlight:Un,insert:zn,subscript:Bn,superscript:Pn,emoji:Fn,checkbox:Gn,checkbox_input:Gn,footnote_reference:On,hardbreak:fi,math_inline:er,reference:Sn},n);return(i,o)=>(z(),Ie(tn(`h${e.node.level}`),Xn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Ae(()=>[(z(!0),Q(Qe,null,gt(e.node.children,(l,a)=>(z(),Ie(tn(r[l.type]),{key:`${e.indexKey||"heading"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"heading"}-${a}`},null,8,["custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-ffb7cf51"]]),Yl=Ys;Yl.install=e=>{e.component(Ys.__name,Ys)};const Pi=it(Se({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},value:{},customId:{},typewriter:{type:Boolean},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=O(()=>{var i;return(i=t.node)!=null?i:t.item}),r=O(()=>t.value==null?{}:{value:t.value});return(i,o)=>{var l,a;return z(),Q("li",Xn({class:"list-item pl-1.5 my-2",dir:"auto"},r.value),[ge(se(Rn),Xn({showTooltips:t.showTooltips},{"index-key":`list-item-${t.indexKey}`,nodes:(a=(l=n.value)==null?void 0:l.children)!=null?a:[],"custom-id":t.customId,typewriter:t.typewriter,"batch-rendering":!1,onCopy:o[0]||(o[0]=s=>i.$emit("copy",s))}),null,16,["index-key","nodes","custom-id","typewriter"])],16)}}}),[["__scopeId","data-v-ce59e808"]]);Pi.install=e=>{e.component(Pi.__name,Pi)};const Bi=it(Se({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=O(()=>($o.value,vn(e.customId).list_item||Pi));return(n,r)=>(z(),Ie(tn(e.node.ordered?"ol":"ul"),{class:Ft(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Ae(()=>[(z(!0),Q(Qe,null,gt(e.node.items,(i,o)=>{var l;return z(),Ie(tn(t.value),Xn({key:`${e.indexKey||"list"}-${o}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${o}`,typewriter:e.typewriter,value:e.node.ordered?((l=e.node.start)!=null?l:1)+o:void 0,onCopy:r[0]||(r[0]=a=>n.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-8e81cbc8"]]);Bi.install=e=>{e.component(Bi.__name,Bi)};const Yp=Symbol("ViewportPriority");function yA(e,t){var n,r;const i=typeof window<"u"&&typeof document<"u",o=typeof t=="boolean"?G(t):t,l=i?(n=window.requestIdleCallback)!=null?n:y=>window.setTimeout(()=>y({didTimeout:!0,timeRemaining:()=>0}),16):null,a=i?(r=window.cancelIdleCallback)!=null?r:y=>window.clearTimeout(y):null;let s=null,c=null;const f=new Map,u=new Set;let d=null;function h(){if(!f.size){try{s?.disconnect()}catch{}s=null,c=null,u.size||(function(){if(d!=null){try{a?.(d)}catch{}d=null}})()}}function p(y){const g=f.get(y);if(g){if(!g.visible.value){g.visible.value=!0;try{g.resolve()}catch{}}try{s?.unobserve(y)}catch{}f.delete(y),u.delete(y),h()}}function m(){l&&d==null&&u.size&&(d=l(()=>{d=null;const y=u.values().next().value;y&&(u.delete(y),p(y),u.size&&m())},{timeout:1200}))}const v=(y,g)=>{const b=G(!1);let k,_=!1;const T=new Promise(R=>{k=()=>{_||(_=!0,R())}}),x=()=>{try{s?.unobserve(y)}catch{}f.delete(y),u.delete(y),h()};if(!i||!o.value)return b.value=!0,k(),{isVisible:b,whenVisible:T,destroy:x};const S=(function(R,W){if(!i)return s;if(typeof IntersectionObserver>"u")return null;const w=(function(M,L){var P,I,N;return{root:(P=e?.(M??null))!=null?P:null,rootMargin:(I=L?.rootMargin)!=null?I:"300px",threshold:(N=L?.threshold)!=null?N:0}})(R,W);if(s&&(A=w,(C=c)&&C.root===A.root&&C.rootMargin===A.rootMargin&&C.threshold===A.threshold))return s;var C,A;if(s)try{s.disconnect()}catch{}s=new IntersectionObserver(M=>{for(const L of M)(L.isIntersecting||L.intersectionRatio>0)&&p(L.target)},{root:w.root,rootMargin:w.rootMargin,threshold:w.threshold}),c=w;for(const M of f.keys())s.observe(M);return s})(y,g);return S?(f.set(y,{resolve:k,visible:b}),S.observe(y),u.add(y),m(),{isVisible:b,whenVisible:T,destroy:x}):(b.value=!0,k(),{isVisible:b,whenVisible:T,destroy:x})};return kr(Yp,v),v}function Kp(){var e,t;const n=$n(Yp,void 0);if(n)return n;const r=new WeakMap;let i=null;const o=new Set;let l=null;const a=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:d=>window.setTimeout(()=>d({didTimeout:!0,timeRemaining:()=>0}),16):null,s=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:d=>window.clearTimeout(d):null,c=()=>{if(l!=null){try{s?.(l)}catch{}l=null}},f=d=>{const h=r.get(d);if(h){if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{i?.unobserve(d)}catch{}r.delete(d),o.delete(d),o.size||c()}},u=()=>{a&&l==null&&o.size&&(l=a(()=>{l=null;const d=o.values().next().value;d&&(o.delete(d),f(d),o.size&&u())},{timeout:1200}))};return d=>{const h=G(!1);let p,m=!1;const v=new Promise(b=>{p=()=>{m||(m=!0,b())}}),y=()=>{try{i?.unobserve(d)}catch{}r.delete(d),o.delete(d),o.size||c()},g=i||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(i=new IntersectionObserver(b=>{for(const k of b)(k.isIntersecting||k.intersectionRatio>0)&&f(k.target)},{root:null,rootMargin:"300px",threshold:0}),i));return g?(r.set(d,{resolve:p,visible:h}),g.observe(d),o.add(d),u(),{isVisible:h,whenVisible:v,destroy:y}):(h.value=!0,p(),{isVisible:h,whenVisible:v,destroy:y})}}const kA={key:1,class:"html-block-node__raw"},bA=["innerHTML"],_A={key:1,class:"html-block-node__placeholder"},go=it(Se({__name:"HtmlBlockNode",props:{node:{},customId:{}},setup(e){const t=e,n=O(()=>{const d=t.node.attrs;if(d){if(Array.isArray(d)){const h={};for(const p of d){if(!p||p.length<2)continue;const[m,v]=p;m!=null&&(h[String(m)]=v==null?"":String(v))}return h}return d}}),r=O(()=>($o.value,vn(t.customId))),i=Se({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),o=G(null),l=G(typeof window>"u"),a=G(t.node.content),s=O(()=>{var d,h,p;if(!l.value)return{mode:"html",content:(d=a.value)!=null?d:""};const m=(h=a.value)!=null?h:t.node.content;if(!m)return{mode:"html",content:""};if(t.node.loading){const y=Ul(m,r.value);return y===null?{mode:"text",content:(p=t.node.raw)!=null?p:m}:{mode:"dynamic",nodes:y}}if(!Hp(m,r.value))return{mode:"html",content:m};const v=Ul(m,r.value);return v===null?{mode:"html",content:m}:{mode:"dynamic",nodes:v}}),c=Kp(),f=G(null),u=!!t.node.loading;return typeof window<"u"?(Oe(o,d=>{var h,p;if((p=(h=f.value)==null?void 0:h.destroy)==null||p.call(h),f.value=null,!u)return l.value=!0,void(a.value=t.node.content);if(!d)return void(l.value=!1);const m=c(d,{rootMargin:"400px"});f.value=m,l.value=m.isVisible.value,m.whenVisible.then(()=>{l.value=!0})},{immediate:!0}),Oe(()=>t.node.content,d=>{u&&!l.value||(a.value=d)})):l.value=!0,To(()=>{var d,h;(h=(d=f.value)==null?void 0:d.destroy)==null||h.call(d),f.value=null}),(d,h)=>(z(),Q("div",Xn({ref_key:"htmlRef",ref:o,class:"html-block-node"},n.value),[l.value?(z(),Q(Qe,{key:0},[s.value.mode==="dynamic"?(z(),Ie(se(i),{key:0,nodes:s.value.nodes},null,8,["nodes"])):s.value.mode==="text"?(z(),Q("pre",kA,$e(s.value.content),1)):(z(),Q("div",{key:2,innerHTML:a.value},null,8,bA))],64)):(z(),Q("div",_A,[ci(d.$slots,"placeholder",{node:e.node},()=>[h[0]||(h[0]=te("span",{class:"html-block-node__placeholder-bar"},null,-1)),h[1]||(h[1]=te("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),h[2]||(h[2]=te("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))],16))}}),[["__scopeId","data-v-b7cace40"]]);go.install=e=>{e.component(go.__name,go)};const wA={dir:"auto",class:"paragraph-node"},zi=it(Se({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vn(t.customId);function r(f){var u;return f.type==="text"&&String((u=f.content)!=null?u:"").trim()===""}function i(f){var u;return String((u=f.content)!=null?u:"")}const o=O(()=>t.node.children.filter(f=>!r(f))),l=O(()=>o.value.length>0&&o.value.every(f=>f.type==="image"||(function(u){var d;const h=(function(p){return p.type==="link"&&Array.isArray(p.children)?p.children.filter(m=>!r(m)):[]})(u);return h.length===1&&((d=h[0])==null?void 0:d.type)==="image"})(f))),a=O(()=>{if(!l.value||o.value.length<=1)return t.node.children;const f=[];for(let u=0;u<t.node.children.length;u++){const d=t.node.children[u];if(!r(d)){f.push(d);continue}const h=f.length>0,p=t.node.children.slice(u+1).some(m=>!r(m));h&&p&&f.push(lr(Ye({},d),{content:" ",raw:" "}))}return f});function s(f,u){return{node:f,"index-key":`${t.indexKey}-${u}`,"custom-id":t.customId}}const c=Ye({inline_code:mn,image:zr,link:Dn,hardbreak:fi,emphasis:En,strong:An,strikethrough:Tn,highlight:Un,insert:zn,subscript:Bn,superscript:Pn,html_inline:Nn,html_block:go,emoji:Fn,checkbox:Gn,math_inline:er,checkbox_input:Gn,reference:Sn,footnote_anchor:mo,footnote_reference:On,text:Vt},n);return(f,u)=>(z(),Q("p",wA,[(z(!0),Q(Qe,null,gt(a.value,(d,h)=>(z(),Q(Qe,{key:`${e.indexKey||"paragraph"}-${h}`},[l.value&&r(d)?(z(),Q(Qe,{key:0},[ot($e(i(d)),1)],64)):(z(),Ie(tn(c[d.type]),Xn({key:1,ref_for:!0},s(d,h)),null,16))],64))),128))]))}}),[["__scopeId","data-v-c4fdb7c8"]]);zi.install=e=>{e.component(zi.__name,zi)};const xA=["aria-busy","aria-label","data-language"],CA=["textContent"],yr=Se({__name:"PreCodeNode",props:{node:{}},setup(e){const t=e,n=O(()=>{var o,l,a;const s=String((l=(o=t.node)==null?void 0:o.language)!=null?l:"");return String((a=String(s).split(/\s+/g)[0])!=null?a:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),r=O(()=>`language-${n.value}`),i=O(()=>{const o=n.value;return o?`Code block: ${o}`:"Code block"});return(o,l)=>(z(),Q("pre",{class:Ft([r.value]),"aria-busy":e.node.loading===!0,"aria-label":i.value,"data-language":n.value,"data-markstream-pre":"1",tabindex:"0"},[te("code",{translate:"no",textContent:$e(e.node.code)},null,8,CA)],10,xA))}});yr.install=e=>{e.component(yr.__name,yr)};const SA={class:"table-node-wrapper"},AA=["aria-busy"],TA={class:"border-[var(--table-border,#cbd5e1)]"},DA={class:"border-b"},EA={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},vo=it(Se({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e,n=O(()=>{var i;return(i=t.node.loading)!=null&&i}),r=O(()=>{var i;return(i=t.node.rows)!=null?i:[]});return(i,o)=>(z(),Q("div",SA,[te("table",{class:Ft(["my-8 text-sm table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[te("thead",TA,[te("tr",DA,[(z(!0),Q(Qe,null,gt(e.node.header.cells,(l,a)=>(z(),Q("th",{key:`header-${a}`,dir:"auto",class:Ft(["font-semibold p-[calc(4/7*1em)]",[l.align==="right"?"text-right":l.align==="center"?"text-center":"text-left"]])},[ge(se(Rn),{nodes:l.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,onCopy:o[0]||(o[0]=s=>i.$emit("copy",s))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))])]),te("tbody",null,[(z(!0),Q(Qe,null,gt(r.value,(l,a)=>(z(),Q("tr",{key:`row-${a}`,class:Ft(["border-[var(--table-border,#cbd5e1)]",[a<r.value.length-1?"border-b":""]])},[(z(!0),Q(Qe,null,gt(l.cells,(s,c)=>(z(),Q("td",{key:`cell-${a}-${c}`,class:Ft(["p-[calc(4/7*1em)]",[s.align==="right"?"text-right":s.align==="center"?"text-center":"text-left"]]),dir:"auto"},[ge(se(Rn),{nodes:s.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,onCopy:o[1]||(o[1]=f=>i.$emit("copy",f))},null,8,["nodes","index-key","custom-id","typewriter"])],2))),128))],2))),128))])],10,AA),ge(Ur,{name:"table-node-fade"},{default:Ae(()=>[n.value?(z(),Q("div",EA,[ci(i.$slots,"loading",{isLoading:n.value},()=>[o[2]||(o[2]=te("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),o[3]||(o[3]=te("span",{class:"sr-only"},"Loading",-1))],!0)])):Ue("",!0)]),_:3})]))}}),[["__scopeId","data-v-369096fa"]]);vo.install=e=>{e.component(vo.__name,vo)};const MA={class:"hr-node"},vl=it({},[["render",function(e,t){return z(),Q("hr",MA)}],["__scopeId","data-v-639cbad9"]]);vl.install=e=>{e.component(vl.__name,vl)};const LA={class:"unknown-node"},Ks=Se({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(z(),Q("div",LA,$e(e.node.raw),1))}),yl=it(Se({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},setup(e){const t=e,n=O(()=>`vmr-container vmr-container-${t.node.name}`),r=vn(t.customId),i=Ye({text:Vt,paragraph:zi,heading:Yl,inline_code:mn,link:Dn,image:zr,strong:An,emphasis:En,strikethrough:Tn,insert:zn,subscript:Bn,superscript:Pn,checkbox:Gn,checkbox_input:Gn,hardbreak:fi,math_inline:er,reference:Sn,list:Bi,math_block:Up,table:vo},r);return(o,l)=>(z(),Q("div",Xn({class:n.value},e.node.attrs),[(z(!0),Q(Qe,null,gt(e.node.children,(a,s)=>{return z(),Ie(tn((c=a.type,i[c]||Ks)),{key:`${e.indexKey||"vmr-container"}-${s}`,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"vmr-container"}-${s}`},null,8,["custom-id","node","index-key"]);var c}),128))],16))}}),[["__scopeId","data-v-a88d22ce"]]);yl.install=e=>{e.component(yl.__name,yl)};const RA=["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","ON","CS","ON","CS","ON","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ON","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","ON","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"],$A=["AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL"];function IA(e){return e<=255?RA[e]:1424<=e&&e<=1524?"R":1536<=e&&e<=1791?$A[255&e]:1792<=e&&e<=2220?"AL":"L"}const FA=/[ \t\n\r\f]+/g,OA=/[\t\n\r\f]| {2,}|^ | $/;let ts=null;const NA=new RegExp("\\p{Script=Arabic}","u"),va=new RegExp("\\p{M}","u"),Zp=new RegExp("\\p{Nd}","u");function Zs(e){return NA.test(e)}function oi(e){for(const t of e){const n=t.codePointAt(0);if(n>=19968&&n<=40959||n>=13312&&n<=19903||n>=131072&&n<=173791||n>=173824&&n<=177983||n>=177984&&n<=178207||n>=178208&&n<=183983||n>=183984&&n<=191471||n>=196608&&n<=201551||n>=63744&&n<=64255||n>=194560&&n<=195103||n>=12288&&n<=12351||n>=12352&&n<=12447||n>=12448&&n<=12543||n>=44032&&n<=55215||n>=65280&&n<=65519)return!0}return!1}const Gp=new Set(["，","．","！","：","；","？","、","。","・","）","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),ya=new Set(['"',"(","[","{","“","‘","«","‹","（","〔","〈","《","「","『","【","〖","〘","〚"]),Bc=new Set(["'","’"]),Io=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),PA=new Set([":",".","،","؛"]),BA=new Set(["၏"]),zA=new Set(["”","’","»","›","」","』","】","》","〉","〕","）"]);function HA(e){if(zc(e))return!0;let t=!1;for(const n of e)if(Io.has(n))t=!0;else if(!t||!va.test(n))return!1;return t}function jA(e){for(const t of e)if(!Gp.has(t)&&!Io.has(t))return!1;return e.length>0}function VA(e){if(zc(e))return!0;for(const t of e)if(!ya.has(t)&&!Bc.has(t)&&!va.test(t))return!1;return e.length>0}function zc(e){let t=!1;for(const n of e)if(n!=="\\"&&!va.test(n)){if(!(ya.has(n)||Io.has(n)||Bc.has(n)))return!1;t=!0}return t}function WA(e){const t=Array.from(e);let n=t.length;for(;n>0;){const r=t[n-1];if(va.test(r))n--;else{if(!ya.has(r)&&!Bc.has(r))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function qA(e,t){if(e.length===0)return!1;for(const n of e)if(n!==t)return!1;return!0}function UA(e){return!(!Zs(e)||e.length===0)&&PA.has(e[e.length-1])}function YA(e){return e.length!==0&&BA.has(e[e.length-1])}function KA(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 Xp(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(zA.has(n))return!0;if(!Io.has(n))return!1}return!1}function ZA(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"}function GA(e,t,n,r){const i=[];let o=null,l="",a=n,s=!1,c=0;for(const f of e){const u=ZA(f,r),d=u==="text"&&t;o===null||u!==o||d!==s?(o!==null&&i.push({text:l,isWordLike:s,kind:o,start:a}),o=u,l=f,a=n+c,s=d,c+=f.length):(l+=f,c+=f.length)}return o!==null&&i.push({text:l,isWordLike:s,kind:o,start:a}),i}function ns(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const XA=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function QA(e,t){const n=e.texts[t];return!!n.startsWith("www.")||XA.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function JA(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const e5=new Set([":","-","/","×",",",".","+","–","—"]),of=/^[A-Za-z0-9_]+[,:;]*$/,t5=/[,:;]+$/;function lf(e){for(const t of e)if(Zp.test(t))return!0;return!1}function rs(e){if(e.length===0)return!1;for(const t of e)if(!Zp.test(t)&&!e5.has(t))return!1;return!0}function n5(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let r=0;for(let i=0;i<e.len;i++)e.kinds[i]==="hard-break"&&(n.push({startSegmentIndex:r,endSegmentIndex:i,consumedEndSegmentIndex:i+1}),r=i+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function r5(e,t,n="normal"){const r=(function(l){const a=l??"normal";return a==="pre-wrap"?{mode:a,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:a,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(n),i=r.mode==="pre-wrap"?(function(l){return/[\r\f]/.test(l)?l.replace(/\r\n/g,`
`).replace(/[\r\f]/g,`
`):l.replace(/\r\n/g,`
`)})(e):(function(l){if(!OA.test(l))return l;let a=l.replace(FA," ");return a.charCodeAt(0)===32&&(a=a.slice(1)),a.length>0&&a.charCodeAt(a.length-1)===32&&(a=a.slice(0,-1)),a})(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const o=(function(l,a,s){var c;const f=(ts===null&&(ts=new Intl.Segmenter(void 0,{granularity:"word"})),ts);let u=0;const d=[],h=[],p=[],m=[];for(const g of f.segment(l))for(const b of GA(g.segment,(c=g.isWordLike)!=null&&c,g.index,s)){const k=b.kind==="text";a.carryCJKAfterClosingQuote&&k&&u>0&&p[u-1]==="text"&&oi(b.text)&&oi(d[u-1])&&Xp(d[u-1])||k&&u>0&&p[u-1]==="text"&&jA(b.text)&&oi(d[u-1])||k&&u>0&&p[u-1]==="text"&&YA(d[u-1])?(d[u-1]+=b.text,h[u-1]=h[u-1]||b.isWordLike):k&&u>0&&p[u-1]==="text"&&b.isWordLike&&Zs(b.text)&&UA(d[u-1])?(d[u-1]+=b.text,h[u-1]=!0):k&&!b.isWordLike&&u>0&&p[u-1]==="text"&&b.text.length===1&&b.text!=="-"&&b.text!=="—"&&qA(d[u-1],b.text)||k&&!b.isWordLike&&u>0&&p[u-1]==="text"&&(HA(b.text)||b.text==="-"&&h[u-1])?d[u-1]+=b.text:(d[u]=b.text,h[u]=b.isWordLike,p[u]=b.kind,m[u]=b.start,u++)}for(let g=1;g<u;g++)p[g]==="text"&&!h[g]&&zc(d[g])&&p[g-1]==="text"&&(d[g-1]+=d[g],h[g-1]=h[g-1]||h[g],d[g]="");for(let g=u-2;g>=0;g--)if(p[g]==="text"&&!h[g]&&VA(d[g])){let b=g+1;for(;b<u&&d[b]==="";)b++;b<u&&p[b]==="text"&&(d[b]=d[g]+d[b],m[b]=m[g],d[g]="")}let v=0;for(let g=0;g<u;g++){const b=d[g];b.length!==0&&(v!==g&&(d[v]=b,h[v]=h[g],p[v]=p[g],m[v]=m[g]),v++)}d.length=v,h.length=v,p.length=v,m.length=v;const y=(function(g){const b=g.texts.slice(),k=g.isWordLike.slice(),_=g.kinds.slice(),T=g.starts.slice();for(let x=0;x<b.length-1;x++){if(_[x]!=="text"||_[x+1]!=="text"||!oi(b[x])||!oi(b[x+1]))continue;const S=WA(b[x]);S!==null&&(b[x]=S.head,b[x+1]=S.tail+b[x+1],T[x+1]=T[x]+S.head.length)}return{len:b.length,texts:b,isWordLike:k,kinds:_,starts:T}})((function(g){const b=[],k=[],_=[],T=[];for(let x=0;x<g.len;x++){const S=g.texts[x],R=g.kinds[x],W=g.isWordLike[x];if(R==="text"&&W&&of.test(S)){let w=S,C=x+1;for(;t5.test(w)&&C<g.len&&g.kinds[C]==="text"&&g.isWordLike[C]&&of.test(g.texts[C]);)w+=g.texts[C],C++;b.push(w),k.push(!0),_.push("text"),T.push(g.starts[x]),x=C-1;continue}b.push(S),k.push(W),_.push(R),T.push(g.starts[x])}return{len:b.length,texts:b,isWordLike:k,kinds:_,starts:T}})((function(g){const b=[],k=[],_=[],T=[];for(let x=0;x<g.len;x++){const S=g.texts[x];if(g.kinds[x]==="text"&&S.includes("-")){const R=S.split("-");let W=R.length>1;for(let w=0;w<R.length;w++){const C=R[w];if(!W)break;C.length!==0&&lf(C)&&rs(C)||(W=!1)}if(W){let w=0;for(let C=0;C<R.length;C++){const A=R[C],M=C<R.length-1?`${A}-`:A;b.push(M),k.push(!0),_.push("text"),T.push(g.starts[x]+w),w+=M.length}continue}}b.push(S),k.push(g.isWordLike[x]),_.push(g.kinds[x]),T.push(g.starts[x])}return{len:b.length,texts:b,isWordLike:k,kinds:_,starts:T}})((function(g){const b=[],k=[],_=[],T=[];for(let x=0;x<g.len;x++){const S=g.texts[x],R=g.kinds[x];if(R==="text"&&rs(S)&&lf(S)){let W=S,w=x+1;for(;w<g.len&&g.kinds[w]==="text"&&rs(g.texts[w]);)W+=g.texts[w],w++;b.push(W),k.push(!0),_.push("text"),T.push(g.starts[x]),x=w-1;continue}b.push(S),k.push(g.isWordLike[x]),_.push(R),T.push(g.starts[x])}return{len:b.length,texts:b,isWordLike:k,kinds:_,starts:T}})((function(g){const b=[],k=[],_=[],T=[];for(let x=0;x<g.len;x++){const S=g.texts[x];if(b.push(S),k.push(g.isWordLike[x]),_.push(g.kinds[x]),T.push(g.starts[x]),!JA(S))continue;const R=x+1;if(R>=g.len||ns(g.kinds[R]))continue;let W="";const w=g.starts[R];let C=R;for(;C<g.len&&!ns(g.kinds[C]);)W+=g.texts[C],C++;W.length>0&&(b.push(W),k.push(!0),_.push("text"),T.push(w),x=C-1)}return{len:b.length,texts:b,isWordLike:k,kinds:_,starts:T}})((function(g){const b=g.texts.slice(),k=g.isWordLike.slice(),_=g.kinds.slice(),T=g.starts.slice();for(let S=0;S<g.len;S++){if(_[S]!=="text"||!QA(g,S))continue;let R=S+1;for(;R<g.len&&!ns(_[R]);){b[S]+=b[R],k[S]=!0;const W=b[R].includes("?");if(_[R]="text",b[R]="",R++,W)break}}let x=0;for(let S=0;S<b.length;S++){const R=b[S];R.length!==0&&(x!==S&&(b[x]=R,k[x]=k[S],_[x]=_[S],T[x]=T[S]),x++)}return b.length=x,k.length=x,_.length=x,T.length=x,{len:x,texts:b,isWordLike:k,kinds:_,starts:T}})((function(g){const b=[],k=[],_=[],T=[];let x=0;for(;x<g.len;){let S=g.texts[x],R=g.isWordLike[x],W=g.kinds[x],w=g.starts[x];if(W==="glue"){let C=S;const A=w;for(x++;x<g.len&&g.kinds[x]==="glue";)C+=g.texts[x],x++;if(!(x<g.len&&g.kinds[x]==="text")){b.push(C),k.push(!1),_.push("glue"),T.push(A);continue}S=C+g.texts[x],R=g.isWordLike[x],W="text",w=A,x++}else x++;if(W==="text")for(;x<g.len&&g.kinds[x]==="glue";){let C="";for(;x<g.len&&g.kinds[x]==="glue";)C+=g.texts[x],x++;x<g.len&&g.kinds[x]==="text"?(S+=C+g.texts[x],R=R||g.isWordLike[x],x++):S+=C}b.push(S),k.push(R),_.push(W),T.push(w)}return{len:b.length,texts:b,isWordLike:k,kinds:_,starts:T}})({len:v,texts:d,isWordLike:h,kinds:p,starts:m})))))));for(let g=0;g<y.len-1;g++){const b=KA(y.texts[g]);b!==null&&(y.kinds[g]!=="space"&&y.kinds[g]!=="preserved-space"||y.kinds[g+1]!=="text"||!Zs(y.texts[g+1])||(y.texts[g]=b.space,y.isWordLike[g]=!1,y.kinds[g]=y.kinds[g]==="preserved-space"?"preserved-space":"space",y.texts[g+1]=b.marks+y.texts[g+1],y.starts[g+1]=y.starts[g]+b.space.length))}return y})(i,t,r);return Ye({normalized:i,chunks:n5(o,r)},o)}let Si=null;const af=new Map;let Ai=null;const i5=new RegExp("\\p{Emoji_Presentation}","u"),o5=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let is=null;const sf=new Map;function Gs(){if(Si!==null)return Si;if(typeof OffscreenCanvas<"u")return Si=new OffscreenCanvas(1,1).getContext("2d"),Si;if(typeof document<"u")return Si=document.createElement("canvas").getContext("2d"),Si;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function li(e,t){let n=t.get(e);return n===void 0&&(n={width:Gs().measureText(e).width,containsCJK:oi(e)},t.set(e,n)),n}function yo(){if(Ai!==null)return Ai;if(typeof navigator>"u")return Ai={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ai;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 Ai={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Ai}function Hc(){return is===null&&(is=new Intl.Segmenter(void 0,{granularity:"grapheme"})),is}function l5(e){return i5.test(e)||e.includes("️")}function ai(e,t,n){return n===0?t.width:t.width-(function(r,i){return i.emojiCount===void 0&&(i.emojiCount=(function(o){let l=0;const a=Hc();for(const s of a.segment(o))l5(s.segment)&&l++;return l})(r)),i.emojiCount})(e,t)*n}function a5(e,t,n,r){if(t.graphemeWidths!==void 0)return t.graphemeWidths;const i=[],o=Hc();for(const l of o.segment(e)){const a=li(l.segment,n);i.push(ai(l.segment,a,r))}return t.graphemeWidths=i.length>1?i:null,t.graphemeWidths}function s5(e,t,n,r){if(t.graphemePrefixWidths!==void 0)return t.graphemePrefixWidths;const i=[],o=Hc();let l="";for(const a of o.segment(e)){l+=a.segment;const s=li(l,n);i.push(ai(l,s,r))}return t.graphemePrefixWidths=i.length>1?i:null,t.graphemePrefixWidths}function el(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function c5(e){return e==="space"}function u5(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function os(e,t,n,r){return r&&t!==null?t[n]-(n>0?t[n-1]:0):e[n]}function d5(e,t){return e.simpleLineWalkFastPath?(function(n,r){const{widths:i,kinds:o,breakableWidths:l,breakablePrefixWidths:a}=n;if(i.length===0)return 0;const s=yo(),c=s.lineFitEpsilon;let f=0,u=0,d=!1;function h(p){var m;const v=i[p];if(v>r&&l[p]!==null){const y=l[p],g=(m=a[p])!=null?m:null;u=0;for(let b=0;b<y.length;b++){const k=os(y,g,b,s.preferPrefixWidthsForBreakableRuns);u>0&&u+k>r+c?(f++,u=k):(u===0&&f++,u+=k)}}else u=v,f++;d=!0}for(let p=0;p<i.length;p++){const m=i[p],v=o[p];if(!d){h(p);continue}const y=u+m;if(y>r+c){if(c5(v))continue;u=0,d=!1,h(p)}else u=y}return d?f:f+1})(e,t):(function(n,r){if(n.simpleLineWalkFastPath)return(function(N,V){const{widths:K,kinds:$,breakableWidths:H,breakablePrefixWidths:re}=N;if(K.length===0)return 0;const Z=yo(),ne=Z.lineFitEpsilon;let de=0,be=0,Te=!1,pe=0,ke=0,Me=-1,et=0;function Je(Ve=pe,oe=ke,X=be){de++,be=0,Te=!1,Me=-1,et=0}function bt(Ve,oe){Te=!0,pe=Ve+1,ke=0,be=oe}function vt(Ve,oe,X){Te=!0,pe=Ve,ke=oe+1,be=X}function lt(Ve,oe){Te?(be+=oe,pe=Ve+1,ke=0):bt(Ve,oe)}function nt(Ve,oe){el($[Ve])&&(Me=Ve+1,et=be-oe)}function Pt(Ve){(function(oe,X){var me;const ze=H[oe],Ne=(me=re[oe])!=null?me:null;for(let He=X;He<ze.length;He++){const J=os(ze,Ne,He,Z.preferPrefixWidthsForBreakableRuns);Te?be+J>V+ne?(Je(),vt(oe,He,J)):(be+=J,pe=oe,ke=He+1):vt(oe,He,J)}Te&&pe===oe&&ke===ze.length&&(pe=oe+1,ke=0)})(Ve,0)}let We=0;for(;We<K.length;){const Ve=K[We],oe=$[We];if(Te)if(be+Ve>V+ne){if(el(oe)){lt(We,Ve),Je(We+1,0,be-Ve),We++;continue}if(Me>=0){Je(Me,0,et);continue}if(Ve>V&&H[We]!==null){Je(),Pt(We),We++;continue}Je()}else lt(We,Ve),nt(We,Ve),We++;else Ve>V&&H[We]!==null?Pt(We):bt(We,Ve),nt(We,Ve),We++}return Te&&Je(),de})(n,r);const{widths:i,lineEndFitAdvances:o,lineEndPaintAdvances:l,kinds:a,breakableWidths:s,breakablePrefixWidths:c,discretionaryHyphenWidth:f,tabStopAdvance:u,chunks:d}=n;if(i.length===0||d.length===0)return 0;const h=yo(),p=h.lineFitEpsilon;let m=0,v=0,y=!1,g=0,b=0,k=-1,_=0,T=0,x=null;function S(){k=-1,_=0,T=0,x=null}function R(N=g,V=b,K=v){m++,v=0,y=!1,S()}function W(N,V){y=!0,g=N+1,b=0,v=V}function w(N,V,K){y=!0,g=N,b=V+1,v=K}function C(N,V){y?(v+=V,g=N+1,b=0):W(N,V)}function A(N,V){if(!el(a[N]))return;const K=a[N]==="tab"?0:o[N],$=a[N]==="tab"?V:l[N];k=N+1,_=v-V+K,T=v-V+$,x=a[N]}function M(N){L(N,0)}function L(N,V){var K;const $=s[N],H=(K=c[N])!=null?K:null;for(let re=V;re<$.length;re++){const Z=os($,H,re,h.preferPrefixWidthsForBreakableRuns);y?v+Z>r+p?(R(),w(N,re,Z)):(v+=Z,g=N,b=re+1):w(N,re,Z)}y&&g===N&&b===$.length&&(g=N+1,b=0)}function P(N){var V;if(x!=="soft-hyphen")return!1;const K=s[N];if(K===null)return!1;const $=h.preferPrefixWidthsForBreakableRuns&&(V=c[N])!=null?V:K,H=$!==K,{fitCount:re,fittedWidth:Z}=(function(ne,de,be,Te,pe,ke){let Me=0,et=de;for(;Me<ne.length;){const Je=ke?de+ne[Me]:et+ne[Me];if((Me+1<ne.length?Je+pe:Je)>be+Te)break;et=Je,Me++}return{fitCount:Me,fittedWidth:et}})($,v,r,p,f,H);return re!==0&&(v=Z,g=N,b=re,S(),re===K.length?(g=N+1,b=0,!0):(R(N,re,Z+f),L(N,re),!0))}function I(N){m++,S()}for(let N=0;N<d.length;N++){const V=d[N];if(V.startSegmentIndex===V.endSegmentIndex){I();continue}y=!1,v=0,V.startSegmentIndex,g=V.startSegmentIndex,b=0,S();let K=V.startSegmentIndex;for(;K<V.endSegmentIndex;){const $=a[K],H=$==="tab"?u5(v,u):i[K];if($!=="soft-hyphen")if(y){if(v+H>r+p){const re=v+($==="tab"?0:o[K]),Z=v+($==="tab"?H:l[K]);if(x==="soft-hyphen"&&h.preferEarlySoftHyphenBreak&&_<=r+p){R(k,0,T);continue}if(x==="soft-hyphen"&&P(K)){K++;continue}if(el($)&&re<=r+p){C(K,H),R(K+1,0,Z),K++;continue}if(k>=0&&_<=r+p){R(k,0,T);continue}if(H>r&&s[K]!==null){R(),M(K),K++;continue}R();continue}C(K,H),A(K,H),K++}else H>r&&s[K]!==null?M(K):W(K,H),A(K,H),K++;else y&&(g=K+1,b=0,k=K+1,_=v+f,T=v+f,x=$),K++}if(y){const $=k===V.consumedEndSegmentIndex?T:v;R(V.consumedEndSegmentIndex,0,$)}}return m})(e,t)}let ls=null;function f5(e,t,n){const r=(ls===null&&(ls=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ls),i=yo(),{cache:o,emojiCorrection:l}=(function(S,R){Gs().font=S;const W=(function(A){let M=af.get(A);return M||(M=new Map,af.set(A,M)),M})(S),w=(function(A){const M=A.match(/(\d+(?:\.\d+)?)\s*px/);return M?parseFloat(M[1]):16})(S),C=R?(function(A,M){let L=sf.get(A);if(L!==void 0)return L;const P=Gs();P.font=A;const I=P.measureText("😀").width;if(L=0,I>M+.5&&typeof document<"u"&&document.body!==null){const N=document.createElement("span");N.style.font=A,N.style.display="inline-block",N.style.visibility="hidden",N.style.position="absolute",N.textContent="😀",document.body.appendChild(N);const V=N.getBoundingClientRect().width;document.body.removeChild(N),I-V>.5&&(L=I-V)}return sf.set(A,L),L})(S,w):0;return{cache:W,fontSize:w,emojiCorrection:C}})(t,(a=e.normalized,o5.test(a)));var a;const s=ai("-",li("-",o),l),c=8*ai(" ",li(" ",o),l);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableWidths:[],breakablePrefixWidths:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],u=[],d=[],h=[];let p=e.chunks.length<=1;const m=null,v=[],y=[],g=null,b=Array.from({length:e.len}),k=Array.from({length:e.len});function _(S,R,W,w,C,A,M,L){C!=="text"&&C!=="space"&&C!=="zero-width-break"&&(p=!1),f.push(R),u.push(W),d.push(w),h.push(C),v.push(M),y.push(L)}for(let S=0;S<e.len;S++){b[S]=f.length;const R=e.texts[S],W=e.isWordLike[S],w=e.kinds[S],C=e.starts[S];if(w==="soft-hyphen"){_(R,0,s,s,w,C,null,null),k[S]=f.length;continue}if(w==="hard-break"){_(R,0,0,0,w,C,null,null),k[S]=f.length;continue}if(w==="tab"){_(R,0,0,0,w,C,null,null),k[S]=f.length;continue}const A=li(R,o);if(w==="text"&&A.containsCJK){let I="",N=0;for(const V of r.segment(R)){const K=V.segment;if(I.length===0){I=K,N=V.index;continue}if(ya.has(I)||Gp.has(K)||Io.has(K)||i.carryCJKAfterClosingQuote&&oi(K)&&Xp(I)){I+=K;continue}const $=ai(I,li(I,o),l);_(I,$,$,$,"text",C+N,null,null),I=K,N=V.index}if(I.length>0){const V=ai(I,li(I,o),l);_(I,V,V,V,"text",C+N,null,null)}k[S]=f.length;continue}const M=ai(R,A,l),L=w==="space"||w==="preserved-space"||w==="zero-width-break"?0:M,P=w==="space"||w==="zero-width-break"?0:M;W&&R.length>1?_(R,M,L,P,w,C,a5(R,A,o,l),i.preferPrefixWidthsForBreakableRuns?s5(R,A,o,l):null):_(R,M,L,P,w,C,null,null),k[S]=f.length}const T=(function(S,R,W){var w,C,A;const M=[];for(let L=0;L<S.length;L++){const P=S[L],I=P.startSegmentIndex<R.length?R[P.startSegmentIndex]:(w=W[W.length-1])!=null?w:0,N=P.endSegmentIndex<R.length?R[P.endSegmentIndex]:(C=W[W.length-1])!=null?C:0,V=P.consumedEndSegmentIndex<R.length?R[P.consumedEndSegmentIndex]:(A=W[W.length-1])!=null?A:0;M.push({startSegmentIndex:I,endSegmentIndex:N,consumedEndSegmentIndex:V})}return M})(e.chunks,b,k),x=m===null?null:(function(S,R){const W=(function(C){const A=C.length;if(A===0)return null;const M=new Array(A);let L=0;for(let $=0;$<A;$++){const H=IA(C.charCodeAt($));H!=="R"&&H!=="AL"&&H!=="AN"||L++,M[$]=H}if(L===0)return null;const P=A/L<.3?0:1,I=new Int8Array(A);for(let $=0;$<A;$++)I[$]=P;const N=1&P?"R":"L",V=N;let K=V;for(let $=0;$<A;$++)M[$]==="NSM"?M[$]=K:K=M[$];K=V;for(let $=0;$<A;$++){const H=M[$];H==="EN"?M[$]=K==="AL"?"AN":"EN":H!=="R"&&H!=="L"&&H!=="AL"||(K=H)}for(let $=0;$<A;$++)M[$]==="AL"&&(M[$]="R");for(let $=1;$<A-1;$++)M[$]==="ES"&&M[$-1]==="EN"&&M[$+1]==="EN"&&(M[$]="EN"),M[$]!=="CS"||M[$-1]!=="EN"&&M[$-1]!=="AN"||M[$+1]!==M[$-1]||(M[$]=M[$-1]);for(let $=0;$<A;$++){if(M[$]!=="EN")continue;let H;for(H=$-1;H>=0&&M[H]==="ET";H--)M[H]="EN";for(H=$+1;H<A&&M[H]==="ET";H++)M[H]="EN"}for(let $=0;$<A;$++){const H=M[$];H!=="WS"&&H!=="ES"&&H!=="ET"&&H!=="CS"||(M[$]="ON")}K=V;for(let $=0;$<A;$++){const H=M[$];H==="EN"?M[$]=K==="L"?"L":"EN":H!=="R"&&H!=="L"||(K=H)}for(let $=0;$<A;$++){if(M[$]!=="ON")continue;let H=$+1;for(;H<A&&M[H]==="ON";)H++;const re=($>0?M[$-1]:V)!=="L"?"R":"L";if(re===((H<A?M[H]:V)!=="L"?"R":"L"))for(let Z=$;Z<H;Z++)M[Z]=re;$=H-1}for(let $=0;$<A;$++)M[$]==="ON"&&(M[$]=N);for(let $=0;$<A;$++){const H=M[$];1&I[$]?H!=="L"&&H!=="AN"&&H!=="EN"||I[$]++:H==="R"?I[$]++:H!=="AN"&&H!=="EN"||(I[$]+=2)}return I})(S);if(W===null)return null;const w=new Int8Array(R.length);for(let C=0;C<R.length;C++)w[C]=W[R[C]];return w})(e.normalized,m);return g!==null?{widths:f,lineEndFitAdvances:u,lineEndPaintAdvances:d,kinds:h,simpleLineWalkFastPath:p,segLevels:x,breakableWidths:v,breakablePrefixWidths:y,discretionaryHyphenWidth:s,tabStopAdvance:c,chunks:T,segments:g}:{widths:f,lineEndFitAdvances:u,lineEndPaintAdvances:d,kinds:h,simpleLineWalkFastPath:p,segLevels:x,breakableWidths:v,breakablePrefixWidths:y,discretionaryHyphenWidth:s,tabStopAdvance:c,chunks:T}}const as="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",jt=(()=>{const e=globalThis;if(e[as])return e[as];const t={configs:{},controllers:{},revision:Jl(0),preparedCache:new Map,blockEstimateCache:new Map};return e[as]=t,t})();let no=null;const h5=jt.revision;function cf(e){var t;return e&&(t=jt.configs[e])!=null?t:null}function uf(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function p5(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function ss(e){var t,n,r;if(!Array.isArray(e)||e.length===0)return null;let i="";for(const o of e){if(!p5(o))return null;o.type==="text"?i+=String((t=o.content)!=null?t:""):o.type==="emoji"?i+=String((r=(n=o.name)!=null?n:o.raw)!=null?r:""):o.type==="hardbreak"&&(i+=`
`)}return i.length>0?i:null}function cs(e,t,n){var r,i;if(!e||!Number.isFinite(t)||t<=0||!(function(){var o;if(no!=null)return no;if(typeof document>"u")return!1;try{const l=document.createElement("canvas");return no=!!((o=l.getContext)!=null&&o.call(l,"2d")),no}catch{return no=!1,!1}})())return null;try{const o=Math.round(100*t)/100,l=[(r=n.whiteSpace)!=null?r:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,o,e].join("\0"),a=jt.blockEstimateCache.get(l);if(a)return jt.blockEstimateCache.delete(l),jt.blockEstimateCache.set(l,a),{kind:"simple-text",height:a.height,contentHeight:a.contentHeight};const s=(i=n.whiteSpace)!=null?i:"pre-wrap",c=(function(h,p,m){const v=`${m}\0${p}\0${h}`,y=jt.preparedCache.get(v);if(y)return jt.preparedCache.delete(v),jt.preparedCache.set(v,y),y.prepared;const g=(function(b,k,_){return(function(T,x,S,R){return f5(r5(T,yo(),R?.whiteSpace),x,!1)})(b,k,0,_)})(h,p,{whiteSpace:m});for(jt.preparedCache.set(v,{prepared:g});jt.preparedCache.size>240;){const b=jt.preparedCache.keys().next().value;if(!b)break;jt.preparedCache.delete(b)}return g})(e,n.font,s),f=(function(h,p,m){const v=d5(h,p);return{lineCount:v,height:v*m}})(c,Math.max(24,o-n.widthAdjustment),n.lineHeight),u=Math.max(n.lineHeight,f.height),d=Math.max(n.lineHeight,Math.round(u+n.wrapperOverhead));for(jt.blockEstimateCache.set(l,{height:d,contentHeight:Math.round(u)});jt.blockEstimateCache.size>4e3;){const h=jt.blockEstimateCache.keys().next().value;if(!h)break;jt.blockEstimateCache.delete(h)}return{kind:"simple-text",height:d,contentHeight:Math.round(u)}}catch{return null}}function Qp(e,t,n){var r,i;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const o=ss(e.children);return o&&n.paragraph?cs(o,t,n.paragraph):null}if(e.type==="heading"){const o=Number(e.level||0),l=ss(e.children),a=n.headings[o];return l&&a?cs(l,t,a):null}if(e.type==="list_item"){const o=Array.isArray(e.children)?e.children:[];if(o.length!==1||((r=o[0])==null?void 0:r.type)!=="paragraph"||!n.listItem)return null;const l=ss((i=o[0])==null?void 0:i.children);return l?cs(l,t,n.listItem):null}if(e.type==="list"){const o=Array.isArray(e.items)?e.items:[];if(!o.length)return null;let l=Math.max(0,n.listWrapperOverhead);for(const a of o){const s=Qp(a,t,n);if(!s)return null;l+=s.height}return{kind:"simple-text",height:Math.max(1,Math.round(l)),contentHeight:Math.max(1,Math.round(l))}}return null}function tl(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function m5(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function us(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const r=window.getComputedStyle(t),i=e.offsetHeight,o=uf(r.lineHeight,1.5*uf(r.fontSize,16)),l=e.getBoundingClientRect().width,a=t.getBoundingClientRect().width;return{font:m5(r),lineHeight:o,wrapperOverhead:Math.max(0,i-o),widthAdjustment:Math.max(0,l-a),whiteSpace:n}}let df=!1,nl=null,ff=!1,rl=null;function lD(){return tt(this,null,function*(){return nl||rl||(ff?null:(rl=tt(null,null,function*(){try{return nl=yield Cn(()=>import("./__vite-optional-peer-dep_stream-monaco_markstream-vue_false-DoSvhc5U.js"),[]),yield(function(e){return tt(this,null,function*(){if(df)return;df=!0;const t=globalThis?.MonacoEnvironment;return!t||typeof t.getWorker!="function"&&typeof t.getWorkerUrl!="function"?e.preloadMonacoWorkers():void 0})})(nl),nl}catch{return ff=!0,null}finally{rl=null}}),rl))})}const hf=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <path fill="none" stroke="#8caaee" d="m 6.665625,1.0107144 c 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 7.18125,3.9983098 h 2.971875 L 10.5125,1.8326156 c 0.09063,-0.5437673 0.60625,-0.9125291 1.15,-0.8219012 0.54375,0.090628 0.9125,0.6062693 0.821875,1.1500367 L 12.18125,3.9983098 H 14 c 0.553125,0 1,0.4468892 1,1.0000319 0,0.5531426 -0.446875,1.0000319 -1,1.0000319 H 11.846875 L 11.18125,9.9985013 H 13 c 0.553125,0 1,0.4468897 1,1.0000317 0,0.553143 -0.446875,1.000032 -1,1.000032 H 10.846875 L 10.4875,14.164259 c -0.09063,0.543768 -0.60625,0.912529 -1.15,0.821902 -0.54375,-0.09063 -0.9125,-0.60627 -0.821875,-1.150037 l 0.30625,-1.834434 h -2.975 L 5.4875,14.167384 c -0.090625,0.543768 -0.60625,0.91253 -1.15,0.821902 C 3.79375,14.898658 3.425,14.383016 3.515625,13.839249 L 3.81875,11.998565 H 2 c -0.553125,0 -1,-0.446889 -1,-1.000032 C 1,10.445391 1.446875,9.9985013 2,9.9985013 H 4.153125 L 4.81875,5.9983736 H 3 c -0.553125,0 -1,-0.4468893 -1,-1.0000319 C 2,4.445199 2.446875,3.9983098 3,3.9983098 H 5.153125 L 5.5125,1.8326156 C 5.603125,1.2888483 6.11875,0.9200865 6.6625,1.0107144 Z M 6.846875,5.9983736 6.18125,9.9985013 H 9.153125 L 9.81875,5.9983736 Z" />
</svg>
`,pf=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">
    <path d="M2 15.5c-.7 0-1.5-.8-1.5-1.5V5c0-.7.8-1.5 1.5-1.5h9c.7 0 1.5.8 1.5 1.5v9c0 .7-.8 1.5-1.5 1.5z" />
    <path d="m1.2 3.8 3.04-2.5S5.17.5 5.7.5h8.4c.66 0 1.4.73 1.4 1.4v7.73a2.7 2.7 0 01-.7 1.75l-2.68 3.51M3 8.5l3 2-3 2m4 0h2" />
  </g>
</svg>
`,ds=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <g fill="none" stroke="#c6d0f5" stroke-linecap="round" stroke-linejoin="round">
    <path d="M13.5 6.5v6a2 2 0 01-2 2h-7a2 2 0 01-2-2v-9c0-1.1.9-2 2-2h4.01" />
    <path d="m8.5 1.5 5 5h-4a1 1 0 01-1-1zm-3 10h5m-5-3h5m-5-3h1" />
  </g>
</svg>
`;let ko=null,fs=null;const Jp=Jl(0),g5={"":ds,plain:ds,text:ds,javascript:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <g fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round">
    <path d="M4.5 11c0 .828427.6715729 1.5 1.5 1.5.8284271 0 1.5-.671573 1.5-1.5V7.5M12.5 8.75C12.5 8.05964406 11.9627417 7.5 11.3 7.5L10.7 7.5C10.0372583 7.5 9.5 8.05964406 9.5 8.75 9.5 9.44035594 10.0372583 10 10.7 10L11.3 10C11.9627417 10 12.5 10.5596441 12.5 11.25 12.5 11.9403559 11.9627417 12.5 11.3 12.5L10.7 12.5C10.0372583 12.5 9.5 11.9403559 9.5 11.25" />
    <path d="m 4,1.5 h 8 c 1.385,0 2.5,1.115 2.5,2.5 v 8 c 0,1.385 -1.115,2.5 -2.5,2.5 H 4 C 2.615,14.5 1.5,13.385 1.5,12 V 4 C 1.5,2.615 2.615,1.5 4,1.5 Z" />
  </g>
</svg>
`,typescript:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">
    <path d="M4 1.5h8A2.5 2.5 0 0114.5 4v8a2.5 2.5 0 01-2.5 2.5H4A2.5 2.5 0 011.5 12V4A2.5 2.5 0 014 1.5" />
    <path d="M12.5 8.75c0-.69-.54-1.25-1.2-1.25h-.6c-.66 0-1.2.56-1.2 1.25S10.04 10 10.7 10h.6c.66 0 1.2.56 1.2 1.25s-.54 1.25-1.2 1.25h-.6c-.66 0-1.2-.56-1.2-1.25m-3-3.75v5M5 7.5h3" />
  </g>
</svg>
`,jsx:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <g fill="none" stroke="#99d1db" stroke-linecap="round" stroke-linejoin="round">
    <path d="M8 10.8c4.14 0 7.5-1.25 7.5-2.8S12.14 5.2 8 5.2.5 6.45.5 8s3.36 2.8 7.5 2.8" />
    <path d="M5.52 9.4c2.07 3.5 4.86 5.72 6.23 4.95 1.37-.78.8-4.24-1.27-7.75C8.41 3.1 5.62.88 4.25 1.65c-1.37.78-.8 4.24 1.27 7.75" />
    <path d="M5.52 6.6c-2.07 3.5-2.64 6.97-1.27 7.75 1.37.77 4.16-1.45 6.23-4.95s2.64-6.97 1.27-7.75C10.38.88 7.59 3.1 5.52 6.6" />
    <path d="M8.5 8a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />
  </g>
</svg>
`,tsx:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <g fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round">
    <path d="M8 11.3c4.14 0 7.5-1.28 7.5-2.86S12.14 5.58 8 5.58.5 6.86.5 8.44s3.36 2.87 7.5 2.87Z" />
    <path d="M5.52 9.87c2.07 3.6 4.86 5.86 6.23 5.07 1.37-.8.8-4.34-1.27-7.93S5.62 1.16 4.25 1.95s-.8 4.34 1.27 7.92" />
    <path d="M5.52 7.01c-2.07 3.59-2.64 7.14-1.27 7.93s4.16-1.48 6.23-5.07c2.07-3.58 2.64-7.13 1.27-7.92-1.37-.8-4.16 1.47-6.23 5.06" />
    <path d="M8.5 8.44a.5.5 0 01-.5.5.5.5 0 01-.5-.5.5.5 0 01.5-.5.5.5 0 01.5.5" />
  </g>
</svg>
`,html:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <g fill="none" stroke-linecap="round" stroke-linejoin="round">
    <path stroke="#ef9f76" d="M1.5 1.5h13L13 13l-5 2-5-2z" />
    <path stroke="#c6d0f5" d="M11 4.5H5l.25 3h5.5l-.25 3-2.5 1-2.5-1-.08-1" />
  </g>
</svg>
`,css:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <g fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round">
    <path d="m4 1.5h8c1.38 0 2.5 1.12 2.5 2.5v8c0 1.38-1.12 2.5-2.5 2.5h-8c-1.38 0-2.5-1.12-2.5-2.5v-8c0-1.38 1.12-2.5 2.5-2.5z" />
    <path stroke-width=".814" d="m 10.240861,11.529149 c 0,0.58011 0.437448,1.039154 0.96002,1.035371 l 0.451635,-0.0032 c 0.522572,-0.0036 0.949379,-0.451477 0.949379,-1.032848 0,-0.581372 -0.426807,-1.065638 -0.949379,-1.065638 l -0.451635,3.4e-5 c -0.522572,3.9e-5 -0.949379,-0.4855273 -0.949379,-1.0656374 0,-0.5801104 0.426807,-1.0378931 0.949379,-1.0378931 l 0.451635,2.825e-4 c 0.522572,3.267e-4 0.951743,0.4577827 0.951743,1.0378931 M 6.8003972,11.529149 c 0,0.58011 0.4374474,1.039154 0.9600196,1.035371 l 0.46464,-0.0032 c 0.5225722,-0.0035 0.9363738,-0.451477 0.9363738,-1.031587 0,-0.580111 -0.4090724,-1.065638 -0.9316446,-1.065638 l -0.4693692,3.4e-5 c -0.5225722,3.8e-5 -0.949379,-0.4855272 -0.949379,-1.0656373 0,-0.5801104 0.4268068,-1.0378931 0.949379,-1.0378931 h 0.4516348 c 0.5225722,0 0.9635665,0.4577827 0.9635665,1.0378931 M 3.4072246,11.529149 c 0,0.58011 0.4374474,1.051765 0.9600196,1.051765 H 4.818879 c 0.5225722,0 0.949379,-0.456521 0.949379,-1.037893 m 0.01129,-2.1312747 c 0,-0.5801103 -0.4374474,-1.037893 -0.9600196,-1.037893 L 4.3678939,8.3741358 C 3.8453217,8.3744624 3.4078743,8.8420074 3.4078743,9.4233788 v 2.1186642" />
  </g>
</svg>
`,scss:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <path fill="none" stroke="#f4b8e4" stroke-linecap="round" stroke-linejoin="round" d="M6.75 6.38c1.85 1.07 3.35.74 4.83-.2 1.5-.95 2.7-2.78 1.3-4.15-.7-.68-3.25-.8-5.62.19-2.36.99-4.59 3.02-4.74 4.11-.31 2.19 3.15 2.88 3.64 4.23s.28 1.98-.2 2.83c-.5.85-1.96 1.62-2.8.68-.83-.95 1.67-2.75 2.98-3.25 1.3-.5 3.1-.4 3.69.25.58.64-.07 1.79-.03 1.79" />
</svg>
`,json:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M4.5 2.5H4c-.75 0-1.5.75-1.5 1.5v2c0 1.1-1 2-1.83 2 .83 0 1.83.9 1.83 2v2c0 .75.75 1.5 1.5 1.5h.5m7-11h.5c.75 0 1.5.75 1.5 1.5v2c0 1.1 1 2 1.83 2-.83 0-1.83.9-1.83 2v2c0 .74-.75 1.5-1.5 1.5h-.5m-6.5-3a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1m3 0a.5.5 0 100-1 .5.5 0 000 1" />
</svg>
`,python:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <g fill="none" stroke-linecap="round" stroke-linejoin="round">
    <path stroke="#8caaee" d="M8.5 5.5h-3m6 0V3c0-.8-.7-1.5-1.5-1.5H7c-.8 0-1.5.7-1.5 1.5v2.5H3c-.8 0-1.5.7-1.5 1.5v2c0 .8.7 1.5 1.48 1.5" />
    <path stroke="#e5c890" d="M10.5 10.5h-3m-3 0V13c0 .8.7 1.5 1.5 1.5h3c.8 0 1.5-.7 1.5-1.5v-2.5H13c.8 0 1.5-.7 1.5-1.5V7c0-.8-.7-1.5-1.48-1.5H11.5c0 1.5 0 2-1 2h-2" />
    <path stroke="#8caaee" d="M2.98 10.5H4.5c0-1.5 0-2 1-2h2M7.5 3.5v0" />
    <path stroke="#e5c890" d="m 8.5,12.5 v 0" />
  </g>
</svg>
`,ruby:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M1.5 9.06v2.5c.02.86.36 1.61.9 2.15 1.76 1.76 5.71.65 8.84-2.47 3.12-3.13 4.23-7.08 2.47-8.84a3.1 3.1 0 00-2.15-.9h-2.5M14.5 4l-.25 10.25L4 14.5m4.39-6.11c2.34-2.35 3.29-5.2 2.12-6.37S6.49 1.8 4.14 4.14C1.8 6.5.85 9.34 2.02 10.51s4.02.22 6.37-2.12M5.5 14.5l.25-3.75L11 11l-.25-5.25 3.75-.25" />
</svg>
`,go:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m15.48 8.06-4.85.48m4.85-.48a4.98 4.98 0 01-4.54 5.42 5 5 0 112.95-8.66l-1.7 1.84a2.5 2.5 0 00-4.18 2.06c.05.57.3 1.1.69 1.51.25.27 1 .83 1.78.82.8-.02 1.58-.25 2.07-.81 0 0 .8-.96.68-1.88M2.5 8.5l-2 .01m1.5 2h1.5m-2-3.99 2-.02" />
</svg>
`,java:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <g fill="none" stroke-linecap="round" stroke-linejoin="round">
    <path stroke="#c6d0f5" d="M10.73 8.41c.57 3 1.59 5.83 2.77 7.09-6.63-3.45-9.76-1.75-10.5 0-.66-3.4-.54-5.74.09-7.78" />
    <path stroke="#e78284" d="M8.5 7c.63.34 1.82 1.07 2.24 1.41-.54-2.9-.64-5.96-.74-7.91-2.13.58-5.73 1.98-6.9 7.22.52-.69 1.72-1.05 2.4-1.22" />
    <path stroke="#e78284" d="M5.5 7A1.5 1.5 0 007 8.5 1.5 1.5 0 008.5 7 1.5 1.5 0 007 5.5 1.5 1.5 0 005.5 7" />
  </g>
</svg>
`,kotlin:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <g fill="none" stroke-linecap="round" stroke-linejoin="round">
    <path stroke="#ca9ee6" d="M2.5 13.5h11L8 8" />
    <path stroke="#ef9f76" d="M8.03 2.5h5.47l-8 8" />
    <path stroke="#e78284" d="M2.5 13.5V8" />
    <path stroke="#85c1dc" d="M8 2.5H2.5V8l3-2.5" />
  </g>
</svg>
`,c:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 4.0559072,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441188,0 l -1.789955,-1.782586 c -1.75742,1.750224 -4.6067879,1.750224 -6.3642294,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642294,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.746003,-2.73472867 -7.1981359,-2.73472867 -9.944119,0 -2.7459858,2.7347089 -2.7459858,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />
</svg>
`,cpp:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="m 2.5559121,12.951629 c 2.7459832,2.734744 7.1981158,2.734744 9.9441189,0 l -1.789955,-1.782586 c -1.7574201,1.750224 -4.606788,1.750224 -6.3642295,0 -1.7574416,-1.7502236 -1.7574416,-4.587893 0,-6.338097 1.7574415,-1.750224 4.6068094,-1.750224 6.3642295,0 l 0.894977,-0.8912929 0.894978,-0.891293 c -2.7460031,-2.73472867 -7.198136,-2.73472867 -9.9441191,0 -2.74598585,2.7347089 -2.74598585,7.1685599 2e-7,9.9032689 z" clip-rule="evenodd" />
  <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M7.5 6v4M5.513524 7.9999996H9.51304M13.486476 5.9999996v4M11.5 7.9999992h3.999516" />
</svg>
`,cs:hf,csharp:hf,php:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <path fill="none" stroke="#8caaee" stroke-linecap="round" stroke-linejoin="round" d="M0.5,12.5 L0.5,13.24 C0.5,14 1.27360724,14.5 2,14.5 C2.9375516,14.5 3.5,14 3.5,13.2445661 L3.5,6.00089968 C3.5,4.28551107 4.99401107,2.52263547 7.14960413,2.5 C9.49387886,2.5 11,4.0579782 11,5.5 C11.1657296,8.48962302 9.57820404,9.63684469 7.49621582,10.5 L7.49621582,14.5 L15.4979764,14.5 L15.4979764,9 C15.5394484,8.36478228 14.9387379,7.15595371 14.1308258,6.5 C13.1942239,5.80827275 12.0584852,5.50253264 11,5.5 M11.5,14.5 L11.5,11.5 M6,6.5 C6.27614237,6.5 6.5,6.27614237 6.5,6 C6.5,5.72385763 6.27614237,5.5 6,5.5 C5.72385763,5.5 5.5,5.72385763 5.5,6 C5.5,6.27614237 5.72385763,6.5 6,6.5 Z" />
</svg>
`,shell:pf,powershell:pf,sql:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <path fill="none" stroke="#e5c890" stroke-linecap="round" stroke-linejoin="round" d="M8 6.5c3.59 0 6.5-1.4 6.5-2.68S11.59 1.5 8 1.5 1.5 2.54 1.5 3.82 4.41 6.5 8 6.5M14.5 8c0 .83-1.24 1.79-3.25 2.2s-4.49.41-6.5 0S1.5 8.83 1.5 8m13 4.18c0 .83-1.24 1.6-3.25 2-2.01.42-4.49.42-6.5 0-2.01-.4-3.25-1.17-3.25-2m0-8.3v8.3m13-8.3v8.3" />
</svg>
`,yaml:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <path fill="none" stroke="#e78284" stroke-linecap="round" stroke-linejoin="round" d="M2.5 1.5h3l3 4 3-4h3l-9 13h-3L7 8z" />
</svg>
`,markdown:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <path fill="none" stroke="#85c1dc" stroke-linecap="round" stroke-linejoin="round" d="m9.25 8.25 2.25 2.25 2.25-2.25M3.5 11V5.5l2.04 3 1.96-3V11m4-.5V5M1.65 2.5h12.7c.59 0 1.15.49 1.15 1v9c0 .51-.56 1-1.15 1H1.65c-.59 0-1.15-.49-1.15-1V3.58c0-.5.56-1.08 1.15-1.08" />
</svg>
`,xml:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <path fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round" d="M4.5 4.5 1 8 4.5 11.5M11.5 4.5 15 8 11.5 11.5M9.5 2 6.5 14" />
</svg>
`,rust:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <g fill="none" stroke="#ef9f76" stroke-linecap="round" stroke-linejoin="round">
    <path d="M15.5 9.5Q8 13.505.5 9.5l1-1-1-2 2-.5V4.5h2l.5-2 1.5 1 1.5-2 1.5 2 1.5-1 .5 2h2V6l2 .5-1 2z" />
    <path d="M6.5 7.5a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1m5 0a1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1 1 1 0 011 1M4 11.02c-.67.37-1.5.98-1.5 2.23s1.22 1.22 2 1.25v-2M12 11c.67.37 1.5 1 1.5 2.25s-1.22 1.22-2 1.25v-2" />
  </g>
</svg>
`,vue:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <g fill="none" stroke="#a6d189" stroke-linecap="round" stroke-linejoin="round">
    <path d="M1 1.5h5.44L8 4.56 9.56 1.5H15l-6.99 13z" />
    <path d="M12.05 1.73 8 9.28 3.95 1.73" />
  </g>
</svg>
`,mermaid:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
  <path fill="none" stroke="#ca9ee6" stroke-linecap="round" stroke-linejoin="round" d="M1.5 2.5c0 6 2.25 5.75 4 7 .83.67 1.17 2 1 4h3c-.17-2 .17-3.33 1-4 1.75-1.25 4-1 4-7C12 2.5 10 3 8 7 6 3 4 2.5 1.5 2.5" />
</svg>
`},v5={"":"",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","c++":"cpp","c#":"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function y5(){return tt(this,null,function*(){return ko||(fs||(fs=Cn(()=>import("./languageIconExtended-CPb6y7Hr.js"),[]).then(e=>(ko=e.EXTENDED_LANGUAGE_ICON_MAP,Jp.value++,ko)).catch(()=>null)),fs)})}function Kl(e){var t;const n=(function(r){if(!r)return"";const i=r.trim();if(!i)return"";const[o]=i.split(/\s+/),[l]=o.split(":");return l.toLowerCase()})(e);return(t=v5[n])!=null?t:n}function aD(e){const t=Kl(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function k5(e){const t=Kl(e),n=g5[t];return n||ko?.[t]||(y5(),'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m10 9l-3 3l3 3m4 0l3-3l-3-3"/><rect width="18" height="18" x="3" y="3" rx="2"/></g></svg>')}const b5={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#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"},em=new class{constructor(){Ka(this,"metrics",[]),Ka(this,"enabled",!1),Ka(this,"maxMetrics",1e3)}enable(){this.enabled=!0}disable(){this.enabled=!1}recordRender(e){this.enabled&&(this.metrics.push(e),this.metrics.length>this.maxMetrics&&this.metrics.shift())}getStats(){if(this.metrics.length===0)return{totalRenders:0,cacheHitRate:0,averageWorkerTime:0,averageDirectTime:0,averageCacheHitTime:0,workerSavings:0,recommendation:"Insufficient data"};const e=this.metrics.filter(u=>u.type==="worker"&&u.success),t=this.metrics.filter(u=>u.type==="direct"&&u.success),n=this.metrics.filter(u=>u.type==="cache-hit"),r=this.metrics.length,i=n.length,o=i/r*100,l=e.length>0?e.reduce((u,d)=>u+d.duration,0)/e.length:0,a=t.length>0?t.reduce((u,d)=>u+d.duration,0)/t.length:0,s=n.length>0?n.reduce((u,d)=>u+d.duration,0)/n.length:0,c=r*a-(e.reduce((u,d)=>u+d.duration,0)+t.reduce((u,d)=>u+d.duration,0)+n.reduce((u,d)=>u+d.duration,0));let f="";return f=o>70&&l<2*a?"✅ Worker + Cache is highly beneficial":o>50?"✅ Worker + Cache is beneficial":l>3*a?"⚠️ Worker overhead too high, consider direct rendering":a<5?"⚠️ Formulas too simple, Worker overhead may not be worth it":"✅ Worker prevents main thread blocking",{totalRenders:r,cacheHits:i,cacheHitRate:o.toFixed(1),workerCalls:e.length,directCalls:t.length,averageWorkerTime:l.toFixed(2),averageDirectTime:a.toFixed(2),averageCacheHitTime:s.toFixed(3),workerSavings:c.toFixed(2),recommendation:f}}printReport(){const e=this.getStats();return console.group("📊 KaTeX Rendering Performance Report"),e.totalRenders,e.cacheHits,e.cacheHitRate,e.workerCalls,e.directCalls,e.averageWorkerTime,e.averageDirectTime,e.averageCacheHitTime,e.workerSavings,e.recommendation,console.groupEnd(),e}reset(){this.metrics=[]}exportMetrics(){return{metrics:[...this.metrics],stats:this.getStats(),timestamp:Date.now()}}};function _5(){return em.printReport()}function sD(e){try{if(typeof globalThis<"u"&&typeof globalThis.requestAnimationFrame=="function")return globalThis.requestAnimationFrame(e)}catch{}return globalThis.setTimeout(e,0)}function cD(e){try{if(e==null)return;if(typeof globalThis<"u"&&typeof globalThis.cancelAnimationFrame=="function")return void globalThis.cancelAnimationFrame(e)}catch{}try{globalThis.clearTimeout(e)}catch{}}typeof window<"u"&&(window.__katexPerfReport=_5,window.__katexPerfMonitor=em);const w5={key:0,class:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",style:{color:"var(--vscode-editor-foreground)","background-color":"var(--vscode-editor-background)"}},x5={class:"flex items-center gap-x-2"},C5=["innerHTML"],S5={class:"text-sm font-medium font-mono"},A5={class:"flex items-center gap-x-2"},T5=["aria-pressed"],D5=["disabled"],E5=["disabled"],M5=["disabled"],L5=["aria-label"],R5={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},$5={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},I5=["aria-pressed"],F5={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},O5={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"0.75rem",height:"0.75rem",viewBox:"0 0 24 24"},N5=["aria-label"],P5=["innerHTML"],kl=it(Se({__name:"MarkdownCodeBlockNode",props:{node:{},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:"vitesse-dark"},lightTheme:{default:"vitesse-light"},isDark:{type:Boolean,default:!1},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean},estimatedHeightPx:{},estimatedContentHeightPx:{}},emits:["previewCode","copy"],setup(e,{emit:t}){const n=e,r=t,{t:i}=Vp(),o=G(Kl(n.node.language)),l=G(!1),a=G(!1),s=G(!1),c=G(null),f=G(null),u=G(null),d=G(""),h=G(!1);let p;const m=Kp(),v=G(null),y=G(typeof window>"u");typeof window<"u"&&Oe(()=>c.value,oe=>{var X;if((X=v.value)==null||X.destroy(),v.value=null,!oe)return void(y.value=!1);const me=m(oe,{rootMargin:"400px"});v.value=me,y.value=me.isVisible.value,me.whenVisible.then(()=>{y.value=!0})},{immediate:!0});const g=G(!0),b=G(0),k=G(14),_=G(k.value),T=O(()=>{const oe=k.value,X=_.value;return typeof oe=="number"&&Number.isFinite(oe)&&oe>0&&typeof X=="number"&&Number.isFinite(X)&&X>0}),x=O(()=>{const oe=o.value.trim().toLowerCase();return b5[oe]||oe.charAt(0).toUpperCase()+oe.slice(1)}),S=O(()=>(Jp.value,k5(o.value.trim().toLowerCase().split(":")[0]))),R=O(()=>{const oe=o.value.trim().toLowerCase();return n.isShowPreview&&(oe==="html"||oe==="svg")}),W=O(()=>{const oe={},X=Ne=>{if(Ne!=null)return typeof Ne=="number"?`${Ne}px`:String(Ne)},me=X(n.minWidth),ze=X(n.maxWidth);return me&&(oe.minWidth=me),ze&&(oe.maxWidth=ze),oe}),w=O(()=>{const oe=n.estimatedContentHeightPx;return typeof oe=="number"&&Number.isFinite(oe)&&oe>0?Math.round(oe):null}),C=O(()=>w.value!=null&&!h.value),A=O(()=>Ye({fontSize:`${_.value}px`},C.value?{minHeight:`${w.value}px`}:{})),M=O(()=>{if(w.value!=null)return{minHeight:`${w.value}px`}}),L=O(()=>n.showTooltips!==!1);function P(){return n.isDark?n.darkTheme:n.lightTheme}function I(oe){if(p?.disconnect(),p=void 0,!oe)return d.value="",void(h.value=!1);var X;d.value=`<pre class="shiki shiki-fallback"><code>${X=oe,X.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</code></pre>`,h.value=!1}function N(){d.value="",h.value=!0}function V(){var oe;const X=u.value;return!!X&&(X.childNodes.length>0||!!((oe=X.textContent)!=null&&oe.trim().length))}function K(){return tt(this,null,function*(){if(yield pn(),V())return void N();const oe=u.value;oe&&(p?.disconnect(),p=new MutationObserver(()=>{V()&&(N(),p?.disconnect(),p=void 0)}),p.observe(oe,{childList:!0,subtree:!0}))})}let $,H,re,Z,ne=null;const de=new Set,be=new Set,Te=import.meta!==void 0&&!1;let pe=null;function ke(oe,X){return tt(this,null,function*(){if(!$)return;const me=(function(ze,Ne=!1){var He;const[J]=String(ze??"").split(":"),Ee=(He=J?.trim().toLowerCase())!=null?He:"";return Ee?!Z||Z.has(Ee)?Ee:(Ne&&Te&&!de.has(Ee)&&(de.add(Ee),console.warn(`[MarkdownCodeBlockNode] Language "${Ee}" not preloaded in stream-markdown; falling back to plaintext.`)),"plaintext"):"plaintext"})(X,!!(oe&&oe.length));try{yield $.updateCode(oe,me)}catch(ze){me!=="plaintext"?(Te&&!be.has(me)&&(be.add(me),console.warn(`[MarkdownCodeBlockNode] Failed to render language "${me}", retrying as plaintext.`,ze)),yield $.updateCode(oe,"plaintext")):Te&&console.warn("[MarkdownCodeBlockNode] Failed to render code block even as plaintext.",ze)}})}function Me(oe){if(!re)return;const X=Array.isArray(oe)?oe.join("\0"):"";ne!==X&&(re({themes:oe}),ne=X)}function et(){return tt(this,null,function*(){y.value?(yield(function(){return tt(this,null,function*(){if(!H)return pe||(pe=tt(null,null,function*(){try{const oe=yield Cn(()=>import("./__vite-optional-peer-dep_stream-markdown_markstream-vue_false-BojRNRsE.js"),[]);H=oe.createShikiStreamRenderer,re=oe.registerHighlight;const X=Array.isArray(oe.defaultLanguages)?oe.defaultLanguages:void 0;Z=X?new Set(X.map(me=>me.toLowerCase())):void 0,Me(n.themes)}catch(oe){console.warn("[MarkdownCodeBlockNode] stream-markdown not available:",oe)}finally{pe=null}}),pe)})})(),f.value&&u.value?(Me(n.themes),!$&&H&&($=H(u.value,{theme:P()}),h.value=!0),$?n.stream===!1&&n.loading?I(n.node.code):(I(n.node.code),yield ke(n.node.code,o.value),yield K()):I(n.node.code)):I(n.node.code)):I(n.node.code)})}function Je(){const oe=f.value;if(!oe||a.value)return;const X=oe.scrollTop;X<b.value?g.value=!1:(function(me,ze=50){return me.scrollHeight-me.scrollTop-me.clientHeight<=ze})(oe)&&(g.value=!0),b.value=X}function bt(){return tt(this,null,function*(){try{typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(n.node.code)),l.value=!0,r("copy",n.node.code),setTimeout(()=>{l.value=!1},1e3)}catch(oe){console.error("Copy failed:",oe)}})}function vt(oe){const X=oe.currentTarget||oe.target;return!X||X.disabled?null:X}function lt(oe,X,me="top"){if(!L.value)return;const ze=vt(oe);if(!ze)return;const Ne=oe;ml(ze,X,me,!1,Ne?.clientX!=null&&Ne?.clientY!=null?{x:Ne.clientX,y:Ne.clientY}:void 0,n.isDark)}function nt(){L.value&&Us()}function Pt(oe){if(!L.value)return;const X=vt(oe);if(!X)return;const me=oe;ml(X,l.value?i("common.copied")||"Copied":i("common.copy")||"Copy","top",!1,me?.clientX!=null&&me?.clientY!=null?{x:me.clientX,y:me.clientY}:void 0,n.isDark)}function We(){s.value=!s.value}function Ve(){if(!R.value)return;const oe=(o.value||n.node.language).toLowerCase(),X=oe==="html"?"HTML Preview":"SVG Preview";r("previewCode",{type:oe==="html"?"text/html":"image/svg+xml",content:n.node.code,title:X})}return Gl(()=>{y.value?et():I(n.node.code)}),To(()=>{var oe;(oe=v.value)==null||oe.destroy(),v.value=null,p?.disconnect(),p=void 0}),Oe(()=>n.themes,()=>tt(null,null,function*(){Me(n.themes)})),Oe(()=>n.loading,oe=>{oe||(y.value?et():I(n.node.code))}),Oe(()=>y.value,oe=>{oe&&et()}),Oe(L,oe=>{oe||Us()}),Oe(()=>[n.node.code,n.node.language],oe=>tt(null,[oe],function*([X,me]){const ze=Kl(me);ze!==o.value&&(o.value=ze),y.value&&f.value&&u.value?($||(I(X),yield et()),$&&X&&(n.stream===!1&&n.loading||(I(X),yield ke(X,me),yield K()))):I(X)})),Oe(()=>[n.darkTheme,n.lightTheme],()=>tt(null,null,function*(){y.value&&f.value&&u.value&&($||(yield et()),$?.setTheme(P()))})),Oe(()=>n.node.code,()=>tt(null,null,function*(){if(a.value||!g.value)return;yield pn();const oe=f.value;oe&&oe.scrollHeight>oe.clientHeight&&(oe.scrollTop=oe.scrollHeight)})),(oe,X)=>(z(),Q("div",{ref_key:"container",ref:c,style:br(W.value),class:Ft(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",[n.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",n.isDark?"is-dark":""]])},[n.showHeader?(z(),Q("div",w5,[ci(oe.$slots,"header-left",{},()=>[te("div",x5,[te("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:S.value},null,8,C5),te("span",S5,$e(x.value),1)])],!0),ci(oe.$slots,"header-right",{},()=>[te("div",A5,[n.showCollapseButton?(z(),Q("button",{key:0,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":s.value,onClick:We,onMouseenter:X[0]||(X[0]=me=>lt(me,s.value?se(i)("common.expand")||"Expand":se(i)("common.collapse")||"Collapse")),onFocus:X[1]||(X[1]=me=>lt(me,s.value?se(i)("common.expand")||"Expand":se(i)("common.collapse")||"Collapse")),onMouseleave:nt,onBlur:nt},[(z(),Q("svg",{style:br({rotate:s.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[...X[18]||(X[18]=[te("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,T5)):Ue("",!0),n.showFontSizeButtons&&n.enableFontSizeControl?(z(),Q(Qe,{key:1},[te("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(_.value)&&_.value<=10,onClick:X[2]||(X[2]=me=>(function(){const ze=Math.max(10,_.value-1);_.value=ze})()),onMouseenter:X[3]||(X[3]=me=>lt(me,se(i)("common.decrease")||"Decrease")),onFocus:X[4]||(X[4]=me=>lt(me,se(i)("common.decrease")||"Decrease")),onMouseleave:nt,onBlur:nt},[...X[19]||(X[19]=[te("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[te("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,D5),te("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!T.value||_.value===k.value,onClick:X[5]||(X[5]=me=>{_.value=k.value}),onMouseenter:X[6]||(X[6]=me=>lt(me,se(i)("common.reset")||"Reset")),onFocus:X[7]||(X[7]=me=>lt(me,se(i)("common.reset")||"Reset")),onMouseleave:nt,onBlur:nt},[...X[20]||(X[20]=[te("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[te("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[te("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),te("path",{d:"M3 3v5h5"})])],-1)])],40,E5),te("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(_.value)&&_.value>=36,onClick:X[8]||(X[8]=me=>(function(){const ze=Math.min(36,_.value+1);_.value=ze})()),onMouseenter:X[9]||(X[9]=me=>lt(me,se(i)("common.increase")||"Increase")),onFocus:X[10]||(X[10]=me=>lt(me,se(i)("common.increase")||"Increase")),onMouseleave:nt,onBlur:nt},[...X[21]||(X[21]=[te("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[te("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,M5)],64)):Ue("",!0),n.showCopyButton?(z(),Q("button",{key:2,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":l.value?se(i)("common.copied")||"Copied":se(i)("common.copy")||"Copy",onClick:bt,onMouseenter:X[11]||(X[11]=me=>Pt(me)),onFocus:X[12]||(X[12]=me=>Pt(me)),onMouseleave:nt,onBlur:nt},[l.value?(z(),Q("svg",$5,[...X[23]||(X[23]=[te("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(z(),Q("svg",R5,[...X[22]||(X[22]=[te("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[te("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),te("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,L5)):Ue("",!0),n.showExpandButton?(z(),Q("button",{key:3,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":a.value,onClick:X[13]||(X[13]=me=>(function(ze){if(a.value=!a.value,ze&&L.value){const He=vt(ze);He&&ml(He,a.value?i("common.collapse")||"Collapse":i("common.expand")||"Expand","top",!1,void 0,n.isDark)}const Ne=f.value;Ne&&(a.value?(Ne.style.maxHeight="none",Ne.style["overflow-y"]="visible",Ne.style["overflow-x"]="auto"):(Ne.style.maxHeight="500px",Ne.style.overflow="auto",g.value=!0,pn(()=>{Ne.scrollHeight>Ne.clientHeight&&(Ne.scrollTop=Ne.scrollHeight)})))})(me)),onMouseenter:X[14]||(X[14]=me=>lt(me,a.value?se(i)("common.collapse")||"Collapse":se(i)("common.expand")||"Expand")),onFocus:X[15]||(X[15]=me=>lt(me,a.value?se(i)("common.collapse")||"Collapse":se(i)("common.expand")||"Expand")),onMouseleave:nt,onBlur:nt},[a.value?(z(),Q("svg",F5,[...X[24]||(X[24]=[te("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)])])):(z(),Q("svg",O5,[...X[25]||(X[25]=[te("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)])]))],40,I5)):Ue("",!0),R.value&&n.showPreviewButton?(z(),Q("button",{key:4,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":se(i)("common.preview")||"Preview",onClick:Ve,onMouseenter:X[16]||(X[16]=me=>lt(me,se(i)("common.preview")||"Preview")),onFocus:X[17]||(X[17]=me=>lt(me,se(i)("common.preview")||"Preview")),onMouseleave:nt,onBlur:nt},[...X[26]||(X[26]=[te("svg",{"data-v-3d59cc65":"",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[te("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[te("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"}),te("circle",{cx:"12",cy:"12",r:"3"})])],-1)])],40,N5)):Ue("",!0)])],!0)])):Ue("",!0),jr(te("div",{ref_key:"codeBlockContent",ref:f,class:"code-block-content",style:br(A.value),onScroll:Je},[te("div",{ref_key:"rendererTarget",ref:u,class:"code-block-render"},null,512),h.value?Ue("",!0):(z(),Q("div",{key:0,class:"code-fallback-plain",innerHTML:d.value},null,8,P5))],36),[[bo,!(s.value||!e.stream&&e.loading)]]),jr(te("div",{class:"code-loading-placeholder",style:br(M.value)},[ci(oe.$slots,"loading",{loading:e.loading,stream:e.stream},()=>[X[27]||(X[27]=te("div",{class:"loading-skeleton"},[te("div",{class:"skeleton-line"}),te("div",{class:"skeleton-line"}),te("div",{class:"skeleton-line short"})],-1))],!0)],4),[[bo,!e.stream&&e.loading]])],6))}}),[["__scopeId","data-v-2e273ed5"]]);kl.install=e=>{e.component(kl.__name,kl)};const B5=["data-custom-id"],z5={class:"m-0 p-0"},H5=["data-probe"],j5=["data-node-index","data-node-type"],Rn=it(Se({__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:!0},themes:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!0},batchRendering:{type:Boolean,default:!0},initialRenderBatchSize:{default:40},renderBatchSize:{default:80},renderBatchDelay:{default:16},renderBatchBudgetMs:{default:6},renderBatchIdleTimeoutMs:{default:120},deferNodesUntilVisible:{type:Boolean,default:!0},maxLiveNodes:{default:320},liveNodeBuffer:{default:60}},emits:["copy","handleArtifactClick","click","mouseover","mouseout"],setup(e,{emit:t}){var n,r;const i=e,o=t,l=G(),a=G(null),s=G(null),c=G(null),f=Vo({1:null,2:null,3:null,4:null,5:null,6:null}),u=G(!1),d=/auto|scroll|overlay/i,h=typeof window<"u",p=O(()=>i.debugPerformance&&h&&typeof console<"u"),m=ea(),v=new Map,y=G(0),g=G(0),b=G({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}}),k=O(()=>{var D;if(typeof i.showTooltips=="boolean")return i.showTooltips;const F=(D=m.showTooltips)!=null?D:m["show-tooltips"];return F===""||F===!0||F==="true"||F!==!1&&F!=="false"&&void 0});function _(D,F){p.value&&console.info(`[markstream-vue][perf] ${D}`,F)}function T(D){if(!D)return!1;const F=(D.overflowY||"").toLowerCase(),j=(D.overflow||"").toLowerCase();return d.test(F)||d.test(j)}function x(D){const F=Math.ceil(D.scrollHeight)>Math.ceil(D.clientHeight)+1,j=Math.ceil(D.scrollWidth)>Math.ceil(D.clientWidth)+1;return F||j}function S(D){if(typeof window>"u")return null;const F=D??l.value;if(!F)return null;const j=F.ownerDocument||document,ie=j.scrollingElement||j.documentElement;let le=F;for(;le&&le!==j.body&&le!==ie;){if(T(window.getComputedStyle(le))&&x(le))return le;le=le.parentElement}return null}kr("markstreamShowTooltips",k),kr("markstreamTypewriter",O(()=>i.typewriter!==!1)),kr("markstreamTextStreamState",v),kr("markstreamStreamVersion",y),Oe([()=>i.content,()=>i.nodes],()=>{y.value+=1},{immediate:!0});const R=i.customId?`renderer-${i.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,W=zd(R),w=new Map,C=O(()=>{const{key:D,tags:F}=(function(le){if(!le||le.length===0)return{key:"",tags:[]};const ue=new Set,fe=[];for(const Ce of le){const we=M(Ce);we&&!ue.has(we)&&(ue.add(we),fe.push(we))}return fe.length===0?{key:"",tags:[]}:{key:fe.join(","),tags:fe}})(i.customHtmlTags);if(!D)return W;const j=w.get(D);if(j)return j;const ie=zd(R,{customHtmlTags:F});return w.set(D,ie),ie}),A=O(()=>{const D=C.value;return i.customMarkdownIt?i.customMarkdownIt(D):D});function M(D){const F=String(D??"").trim();if(!F)return"";const j=F.match(/^[<\s/]*([A-Z][\w-]*)/i);return j?j[1].toLowerCase():""}const L=O(()=>{var D,F,j,ie;const le=(D=i.parseOptions)!=null?D:{},ue=(F=i.final)!=null?F:le.final,fe=[...(j=i.customHtmlTags)!=null?j:[],...(ie=le.customHtmlTags)!=null?ie:[]].map(M).filter(Boolean),Ce=ue!=null,we=fe.length>0;return Ce||we?Ye(Ye(Ye({},le),Ce?{final:ue}:{}),we?{customHtmlTags:Array.from(new Set(fe))}:{}):le}),P=O(()=>{var D;const F=(D=L.value.customHtmlTags)!=null?D:[];return new Set(F.map(j=>String(j).trim().toLowerCase()).filter(Boolean))}),I=O(()=>{var D;if((D=i.nodes)!=null&&D.length)return wn(i.nodes.slice());if(i.content){const F=p.value?performance.now():0,j=Ap(i.content,A.value,L.value);return p.value&&_("parse(sync)",{ms:Math.round(performance.now()-F),nodes:j.length,contentLength:i.content.length}),wn(j)}return[]}),N=G(null),V=G(null),K=G(null),$=G(null),H=i.indexKey!=null&&String(i.indexKey).startsWith("list-item-"),re=!H&&i.customId?cf(i.customId):null,Z=O(()=>re?(h5.value,cf(i.customId)):null),ne=O(()=>{var D;return!!(h&&i.customId&&!H&&((D=Z.value)!=null&&D.enabled))}),de=O(()=>{var D;return ne.value&&((D=Z.value)==null?void 0:D.textEstimation)!==!1}),be=O(()=>{var D;return ne.value&&((D=Z.value)==null?void 0:D.codeBlockEstimation)!==!1}),Te=O(()=>{var D;return Math.max(320,g.value||((D=l.value)==null?void 0:D.clientWidth)||640)}),pe=O(()=>{var D;return Math.max(1,(D=i.maxLiveNodes)!=null?D:320)}),ke=O(()=>{var D;return!(((D=i.maxLiveNodes)!=null?D:0)<=0)&&I.value.length>pe.value}),Me=O(()=>ke.value||ne.value),et=O(()=>i.viewportPriority!==!1&&!u.value),Je=yA(D=>{var F;return S((F=D??l.value)!=null?F:null)},et),bt=h&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,vt=h&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,lt=typeof globalThis<"u"&&"process"in globalThis?(n=globalThis.process)==null?void 0:n.env:void 0,nt=lt?.NODE_ENV==="test",Pt=h&&typeof window.requestIdleCallback=="function",We=O(()=>{var D;const F=Math.trunc((D=i.renderBatchSize)!=null?D:80);return Number.isFinite(F)?Math.max(0,F):0}),Ve=O(()=>{var D;const F=Math.trunc((D=i.initialRenderBatchSize)!=null?D:We.value);return Number.isFinite(F)?Math.max(0,F):We.value}),oe=O(()=>i.batchRendering!==!1&&We.value>0&&h&&!nt),X=G(0),me=G({key:i.indexKey,total:0}),ze=G(Math.max(1,We.value||1)),Ne=G(new Set),He=new Map,J=new Map,Ee=new Map,Ke=new Map,nn=new Map,Mn=new WeakMap,ft=G(0),Wt=O(()=>(ft.value,Array.from(Ke.entries()).sort((D,F)=>D[0]-F[0]))),Ht=G(0),qt=G([]),St=G([]),Lt=G(null),_t=G(null);let rn=null,Gt=[],ee=null,xe=null;const q=O(()=>{var D;return i.deferNodesUntilVisible!==!1&&!(((D=i.maxLiveNodes)!=null?D:0)<=0)&&!ke.value&&!(I.value.length>900)&&et.value}),U=O(()=>{var D;return oe.value&&((D=i.maxLiveNodes)!=null?D:0)<=0}),ce=G({batchSize:We.value,initial:Ve.value,delay:(r=i.renderBatchDelay)!=null?r:16,enabled:U.value}),_e=O(()=>!!Je&&(q.value||ke.value)),B=O(()=>{var D;return Math.max(0,(D=i.liveNodeBuffer)!=null?D:60)}),ae=G(0),ye=Vo({start:0,end:0}),Ze=new Map,ht=new Map,pt=O(()=>{if(!ke.value)return I.value.length;const D=B.value,F=Math.max(ye.end+D,Ve.value),j=Math.min(I.value.length,F);return Math.max(X.value,j)});function At(D){var F,j;return(j=(F=$.value)==null?void 0:F[D])!=null?j:null}function jn(D){var F,j,ie,le;const ue=S((F=D??l.value)!=null?F:null);if(ue)return ue;const fe=(le=(ie=D?.ownerDocument)!=null?ie:(j=l.value)==null?void 0:j.ownerDocument)!=null?le:typeof document<"u"?document:null;return fe?.scrollingElement||fe?.documentElement||null}function cr(D){if(!h)return!1;try{const F=window.getComputedStyle(D);return!!(F.display||"").toLowerCase().includes("flex")&&(F.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function ur(D,F,j){var ie,le,ue,fe,Ce,we;if(j)return(fe=(ue=(ie=F?.documentElement)==null?void 0:ie.scrollTop)!=null?ue:(le=F?.body)==null?void 0:le.scrollTop)!=null?fe:0;const Le=D.scrollTop;if(!cr(D))return Le;const Pe=Le<0?-Le:Le;return Math.max(0,((Ce=D.scrollHeight)!=null?Ce:0)-((we=D.clientHeight)!=null?we:0))-Pe}function tr(D,F){let j=D,ie=0,le=0;for(;j&&j!==F&&le++<64;)ie+=j.offsetTop||0,j=j.offsetParent;return ie}function dr(){ee&&(ee(),ee=null),Lt.value=null}function xr(){if(!h||!ke.value)return;const D=jn();if(!D||Lt.value===D)return;dr();const F=()=>yn();D.addEventListener("scroll",F,{passive:!0}),Lt.value=D,ee=()=>{D.removeEventListener("scroll",F)}}function fr(){var D,F,j;if(!xe)return;const ie=(j=(F=(D=l.value)==null?void 0:D.ownerDocument)==null?void 0:F.defaultView)!=null?j:typeof window<"u"?window:null;xe.viaTimeout?ie?ie.clearTimeout(xe.id):clearTimeout(xe.id):vt?.(xe.id),xe=null}function yn(D={}){var F,j,ie;if(!ke.value)return;if(!h)return void kn(!0);if(D.immediate)return fr(),void kn(!0);if(xe)return;const le=()=>{xe=null,kn()};if(bt)xe={id:bt(le),viaTimeout:!1};else{const ue=(ie=(j=(F=l.value)==null?void 0:F.ownerDocument)==null?void 0:j.defaultView)!=null?ie:typeof window<"u"?window:null;xe={id:ue?ue.setTimeout(le,16):setTimeout(le,16),viaTimeout:!0}}}function kn(D=!1){var F,j,ie,le,ue,fe,Ce;if(!ke.value)return;const we=Lt.value||jn();if(!we)return;const Le=we.ownerDocument||((F=l.value)==null?void 0:F.ownerDocument)||document,Pe=Le?.defaultView||(typeof window<"u"?window:null),Re=we===Le?.documentElement||we===Le?.body,yt=I.value.length;if(!Re&&yt>0&&cr(we)){const Xt=we.clientHeight||0,st=we.scrollTop,_n=st<0?-st:st,Tr=(function(Dr){var Er;const Mr=I.value;if(!Mr.length)return 0;if(Dr<=0)return Math.max(0,Mr.length-1);if(ne.value){let gr=Dr;for(let Qr=Mr.length-1;Qr>=0;Qr--){const tu=Kr(Qr);if(gr<=tu)return Qr;gr-=tu}return 0}if(Ht.value===Mr.length){const gr=yi(0,Mr.length);return _a(Math.max(0,gr-Dr))}let eu=Dr;for(let gr=Mr.length-1;gr>=0;gr--){const Qr=(Er=Ut[gr])!=null?Er:De.value;if(eu<=Qr)return gr;eu-=Qr}return 0})(Math.max(0,_n)+.5*Math.max(0,Xt)),Xr=un(Tr,0,Math.max(0,yt-1));return void((D||Math.abs(Xr-ae.value)>1)&&(ae.value=Xr))}const Bt=Re?null:we.getBoundingClientRect(),Yt=Re?0:Bt.top,wt=Re?(ie=(j=Pe?.innerHeight)!=null?j:we.clientHeight)!=null?ie:0:Bt.bottom,on=Wt.value;let ln=null,Tt=null;for(const[Xt,st]of on){if(!st)continue;const _n=st.getBoundingClientRect();_n.bottom<=Yt||_n.top>=wt||(ln==null&&(ln=Xt),Tt=Xt)}if(ln==null||Tt==null){const Xt=l.value;if(!Xt)return;const st=Re?{top:0}:we.getBoundingClientRect(),_n=ur(we,Le,Re),Tr=Re?(()=>{const Er=Xt.getBoundingClientRect(),Mr=(Re?0:st.top)-Er.top;return Math.max(0,Mr)})():(()=>{const Er=tr(Xt,we);return Math.max(0,_n-Er)})(),Xr=Re?(Ce=(fe=(ue=Pe?.innerHeight)!=null?ue:(le=Le?.documentElement)==null?void 0:le.clientHeight)!=null?fe:we.clientHeight)!=null?Ce:0:we.clientHeight,Dr=_a(Tr+.5*Math.max(0,Xr));return void(ae.value=un(Dr,0,Math.max(0,I.value.length-1)))}const Zn=Math.round((ln+Tt)/2);!D&&Math.abs(Zn-ae.value)<=1||(ae.value=un(Zn,0,Math.max(0,I.value.length-1)))}function un(D,F,j){return Math.min(Math.max(D,F),j)}const Ut=Vo({}),dn=Vo({total:0,count:0});function Yr(){for(const D of Object.keys(Ut))delete Ut[Number(D)];dn.total=0,dn.count=0,Ht.value=0,qt.value=[],St.value=[]}function hr(D,F,j){for(let ie=F+1;ie<D.length;ie+=ie&-ie)D[ie]+=j}function Cr(D,F){let j=0;for(let ie=F+1;ie>0;ie-=ie&-ie)j+=D[ie];return j}function Y(D,F,j){if(j<=F)return 0;const ie=Cr(D,j-1);return F<=0?ie:ie-Cr(D,F-1)}function he(D){Ht.value=D;const F=new Array(D+1).fill(0),j=new Array(D+1).fill(0);for(const[ie,le]of Object.entries(Ut)){const ue=Number(ie),fe=Number(le);!Number.isFinite(ue)||ue<0||ue>=D||!Number.isFinite(fe)||fe<=0||(hr(F,ue,fe),hr(j,ue,1))}qt.value=F,St.value=j}const De=O(()=>dn.count>0?Math.max(12,dn.total/dn.count):32);function Et(D){return D?.firstElementChild}function bn(D,F){var j;return D?(j=D.matches)!=null&&j.call(D,F)?D:D.querySelector(F):null}function at(){var D,F;if(!ne.value)return void(g.value=0);const j=(F=(D=l.value)==null?void 0:D.clientWidth)!=null?F:0;g.value=j>0?j:0}let Kn=null;function Sr(){Kn?.disconnect(),Kn=null}const pr=Mi(()=>tt(null,null,function*(){try{return(yield Cn(()=>import("./CodeBlockNode-HLQ5TA-U.js"),__vite__mapDeps([10,0,1,3,4,5,6,7,8]))).default}catch(D){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to inline-code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',D),yr}})),Fo=O(()=>i.renderCodeBlocksAsPre?yr:pr);function ka(){var D;return((D=i.codeBlockProps)==null?void 0:D.showHeader)!==!1}const mr=O(()=>{var D;const F=I.value;if(!F.length||!ne.value)return F.map(()=>null);const j=g.value||((D=l.value)==null?void 0:D.clientWidth)||0;return!Number.isFinite(j)||j<=0?F.map(()=>null):F.map((ie,le)=>{const ue=Ut[le],fe=typeof ue=="number"&&ue>0;if(de.value&&!fe){const Ce=Qp(ie,j,b.value);if(Ce)return Ce}if(be.value&&ie.type==="code_block"){const Ce=(function(we){if(we.type!=="code_block")return null;const Le=Jc(we,jo(we));return Le===kl?"markdown":Le===yr?"pre":Le===Fo.value||Le===pr?"monaco":null})(ie);if(Ce==="monaco"||Ce==="markdown")return(function(we,Le){var Pe;if(!we||we.type!=="code_block")return null;const Re=Le.rendererKind,yt=Le.showHeader!==!1,Bt=(function(Tt){var Zn,Xt,st,_n;return Tt.diff?Math.max(tl(String((Zn=Tt.originalCode)!=null?Zn:"")),tl(String((Xt=Tt.updatedCode)!=null?Xt:"")),tl(String((st=Tt.code)!=null?st:""))):tl(String((_n=Tt.code)!=null?_n:""))})(we),Yt=!!we.diff;let wt=0,on=500;if(Re==="monaco"){const Tt=(Pe=Le.monacoOptions)!=null?Pe:{},Zn=(function(st,_n){const Tr=typeof st?.fontSize=="number"&&st.fontSize>0?st.fontSize:_n?13:12;return typeof st?.lineHeight=="number"&&st.lineHeight>0?st.lineHeight:_n?30:Math.round(1.5*Tr)})(Tt,Yt),Xt=(function(st,_n){var Tr,Xr;if(!_n)return 0;const Dr=typeof((Tr=st?.padding)==null?void 0:Tr.top)=="number"?st.padding.top:10,Er=typeof((Xr=st?.padding)==null?void 0:Xr.bottom)=="number"?st.padding.bottom:22;return Math.max(0,Dr)+Math.max(0,Er)})(Tt,Yt);on=typeof Tt.MAX_HEIGHT=="number"&&Tt.MAX_HEIGHT>0?Tt.MAX_HEIGHT:500,wt=Math.round(Yt?Bt*Zn+Xt:Bt*(Zn+1.5))}else Re==="markdown"?wt=Math.round(21*Bt+32):(wt=Math.round(21*Bt+32),on=Number.POSITIVE_INFINITY);const ln=Math.max(1,Math.min(wt,on));return{kind:"code-block",height:Math.round(ln+(yt?40:0)),contentHeight:ln,rendererKind:Re}})(ie,{rendererKind:Ce,monacoOptions:i.codeBlockMonacoOptions,showHeader:ka()})}return null})});function Kr(D){var F,j,ie;return(ie=(j=Ut[D])!=null?j:(F=mr.value[D])==null?void 0:F.height)!=null?ie:De.value}function Oo(){const D=Lt.value||jn(),F=l.value;if(!D||!F)return null;const j=D.ownerDocument||F.ownerDocument||document;if(D===j.documentElement||D===j.body||D===j.scrollingElement){const ie=F.getBoundingClientRect();return Math.max(0,-ie.top)}return Math.max(0,ur(D,j,!1)-tr(F,D))}function No(D){return yi(0,un(D.nodeIndex,0,Math.max(0,I.value.length-1)))+Math.max(0,D.offsetWithinNodePx)}function Po(){if(rn!=null&&(vt?.(rn),rn=null),h)for(const D of Gt)window.clearTimeout(D);Gt=[]}function Bo(D){(function(F){var j;const ie=Lt.value||jn(),le=l.value;if(!ie||!le)return;const ue=Math.max(0,F),fe=ie.ownerDocument||le.ownerDocument||document,Ce=fe.defaultView||(typeof window<"u"?window:null);if(ie===fe.documentElement||ie===fe.body||ie===fe.scrollingElement){const we=ur(ie,fe,!0)+le.getBoundingClientRect().top;return void((j=Ce?.scrollTo)==null||j.call(Ce,0,Math.max(0,we+ue)))}ie.scrollTop=tr(le,ie)+ue})(No(D))}function ba(){_t.value&&h&&rn==null&&(rn=bt?bt(()=>{rn=null,_t.value&&Bo(_t.value)}):null,rn==null&&_t.value&&Bo(_t.value))}function am(){const D=Oo(),F=I.value.length;if(D==null||F<=0)return null;const j=un(_a(D+1),0,F-1),ie=yi(0,j),le=Kr(j);return{nodeIndex:j,offsetWithinNodePx:un(D-ie,0,Math.max(0,le-1))}}function sm(D){if(_t.value={nodeIndex:un(D.nodeIndex,0,Math.max(0,I.value.length-1)),offsetWithinNodePx:Math.max(0,D.offsetWithinNodePx)},Po(),Bo(_t.value),h)for(const F of[0,120,280,480])Gt.push(window.setTimeout(()=>{_t.value&&Bo(_t.value)},F))}function cm(D){const F=Oo();return F==null?null:F-No(D)}function yi(D,F){var j,ie;if(D>=F)return 0;if(ne.value){let fe=0;for(let Ce=D;Ce<F;Ce++)fe+=Kr(Ce);return fe}if(Ht.value!==I.value.length){let fe=0;for(let Ce=D;Ce<F;Ce++)fe+=(j=Ut[Ce])!=null?j:De.value;return fe}const le=qt.value,ue=St.value;if(!le.length||!ue.length){let fe=0;for(let Ce=D;Ce<F;Ce++)fe+=(ie=Ut[Ce])!=null?ie:De.value;return fe}return Y(le,D,F)+(F-D-Y(ue,D,F))*De.value}Oe(()=>I.value.length,D=>{D<=0?Yr():(D<Ht.value&&(function(F){if(F<=0)return void Yr();let j=0,ie=0;for(const[le,ue]of Object.entries(Ut)){const fe=Number(le),Ce=Number(ue);!Number.isFinite(fe)||fe<0||fe>=F||!Number.isFinite(Ce)||Ce<=0?delete Ut[fe]:(j+=Ce,ie++)}dn.total=j,dn.count=ie})(D),D!==Ht.value&&he(D))},{immediate:!0});const um=O(()=>{if(!ke.value)return I.value.map((ie,le)=>({node:ie,index:le}));const D=I.value.length,F=un(ye.start,0,D),j=un(ye.end,F,D);return I.value.slice(F,j).map((ie,le)=>({node:ie,index:F+le}))}),jc=O(()=>ke.value?yi(0,Math.min(ye.start,I.value.length)):0),Vc=O(()=>{if(!ke.value)return 0;const D=I.value.length;return yi(Math.min(ye.end,D),D)});function dm(){var D;const F=I.value;return{totalNodes:F.length,measuredCount:dn.count,estimatedCount:mr.value.filter(Boolean).length,averageNodeHeight:De.value,topSpacerHeight:jc.value,bottomSpacerHeight:Vc.value,estimatedTotalHeight:yi(0,F.length),width:g.value||((D=l.value)==null?void 0:D.clientWidth)||0,probe:{paragraphReady:!!b.value.paragraph,listItemReady:!!b.value.listItem,listWrapperOverhead:b.value.listWrapperOverhead,headingReadyLevels:Object.entries(b.value.headings).filter(([,j])=>!!j).map(([j])=>Number(j))},nodes:F.map((j,ie)=>{var le,ue,fe,Ce,we,Le,Pe,Re,yt;return{index:ie,type:j.type,estimateKind:(ue=(le=mr.value[ie])==null?void 0:le.kind)!=null?ue:null,rendererKind:(Ce=(fe=mr.value[ie])==null?void 0:fe.rendererKind)!=null?Ce:null,estimatedHeight:(Le=(we=mr.value[ie])==null?void 0:we.height)!=null?Le:null,estimatedContentHeight:(Re=(Pe=mr.value[ie])==null?void 0:Pe.contentHeight)!=null?Re:null,measuredHeight:(yt=Ut[ie])!=null?yt:null}})}}function _a(D){var F;if(D<=0)return 0;const j=I.value;if(ne.value){let le=D;for(let ue=0;ue<j.length;ue++){const fe=Kr(ue);if(le<=fe)return ue;le-=fe}return Math.max(0,j.length-1)}if(Ht.value===j.length&&qt.value.length&&St.value.length){const le=De.value,ue=qt.value,fe=St.value,Ce=Re=>Re<=0?0:Cr(ue,Re-1)+(Re-Cr(fe,Re-1))*le;let we=0,Le=j.length-1,Pe=j.length-1;for(;we<=Le;){const Re=we+Le>>1;Ce(Re+1)>=D?(Pe=Re,Le=Re-1):we=Re+1}return Pe}let ie=D;for(let le=0;le<j.length;le++){const ue=(F=Ut[le])!=null?F:De.value;if(ie<=ue)return le;ie-=ue}return Math.max(0,j.length-1)}function Wc(){ft.value+=1}function qc(D,F){const j=Ne.value,ie=j.has(D);if(F){if(ie)return;const ue=new Set(j);return ue.add(D),void(Ne.value=ue)}if(!ie)return;const le=new Set(j);le.delete(D),Ne.value=le}function Uc(){Ne.value.size!==0&&(Ne.value=new Set)}function zo(D){if(!He.size||!ke.value)return;let F=!1;for(const[j,ie]of He)j>=D&&(ie.destroy(),He.delete(j),q.value&&qc(j,!1),Gr(j),Ke.delete(j)&&(F=!0));F&&Wc()}function Ar(D,F){q.value&&qc(D,F),F&&(ke.value?yn():ae.value=un(D,0,Math.max(0,I.value.length-1)))}function ki(D){const F=J.get(D);F&&(F(),J.delete(D));const j=He.get(D);j&&(j.destroy(),He.delete(D)),Gr(D)}function Yc(D,F){let j=!1;if(F){const ue=Ke.get(D);Ke.set(D,F),ue!==F&&(j=!0)}else Ke.delete(D)&&(j=!0);if(j&&Wc(),F||Gr(D),!_e.value||!Je||!ke.value&&q.value&&!u.value&&He.size>=640&&((function(){if(!u.value){u.value=!0;for(const ue of He.values())ue.destroy();if(He.clear(),h)for(const ue of Ee.values())window.clearTimeout(ue);Ee.clear(),Uc()}})(),!_e.value||!Je))return ki(D),void(F&&Ar(D,!0));if(D<Ve.value&&!ke.value||Ne.value.has(D))return ki(D),void Ar(D,!0);if(!F)return void ki(D);ki(D);const ie=Je(F,{rootMargin:"400px"});if(!ie)return;He.set(D,ie),Ar(D,ie.isVisible.value),q.value&&(function(ue){if(!h||!q.value)return;Gr(ue);const fe=ue%17*23,Ce=window.setTimeout(()=>{var we,Le;if(Ee.delete(ue),!q.value||Ne.value.has(ue))return;const Pe=Ke.get(ue);if(!Pe)return;const Re=jn(Pe),yt=Pe.ownerDocument||document,Bt=yt.defaultView||window,Yt=!Re||Re===yt.documentElement||Re===yt.body,wt=!Yt&&Re?Re.getBoundingClientRect():null,on=Yt?0:wt.top,ln=Yt?(Le=(we=Bt.innerHeight)!=null?we:Re?.clientHeight)!=null?Le:0:wt.bottom,Tt=Pe.getBoundingClientRect();Tt.bottom>=on-500&&Tt.top<=ln+500&&Ar(ue,!0)},1800+fe);Ee.set(ue,Ce)})(D);let le=null;le=Oe(()=>ie.isVisible.value,ue=>{if(ue){Gr(D),Ar(D,!0),le?.(),J.delete(D),He.get(D)===ie&&He.delete(D);try{ie.destroy()}catch{}}},{immediate:!0}),J.set(D,le),ke.value&&yn()}Oe(()=>Me.value,D=>{if(!D){for(const F of nn.values())F.disconnect();nn.clear();for(const F of ht.values())for(const j of F)window.clearTimeout(j);ht.clear()}},{immediate:!0});let eo=null,bi=null,Ho=!1,Zr=null,to=null;function Kc(){h&&(eo!=null&&(vt?.(eo),eo=null),bi!=null&&(window.clearTimeout(bi),bi=null),to!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(to),to=null),Ho=!1,Zr=null)}function Gr(D){if(!h)return;const F=Ee.get(D);F!=null&&(window.clearTimeout(F),Ee.delete(D))}function Zc(D,F={}){var j,ie;if(!U.value)return;const le=pt.value;if(X.value>=le)return;const ue=Math.max(1,D),fe=we=>{var Le;eo=null,bi=null,to=null,Ho=!1;const Pe=Zr??ue;Zr=null;const Re=Math.max(2,(Le=i.renderBatchBudgetMs)!=null?Le:6),yt=Yt=>{const wt=typeof performance<"u"?performance.now():Date.now();X.value=Math.min(le,X.value+Math.max(1,Yt)),zo(X.value);const on=(typeof performance<"u"?performance.now():Date.now())-wt;return(function(ln){var Tt;if(!U.value)return;const Zn=Math.max(2,(Tt=i.renderBatchBudgetMs)!=null?Tt:6),Xt=Math.max(1,We.value||1),st=Math.max(1,Math.floor(Xt/4));ln>1.2*Zn?ze.value=Math.max(st,Math.floor(.7*ze.value)):ln<.5*Zn&&ze.value<Xt&&(ze.value=Math.min(Xt,Math.ceil(1.2*ze.value)))})(on),on};let Bt=Pe;for(;yt(Bt),!(X.value>=le)&&we&&!((typeof we.timeRemaining=="function"?we.timeRemaining():0)<=.5*Re);)Bt=Math.max(1,Math.round(ze.value));X.value<le&&Gc()};if(!h||F.immediate)return void fe();const Ce=Math.max(0,(j=i.renderBatchDelay)!=null?j:16);if(Zr=Zr!=null?Math.max(Zr,ue):ue,!Ho){if(Ho=!0,!nt&&Pt&&window.requestIdleCallback){const we=Math.max(0,(ie=i.renderBatchIdleTimeoutMs)!=null?ie:120);return void(to=window.requestIdleCallback(Le=>{fe(Le)},{timeout:we}))}bt&&!nt?eo=bt(()=>{Ce!==0?bi=window.setTimeout(()=>fe(),Ce):fe()}):bi=window.setTimeout(()=>fe(),Ce)}}function Gc(){U.value&&Zc(oe.value?Math.max(1,Math.round(ze.value)):Math.max(1,We.value))}Oe([()=>I.value,()=>I.value.length,()=>U.value,()=>We.value,()=>Ve.value,()=>i.renderBatchDelay,()=>i.indexKey],()=>{var D;const F=I.value.length,j=me.value,ie=i.indexKey,le=ie!==void 0&&ie!==j.key,ue=F!==j.total,fe=le||ue;me.value={key:ie,total:F};const Ce=ce.value,we=(D=i.renderBatchDelay)!=null?D:16,Le=Ce.batchSize!==We.value||Ce.initial!==Ve.value||Ce.delay!==we||Ce.enabled!==U.value;ce.value={batchSize:We.value,initial:Ve.value,delay:we,enabled:U.value},le&&(Yr(),F>0&&he(F)),(fe||Le||!U.value)&&Kc(),(fe||Le)&&(ze.value=Math.max(1,We.value||1)),fe&&ke.value&&yn({immediate:!0});const Pe=pt.value;if(!F)return X.value=0,void zo(0);if(!U.value)return X.value=Pe,void zo(X.value);const Re=le||j.total===0;X.value=Re||Le?Math.min(Pe,Ve.value):Math.min(X.value,Pe);const yt=Math.max(1,Ve.value||We.value||F);X.value<Pe?Zc(yt,{immediate:!h}):zo(X.value)},{immediate:!0}),Oe(()=>ke.value,D=>{if(!D)return dr(),void fr();xr(),yn({immediate:!0})},{immediate:!0}),Oe([()=>I.value.length,()=>ke.value],D=>tt(null,[D],function*([F,j]){j&&F&&h&&(yield pn(),yn({immediate:!0}))}),{flush:"post"}),Oe(()=>l.value,()=>{ke.value&&(xr(),yn({immediate:!0}))}),Oe(ne,D=>{D&&(function(){var F;if(N.value&&V.value&&K.value&&((F=$.value)!=null&&F[1]))return;const j=wn({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),ie=wn({type:"list_item",children:[j],raw:"- Probe paragraph text"}),le=wn({type:"list",ordered:!1,items:[ie],raw:"- Probe paragraph text"});N.value=j,V.value=ie,K.value=le;const ue={1:null,2:null,3:null,4:null,5:null,6:null};for(let fe=1;fe<=6;fe++)ue[fe]=wn({type:"heading",level:fe,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(fe)} Probe heading`});$.value=ue})()},{immediate:!0}),Oe([()=>l.value,ne],()=>{if(!ne.value)return Sr(),void(g.value=0);at(),Sr(),ne.value&&l.value&&typeof ResizeObserver<"u"&&(Kn=new ResizeObserver(()=>{at(),_t.value&&ba()}),Kn.observe(l.value))},{immediate:!0}),Oe([ne,Te],()=>tt(null,null,function*(){ne.value?(yield pn(),(function(){var D,F,j,ie;if(!ne.value||typeof window>"u")return void(b.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});const le={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},ue=bn(Et(a.value),".paragraph-node");le.paragraph=us(a.value,ue,"pre-wrap");const fe=Et(s.value),Ce=fe?.querySelector(".paragraph-node");le.listItem=us(s.value,Ce,"pre-wrap");const we=(F=(D=c.value)==null?void 0:D.offsetHeight)!=null?F:0,Le=(ie=(j=s.value)==null?void 0:j.offsetHeight)!=null?ie:0;le.listWrapperOverhead=Math.max(0,we-Le);for(let Pe=1;Pe<=6;Pe++){const Re=bn(Et(f[Pe]),`h${Pe}`);le.headings[Pe]=us(f[Pe],Re,"pre-wrap")}b.value=le})()):b.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}}}),{flush:"post",immediate:!0}),Oe(()=>I.value.length,()=>{ke.value&&yn({immediate:!0})}),Oe([ne,g],()=>{ke.value&&yn({immediate:!0}),_t.value&&ba()},{immediate:!1}),Oe(()=>q.value,D=>{if(D)for(const[F,j]of Ke)Yc(F,j);else{for(const F of He.values())F.destroy();He.clear();for(const F of Array.from(Ee.keys()))Gr(F);Uc();for(const[F,j]of Ke)j&&Ar(F,!0)}},{immediate:!1}),Oe([()=>i.viewportPriority,()=>I.value.length],([D,F])=>{D!==!1?u.value&&F<=200&&(u.value=!1):u.value=!1}),Oe(()=>X.value,()=>{ke.value&&yn({immediate:!0})}),Oe([ae,pe,B,()=>I.value.length,ke],()=>{(function(){const D=I.value.length;if(!ke.value||D===0)return ye.start=0,void(ye.end=D);const F=Math.min(pe.value,D),j=B.value,ie=un(ae.value-j,0,Math.max(0,D-F));ye.start=ie,ye.end=Math.min(D,ie+F)})()},{immediate:!0}),Oe([()=>I.value.length,ke,pe,B,()=>ye.start,()=>ye.end],([D,F,j,ie,le,ue])=>{p.value&&_("virtualization",{nodes:D,virtualization:F,maxLiveNodes:j,buffer:ie,focusIndex:ae.value,scroll:F?(()=>{const fe=Lt.value||jn();return fe?{reverse:cr(fe),scrollTop:Math.round(fe.scrollTop),scrollTopAbs:Math.round(Math.abs(fe.scrollTop)),scrollHeight:Math.round(fe.scrollHeight),clientHeight:Math.round(fe.clientHeight)}:null})():null,liveRange:{start:le,end:ue},rendered:X.value})}),Oe(()=>pt.value,(D,F)=>{U.value&&(typeof F=="number"&&D<=F||D>X.value&&Gc())}),Oe([()=>i.customId],([D],F,j)=>{if(!D||H)return;const ie=(function(le,ue){return le?(jt.controllers[le]=ue,()=>{jt.controllers[le]===ue&&delete jt.controllers[le]}):()=>{}})(D,{captureRestoreAnchor:am,restoreAnchor:sm,getAnchorDrift:cm,getReport:dm});j(()=>{ie()})},{immediate:!0}),To(()=>{Kc();for(const D of He.values())D.destroy();He.clear();for(const D of nn.values())D.disconnect();nn.clear();for(const D of ht.values())for(const F of D)window.clearTimeout(F);ht.clear();for(const D of J.values())D();J.clear();for(const D of Array.from(Ee.keys()))Gr(D);Sr(),Po(),dr(),fr()});const fm=Mi(()=>tt(null,null,function*(){try{return(yield Cn(()=>import("./index4-BgHvAk1M.js"),__vite__mapDeps([11,0,1,3,4,5,6,7,8]))).default}catch(D){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".',D),yr}})),hm=Mi(()=>tt(null,null,function*(){try{return(yield Cn(()=>import("./index5-DJlccZkz.js"),__vite__mapDeps([12,0,1,3,4,5,6,7,8]))).default}catch(D){return console.warn('[markstream-vue] Optional peer dependencies for InfographicBlockNode are missing. Falling back to preformatted code rendering. To enable Infographic rendering, please install "@antv/infographic".',D),yr}})),pm=Mi(()=>tt(null,null,function*(){try{return(yield Cn(()=>import("./index6-Bla8rVPT.js"),__vite__mapDeps([13,0,1,3,4,5,6,7,8]))).default}catch(D){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".',D),yr}})),Xc={text:Vt,paragraph:zi,heading:Yl,code_block:pr,list:Bi,list_item:Pi,blockquote:ul,table:vo,definition_list:dl,footnote:gl,footnote_reference:On,footnote_anchor:mo,admonition:bl,vmr_container:yl,hardbreak:fi,link:Dn,image:zr,thematic_break:vl,math_inline:er,math_block:Up,strong:An,emphasis:En,strikethrough:Tn,highlight:Un,insert:zn,subscript:Bn,superscript:Pn,emoji:Fn,checkbox:Gn,checkbox_input:Gn,inline_code:mn,html_inline:Nn,reference:Sn,html_block:go},Qc=O(()=>($o.value,vn(i.customId))),mm=O(()=>i.indexKey!=null?String(i.indexKey):"markdown-renderer"),gm=O(()=>Ye(Ye({stream:i.codeBlockStream,darkTheme:i.codeBlockDarkTheme,lightTheme:i.codeBlockLightTheme,monacoOptions:i.codeBlockMonacoOptions,themes:i.themes,minWidth:i.codeBlockMinWidth,maxWidth:i.codeBlockMaxWidth},typeof k.value=="boolean"?{showTooltips:k.value}:{}),i.codeBlockProps||{})),vm=O(()=>Ye({},i.mermaidProps||{})),ym=O(()=>Ye({},i.d2Props||{})),km=O(()=>Ye({},i.infographicProps||{})),wa=O(()=>({typewriter:i.typewriter})),bm=O(()=>Ye(Ye({},wa.value),typeof k.value=="boolean"?{showTooltip:k.value}:{})),_m=O(()=>Ye(Ye({},wa.value),typeof k.value=="boolean"?{showTooltips:k.value}:{})),wm=O(()=>um.value.map(D=>{var F;let j=(function(Ce){var we,Le,Pe,Re,yt,Bt,Yt;if(Ce.type!=="code_block")return Ce;const wt=Ce,on=[String((we=wt.language)!=null?we:""),String((Le=wt.loading)!=null?Le:""),String((Pe=wt.diff)!=null?Pe:""),String((Re=wt.code)!=null?Re:""),String((yt=wt.originalCode)!=null?yt:""),String((Bt=wt.updatedCode)!=null?Bt:""),String((Yt=wt.raw)!=null?Yt:"")].join("\0"),ln=Mn.get(wt);if(ln&&ln.signature===on)return ln.node;const Tt=Ye({},wt);return Mn.set(wt,{signature:on,node:Tt}),Tt})(D.node);const ie=jo(j);let le=Jc(j,ie);if((j.type==="html_block"||j.type==="html_inline")&&le===Xc[j.type]){const Ce=j,we=String((F=Ce.tag)!=null?F:"").trim().toLowerCase()||(function(Le){const Pe=String(Le??"").match(/^\s*<\s*([A-Z][\w:-]*)/i);return Pe?Pe[1].toLowerCase():""})(Ce.content);if(we&&P.value.has(we)){const Le=Qc.value[we];Le&&(le=Le,j=lr(Ye({},Ce),{type:we,tag:we,content:xm(Ce.content,we)}))}}let ue=Ye({},(function(Ce,we){const Le=we??jo(Ce);return Le==="mermaid"?vm.value:Le==="infographic"?km.value:Le==="d2"||Le==="d2lang"?ym.value:Ce.type==="link"?bm.value:Ce.type==="list"?_m.value:Ce.type==="code_block"?gm.value:wa.value})(j,ie));const fe=mr.value[D.index];return j.type==="code_block"&&fe?.kind==="code-block"&&(ue=lr(Ye({},ue),{estimatedHeightPx:fe.height,estimatedContentHeightPx:fe.contentHeight})),lr(Ye({},D),{node:j,component:le,bindings:ue,isCodeBlock:j.type==="code_block",indexKey:`${mm.value}-${D.index}`})}));function xm(D,F){const j=String(D??"");if(!F)return j;const ie=F.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),le=new RegExp(String.raw`^\s*<\s*${ie}(?:\s[^>]*)?>\s*`,"i"),ue=new RegExp(String.raw`\s*<\s*\/\s*${ie}\s*>\s*$`,"i");return j.replace(le,"").replace(ue,"")}function jo(D){var F;return D?.type==="code_block"?String((F=D.language)!=null?F:"").trim().toLowerCase():""}function Jc(D,F){if(!D)return Ks;const j=Qc.value,ie=j[String(D.type)];if(D.type==="code_block"){const le=F??jo(D);return le==="mermaid"?j.mermaid||fm:le==="infographic"?j.infographic||hm:le==="d2"||le==="d2lang"?j.d2||pm:ie||j.code_block||Fo.value}return ie||Xc[String(D.type)]||Ks}function Cm(D){o("click",D)}function Sm(D){var F;(F=D.target)!=null&&F.closest("[data-node-index]")&&o("mouseover",D)}function Am(D){var F;(F=D.target)!=null&&F.closest("[data-node-index]")&&o("mouseout",D)}return(D,F)=>(z(),Q("div",{ref_key:"containerRef",ref:l,class:Ft(["markstream-vue markdown-renderer",[{dark:i.isDark},{virtualized:ke.value}]]),"data-custom-id":i.customId,onClick:Cm,onMouseover:Sm,onMouseout:Am},[ne.value||ke.value?(z(),Q(Qe,{key:0},[ne.value?(z(),Q("div",{key:0,class:"height-estimation-probes",style:br({width:`${Te.value}px`}),"aria-hidden":"true"},[te("div",{ref_key:"paragraphProbeWrapperRef",ref:a,class:"node-content","data-probe":"paragraph"},[ge(se(zi),{node:N.value,"index-key":"probe-paragraph"},null,8,["node"])],512),te("div",{ref_key:"listItemProbeWrapperRef",ref:s,class:"node-content","data-probe":"list-item"},[te("ul",z5,[ge(se(Pi),{node:V.value,"index-key":"probe-list-item"},null,8,["node"])])],512),te("div",{ref_key:"listProbeWrapperRef",ref:c,class:"node-content","data-probe":"list"},[ge(se(Bi),{node:K.value,"index-key":"probe-list"},null,8,["node"])],512),(z(),Q(Qe,null,gt(6,j=>te("div",{key:`probe-heading-${j}`,ref_for:!0,ref:ie=>(function(le,ue){le<1||le>6||(f[le]=ue)})(j,ie),class:"node-content","data-probe":`heading-${j}`},[ge(se(Yl),{node:At(j),"index-key":`probe-heading-${j}`},null,8,["node","index-key"])],8,H5)),64))],4)):Ue("",!0),ke.value?(z(),Q("div",{key:1,class:"node-spacer",style:br({height:`${jc.value}px`}),"aria-hidden":"true"},null,4)):Ue("",!0)],64)):Ue("",!0),(z(!0),Q(Qe,null,gt(wm.value,j=>{return z(),Q("div",{key:j.index,ref_for:!0,ref:le=>Yc(j.index,le),class:"node-slot","data-node-index":j.index,"data-node-type":j.node.type},[(ie=j.index,U.value&&ie>=X.value||!(!q.value||ie<Ve.value||Ne.value.has(ie))?(z(),Q("div",{key:1,class:"node-placeholder",style:br({height:`${Kr(j.index)}px`})},null,4)):(z(),Q("div",{key:0,ref_for:!0,ref:le=>(function(ue,fe){var Ce;const we=ht.get(ue);if(we){for(const Re of we)window.clearTimeout(Re);ht.delete(ue)}const Le=nn.get(ue);if(Le&&(Le.disconnect(),nn.delete(ue)),!fe||!Me.value)return void Ze.delete(ue);Ze.set(ue,fe);const Pe=()=>{(function(Re,yt){if(!Number.isFinite(yt)||yt<=0)return;const Bt=Ut[Re];if(Ut[Re]=yt,Bt?dn.total+=yt-Bt:(dn.total+=yt,dn.count++),Ht.value>Re){const Yt=qt.value,wt=St.value;if(Yt.length&&wt.length)if(Bt){const on=yt-Bt;on!==0&&hr(Yt,Re,on)}else hr(Yt,Re,yt),hr(wt,Re,1)}_t.value&&ba()})(ue,fe.offsetHeight)};if(queueMicrotask(Pe),typeof ResizeObserver<"u"){const Re=new ResizeObserver(()=>{Pe()});Re.observe(fe),nn.set(ue,Re)}((Ce=I.value[ue])==null?void 0:Ce.type)==="code_block"&&typeof window<"u"&&ht.set(ue,[window.setTimeout(Pe,16),window.setTimeout(Pe,80),window.setTimeout(Pe,240),window.setTimeout(Pe,800)])})(j.index,le),class:"node-content"},[j.isCodeBlock||i.typewriter===!1?(z(),Ie(tn(j.component),Xn({key:1,node:j.node,loading:j.node.loading,"index-key":j.indexKey},{ref_for:!0},j.bindings,{"custom-id":i.customId,"is-dark":i.isDark,onCopy:F[2]||(F[2]=le=>o("copy",le)),onHandleArtifactClick:F[3]||(F[3]=le=>o("handleArtifactClick",le))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(z(),Ie(Ur,{key:0,name:"typewriter",appear:""},{default:Ae(()=>[(z(),Ie(tn(j.component),Xn({node:j.node,loading:j.node.loading,"index-key":j.indexKey},{ref_for:!0},j.bindings,{"custom-id":i.customId,"is-dark":i.isDark,onCopy:F[0]||(F[0]=le=>o("copy",le)),onHandleArtifactClick:F[1]||(F[1]=le=>o("handleArtifactClick",le))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1024))],512)))],8,j5);var ie}),128)),ke.value?(z(),Q("div",{key:1,class:"node-spacer",style:br({height:`${Vc.value}px`}),"aria-hidden":"true"},null,4)):Ue("",!0)],42,B5))}}),[["__scopeId","data-v-d81d311f"]]);Rn.install=e=>{var t,n;const r=(n=(t=Rn.__name)!=null?t:Rn.name)!=null?n:"NodeRenderer";e.component(r,Rn)};const V5={key:0,class:"admonition-icon"},W5={class:"admonition-title"},q5=["aria-expanded","aria-controls","title"],U5={key:0},Y5={key:1},K5=["id"],bl=it(Se({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const r=e,i=t,o={note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},l=O(()=>{if(r.node.title&&r.node.title.trim().length)return r.node.title;const f=r.node.kind||"note";return f.charAt(0).toUpperCase()+f.slice(1)}),a=G(!!r.node.collapsible&&!((n=r.node.open)==null||n));function s(){r.node.collapsible&&(a.value=!a.value)}const c=`admonition-${Math.random().toString(36).slice(2,9)}`;return(f,u)=>(z(),Q("div",{class:Ft(["admonition",[`admonition-${r.node.kind}`,r.isDark?"is-dark":""]])},[te("div",{id:c,class:"admonition-header"},[o[r.node.kind]?(z(),Q("span",V5,$e(o[r.node.kind]),1)):Ue("",!0),te("span",W5,$e(l.value),1),r.node.collapsible?(z(),Q("button",{key:1,class:"admonition-toggle","aria-expanded":!a.value,"aria-controls":`${c}-content`,title:a.value?"Expand":"Collapse",onClick:s},[a.value?(z(),Q("span",U5,"▶")):(z(),Q("span",Y5,"▼"))],8,q5)):Ue("",!0)]),jr(te("div",{id:`${c}-content`,class:"admonition-content","aria-labelledby":c},[ge(se(Rn),{"index-key":`admonition-${e.indexKey}`,nodes:r.node.children,"custom-id":r.customId,typewriter:r.typewriter,onCopy:u[0]||(u[0]=d=>i("copy",d))},null,8,["index-key","nodes","custom-id","typewriter"])],8,K5),[[bo,!a.value]])],2))}}),[["__scopeId","data-v-ee240a2a"]]);bl.install=e=>{e.component(bl.__name,bl)};const tm=()=>Cn(()=>import("./d2_markstream-vue_false-DAdk4EzK.js"),[]);let il=null,Z5=tm;function uD(){return tt(this,null,function*(){if(il)return il;const e=Z5;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===tm?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(il=(function(n){var r;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 i=(r=n.default)!=null?r:n;return typeof i=="function"?i:i?.D2&&typeof i.D2=="function"?i.D2:i})(t),il):null})}const nm=()=>Cn(()=>import("./__vite-optional-peer-dep_mermaid_markstream-vue_false-DsfAepTz.js"),[]);let Ir=null,rm=nm;function G5(){return typeof rm=="function"}function mf(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 n=t.mermaidAPI;return lr(Ye({},t),{render:n.render.bind(n),parse:n.parse?n.parse.bind(n):void 0,initialize:r=>typeof t.initialize=="function"?t.initialize(r):n.initialize?n.initialize(r):void 0})}return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function gf(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const r=Ye({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,r):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(r):void 0}}catch{}}function dD(){return tt(this,null,function*(){if(Ir)return Ir;const e=(function(){try{const r=globalThis;return mf(r?.mermaid)}catch{return null}})();if(e)return Ir=e,gf(Ir),Ir;const t=rm;if(!t)return null;let n;try{n=yield t()}catch(r){throw t===nm?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):r}return n?(Ir=mf(n),gf(Ir),Ir):null})}fl.install=e=>{e.component(fl.__name,fl)};let Ti=null;const im=new Map,ao=new Map;let om=5;const si=new Set;function X5(){if(im.size<om&&si.size){const e=Array.from(si);si.clear();for(const t of e)try{t()}catch{}}}function Q5(e,t=!0,n=2e3,r){return tt(this,null,function*(){if(performance.now(),!qp()){const l=new Error("KaTeX rendering disabled");return l.name="KaTeXDisabled",l.code="KATEX_DISABLED",Promise.reject(l)}if(Ti)return Promise.reject(Ti);const i=`${t?"d":"i"}:${e}`,o=ao.get(i);return o?Promise.resolve(o):(Ti=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Ti.name="WorkerInitError",Ti.code="WORKER_INIT_ERROR",Promise.reject(Ti))})}function fD(e,t=!0,n){const r=`${t?"d":"i"}:${e}`;if(ao.set(r,n),ao.size>200){const i=ao.keys().next().value;ao.delete(i)}}const J5="WORKER_BUSY";function eT(e=2e3,t){return im.size<om?Promise.resolve():new Promise((n,r)=>{let i,o=!1;const l=()=>{o||(o=!0,i&&globalThis.clearTimeout(i),si.delete(l),n())};if(si.add(l),i=globalThis.setTimeout(()=>{if(o)return;o=!0,si.delete(l);const a=new Error("Wait for worker slot timed out");a.name="WorkerBusyTimeout",a.code="WORKER_BUSY_TIMEOUT",r(a)},e),queueMicrotask(()=>X5()),t){const a=()=>{if(o)return;o=!0,i&&globalThis.clearTimeout(i),si.delete(l);const s=new Error("Aborted");s.name="AbortError",r(s)};t.aborted?a():t.addEventListener("abort",a,{once:!0})}})}const ro={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function hD(e){return tt(this,arguments,function*(t,n=!0,r={}){var i,o,l,a;if(!qp()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const s=(i=r.timeout)!=null?i:ro.timeout,c=(o=r.waitTimeout)!=null?o:ro.waitTimeout,f=(l=r.backoffMs)!=null?l:ro.backoffMs,u=(a=r.maxRetries)!=null?a:ro.maxRetries,d=Number.isFinite(u)?Math.max(0,Math.min(Math.floor(u),8)):ro.maxRetries,h=r.signal;let p=0;for(;;){if(h?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield Q5(t,n,s,h)}catch(m){if(m?.code!==J5||p>=d)throw m;if(p++,yield eT(c,h).catch(()=>{}),h?.aborted){const v=new Error("Aborted");throw v.name="AbortError",v}f>0&&(yield new Promise(v=>globalThis.setTimeout(v,f*p)))}}})}let Di=null;const tT="MERMAID_DISABLED";function lm(e,t,n=1400){if(!G5()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=tT,Promise.reject(r)}return Di||(Di=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Di.name="WorkerInitError",Di.code="WORKER_INIT_ERROR"),Promise.reject(Di)}function pD(e,t,n=1400){return tt(this,null,function*(){try{return yield lm("canParse",{code:e,theme:t},n)}catch(r){return Promise.reject(r)}})}function mD(e,t,n=1400){return tt(this,null,function*(){try{return yield lm("findPrefix",{code:e,theme:t},n)}catch(r){return Promise.reject(r)}})}const nT={class:"assistant-content"},rT={key:1,class:"assistant-content__placeholder"},iT=Se({__name:"assistant-message-content",props:{blocks:{},streaming:{type:Boolean}},setup(e){const t=e,n=O(()=>t.blocks.filter(o=>o.type==="markdown")),r=O(()=>n.value.some(o=>_u(o.content).length>0));function i(o){return _u(o)||""}return(o,l)=>(z(),Q("div",nT,[n.value.length?(z(!0),Q(Qe,{key:0},gt(n.value,(a,s)=>(z(),Q(Qe,{key:s},[i(a.content)||e.streaming&&s===n.value.length-1?(z(),Ie(se(Rn),{key:0,"custom-id":"chat",class:"assistant-content__markdown",content:i(a.content)||""},null,8,["content"])):Ue("",!0)],64))),128)):Ue("",!0),!r.value&&e.streaming?(z(),Q("div",rT,"正在生成回复...")):Ue("",!0)]))}}),oT=gn(iT,[["__scopeId","data-v-85acfe08"]]),lT={key:0,class:"assistant-footer"},aT={class:"assistant-footer__meta"},sT={key:0,class:"assistant-footer__meta-item"},cT={key:1,class:"assistant-footer__meta-item"},uT={key:2,class:"assistant-footer__meta-item"},dT={class:"assistant-footer__actions"},fT=Se({__name:"assistant-message-footer",props:{content:{},streaming:{type:Boolean},responseTimeMs:{},citationCount:{},tokenUsage:{}},emits:["copy","feedback","action"],setup(e,{emit:t}){const n=e,r=t,i=lc(),{SvgIconVNode:o}=sg(),l=O(()=>!n.responseTimeMs||n.responseTimeMs<=0?null:`${(n.responseTimeMs/1e3).toFixed(1)}s`),a=O(()=>!n.tokenUsage||n.tokenUsage<=0?null:n.tokenUsage>=1e3?`${(n.tokenUsage/1e3).toFixed(1)}k tok`:`${n.tokenUsage} tok`),s=O(()=>[{key:"regenerate",label:"重新生成",icon:o({icon:"mdi:refresh",fontSize:16})},{key:"view-raw",label:"查看原始内容",icon:o({icon:"mdi:code-braces",fontSize:16})}]);async function c(){try{await navigator.clipboard.writeText(n.content),i.success("已复制到剪贴板"),r("copy")}catch{i.error("复制失败")}}function f(d){r("feedback",d)}function u(d){r("action",d)}return(d,h)=>{const p=oc;return e.streaming?Ue("",!0):(z(),Q("div",lT,[te("div",aT,[e.citationCount&&e.citationCount>0?(z(),Q("span",sT,[ge(p,{icon:"mdi:link-variant",class:"assistant-footer__icon"}),ot(" 引用 "+$e(e.citationCount),1)])):Ue("",!0),a.value?(z(),Q("span",cT,[ge(p,{icon:"mdi:token-outline",class:"assistant-footer__icon"}),ot(" "+$e(a.value),1)])):Ue("",!0),l.value?(z(),Q("span",uT,[ge(p,{icon:"mdi:timer-outline",class:"assistant-footer__icon"}),ot(" "+$e(l.value),1)])):Ue("",!0)]),te("div",dT,[ge(se(Xe),{quaternary:"",size:"tiny",onClick:c},{icon:Ae(()=>[ge(p,{icon:"mdi:content-copy"})]),_:1}),ge(se(Xe),{quaternary:"",size:"tiny",onClick:h[0]||(h[0]=m=>f("up"))},{icon:Ae(()=>[ge(p,{icon:"mdi:thumb-up-outline"})]),_:1}),ge(se(Xe),{quaternary:"",size:"tiny",onClick:h[1]||(h[1]=m=>f("down"))},{icon:Ae(()=>[ge(p,{icon:"mdi:thumb-down-outline"})]),_:1}),ge(se(ag),{options:s.value,trigger:"click",onSelect:u},{default:Ae(()=>[ge(se(Xe),{quaternary:"",size:"tiny"},{icon:Ae(()=>[ge(p,{icon:"mdi:dots-horizontal"})]),_:1})]),_:1},8,["options"])])]))}}}),hT=gn(fT,[["__scopeId","data-v-cb029dbe"]]),pT={class:"assistant-message"},mT={class:"assistant-message__meta"},gT=Se({__name:"chat-assistant-message",props:{message:{}},setup(e){const t=e,n=O(()=>t.message.blocks??[]),r=O(()=>{const s=n.value.some(f=>f.type==="trace-timeline"),c=n.value.some(f=>f.type==="markdown"&&oh(f.content));return s||c});function i(s){return s?Ql(s).format("YYYY-MM-DD HH:mm:ss"):"-"}function o(){}function l(s){}function a(s){}return(s,c)=>(z(),Q("div",pT,[te("div",mT,[c[1]||(c[1]=te("span",null,"助手",-1)),te("span",null,$e(i(e.message.createdAt)),1),e.message.streaming?(z(),Ie(se(hi),{key:0,size:"small",type:"warning"},{default:Ae(()=>[...c[0]||(c[0]=[ot("生成中",-1)])]),_:1})):Ue("",!0)]),r.value?(z(),Ie($y,{key:0,blocks:n.value,streaming:!!e.message.streaming},null,8,["blocks","streaming"])):Ue("",!0),ge(oT,{blocks:n.value,streaming:!!e.message.streaming},null,8,["blocks","streaming"]),ge(hT,{content:e.message.content,streaming:!!e.message.streaming,"response-time-ms":e.message.responseTimeMs,onCopy:o,onFeedback:l,onAction:a},null,8,["content","streaming","response-time-ms"])]))}}),vT=gn(gT,[["__scopeId","data-v-18a3fe67"]]),yT=Se({__name:"chat-message-item",props:{message:{}},setup(e){const t=e;function n(r){return r==="user"}return(r,i)=>(z(),Q("div",{class:Ft(["message-row",n(t.message.role)?"message-row--user":"message-row--assistant"])},[n(t.message.role)?(z(),Ie(ly,{key:0,message:t.message},null,8,["message"])):(z(),Ie(vT,{key:1,message:t.message},null,8,["message"]))],2))}}),kT=gn(yT,[["__scopeId","data-v-dc5abd8d"]]),bT={},_T={class:"thread-divider"};function wT(e,t){return z(),Q("div",_T,[...t[0]||(t[0]=[te("span",{class:"thread-divider__label"},"新上下文开始",-1)])])}const xT=gn(bT,[["render",wT],["__scopeId","data-v-495e91dc"]]),CT={class:"message-list"},ST=Se({__name:"chat-message-list",props:{items:{},messagesLoading:{type:Boolean}},setup(e,{expose:t}){const n=G(null);async function r(){await pn(),n.value?.scrollTo({top:Number.MAX_SAFE_INTEGER})}return t({scrollToBottom:r}),(i,o)=>(z(),Ie(se(Df),{ref_key:"viewportRef",ref:n,class:"message-viewport"},{default:Ae(()=>[!e.items.length&&!e.messagesLoading?(z(),Ie(se(Xl),{key:0,description:"暂无对话记录"})):(z(),Ie(se(vc),{key:1,show:e.messagesLoading},{default:Ae(()=>[te("div",CT,[(z(!0),Q(Qe,null,gt(e.items,l=>(z(),Q(Qe,{key:l.key},[l.type==="message"?(z(),Ie(kT,{key:0,message:l.message},null,8,["message"])):(z(),Ie(xT,{key:1}))],64))),128))])]),_:1},8,["show"]))]),_:1},512))}}),AT=gn(ST,[["__scopeId","data-v-eb6af1c4"]]),TT={class:"pending-approval__content"},DT={class:"pending-approval__main"},ET={class:"pending-approval__summary"},MT={class:"pending-approval__field-label"},LT={class:"pending-approval__field-value"},RT={class:"pending-approval__actions"},$T=Se({__name:"chat-pending-approval-bar",props:{approval:{},actionLoading:{type:Boolean}},emits:["approve","reject","viewDetail"],setup(e,{emit:t}){const n=e,r=t,i=O(()=>n.approval.summaryFields||[]);return(o,l)=>(z(),Ie(se(ic),{size:"small",class:"pending-approval",bordered:!1},{default:Ae(()=>[te("div",TT,[te("div",DT,[ge(se(ms),{align:"center",size:8,wrap:""},{default:Ae(()=>[l[3]||(l[3]=te("div",{class:"pending-approval__title"},"待你确认提交",-1)),ge(se(hi),{type:"warning",size:"small"},{default:Ae(()=>[ot($e(e.approval.actionType||"submit"),1)]),_:1}),ge(se(hi),{size:"small",type:"info"},{default:Ae(()=>[ot($e(e.approval.agentName||"当前申请"),1)]),_:1})]),_:1}),ge(se(dv),{depth:"3"},{default:Ae(()=>[...l[4]||(l[4]=[ot("请确认后再提交到业务系统。",-1)])]),_:1}),te("div",ET,[i.value.length?(z(!0),Q(Qe,{key:0},gt(i.value,a=>(z(),Q("div",{key:`${a.key}-${a.label}`,class:"pending-approval__field"},[te("div",MT,$e(a.label),1),te("div",LT,$e(a.value||"-"),1)]))),128)):(z(),Ie(se(Xl),{key:1,size:"small",description:"暂无摘要字段"}))])]),te("div",RT,[ge(se(Xe),{tertiary:"",size:"small",onClick:l[0]||(l[0]=a=>r("viewDetail"))},{default:Ae(()=>[...l[5]||(l[5]=[ot("查看完整信息",-1)])]),_:1}),ge(se(Xe),{size:"small",disabled:e.actionLoading,onClick:l[1]||(l[1]=a=>r("reject"))},{default:Ae(()=>[...l[6]||(l[6]=[ot("拒绝",-1)])]),_:1},8,["disabled"]),ge(se(Xe),{type:"primary",size:"small",loading:e.actionLoading,onClick:l[2]||(l[2]=a=>r("approve"))},{default:Ae(()=>[...l[7]||(l[7]=[ot("同意",-1)])]),_:1},8,["loading"])])])]),_:1}))}}),IT=gn($T,[["__scopeId","data-v-1f567780"]]),FT={key:0,class:"approval-drawer"},OT={class:"approval-drawer__session"},NT={key:0,class:"approval-drawer__load-error"},PT={key:0,class:"approval-drawer__fields"},BT={class:"approval-drawer__field-label"},zT={class:"approval-drawer__field-value"},HT={class:"approval-drawer__edit-form"},jT={class:"approval-drawer__footer"},VT=Se({__name:"chat-pending-approval-drawer",props:{show:{type:Boolean},approval:{},actionLoading:{type:Boolean},agentFields:{},fieldsLoading:{type:Boolean}},emits:["update:show","approve","reject"],setup(e,{emit:t}){const n=e,r=t,i=lc(),o=G(!1),l=G({}),a=G({});Oe(()=>n.show,k=>{k||m()});const s=O(()=>n.approval?.allFields||[]),c=O(()=>!!n.approval?.agentId),f=O(()=>c.value&&!n.fieldsLoading&&n.agentFields.length===0);function u(k){return n.agentFields.find(_=>_.fieldName===k)}function d(k,_){return u(k)?.fieldLabel||_}function h(){const k={};for(const _ of s.value)k[_.key]=_.value||"";for(const _ of n.agentFields)_.fieldName in k||(k[_.fieldName]="");l.value=k,a.value={},o.value=!0}function p(){m()}function m(){o.value=!1,l.value={},a.value={}}function v(){if(o.value){if(!y())return;r("approve",{...l.value})}else r("approve",null)}function y(){const k={};for(const _ of n.agentFields)if(_.required){const T=l.value[_.fieldName];(T==null||String(T).trim()==="")&&(k[_.fieldName]=`${_.fieldLabel} 为必填项`)}return a.value=k,Object.keys(k).length>0?(i.warning("请填写所有必填字段"),!1):!0}function g(k){if(!k)return null;if(typeof k=="number")return k;const _=Date.parse(String(k));return Number.isNaN(_)?null:_}function b(k,_){l.value[k]=_!==null?_:""}return(k,_)=>(z(),Ie(se(dg),{show:e.show,placement:"right",width:480,"auto-focus":!1,"onUpdate:show":_[1]||(_[1]=T=>r("update:show",T))},{default:Ae(()=>[ge(se(cg),{title:"审批详情",closable:""},{footer:Ae(()=>[te("div",jT,[ge(se(Xe),{disabled:e.actionLoading,onClick:_[0]||(_[0]=T=>r("reject"))},{default:Ae(()=>[..._[4]||(_[4]=[ot("拒绝",-1)])]),_:1},8,["disabled"]),ge(se(Xe),{type:"primary",loading:e.actionLoading,onClick:v},{default:Ae(()=>[..._[5]||(_[5]=[ot("同意",-1)])]),_:1},8,["loading"])])]),default:Ae(()=>[e.approval?(z(),Q("div",FT,[ge(se(ms),{align:"center",justify:"space-between",size:8},{default:Ae(()=>[ge(se(ms),{align:"center",size:8,wrap:""},{default:Ae(()=>[ge(se(hi),{type:"warning",size:"small"},{default:Ae(()=>[ot($e(e.approval.actionType||"submit"),1)]),_:1}),ge(se(hi),{type:"info",size:"small"},{default:Ae(()=>[ot($e(e.approval.agentName||"当前申请"),1)]),_:1}),te("span",OT,"会话："+$e(e.approval.sessionId||"-"),1)]),_:1}),c.value?(z(),Q(Qe,{key:0},[o.value?(z(),Ie(se(Xe),{key:1,size:"small",onClick:p},{default:Ae(()=>[..._[3]||(_[3]=[ot("取消",-1)])]),_:1})):(z(),Ie(se(Xe),{key:0,size:"small",loading:e.fieldsLoading,disabled:f.value,title:f.value?"字段定义加载失败，无法编辑":"",onClick:h},{default:Ae(()=>[..._[2]||(_[2]=[ot(" 编辑 ",-1)])]),_:1},8,["loading","disabled","title"]))],64)):Ue("",!0)]),_:1}),c.value&&!e.fieldsLoading&&e.agentFields.length===0?(z(),Q("div",NT," 字段定义加载失败，仅可查看但无法编辑 ")):Ue("",!0),o.value?(z(),Ie(se(vc),{key:2,show:e.fieldsLoading},{default:Ae(()=>[te("div",HT,[(z(!0),Q(Qe,null,gt(e.agentFields,T=>(z(),Ie(se(ps),{key:T.fieldName,label:T.fieldLabel,feedback:a.value[T.fieldName],"validation-status":a.value[T.fieldName]?"error":void 0},{default:Ae(()=>[T.fieldType==="text"?(z(),Ie(se(ar),{key:0,value:String(l.value[T.fieldName]??""),clearable:"","onUpdate:value":x=>{l.value[T.fieldName]=x,delete a.value[T.fieldName]}},null,8,["value","onUpdate:value"])):T.fieldType==="number"?(z(),Ie(se(ug),{key:1,value:l.value[T.fieldName]!==""&&l.value[T.fieldName]!=null?Number(l.value[T.fieldName]):null,clearable:"",style:{width:"100%"},"onUpdate:value":x=>{l.value[T.fieldName]=x??"",delete a.value[T.fieldName]}},null,8,["value","onUpdate:value"])):T.fieldType==="date"?(z(),Ie(se(ku),{key:2,type:"date",value:g(l.value[T.fieldName]),format:T.dateFormat||"yyyy-MM-dd",clearable:"",style:{width:"100%"},"onUpdate:value":x=>b(T.fieldName,x)},null,8,["value","format","onUpdate:value"])):T.fieldType==="datetime"?(z(),Ie(se(ku),{key:3,type:"datetime",value:g(l.value[T.fieldName]),format:T.dateFormat||"yyyy-MM-dd HH:mm:ss",clearable:"",style:{width:"100%"},"onUpdate:value":x=>b(T.fieldName,x)},null,8,["value","format","onUpdate:value"])):T.fieldType==="enum"?(z(),Ie(se(Tf),{key:4,value:l.value[T.fieldName]!=null?String(l.value[T.fieldName]):null,options:(T.enumOptions||[]).map(x=>({label:x,value:x})),clearable:"","onUpdate:value":x=>{l.value[T.fieldName]=x,delete a.value[T.fieldName]}},null,8,["value","options","onUpdate:value"])):(z(),Ie(se(ar),{key:5,value:String(l.value[T.fieldName]??""),clearable:"","onUpdate:value":x=>{l.value[T.fieldName]=x,delete a.value[T.fieldName]}},null,8,["value","onUpdate:value"]))]),_:2},1032,["label","feedback","validation-status"]))),128))])]),_:1},8,["show"])):(z(),Q(Qe,{key:1},[s.value.length?(z(),Q("div",PT,[(z(!0),Q(Qe,null,gt(s.value,T=>(z(),Q("div",{key:`${T.key}-${T.label}`,class:"approval-drawer__field"},[te("div",BT,$e(d(T.key,T.label)),1),te("div",zT,$e(T.value||"-"),1)]))),128))])):(z(),Ie(se(Xl),{key:1,description:"暂无完整字段信息"}))],64))])):Ue("",!0)]),_:1})]),_:1},8,["show"]))}}),WT=gn(VT,[["__scopeId","data-v-766d4b0f"]]),qT={class:"chat-playground"},UT={class:"chat-playground__layout"},YT={class:"chat-playground__sidebar"},KT={class:"chat-playground__main"},ZT={class:"conversation-header"},GT={class:"conversation-header__meta"},XT=Se({name:"system_chat-playground",__name:"index",setup(e){const t=lc(),n=fg(),r=G(""),i=G(null),o=G(null),l=G(null),a=G([]),s=G(""),c=G(null),f=G(!1),u=G([]),d=G([]),h=G(!1),p=G(!1),m=G(!1),v=G(""),y=G(!1),g=G(!1),b=G(!1),k=G(!1),_=G(!1),T=G([]),x=G(!1),S=G(null),R=G(0),W=G(0),w=G(0),C=G(""),A=G(null),M=G(0),L=O(()=>o.value?.sessionId||""),P=O(()=>u.value.find(q=>q.id===i.value)||null),I=O(()=>c.value?.pending?c.value:null),N=O(()=>{const q=u.value.filter(U=>U.enabled).map(U=>({label:U.name,value:U.id}));return P.value&&!P.value.enabled&&q.push({label:`${P.value.name}（已禁用）`,value:P.value.id,disabled:!0}),q}),V=O(()=>{const q=new Map;return u.value.forEach(U=>{q.set(U.id,U.name)}),q}),K=O(()=>ze(o.value?.chatbotId)),$=O(()=>o.value?.status==="active"),H=O(()=>!!o.value?.contextResetPending),re=O(()=>!!(L.value&&$.value&&!b.value&&!k.value&&!_.value&&!I.value)),Z=O(()=>!!(L.value&&$.value&&s.value.trim()&&!b.value&&!k.value)),ne=O(()=>_t(a.value));To(()=>{ft()}),Oe(()=>I.value?.agentId,async q=>{if(T.value=[],!!q){x.value=!0;try{const U=await Ag(q);T.value=U.data||[]}catch{T.value=[]}finally{x.value=!1}}},{immediate:!0}),Gl(async()=>{await de()});async function de(){await be(),n.userInfo.userId||await n.initUserInfo(),r.value=String(n.userInfo.userId||"").trim(),r.value&&await pe()}async function be(){h.value=!0;try{const q=await xg();u.value=q.data||[],!L.value&&i.value&&!V.value.has(i.value)&&(i.value=null)}catch{t.error("获取 chatbot 列表失败")}finally{h.value=!1}}Oe(o,q=>{q&&(i.value=q.chatbotId)});function Te(q){o.value=q,q&&(d.value=d.value.map(U=>U.sessionId===q.sessionId?q:U))}async function pe(){if(r.value.trim()){p.value=!0;try{const q=await hg(r.value.trim());d.value=q.data||[];const U=d.value.find(ce=>ce.sessionId===L.value)||null;U&&(o.value=U),d.value.length===0?(o.value=null,a.value=[],Lt()):L.value&&!U&&(o.value=null,a.value=[],Lt())}catch{t.error("获取会话列表失败")}finally{p.value=!1}}}async function ke(q){L.value!==q.sessionId&&(ft(),o.value=q,l.value=null,Lt(),await oe(q.sessionId),await X(q.sessionId))}function Me(){ft(),o.value=null,l.value=null,a.value=[],s.value="",Lt()}async function et(){const q=r.value.trim(),U=i.value;if(!q){t.warning("请输入 userId");return}if(!U){t.warning("请选择 chatbot");return}if(!P.value?.enabled){t.warning("请选择启用状态的 chatbot");return}m.value=!0;try{const _e=(await pg({userId:q,chatbotId:U})).data||null;if(!_e){t.error("创建会话失败：未返回会话数据");return}Te(_e),l.value=null,s.value="",a.value=[],Lt(),await pe();const B=await oe(_e.sessionId),ae=await X(_e.sessionId);B==="applied"&&ae!=="failed"?t.success("会话创建成功"):B==="failed"?t.warning("会话已创建，但加载消息历史失败"):t.info("会话已创建，界面已切换到更新后的状态")}catch(ce){console.error(ce),t.error("创建会话失败，请稍后重试")}finally{m.value=!1}}async function Je(q){if(v.value)return;const U=L.value===q.sessionId;U&&ft(),v.value=q.sessionId;try{if(await mg(q.sessionId),await pe(),U){l.value=null,s.value="";const ce=d.value[0]||null;if(ce){o.value=ce;const _e=await oe(ce.sessionId),B=await X(ce.sessionId);_e==="failed"?t.warning("会话已删除，但下一条会话的消息历史加载失败"):B==="failed"?t.warning("会话已删除，但下一条会话的待审批状态加载失败"):t.success("会话删除成功")}else o.value=null,a.value=[],Lt(),t.success("会话删除成功");return}t.success("会话删除成功")}catch(ce){console.error(ce),t.error("删除会话失败，请稍后重试")}finally{v.value=""}}async function bt(){if(!L.value){t.warning("请先创建会话");return}const q=await oe(L.value),U=await X(L.value);if(q==="failed"){t.error("刷新消息历史失败");return}U==="failed"&&t.warning("消息历史已刷新，但待审批状态刷新失败")}async function vt(){const q=L.value;if(!q){t.warning("请先创建会话");return}if(!re.value){t.warning("当前状态不支持清除上下文");return}_.value=!0;try{const ce=(await gg(q)).data||null;if(!ce){t.error("清除上下文失败：未返回会话状态");return}Te(ce)}catch(U){console.error(U),t.error(U instanceof Error?U.message:"清除上下文失败，请稍后重试")}finally{_.value=!1}}async function lt(){const q=L.value;if(!q){t.warning("请先创建会话");return}_.value=!0;try{const ce=(await vg(q)).data||null;if(!ce){t.error("恢复上下文失败：未返回会话状态");return}Te(ce)}catch(U){console.error(U),t.error(U instanceof Error?U.message:"恢复上下文失败，请稍后重试")}finally{_.value=!1}}async function nt(){const q=L.value,U=s.value.trim(),ce=o.value;if(!q){t.warning("请先创建会话");return}if(!U){t.warning("请输入消息内容");return}if(!$.value){t.warning("当前会话状态不支持发送消息");return}b.value=!0;try{const _e=ce?.contextResetPending?qt():ce?.activeThreadId||qt();Ne(U,_e);const B=He(_e);l.value=null,s.value="",ce&&Te({...ce,contextResetPending:!1}),ft();const ae=new AbortController;if(A.value=ae,C.value=B,await me(),await yg(q,{content:U},{signal:ae.signal,onEvent(ye){L.value===q&&J(ye,B)}}),L.value!==q)return;await We(q)}catch(_e){if(_e instanceof DOMException&&_e.name==="AbortError")return;Mn(),await X(q).catch(()=>{}),t.error(_e instanceof Error?_e.message:"发送消息失败，请稍后重试")}finally{Wt(),b.value=!1}}async function Pt(q,U){const ce=L.value,_e=I.value;if(!ce||!_e?.interruptionId){t.warning("当前没有可处理的待审批事项");return}k.value=!0;try{ft(),St(null),f.value=!1;const B=He(o.value?.activeThreadId||qt()),ae=new AbortController;if(A.value=ae,C.value=B,await me(),await kg(ce,{interruptionId:_e.interruptionId,decision:q,...q==="approve"&&U!==null&&U!==void 0?{editedFields:U}:{}},{signal:ae.signal,onEvent(ye){L.value===ce&&J(ye,B)}}),L.value!==ce)return;await We(ce)}catch(B){if(B instanceof DOMException&&B.name==="AbortError")return;Mn(),await X(ce).catch(()=>{}),t.error(B instanceof Error?B.message:"审批处理失败，请稍后重试")}finally{Wt(),k.value=!1}}async function We(q){const U=await X(q),ce=await oe(q),_e=await Ve(q);if(await pe(),L.value!==q)return;if(ce==="applied"&&_e==="applied"&&U!=="failed"){window.setTimeout(()=>{pe().catch(()=>{})},2e3);return}if(ce==="stale"||_e==="stale"||U==="stale"){t.info("消息已发送，界面状态已在处理中发生变化");return}const B=[];ce==="failed"&&B.push("消息历史"),_e==="failed"&&B.push("会话信息"),U==="failed"&&B.push("待审批状态"),B.length>0&&t.warning(`操作已完成，但刷新${B.join("和")}失败`)}async function Ve(q){R.value+=1;const U=R.value;y.value=!0;try{const ce=await bg(q);if(U!==R.value||L.value!==q)return"stale";const _e=ce.data||null;return _e?(Te(_e),"applied"):"failed"}catch(ce){return console.error(ce),U!==R.value||L.value!==q?"stale":"failed"}finally{U===R.value&&(y.value=!1)}}async function oe(q){W.value+=1;const U=W.value;g.value=!0;try{const ce=await _g(q);return U!==W.value||L.value!==q?"stale":(a.value=(ce.data||[]).map(_e=>({..._e,streaming:!1,local:!1,blocks:rn(_e)})),await me(),"applied")}catch(ce){return console.error(ce),U!==W.value||L.value!==q?"stale":"failed"}finally{U===W.value&&(g.value=!1)}}async function X(q){w.value+=1;const U=w.value;try{const ce=await wg(q);return U!==w.value||L.value!==q?"stale":(St(ce.data||null),"applied")}catch(ce){return console.error(ce),U!==w.value||L.value!==q?"stale":"failed"}}async function me(){await pn(),await S.value?.scrollToBottom()}function ze(q){return q?V.value.get(q)||"未知机器人":"-"}function Ne(q,U){a.value.push({id:Ht("user"),role:"user",threadId:U,content:q,createdAt:new Date().toISOString(),local:!0,streaming:!1,blocks:void 0})}function He(q){const U=Ht("assistant");return M.value=Date.now(),a.value.push({id:U,role:"assistant",threadId:q,content:"",createdAt:new Date().toISOString(),local:!0,streaming:!0,blocks:[{type:"markdown",content:""}]}),U}function J(q,U){if(q.type==="message"){Ke(U,q.content||"");return}if(q.type==="error")throw nn(U,q.content||""),new Error(q.content||q.errorMessage||"对话流执行失败");if(q.type==="tool_running"||q.type==="tool_finished"||q.type==="tool_failed"){xe(U,q);return}if(q.type==="approval_required"){Ee(q,U);return}q.type==="complete"&&(nn(U,q.content||""),l.value={role:"assistant",content:q.content||"",agentTriggered:q.node,status:q.status==="pending"?"collecting":q.status||"chatting"})}function Ee(q,U){St({pending:!0,interruptionId:q.interruptionId||null,sessionId:q.sessionId||L.value||null,agentId:q.agentId||null,agentName:q.agentName||null,actionType:q.actionType||"submit",summaryFields:q.summaryFields||[],allFields:[]});const ce=a.value.find(ae=>ae.id===U);if(!ce)return;const _e=!!ce.blocks?.some(ae=>ae.type==="trace-timeline"&&ae.items.length>0),B=!!ce.content.trim();if(_e||B){ce.streaming=!1;return}a.value=a.value.filter(ae=>ae.id!==U)}function Ke(q,U){const ce=a.value.find(B=>B.id===q);if(!ce)return;ce.content+=U;const _e=Gt(ce);_e.content+=U,me().catch(()=>{})}function nn(q,U){const ce=a.value.find(B=>B.id===q);if(!ce)return;ce.content=U||ce.content,ce.streaming=!1,ce.responseTimeMs=M.value>0?Date.now()-M.value:void 0;const _e=Gt(ce);_e.content=U||_e.content,me().catch(()=>{})}function Mn(){if(!C.value)return;const q=a.value.find(U=>U.id===C.value);q&&(q.streaming=!1)}function ft(){A.value?.abort(),Wt()}function Wt(){A.value=null,C.value="",M.value=0}function Ht(q){return`${q}-${Date.now()}-${Math.random().toString(16).slice(2,8)}`}function qt(){return`optimistic-thread-${Date.now()}-${Math.random().toString(16).slice(2,8)}`}function St(q){if(!q?.pending){Lt();return}c.value={...q,actionType:q.actionType||"submit"}}function Lt(){c.value=null,f.value=!1,T.value=[],x.value=!1}function _t(q){const U=[];let ce=null;return q.forEach((_e,B)=>{B>0&&_e.threadId&&ce&&ce!==_e.threadId&&U.push({type:"thread-divider",key:`thread-divider-${_e.id}`}),U.push({type:"message",key:_e.id,message:_e}),ce=_e.threadId||ce}),U}function rn(q){if(q.role==="assistant")return q.blocks?.length?q.blocks:[{type:"markdown",content:q.content}]}function Gt(q){q.blocks||(q.blocks=[{type:"markdown",content:""}]);const U=q.blocks.findIndex(B=>B.type==="trace-timeline"),ce=U>=0?U:q.blocks.length,_e=q.blocks[ce-1];if(!_e||_e.type!=="markdown"){const B={type:"markdown",content:""};return U>=0?q.blocks.splice(U,0,B):q.blocks.push(B),B}return _e}function ee(q){q.blocks||(q.blocks=[{type:"markdown",content:q.content}]);const U=q.blocks.find(_e=>_e.type==="trace-timeline");if(U&&U.type==="trace-timeline")return U;const ce={type:"trace-timeline",summary:{total:0,failed:0},items:[]};return q.blocks.push(ce),ce}function xe(q,U){const ce=a.value.find(ae=>ae.id===q);if(!ce||!U.toolCallId||!U.toolName)return;const _e=ee(ce),B=_e.items.find(ae=>ae.toolCallId===U.toolCallId);B?(B.status=U.toolStatus||B.status,B.node=U.node??B.node,B.startedAt=U.startedAt??B.startedAt,B.finishedAt=U.finishedAt??B.finishedAt,B.input=U.toolInput??B.input,B.output=U.toolOutput??B.output,B.errorMessage=U.errorMessage??B.errorMessage):_e.items.push({toolCallId:U.toolCallId,toolName:U.toolName,toolDisplayName:U.toolDisplayName||U.toolName,status:U.toolStatus||"running",node:U.node,startedAt:U.startedAt||U.createdAt||new Date().toISOString(),finishedAt:U.finishedAt||null,input:U.toolInput||null,output:U.toolOutput||null,errorMessage:U.errorMessage||null}),_e.summary.total=_e.items.length,_e.summary.failed=_e.items.filter(ae=>ae.status==="failed").length,me().catch(()=>{})}return(q,U)=>(z(),Q("div",qT,[te("div",UT,[te("div",YT,[ge(Sv,{"user-id":r.value,"selected-chatbot-id":i.value,"chatbot-options":N.value,"chatbots-loading":h.value,"current-session-id":L.value,"creating-session":m.value,"deleting-session-id":v.value,sessions:d.value,"sessions-loading":p.value,"session-busy":b.value||k.value,"onUpdate:userId":U[0]||(U[0]=ce=>r.value=ce),"onUpdate:selectedChatbotId":U[1]||(U[1]=ce=>i.value=ce),onCreateSession:et,onDeleteSession:Je,onPrepareNewSession:Me,onSelectSession:ke,onRefreshSessions:pe},null,8,["user-id","selected-chatbot-id","chatbot-options","chatbots-loading","current-session-id","creating-session","deleting-session-id","sessions","sessions-loading","session-busy"])]),te("div",KT,[ge(se(ic),{bordered:!1,size:"small",class:"panel-card conversation-card"},{header:Ae(()=>[te("div",ZT,[te("div",null,[U[9]||(U[9]=te("div",{class:"conversation-header__title"},"对话记录",-1)),te("div",GT,[te("span",null,"当前会话："+$e(o.value?.sessionId||"-"),1),te("span",null,"当前机器人："+$e(K.value),1),te("span",null,"消息数："+$e(a.value.length),1)])]),ge(se(Xe),{tertiary:"",disabled:!L.value,loading:g.value||y.value,onClick:bt},{default:Ae(()=>[...U[10]||(U[10]=[ot(" 刷新历史 ",-1)])]),_:1},8,["disabled","loading"])])]),footer:Ae(()=>[H.value?(z(),Ie(Dv,{key:0,loading:_.value,onUndo:lt},null,8,["loading"])):Ue("",!0),I.value?(z(),Ie(IT,{key:1,approval:I.value,"action-loading":k.value,onApprove:U[2]||(U[2]=ce=>Pt("approve")),onReject:U[3]||(U[3]=ce=>Pt("reject")),onViewDetail:U[4]||(U[4]=ce=>f.value=!0)},null,8,["approval","action-loading"])):Ue("",!0),ge(ty,{modelValue:s.value,"onUpdate:modelValue":U[5]||(U[5]=ce=>s.value=ce),"current-session-id":L.value,"can-send":Z.value,"context-reset-pending":H.value,"can-toggle-context-reset":re.value,"context-reset-loading":_.value,sending:b.value||k.value,onMarkContextReset:vt,onClearContextReset:lt,onSend:nt},null,8,["modelValue","current-session-id","can-send","context-reset-pending","can-toggle-context-reset","context-reset-loading","sending"])]),default:Ae(()=>[ge(AT,{ref_key:"messageListRef",ref:S,items:ne.value,"messages-loading":g.value},null,8,["items","messages-loading"])]),_:1})])]),ge(WT,{show:f.value,"onUpdate:show":U[6]||(U[6]=ce=>f.value=ce),approval:I.value,"action-loading":k.value,"agent-fields":T.value,"fields-loading":x.value,onApprove:U[7]||(U[7]=ce=>Pt("approve",ce)),onReject:U[8]||(U[8]=ce=>Pt("reject"))},null,8,["show","approval","action-loading","agent-fields","fields-loading"])]))}}),QT=gn(XT,[["__scopeId","data-v-4ceeff9a"]]),gD=Object.freeze(Object.defineProperty({__proto__:null,default:QT},Symbol.toStringTag,{value:"Module"}));export{k5 as $,yr as C,oD as E,Pc as I,fD as J,pD as L,mD as M,Jp as N,sD as R,Kl as T,b5 as W,uD as _,ml as a,aD as b,Us as c,it as d,J5 as e,Vp as f,dD as g,gD as h,hD as i,lD as p,Kp as x,cD as z};
