@gientech/modual 1.9.4-fix.3 → 1.9.4-fix.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +643 -643
  2. package/assets/{GientechStreamReader-9YdiPc7N.js → GientechStreamReader-DwQ4OUPO.js} +57 -57
  3. package/assets/database.svg +11 -11
  4. package/assets/database_add.svg +53 -53
  5. package/assets/database_connect.svg +66 -66
  6. package/assets/database_upload.svg +29 -29
  7. package/assets/databse.svg +6 -6
  8. package/assets/defaultWeLogo.svg +14 -14
  9. package/assets/graph.svg +4 -4
  10. package/assets/index-BGq5I3Zn.js +2257 -0
  11. package/assets/{index-DdVFXD_y.js → index-BVDU9PrK.js} +1 -1
  12. package/assets/{index-j0kQJd0a.js → index-ByvRmu2a.js} +1 -1
  13. package/assets/{index-CF21Mbsz.js → index-CBnj-8YZ.js} +1 -1
  14. package/assets/index-CfbTJRNC.js +285 -0
  15. package/assets/{index-R8HnY_Ab.js → index-CtR7JL1j.js} +1 -1
  16. package/assets/{index-DwoTKC3G.js → index-D8mrZqFQ.js} +1 -1
  17. package/assets/{index-BKe5FgcC.js → index-DZ_BW6Hp.js} +1 -1
  18. package/assets/{index-D72cKELw.js → index-UHqCy9nm.js} +1 -1
  19. package/assets/{index-x8IlxRuv.js → index-cZm_IH3D.js} +1 -1
  20. package/assets/knowledge.svg +4 -4
  21. package/assets/mysql.svg +14 -14
  22. package/assets/{plus-V9zUoSq6.js → plus-Dmqa3k_O.js} +1 -1
  23. package/assets/sensitive.svg +5 -5
  24. package/assets/style-BSpDpc7m.js +16 -0
  25. package/assets/style.css +1 -1
  26. package/assets/{x-CnaaLGJF.js → x-B2JeGn6d.js} +1 -1
  27. package/assistantConfig.js +1 -1
  28. package/chat.js +11 -11
  29. package/database.js +2 -2
  30. package/databaseId.js +1 -1
  31. package/databaseTable.js +1 -1
  32. package/index.js +1 -1
  33. package/modelManage.js +1 -1
  34. package/package.json +6 -6
  35. package/sensitive.js +1 -1
  36. package/streamFilesReader.js +1 -1
  37. package/worker/pdf.worker.min.js +21 -21
  38. package/assets/index-g-SUxfJH.js +0 -280
  39. package/assets/index-h59-yboB.js +0 -1393
  40. package/assets/style-CGmZ5osp.js +0 -21
@@ -0,0 +1,2257 @@
1
+ import*as D from"react";import We,{useState as Ht,useCallback as zt,useImperativeHandle as nc,forwardRef as _o,useMemo as At,useRef as Vt,createContext as xo,useContext as jo,useEffect as sr,createElement as As,useLayoutEffect as z4,useReducer as _4,Component as j4,memo as L4}from"react";import a0,{flushSync as H4,unstable_batchedUpdates as K4,createPortal as q4}from"react-dom";import{R as Lm,I as ao}from"./index-cZm_IH3D.js";import{aS as Rn,bH as V4,aB as Hm,M as qr,V as Km,bN as oc,bO as Bs,y as kr,H as Dt,f as ft,aR as qm,A as Et,L as Me,bP as ac,bQ as Io,J as Ve,_ as Gt,aU as Vm,a5 as bo,G as io,z as Wm,aC as wo,bA as Um,bB as Xm,aX as Gm,aW as Ym,aY as ai,t as tl,p as ic,ad as $n,ac as sn,l as Co,o as Ca,T as Fs,bR as W4,X as U4,k as rt,af as Zm,bj as sc,g as Bi,m as Jo,bF as Jm,bd as Ts,$ as lc,aJ as i0,r as Fi,b7 as kn,bS as X4,W as rl,aq as Un,as as Ti,bI as Qm,bg as G4,bf as Y4,bi as Z4,bh as J4,a0 as Q4,be as gf,U as vf,a3 as ev,a2 as tv,ax as nl,am as uc,bT as rv,Y as nv,bs as ov,bn as av,B as $s,P as iv,aG as sv,bU as lv,bD as uv,ay as cv,Z as Ns,u as dv,an as fv,bG as hv,N as Ro,bV as cc,aV as dc,bW as bf,bX as fc,bY as yf,bZ as xf,E as Os,b_ as e1,a9 as Ms,b$ as pv,bC as or,c0 as mv,K as gv,at as vv,a_ as bv,c1 as yv,c2 as xv,v as t1,bL as wf,c3 as wv,w as Cv,aN as Dv,s as kv,D as Ev,aK as Sv,c as ol}from"./index-CfbTJRNC.js";import{R as Is,a as Rs,S as r1,P as n1}from"./index-DZ_BW6Hp.js";import{S as Av}from"./index-ByvRmu2a.js";function s0(e){return e!=null&&e===e.window}const Bv=e=>{var t,r;if(typeof window>"u")return 0;let n=0;return s0(e)?n=e.pageYOffset:e instanceof Document?n=e.documentElement.scrollTop:(e instanceof HTMLElement||e)&&(n=e.scrollTop),e&&!s0(e)&&typeof n!="number"&&(n=(r=((t=e.ownerDocument)!==null&&t!==void 0?t:e).documentElement)===null||r===void 0?void 0:r.scrollTop),n};function Fv(e,t,r,n){const o=r-t;return e/=n/2,e<1?o/2*e*e*e+t:o/2*((e-=2)*e*e+2)+t}function Tv(e,t={}){const{getContainer:r=()=>window,callback:n,duration:o=450}=t,a=r(),l=Bv(a),u=Date.now(),f=()=>{const m=Date.now()-u,g=Fv(m>o?o:m,l,e,o);s0(a)?a.scrollTo(window.pageXOffset,g):a instanceof Document||a.constructor.name==="HTMLDocument"?a.documentElement.scrollTop=g:a.scrollTop=g,m<o?Rn(f):typeof n=="function"&&n()};Rn(f)}const $v=e=>{const[t,r]=Ht(null);return[zt((o,a,l)=>{const u=t??o,f=Math.min(u||0,o),d=Math.max(u||0,o),m=a.slice(f,d+1).map(e),g=m.some(y=>!l.has(y)),v=[];return m.forEach(y=>{g?(l.has(y)||v.push(y),l.add(y)):(l.delete(y),v.push(y))}),r(g?d:null),v},[t]),r]};function Nv(e,t){return e._antProxy=e._antProxy||{},Object.keys(t).forEach(r=>{if(!(r in e._antProxy)){const n=e[r];e._antProxy[r]=n,e[r]=t[r]}}),e}const Ov=(e,t)=>nc(e,()=>{const r=t(),{nativeElement:n}=r;return typeof Proxy<"u"?new Proxy(n,{get(o,a){return r[a]?r[a]:Reflect.get(o,a)}}):Nv(n,r)}),Mv=e=>{const t=D.useRef(e),[,r]=V4();return[()=>t.current,n=>{t.current=n,r()}]};var o1=function(t){if(Hm()&&window.document.documentElement){var r=Array.isArray(t)?t:[t],n=window.document.documentElement;return r.some(function(o){return o in n.style})}return!1},Iv=function(t,r){if(!o1(t))return!1;var n=document.createElement("div"),o=n.style[t];return n.style[t]=r,n.style[t]!==o};function Rv(e,t){return!Array.isArray(e)&&t!==void 0?Iv(e,t):o1(e)}var Pv=qr.ESC,zv=qr.TAB;function _v(e){var t=e.visible,r=e.triggerRef,n=e.onVisibleChange,o=e.autoFocus,a=e.overlayRef,l=D.useRef(!1),u=function(){if(t){var g,v;(g=r.current)===null||g===void 0||(v=g.focus)===null||v===void 0||v.call(g),n==null||n(!1)}},f=function(){var g;return(g=a.current)!==null&&g!==void 0&&g.focus?(a.current.focus(),l.current=!0,!0):!1},d=function(g){switch(g.keyCode){case Pv:u();break;case zv:{var v=!1;l.current||(v=f()),v?g.preventDefault():u();break}}};D.useEffect(function(){return t?(window.addEventListener("keydown",d),o&&Rn(f,3),function(){window.removeEventListener("keydown",d),l.current=!1}):function(){l.current=!1}},[t])}var jv=_o(function(e,t){var r=e.overlay,n=e.arrow,o=e.prefixCls,a=At(function(){var u;return typeof r=="function"?u=r():u=r,u},[r]),l=Km(t,oc(a));return We.createElement(We.Fragment,null,n&&We.createElement("div",{className:"".concat(o,"-arrow")}),We.cloneElement(a,{ref:Bs(a)?l:void 0}))}),sa={adjustX:1,adjustY:1},la=[0,0],Lv={topLeft:{points:["bl","tl"],overflow:sa,offset:[0,-4],targetOffset:la},top:{points:["bc","tc"],overflow:sa,offset:[0,-4],targetOffset:la},topRight:{points:["br","tr"],overflow:sa,offset:[0,-4],targetOffset:la},bottomLeft:{points:["tl","bl"],overflow:sa,offset:[0,4],targetOffset:la},bottom:{points:["tc","bc"],overflow:sa,offset:[0,4],targetOffset:la},bottomRight:{points:["tr","br"],overflow:sa,offset:[0,4],targetOffset:la}},Hv=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function Kv(e,t){var r,n=e.arrow,o=n===void 0?!1:n,a=e.prefixCls,l=a===void 0?"rc-dropdown":a,u=e.transitionName,f=e.animation,d=e.align,m=e.placement,g=m===void 0?"bottomLeft":m,v=e.placements,y=v===void 0?Lv:v,b=e.getPopupContainer,C=e.showAction,p=e.hideAction,S=e.overlayClassName,B=e.overlayStyle,k=e.visible,$=e.trigger,T=$===void 0?["hover"]:$,O=e.autoFocus,F=e.overlay,P=e.children,N=e.onVisibleChange,q=kr(e,Hv),R=We.useState(),X=Dt(R,2),G=X[0],_=X[1],j="visible"in e?k:G,W=We.useRef(null),U=We.useRef(null),ee=We.useRef(null);We.useImperativeHandle(t,function(){return W.current});var V=function(le){_(le),N==null||N(le)};_v({visible:j,triggerRef:ee,onVisibleChange:V,autoFocus:O,overlayRef:U});var Y=function(le){var ue=e.onOverlayClick;_(!1),ue&&ue(le)},fe=function(){return We.createElement(jv,{ref:U,overlay:F,prefixCls:l,arrow:o})},be=function(){return typeof F=="function"?fe:fe()},he=function(){var le=e.minOverlayWidthMatchTrigger,ue=e.alignPoint;return"minOverlayWidthMatchTrigger"in e?le:!ue},De=function(){var le=e.openClassName;return le!==void 0?le:"".concat(l,"-open")},$e=We.cloneElement(P,{className:ft((r=P.props)===null||r===void 0?void 0:r.className,j&&De()),ref:Bs(P)?Km(ee,oc(P)):void 0}),Z=p;return!Z&&T.indexOf("contextMenu")!==-1&&(Z=["click"]),We.createElement(qm,Et({builtinPlacements:y},q,{prefixCls:l,ref:W,popupClassName:ft(S,Me({},"".concat(l,"-show-arrow"),o)),popupStyle:B,action:T,showAction:C,hideAction:Z,popupPlacement:g,popupAlign:d,popupTransitionName:u,popupAnimation:f,popupVisible:j,stretch:he()?"minWidth":"",popup:be(),onPopupVisibleChange:V,onPopupClick:Y,getPopupContainer:b}),$e)}const qv=We.forwardRef(Kv),Vv=e=>typeof e!="object"&&typeof e!="function"||e===null;var a1=D.createContext(null);function i1(e,t){return e===void 0?null:"".concat(e,"-").concat(t)}function s1(e){var t=D.useContext(a1);return i1(t,e)}var Wv=["children","locked"],Xn=D.createContext(null);function Uv(e,t){var r=Ve({},e);return Object.keys(t).forEach(function(n){var o=t[n];o!==void 0&&(r[n]=o)}),r}function pi(e){var t=e.children,r=e.locked,n=kr(e,Wv),o=D.useContext(Xn),a=ac(function(){return Uv(o,n)},[o,n],function(l,u){return!r&&(l[0]!==u[0]||!Io(l[1],u[1],!0))});return D.createElement(Xn.Provider,{value:a},t)}var Xv=[],l1=D.createContext(null);function al(){return D.useContext(l1)}var u1=D.createContext(Xv);function $a(e){var t=D.useContext(u1);return D.useMemo(function(){return e!==void 0?[].concat(Gt(t),[e]):t},[t,e])}var c1=D.createContext(null),hc=D.createContext({});function Cf(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Vm(e)){var r=e.nodeName.toLowerCase(),n=["input","select","textarea","button"].includes(r)||e.isContentEditable||r==="a"&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),a=Number(o),l=null;return o&&!Number.isNaN(a)?l=a:n&&l===null&&(l=0),n&&e.disabled&&(l=null),l!==null&&(l>=0||t&&l<0)}return!1}function Gv(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=Gt(e.querySelectorAll("*")).filter(function(n){return Cf(n,t)});return Cf(e,t)&&r.unshift(e),r}var l0=qr.LEFT,u0=qr.RIGHT,c0=qr.UP,ds=qr.DOWN,fs=qr.ENTER,d1=qr.ESC,Ka=qr.HOME,qa=qr.END,Df=[c0,ds,l0,u0];function Yv(e,t,r,n){var o,a="prev",l="next",u="children",f="parent";if(e==="inline"&&n===fs)return{inlineTrigger:!0};var d=Me(Me({},c0,a),ds,l),m=Me(Me(Me(Me({},l0,r?l:a),u0,r?a:l),ds,u),fs,u),g=Me(Me(Me(Me(Me(Me({},c0,a),ds,l),fs,u),d1,f),l0,r?u:f),u0,r?f:u),v={inline:d,horizontal:m,vertical:g,inlineSub:d,horizontalSub:g,verticalSub:g},y=(o=v["".concat(e).concat(t?"":"Sub")])===null||o===void 0?void 0:o[n];switch(y){case a:return{offset:-1,sibling:!0};case l:return{offset:1,sibling:!0};case f:return{offset:-1,sibling:!1};case u:return{offset:1,sibling:!1};default:return null}}function Zv(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}function Jv(e,t){for(var r=e||document.activeElement;r;){if(t.has(r))return r;r=r.parentElement}return null}function pc(e,t){var r=Gv(e,!0);return r.filter(function(n){return t.has(n)})}function kf(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!e)return null;var o=pc(e,t),a=o.length,l=o.findIndex(function(u){return r===u});return n<0?l===-1?l=a-1:l-=1:n>0&&(l+=1),l=(l+a)%a,o[l]}var d0=function(t,r){var n=new Set,o=new Map,a=new Map;return t.forEach(function(l){var u=document.querySelector("[data-menu-id='".concat(i1(r,l),"']"));u&&(n.add(u),a.set(u,l),o.set(l,u))}),{elements:n,key2element:o,element2key:a}};function Qv(e,t,r,n,o,a,l,u,f,d){var m=D.useRef(),g=D.useRef();g.current=t;var v=function(){Rn.cancel(m.current)};return D.useEffect(function(){return function(){v()}},[]),function(y){var b=y.which;if([].concat(Df,[fs,d1,Ka,qa]).includes(b)){var C=a(),p=d0(C,n),S=p,B=S.elements,k=S.key2element,$=S.element2key,T=k.get(t),O=Jv(T,B),F=$.get(O),P=Yv(e,l(F,!0).length===1,r,b);if(!P&&b!==Ka&&b!==qa)return;(Df.includes(b)||[Ka,qa].includes(b))&&y.preventDefault();var N=function(U){if(U){var ee=U,V=U.querySelector("a");V!=null&&V.getAttribute("href")&&(ee=V);var Y=$.get(U);u(Y),v(),m.current=Rn(function(){g.current===Y&&ee.focus()})}};if([Ka,qa].includes(b)||P.sibling||!O){var q;!O||e==="inline"?q=o.current:q=Zv(O);var R,X=pc(q,B);b===Ka?R=X[0]:b===qa?R=X[X.length-1]:R=kf(q,B,O,P.offset),N(R)}else if(P.inlineTrigger)f(F);else if(P.offset>0)f(F,!0),v(),m.current=Rn(function(){p=d0(C,n);var W=O.getAttribute("aria-controls"),U=document.getElementById(W),ee=kf(U,p.elements);N(ee)},5);else if(P.offset<0){var G=l(F,!0),_=G[G.length-2],j=k.get(_);f(_,!1),N(j)}}d==null||d(y)}}function e3(e){Promise.resolve().then(e)}var mc="__RC_UTIL_PATH_SPLIT__",Ef=function(t){return t.join(mc)},t3=function(t){return t.split(mc)},f0="rc-menu-more";function r3(){var e=D.useState({}),t=Dt(e,2),r=t[1],n=Vt(new Map),o=Vt(new Map),a=D.useState([]),l=Dt(a,2),u=l[0],f=l[1],d=Vt(0),m=Vt(!1),g=function(){m.current||r({})},v=zt(function(k,$){var T=Ef($);o.current.set(T,k),n.current.set(k,T),d.current+=1;var O=d.current;e3(function(){O===d.current&&g()})},[]),y=zt(function(k,$){var T=Ef($);o.current.delete(T),n.current.delete(k)},[]),b=zt(function(k){f(k)},[]),C=zt(function(k,$){var T=n.current.get(k)||"",O=t3(T);return $&&u.includes(O[0])&&O.unshift(f0),O},[u]),p=zt(function(k,$){return k.filter(function(T){return T!==void 0}).some(function(T){var O=C(T,!0);return O.includes($)})},[C]),S=function(){var $=Gt(n.current.keys());return u.length&&$.push(f0),$},B=zt(function(k){var $="".concat(n.current.get(k)).concat(mc),T=new Set;return Gt(o.current.keys()).forEach(function(O){O.startsWith($)&&T.add(o.current.get(O))}),T},[]);return D.useEffect(function(){return function(){m.current=!0}},[]),{registerPath:v,unregisterPath:y,refreshOverflowKeys:b,isSubPathKey:p,getKeyPath:C,getKeys:S,getSubPathKeys:B}}function ei(e){var t=D.useRef(e);t.current=e;var r=D.useCallback(function(){for(var n,o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return(n=t.current)===null||n===void 0?void 0:n.call.apply(n,[t].concat(a))},[]);return e?r:void 0}var n3=Math.random().toFixed(5).toString().slice(2),Sf=0;function o3(e){var t=bo(e,{value:e}),r=Dt(t,2),n=r[0],o=r[1];return D.useEffect(function(){Sf+=1;var a="".concat(n3,"-").concat(Sf);o("rc-menu-uuid-".concat(a))},[]),n}function f1(e,t,r,n){var o=D.useContext(Xn),a=o.activeKey,l=o.onActive,u=o.onInactive,f={active:a===e};return t||(f.onMouseEnter=function(d){r==null||r({key:e,domEvent:d}),l(e)},f.onMouseLeave=function(d){n==null||n({key:e,domEvent:d}),u(e)}),f}function h1(e){var t=D.useContext(Xn),r=t.mode,n=t.rtl,o=t.inlineIndent;if(r!=="inline")return null;var a=e;return n?{paddingRight:a*o}:{paddingLeft:a*o}}function p1(e){var t=e.icon,r=e.props,n=e.children,o;return t===null||t===!1?null:(typeof t=="function"?o=D.createElement(t,Ve({},r)):typeof t!="boolean"&&(o=t),o||n||null)}var a3=["item"];function Ps(e){var t=e.item,r=kr(e,a3);return Object.defineProperty(r,"item",{get:function(){return io(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),t}}),r}var i3=["title","attribute","elementRef"],s3=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],l3=["active"],u3=(function(e){Um(r,e);var t=Xm(r);function r(){return Gm(this,r),t.apply(this,arguments)}return Ym(r,[{key:"render",value:function(){var o=this.props,a=o.title,l=o.attribute,u=o.elementRef,f=kr(o,i3),d=wo(f,["eventKey","popupClassName","popupOffset","onTitleClick"]);return io(!l,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),D.createElement(ai.Item,Et({},l,{title:typeof a=="string"?a:void 0},d,{ref:u}))}}]),r})(D.Component),c3=D.forwardRef(function(e,t){var r=e.style,n=e.className,o=e.eventKey;e.warnKey;var a=e.disabled,l=e.itemIcon,u=e.children,f=e.role,d=e.onMouseEnter,m=e.onMouseLeave,g=e.onClick,v=e.onKeyDown,y=e.onFocus,b=kr(e,s3),C=s1(o),p=D.useContext(Xn),S=p.prefixCls,B=p.onItemClick,k=p.disabled,$=p.overflowDisabled,T=p.itemIcon,O=p.selectedKeys,F=p.onActive,P=D.useContext(hc),N=P._internalRenderMenuItem,q="".concat(S,"-item"),R=D.useRef(),X=D.useRef(),G=k||a,_=Wm(t,X),j=$a(o),W=function(ue){return{key:o,keyPath:Gt(j).reverse(),item:R.current,domEvent:ue}},U=l||T,ee=f1(o,G,d,m),V=ee.active,Y=kr(ee,l3),fe=O.includes(o),be=h1(j.length),he=function(ue){if(!G){var Se=W(ue);g==null||g(Ps(Se)),B(Se)}},De=function(ue){if(v==null||v(ue),ue.which===qr.ENTER){var Se=W(ue);g==null||g(Ps(Se)),B(Se)}},$e=function(ue){F(o),y==null||y(ue)},Z={};e.role==="option"&&(Z["aria-selected"]=fe);var ie=D.createElement(u3,Et({ref:R,elementRef:_,role:f===null?"none":f||"menuitem",tabIndex:a?null:-1,"data-menu-id":$&&C?null:C},wo(b,["extra"]),Y,Z,{component:"li","aria-disabled":a,style:Ve(Ve({},be),r),className:ft(q,Me(Me(Me({},"".concat(q,"-active"),V),"".concat(q,"-selected"),fe),"".concat(q,"-disabled"),G),n),onClick:he,onKeyDown:De,onFocus:$e}),u,D.createElement(p1,{props:Ve(Ve({},e),{},{isSelected:fe}),icon:U}));return N&&(ie=N(ie,e,{selected:fe})),ie});function d3(e,t){var r=e.eventKey,n=al(),o=$a(r);return D.useEffect(function(){if(n)return n.registerPath(r,o),function(){n.unregisterPath(r,o)}},[o]),n?null:D.createElement(c3,Et({},e,{ref:t}))}const il=D.forwardRef(d3);var f3=["className","children"],h3=function(t,r){var n=t.className,o=t.children,a=kr(t,f3),l=D.useContext(Xn),u=l.prefixCls,f=l.mode,d=l.rtl;return D.createElement("ul",Et({className:ft(u,d&&"".concat(u,"-rtl"),"".concat(u,"-sub"),"".concat(u,"-").concat(f==="inline"?"inline":"vertical"),n),role:"menu"},a,{"data-menu-list":!0,ref:r}),o)},gc=D.forwardRef(h3);gc.displayName="SubMenuList";function vc(e,t){return tl(e).map(function(r,n){if(D.isValidElement(r)){var o,a,l=r.key,u=(o=(a=r.props)===null||a===void 0?void 0:a.eventKey)!==null&&o!==void 0?o:l,f=u==null;f&&(u="tmp_key-".concat([].concat(Gt(t),[n]).join("-")));var d={key:u,eventKey:u};return D.cloneElement(r,d)}return r})}var on={adjustX:1,adjustY:1},p3={topLeft:{points:["bl","tl"],overflow:on},topRight:{points:["br","tr"],overflow:on},bottomLeft:{points:["tl","bl"],overflow:on},bottomRight:{points:["tr","br"],overflow:on},leftTop:{points:["tr","tl"],overflow:on},leftBottom:{points:["br","bl"],overflow:on},rightTop:{points:["tl","tr"],overflow:on},rightBottom:{points:["bl","br"],overflow:on}},m3={topLeft:{points:["bl","tl"],overflow:on},topRight:{points:["br","tr"],overflow:on},bottomLeft:{points:["tl","bl"],overflow:on},bottomRight:{points:["tr","br"],overflow:on},rightTop:{points:["tr","tl"],overflow:on},rightBottom:{points:["br","bl"],overflow:on},leftTop:{points:["tl","tr"],overflow:on},leftBottom:{points:["bl","br"],overflow:on}};function m1(e,t,r){if(t)return t;if(r)return r[e]||r.other}var g3={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function v3(e){var t=e.prefixCls,r=e.visible,n=e.children,o=e.popup,a=e.popupStyle,l=e.popupClassName,u=e.popupOffset,f=e.disabled,d=e.mode,m=e.onVisibleChange,g=D.useContext(Xn),v=g.getPopupContainer,y=g.rtl,b=g.subMenuOpenDelay,C=g.subMenuCloseDelay,p=g.builtinPlacements,S=g.triggerSubMenuAction,B=g.forceSubMenuRender,k=g.rootClassName,$=g.motion,T=g.defaultMotions,O=D.useState(!1),F=Dt(O,2),P=F[0],N=F[1],q=y?Ve(Ve({},m3),p):Ve(Ve({},p3),p),R=g3[d],X=m1(d,$,T),G=D.useRef(X);d!=="inline"&&(G.current=X);var _=Ve(Ve({},G.current),{},{leavedClassName:"".concat(t,"-hidden"),removeOnLeave:!1,motionAppear:!0}),j=D.useRef();return D.useEffect(function(){return j.current=Rn(function(){N(r)}),function(){Rn.cancel(j.current)}},[r]),D.createElement(qm,{prefixCls:t,popupClassName:ft("".concat(t,"-popup"),Me({},"".concat(t,"-rtl"),y),l,k),stretch:d==="horizontal"?"minWidth":null,getPopupContainer:v,builtinPlacements:q,popupPlacement:R,popupVisible:P,popup:o,popupStyle:a,popupAlign:u&&{offset:u},action:f?[]:[S],mouseEnterDelay:b,mouseLeaveDelay:C,onPopupVisibleChange:m,forceRender:B,popupMotion:_,fresh:!0},n)}function b3(e){var t=e.id,r=e.open,n=e.keyPath,o=e.children,a="inline",l=D.useContext(Xn),u=l.prefixCls,f=l.forceSubMenuRender,d=l.motion,m=l.defaultMotions,g=l.mode,v=D.useRef(!1);v.current=g===a;var y=D.useState(!v.current),b=Dt(y,2),C=b[0],p=b[1],S=v.current?r:!1;D.useEffect(function(){v.current&&p(!1)},[g]);var B=Ve({},m1(a,d,m));n.length>1&&(B.motionAppear=!1);var k=B.onVisibleChanged;return B.onVisibleChanged=function($){return!v.current&&!$&&p(!0),k==null?void 0:k($)},C?null:D.createElement(pi,{mode:a,locked:!v.current},D.createElement(ic,Et({visible:S},B,{forceRender:f,removeOnLeave:!1,leavedClassName:"".concat(u,"-hidden")}),function($){var T=$.className,O=$.style;return D.createElement(gc,{id:t,className:T,style:O},o)}))}var y3=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],x3=["active"],w3=D.forwardRef(function(e,t){var r=e.style,n=e.className,o=e.title,a=e.eventKey;e.warnKey;var l=e.disabled,u=e.internalPopupClose,f=e.children,d=e.itemIcon,m=e.expandIcon,g=e.popupClassName,v=e.popupOffset,y=e.popupStyle,b=e.onClick,C=e.onMouseEnter,p=e.onMouseLeave,S=e.onTitleClick,B=e.onTitleMouseEnter,k=e.onTitleMouseLeave,$=kr(e,y3),T=s1(a),O=D.useContext(Xn),F=O.prefixCls,P=O.mode,N=O.openKeys,q=O.disabled,R=O.overflowDisabled,X=O.activeKey,G=O.selectedKeys,_=O.itemIcon,j=O.expandIcon,W=O.onItemClick,U=O.onOpenChange,ee=O.onActive,V=D.useContext(hc),Y=V._internalRenderSubMenuItem,fe=D.useContext(c1),be=fe.isSubPathKey,he=$a(),De="".concat(F,"-submenu"),$e=q||l,Z=D.useRef(),ie=D.useRef(),le=d??_,ue=m??j,Se=N.includes(a),Be=!R&&Se,ge=be(G,a),Ee=f1(a,$e,B,k),Ae=Ee.active,Fe=kr(Ee,x3),xe=D.useState(!1),Ce=Dt(xe,2),_e=Ce[0],ht=Ce[1],ot=function(yt){$e||ht(yt)},Ie=function(yt){ot(!0),C==null||C({key:a,domEvent:yt})},Ke=function(yt){ot(!1),p==null||p({key:a,domEvent:yt})},Ue=D.useMemo(function(){return Ae||(P!=="inline"?_e||be([X],a):!1)},[P,Ae,X,_e,a,be]),vt=h1(he.length),tt=function(yt){$e||(S==null||S({key:a,domEvent:yt}),P==="inline"&&U(a,!Se))},nt=ei(function(Ft){b==null||b(Ps(Ft)),W(Ft)}),It=function(yt){P!=="inline"&&U(a,yt)},$t=function(){ee(a)},Bt=T&&"".concat(T,"-popup"),Mt=D.useMemo(function(){return D.createElement(p1,{icon:P!=="horizontal"?ue:void 0,props:Ve(Ve({},e),{},{isOpen:Be,isSubMenu:!0})},D.createElement("i",{className:"".concat(De,"-arrow")}))},[P,ue,e,Be,De]),je=D.createElement("div",Et({role:"menuitem",style:vt,className:"".concat(De,"-title"),tabIndex:$e?null:-1,ref:Z,title:typeof o=="string"?o:null,"data-menu-id":R&&T?null:T,"aria-expanded":Be,"aria-haspopup":!0,"aria-controls":Bt,"aria-disabled":$e,onClick:tt,onFocus:$t},Fe),o,Mt),pe=D.useRef(P);if(P!=="inline"&&he.length>1?pe.current="vertical":pe.current=P,!R){var it=pe.current;je=D.createElement(v3,{mode:it,prefixCls:De,visible:!u&&Be&&P!=="inline",popupClassName:g,popupOffset:v,popupStyle:y,popup:D.createElement(pi,{mode:it==="horizontal"?"vertical":it},D.createElement(gc,{id:Bt,ref:ie},f)),disabled:$e,onVisibleChange:It},je)}var Nt=D.createElement(ai.Item,Et({ref:t,role:"none"},$,{component:"li",style:r,className:ft(De,"".concat(De,"-").concat(P),n,Me(Me(Me(Me({},"".concat(De,"-open"),Be),"".concat(De,"-active"),Ue),"".concat(De,"-selected"),ge),"".concat(De,"-disabled"),$e)),onMouseEnter:Ie,onMouseLeave:Ke}),je,!R&&D.createElement(b3,{id:Bt,open:Be,keyPath:he},f));return Y&&(Nt=Y(Nt,e,{selected:ge,active:Ue,open:Be,disabled:$e})),D.createElement(pi,{onItemClick:nt,mode:P==="horizontal"?"vertical":P,itemIcon:le,expandIcon:ue},Nt)}),sl=D.forwardRef(function(e,t){var r=e.eventKey,n=e.children,o=$a(r),a=vc(n,o),l=al();D.useEffect(function(){if(l)return l.registerPath(r,o),function(){l.unregisterPath(r,o)}},[o]);var u;return l?u=a:u=D.createElement(w3,Et({ref:t},e),a),D.createElement(u1.Provider,{value:o},u)});function bc(e){var t=e.className,r=e.style,n=D.useContext(Xn),o=n.prefixCls,a=al();return a?null:D.createElement("li",{role:"separator",className:ft("".concat(o,"-item-divider"),t),style:r})}var C3=["className","title","eventKey","children"],D3=D.forwardRef(function(e,t){var r=e.className,n=e.title;e.eventKey;var o=e.children,a=kr(e,C3),l=D.useContext(Xn),u=l.prefixCls,f="".concat(u,"-item-group");return D.createElement("li",Et({ref:t,role:"presentation"},a,{onClick:function(m){return m.stopPropagation()},className:ft(f,r)}),D.createElement("div",{role:"presentation",className:"".concat(f,"-title"),title:typeof n=="string"?n:void 0},n),D.createElement("ul",{role:"group",className:"".concat(f,"-list")},o))}),yc=D.forwardRef(function(e,t){var r=e.eventKey,n=e.children,o=$a(r),a=vc(n,o),l=al();return l?a:D.createElement(D3,Et({ref:t},wo(e,["warnKey"])),a)}),k3=["label","children","key","type","extra"];function h0(e,t,r){var n=t.item,o=t.group,a=t.submenu,l=t.divider;return(e||[]).map(function(u,f){if(u&&$n(u)==="object"){var d=u,m=d.label,g=d.children,v=d.key,y=d.type,b=d.extra,C=kr(d,k3),p=v??"tmp-".concat(f);return g||y==="group"?y==="group"?D.createElement(o,Et({key:p},C,{title:m}),h0(g,t,r)):D.createElement(a,Et({key:p},C,{title:m}),h0(g,t,r)):y==="divider"?D.createElement(l,Et({key:p},C)):D.createElement(n,Et({key:p},C,{extra:b}),m,(!!b||b===0)&&D.createElement("span",{className:"".concat(r,"-item-extra")},b))}return null}).filter(function(u){return u})}function Af(e,t,r,n,o){var a=e,l=Ve({divider:bc,item:il,group:yc,submenu:sl},n);return t&&(a=h0(t,l,o)),vc(a,r)}var E3=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],Ho=[],S3=D.forwardRef(function(e,t){var r,n=e,o=n.prefixCls,a=o===void 0?"rc-menu":o,l=n.rootClassName,u=n.style,f=n.className,d=n.tabIndex,m=d===void 0?0:d,g=n.items,v=n.children,y=n.direction,b=n.id,C=n.mode,p=C===void 0?"vertical":C,S=n.inlineCollapsed,B=n.disabled,k=n.disabledOverflow,$=n.subMenuOpenDelay,T=$===void 0?.1:$,O=n.subMenuCloseDelay,F=O===void 0?.1:O,P=n.forceSubMenuRender,N=n.defaultOpenKeys,q=n.openKeys,R=n.activeKey,X=n.defaultActiveFirst,G=n.selectable,_=G===void 0?!0:G,j=n.multiple,W=j===void 0?!1:j,U=n.defaultSelectedKeys,ee=n.selectedKeys,V=n.onSelect,Y=n.onDeselect,fe=n.inlineIndent,be=fe===void 0?24:fe,he=n.motion,De=n.defaultMotions,$e=n.triggerSubMenuAction,Z=$e===void 0?"hover":$e,ie=n.builtinPlacements,le=n.itemIcon,ue=n.expandIcon,Se=n.overflowedIndicator,Be=Se===void 0?"...":Se,ge=n.overflowedIndicatorPopupClassName,Ee=n.getPopupContainer,Ae=n.onClick,Fe=n.onOpenChange,xe=n.onKeyDown;n.openAnimation,n.openTransitionName;var Ce=n._internalRenderMenuItem,_e=n._internalRenderSubMenuItem,ht=n._internalComponents,ot=kr(n,E3),Ie=D.useMemo(function(){return[Af(v,g,Ho,ht,a),Af(v,g,Ho,{},a)]},[v,g,ht]),Ke=Dt(Ie,2),Ue=Ke[0],vt=Ke[1],tt=D.useState(!1),nt=Dt(tt,2),It=nt[0],$t=nt[1],Bt=D.useRef(),Mt=o3(b),je=y==="rtl",pe=bo(N,{value:q,postState:function(He){return He||Ho}}),it=Dt(pe,2),Nt=it[0],Ft=it[1],yt=function(He){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Tt(){Ft(He),Fe==null||Fe(He)}Qe?H4(Tt):Tt()},Rt=D.useState(Nt),St=Dt(Rt,2),Kt=St[0],tr=St[1],lr=D.useRef(!1),_t=D.useMemo(function(){return(p==="inline"||p==="vertical")&&S?["vertical",S]:[p,!1]},[p,S]),Er=Dt(_t,2),Cr=Er[0],Zr=Er[1],Ut=Cr==="inline",Sr=D.useState(Cr),zr=Dt(Sr,2),cr=zr[0],ir=zr[1],Ot=D.useState(Zr),w=Dt(Ot,2),E=w[0],ze=w[1];D.useEffect(function(){ir(Cr),ze(Zr),lr.current&&(Ut?Ft(Kt):yt(Ho))},[Cr,Zr]);var I=D.useState(0),re=Dt(I,2),rr=re[0],pt=re[1],wt=rr>=Ue.length-1||cr!=="horizontal"||k;D.useEffect(function(){Ut&&tr(Nt)},[Nt]),D.useEffect(function(){return lr.current=!0,function(){lr.current=!1}},[]);var xt=r3(),st=xt.registerPath,jt=xt.unregisterPath,Jt=xt.refreshOverflowKeys,yr=xt.isSubPathKey,te=xt.getKeyPath,ne=xt.getKeys,Q=xt.getSubPathKeys,Je=D.useMemo(function(){return{registerPath:st,unregisterPath:jt}},[st,jt]),lt=D.useMemo(function(){return{isSubPathKey:yr}},[yr]);D.useEffect(function(){Jt(wt?Ho:Ue.slice(rr+1).map(function(ce){return ce.key}))},[rr,wt]);var mr=bo(R||X&&((r=Ue[0])===null||r===void 0?void 0:r.key),{value:R}),Lt=Dt(mr,2),bt=Lt[0],Mr=Lt[1],Lr=ei(function(ce){Mr(ce)}),Sn=ei(function(){Mr(void 0)});nc(t,function(){return{list:Bt.current,focus:function(He){var Qe,Tt=ne(),dt=d0(Tt,Mt),qe=dt.elements,Pt=dt.key2element,dr=dt.element2key,Vr=pc(Bt.current,qe),un=bt??(Vr[0]?dr.get(Vr[0]):(Qe=Ue.find(function(jn){return!jn.props.disabled}))===null||Qe===void 0?void 0:Qe.key),we=Pt.get(un);if(un&&we){var fr;we==null||(fr=we.focus)===null||fr===void 0||fr.call(we,He)}}}});var Fr=bo(U||[],{value:ee,postState:function(He){return Array.isArray(He)?He:He==null?Ho:[He]}}),nn=Dt(Fr,2),oe=nn[0],Te=nn[1],ct=function(He){if(_){var Qe=He.key,Tt=oe.includes(Qe),dt;W?Tt?dt=oe.filter(function(Pt){return Pt!==Qe}):dt=[].concat(Gt(oe),[Qe]):dt=[Qe],Te(dt);var qe=Ve(Ve({},He),{},{selectedKeys:dt});Tt?Y==null||Y(qe):V==null||V(qe)}!W&&Nt.length&&cr!=="inline"&&yt(Ho)},Ye=ei(function(ce){Ae==null||Ae(Ps(ce)),ct(ce)}),ae=ei(function(ce,He){var Qe=Nt.filter(function(dt){return dt!==ce});if(He)Qe.push(ce);else if(cr!=="inline"){var Tt=Q(ce);Qe=Qe.filter(function(dt){return!Tt.has(dt)})}Io(Nt,Qe,!0)||yt(Qe,!0)}),Re=function(He,Qe){var Tt=Qe??!Nt.includes(He);ae(He,Tt)},Pe=Qv(cr,bt,je,Mt,Bt,ne,te,Mr,Re,xe);D.useEffect(function(){$t(!0)},[]);var ut=D.useMemo(function(){return{_internalRenderMenuItem:Ce,_internalRenderSubMenuItem:_e}},[Ce,_e]),ve=cr!=="horizontal"||k?Ue:Ue.map(function(ce,He){return D.createElement(pi,{key:ce.key,overflowDisabled:He>rr},ce)}),me=D.createElement(ai,Et({id:b,ref:Bt,prefixCls:"".concat(a,"-overflow"),component:"ul",itemComponent:il,className:ft(a,"".concat(a,"-root"),"".concat(a,"-").concat(cr),f,Me(Me({},"".concat(a,"-inline-collapsed"),E),"".concat(a,"-rtl"),je),l),dir:y,style:u,role:"menu",tabIndex:m,data:ve,renderRawItem:function(He){return He},renderRawRest:function(He){var Qe=He.length,Tt=Qe?Ue.slice(-Qe):null;return D.createElement(sl,{eventKey:f0,title:Be,disabled:wt,internalPopupClose:Qe===0,popupClassName:ge},Tt)},maxCount:cr!=="horizontal"||k?ai.INVALIDATE:ai.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(He){pt(He)},onKeyDown:Pe},ot));return D.createElement(hc.Provider,{value:ut},D.createElement(a1.Provider,{value:Mt},D.createElement(pi,{prefixCls:a,rootClassName:l,mode:cr,openKeys:Nt,rtl:je,disabled:B,motion:It?he:null,defaultMotions:It?De:null,activeKey:bt,onActive:Lr,onInactive:Sn,selectedKeys:oe,inlineIndent:be,subMenuOpenDelay:T,subMenuCloseDelay:F,forceSubMenuRender:P,builtinPlacements:ie,triggerSubMenuAction:Z,getPopupContainer:Ee,itemIcon:le,expandIcon:ue,onItemClick:Ye,onOpenChange:ae},D.createElement(c1.Provider,{value:lt},me),D.createElement("div",{style:{display:"none"},"aria-hidden":!0},D.createElement(l1.Provider,{value:Je},vt)))))}),$i=S3;$i.Item=il;$i.SubMenu=sl;$i.ItemGroup=yc;$i.Divider=bc;const g1=D.createContext({});var A3={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},B3=function(t,r){return D.createElement(sn,Et({},t,{ref:r,icon:A3}))},v1=D.forwardRef(B3);const zs=xo({prefixCls:"",firstLevel:!0,inlineCollapsed:!1});var F3=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const b1=e=>{const{prefixCls:t,className:r,dashed:n}=e,o=F3(e,["prefixCls","className","dashed"]),{getPrefixCls:a}=D.useContext(Co),l=a("menu",t),u=ft({[`${l}-item-divider-dashed`]:!!n},r);return D.createElement(bc,Object.assign({className:u},o))},y1=e=>{var t;const{className:r,children:n,icon:o,title:a,danger:l,extra:u}=e,{prefixCls:f,firstLevel:d,direction:m,disableMenuItemTitleTooltip:g,inlineCollapsed:v}=D.useContext(zs),y=k=>{const $=n==null?void 0:n[0],T=D.createElement("span",{className:ft(`${f}-title-content`,{[`${f}-title-content-with-extra`]:!!u||u===0})},n);return(!o||D.isValidElement(n)&&n.type==="span")&&n&&k&&d&&typeof $=="string"?D.createElement("div",{className:`${f}-inline-collapsed-noicon`},$.charAt(0)):T},{siderCollapsed:b}=D.useContext(g1);let C=a;typeof a>"u"?C=d?n:"":a===!1&&(C="");const p={title:C};!b&&!v&&(p.title=null,p.open=!1);const S=tl(n).length;let B=D.createElement(il,Object.assign({},wo(e,["title","icon","danger"]),{className:ft({[`${f}-item-danger`]:l,[`${f}-item-only-child`]:(o?S+1:S)===1},r),title:typeof a=="string"?a:void 0}),Ca(o,{className:ft(D.isValidElement(o)?(t=o.props)===null||t===void 0?void 0:t.className:void 0,`${f}-item-icon`)}),y(v));return g||(B=D.createElement(Fs,Object.assign({},p,{placement:m==="rtl"?"left":"right",classNames:{root:`${f}-inline-collapsed-tooltip`}}),B)),B};var T3=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const _s=D.createContext(null),x1=D.forwardRef((e,t)=>{const{children:r}=e,n=T3(e,["children"]),o=D.useContext(_s),a=D.useMemo(()=>Object.assign(Object.assign({},o),n),[o,n.prefixCls,n.mode,n.selectable,n.rootClassName]),l=W4(r),u=Wm(t,l?oc(r):null);return D.createElement(_s.Provider,{value:a},D.createElement(U4,{space:!0},l?D.cloneElement(r,{ref:u}):r))}),$3=e=>{const{componentCls:t,motionDurationSlow:r,horizontalLineHeight:n,colorSplit:o,lineWidth:a,lineType:l,itemPaddingInline:u}=e;return{[`${t}-horizontal`]:{lineHeight:n,border:0,borderBottom:`${rt(a)} ${l} ${o}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${t}-item, ${t}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:u},[`> ${t}-item:hover,
2
+ > ${t}-item-active,
3
+ > ${t}-submenu ${t}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${t}-item, ${t}-submenu-title`]:{transition:[`border-color ${r}`,`background ${r}`].join(",")},[`${t}-submenu-arrow`]:{display:"none"}}}},N3=({componentCls:e,menuArrowOffset:t,calc:r})=>({[`${e}-rtl`]:{direction:"rtl"},[`${e}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${e}-rtl${e}-vertical,
4
+ ${e}-submenu-rtl ${e}-vertical`]:{[`${e}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(${rt(r(t).mul(-1).equal())})`},"&::after":{transform:`rotate(45deg) translateY(${rt(t)})`}}}}),Bf=e=>Zm(e),Ff=(e,t)=>{const{componentCls:r,itemColor:n,itemSelectedColor:o,subMenuItemSelectedColor:a,groupTitleColor:l,itemBg:u,subMenuItemBg:f,itemSelectedBg:d,activeBarHeight:m,activeBarWidth:g,activeBarBorderWidth:v,motionDurationSlow:y,motionEaseInOut:b,motionEaseOut:C,itemPaddingInline:p,motionDurationMid:S,itemHoverColor:B,lineType:k,colorSplit:$,itemDisabledColor:T,dangerItemColor:O,dangerItemHoverColor:F,dangerItemSelectedColor:P,dangerItemActiveBg:N,dangerItemSelectedBg:q,popupBg:R,itemHoverBg:X,itemActiveBg:G,menuSubMenuBg:_,horizontalItemSelectedColor:j,horizontalItemSelectedBg:W,horizontalItemBorderRadius:U,horizontalItemHoverBg:ee}=e;return{[`${r}-${t}, ${r}-${t} > ${r}`]:{color:n,background:u,[`&${r}-root:focus-visible`]:Object.assign({},Bf(e)),[`${r}-item`]:{"&-group-title, &-extra":{color:l}},[`${r}-submenu-selected > ${r}-submenu-title`]:{color:a},[`${r}-item, ${r}-submenu-title`]:{color:n,[`&:not(${r}-item-disabled):focus-visible`]:Object.assign({},Bf(e))},[`${r}-item-disabled, ${r}-submenu-disabled`]:{color:`${T} !important`},[`${r}-item:not(${r}-item-selected):not(${r}-submenu-selected)`]:{[`&:hover, > ${r}-submenu-title:hover`]:{color:B}},[`&:not(${r}-horizontal)`]:{[`${r}-item:not(${r}-item-selected)`]:{"&:hover":{backgroundColor:X},"&:active":{backgroundColor:G}},[`${r}-submenu-title`]:{"&:hover":{backgroundColor:X},"&:active":{backgroundColor:G}}},[`${r}-item-danger`]:{color:O,[`&${r}-item:hover`]:{[`&:not(${r}-item-selected):not(${r}-submenu-selected)`]:{color:F}},[`&${r}-item:active`]:{background:N}},[`${r}-item a`]:{"&, &:hover":{color:"inherit"}},[`${r}-item-selected`]:{color:o,[`&${r}-item-danger`]:{color:P},"a, a:hover":{color:"inherit"}},[`& ${r}-item-selected`]:{backgroundColor:d,[`&${r}-item-danger`]:{backgroundColor:q}},[`&${r}-submenu > ${r}`]:{backgroundColor:_},[`&${r}-popup > ${r}`]:{backgroundColor:R},[`&${r}-submenu-popup > ${r}`]:{backgroundColor:R},[`&${r}-horizontal`]:Object.assign(Object.assign({},t==="dark"?{borderBottom:0}:{}),{[`> ${r}-item, > ${r}-submenu`]:{top:v,marginTop:e.calc(v).mul(-1).equal(),marginBottom:0,borderRadius:U,"&::after":{position:"absolute",insetInline:p,bottom:0,borderBottom:`${rt(m)} solid transparent`,transition:`border-color ${y} ${b}`,content:'""'},"&:hover, &-active, &-open":{background:ee,"&::after":{borderBottomWidth:m,borderBottomColor:j}},"&-selected":{color:j,backgroundColor:W,"&:hover":{backgroundColor:W},"&::after":{borderBottomWidth:m,borderBottomColor:j}}}}),[`&${r}-root`]:{[`&${r}-inline, &${r}-vertical`]:{borderInlineEnd:`${rt(v)} ${k} ${$}`}},[`&${r}-inline`]:{[`${r}-sub${r}-inline`]:{background:f},[`${r}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${rt(g)} solid ${o}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${S} ${C}`,`opacity ${S} ${C}`].join(","),content:'""'},[`&${r}-item-danger`]:{"&::after":{borderInlineEndColor:P}}},[`${r}-selected, ${r}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${S} ${b}`,`opacity ${S} ${b}`].join(",")}}}}}},Tf=e=>{const{componentCls:t,itemHeight:r,itemMarginInline:n,padding:o,menuArrowSize:a,marginXS:l,itemMarginBlock:u,itemWidth:f,itemPaddingInline:d}=e,m=e.calc(a).add(o).add(l).equal();return{[`${t}-item`]:{position:"relative",overflow:"hidden"},[`${t}-item, ${t}-submenu-title`]:{height:r,lineHeight:rt(r),paddingInline:d,overflow:"hidden",textOverflow:"ellipsis",marginInline:n,marginBlock:u,width:f},[`> ${t}-item,
5
+ > ${t}-submenu > ${t}-submenu-title`]:{height:r,lineHeight:rt(r)},[`${t}-item-group-list ${t}-submenu-title,
6
+ ${t}-submenu-title`]:{paddingInlineEnd:m}}},O3=e=>{const{componentCls:t,iconCls:r,itemHeight:n,colorTextLightSolid:o,dropdownWidth:a,controlHeightLG:l,motionEaseOut:u,paddingXL:f,itemMarginInline:d,fontSizeLG:m,motionDurationFast:g,motionDurationSlow:v,paddingXS:y,boxShadowSecondary:b,collapsedWidth:C,collapsedIconSize:p}=e,S={height:n,lineHeight:rt(n),listStylePosition:"inside",listStyleType:"disc"};return[{[t]:{"&-inline, &-vertical":Object.assign({[`&${t}-root`]:{boxShadow:"none"}},Tf(e))},[`${t}-submenu-popup`]:{[`${t}-vertical`]:Object.assign(Object.assign({},Tf(e)),{boxShadow:b})}},{[`${t}-submenu-popup ${t}-vertical${t}-sub`]:{minWidth:a,maxHeight:`calc(100vh - ${rt(e.calc(l).mul(2.5).equal())})`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${t}-inline`]:{width:"100%",[`&${t}-root`]:{[`${t}-item, ${t}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${v}`,`background ${v}`,`padding ${g} ${u}`].join(","),[`> ${t}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${t}-sub${t}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${t}-submenu > ${t}-submenu-title`]:S,[`& ${t}-item-group-title`]:{paddingInlineStart:f}},[`${t}-item`]:S}},{[`${t}-inline-collapsed`]:{width:C,[`&${t}-root`]:{[`${t}-item, ${t}-submenu ${t}-submenu-title`]:{[`> ${t}-inline-collapsed-noicon`]:{fontSize:m,textAlign:"center"}}},[`> ${t}-item,
7
+ > ${t}-item-group > ${t}-item-group-list > ${t}-item,
8
+ > ${t}-item-group > ${t}-item-group-list > ${t}-submenu > ${t}-submenu-title,
9
+ > ${t}-submenu > ${t}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${rt(e.calc(p).div(2).equal())} - ${rt(d)})`,textOverflow:"clip",[`
10
+ ${t}-submenu-arrow,
11
+ ${t}-submenu-expand-icon
12
+ `]:{opacity:0},[`${t}-item-icon, ${r}`]:{margin:0,fontSize:p,lineHeight:rt(n),"+ span":{display:"inline-block",opacity:0}}},[`${t}-item-icon, ${r}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${t}-item-icon, ${r}`]:{display:"none"},"a, a:hover":{color:o}},[`${t}-item-group-title`]:Object.assign(Object.assign({},sc),{paddingInline:y})}}]},$f=e=>{const{componentCls:t,motionDurationSlow:r,motionDurationMid:n,motionEaseInOut:o,motionEaseOut:a,iconCls:l,iconSize:u,iconMarginInlineEnd:f}=e;return{[`${t}-item, ${t}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${r}`,`background ${r}`,`padding calc(${r} + 0.1s) ${o}`].join(","),[`${t}-item-icon, ${l}`]:{minWidth:u,fontSize:u,transition:[`font-size ${n} ${a}`,`margin ${r} ${o}`,`color ${r}`].join(","),"+ span":{marginInlineStart:f,opacity:1,transition:[`opacity ${r} ${o}`,`margin ${r}`,`color ${r}`].join(",")}},[`${t}-item-icon`]:Object.assign({},X4()),[`&${t}-item-only-child`]:{[`> ${l}, > ${t}-item-icon`]:{marginInlineEnd:0}}},[`${t}-item-disabled, ${t}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important",cursor:"not-allowed",pointerEvents:"none"},[`> ${t}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},Nf=e=>{const{componentCls:t,motionDurationSlow:r,motionEaseInOut:n,borderRadius:o,menuArrowSize:a,menuArrowOffset:l}=e;return{[`${t}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:e.margin,width:a,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${r} ${n}, opacity ${r}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:e.calc(a).mul(.6).equal(),height:e.calc(a).mul(.15).equal(),backgroundColor:"currentcolor",borderRadius:o,transition:[`background ${r} ${n}`,`transform ${r} ${n}`,`top ${r} ${n}`,`color ${r} ${n}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(${rt(e.calc(l).mul(-1).equal())})`},"&::after":{transform:`rotate(-45deg) translateY(${rt(l)})`}}}}},M3=e=>{const{antCls:t,componentCls:r,fontSize:n,motionDurationSlow:o,motionDurationMid:a,motionEaseInOut:l,paddingXS:u,padding:f,colorSplit:d,lineWidth:m,zIndexPopup:g,borderRadiusLG:v,subMenuItemBorderRadius:y,menuArrowSize:b,menuArrowOffset:C,lineType:p,groupTitleLineHeight:S,groupTitleFontSize:B}=e;return[{"":{[r]:Object.assign(Object.assign({},i0()),{"&-hidden":{display:"none"}})},[`${r}-submenu-hidden`]:{display:"none"}},{[r]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Fi(e)),i0()),{marginBottom:0,paddingInlineStart:0,fontSize:n,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${o} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${r}-item`]:{flex:"none"}},[`${r}-item, ${r}-submenu, ${r}-submenu-title`]:{borderRadius:e.itemBorderRadius},[`${r}-item-group-title`]:{padding:`${rt(u)} ${rt(f)}`,fontSize:B,lineHeight:S,transition:`all ${o}`},[`&-horizontal ${r}-submenu`]:{transition:[`border-color ${o} ${l}`,`background ${o} ${l}`].join(",")},[`${r}-submenu, ${r}-submenu-inline`]:{transition:[`border-color ${o} ${l}`,`background ${o} ${l}`,`padding ${a} ${l}`].join(",")},[`${r}-submenu ${r}-sub`]:{cursor:"initial",transition:[`background ${o} ${l}`,`padding ${o} ${l}`].join(",")},[`${r}-title-content`]:{transition:`color ${o}`,"&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},[`> ${t}-typography-ellipsis-single-line`]:{display:"inline",verticalAlign:"unset"},[`${r}-item-extra`]:{marginInlineStart:"auto",paddingInlineStart:e.padding}},[`${r}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${r}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:d,borderStyle:p,borderWidth:0,borderTopWidth:m,marginBlock:m,padding:0,"&-dashed":{borderStyle:"dashed"}}}),$f(e)),{[`${r}-item-group`]:{[`${r}-item-group-list`]:{margin:0,padding:0,[`${r}-item, ${r}-submenu-title`]:{paddingInline:`${rt(e.calc(n).mul(2).equal())} ${rt(f)}`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:g,borderRadius:v,boxShadow:"none",transformOrigin:"0 0",[`&${r}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:0,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'},[`> ${r}`]:Object.assign(Object.assign(Object.assign({borderRadius:v},$f(e)),Nf(e)),{[`${r}-item, ${r}-submenu > ${r}-submenu-title`]:{borderRadius:y},[`${r}-submenu-title::after`]:{transition:`transform ${o} ${l}`}})},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:e.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:e.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:e.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:e.paddingXS}}}),Nf(e)),{[`&-inline-collapsed ${r}-submenu-arrow,
13
+ &-inline ${r}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${rt(C)})`},"&::after":{transform:`rotate(45deg) translateX(${rt(e.calc(C).mul(-1).equal())})`}},[`${r}-submenu-open${r}-submenu-inline > ${r}-submenu-title > ${r}-submenu-arrow`]:{transform:`translateY(${rt(e.calc(b).mul(.2).mul(-1).equal())})`,"&::after":{transform:`rotate(-45deg) translateX(${rt(e.calc(C).mul(-1).equal())})`},"&::before":{transform:`rotate(45deg) translateX(${rt(C)})`}}})},{[`${t}-layout-header`]:{[r]:{lineHeight:"inherit"}}}]},I3=e=>{var t,r,n;const{colorPrimary:o,colorError:a,colorTextDisabled:l,colorErrorBg:u,colorText:f,colorTextDescription:d,colorBgContainer:m,colorFillAlter:g,colorFillContent:v,lineWidth:y,lineWidthBold:b,controlItemBgActive:C,colorBgTextHover:p,controlHeightLG:S,lineHeight:B,colorBgElevated:k,marginXXS:$,padding:T,fontSize:O,controlHeightSM:F,fontSizeLG:P,colorTextLightSolid:N,colorErrorHover:q}=e,R=(t=e.activeBarWidth)!==null&&t!==void 0?t:0,X=(r=e.activeBarBorderWidth)!==null&&r!==void 0?r:y,G=(n=e.itemMarginInline)!==null&&n!==void 0?n:e.marginXXS,_=new kn(N).setA(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:e.zIndexPopupBase+50,radiusItem:e.borderRadiusLG,itemBorderRadius:e.borderRadiusLG,radiusSubMenuItem:e.borderRadiusSM,subMenuItemBorderRadius:e.borderRadiusSM,colorItemText:f,itemColor:f,colorItemTextHover:f,itemHoverColor:f,colorItemTextHoverHorizontal:o,horizontalItemHoverColor:o,colorGroupTitle:d,groupTitleColor:d,colorItemTextSelected:o,itemSelectedColor:o,subMenuItemSelectedColor:o,colorItemTextSelectedHorizontal:o,horizontalItemSelectedColor:o,colorItemBg:m,itemBg:m,colorItemBgHover:p,itemHoverBg:p,colorItemBgActive:v,itemActiveBg:C,colorSubItemBg:g,subMenuItemBg:g,colorItemBgSelected:C,itemSelectedBg:C,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:R,colorActiveBarHeight:b,activeBarHeight:b,colorActiveBarBorderSize:y,activeBarBorderWidth:X,colorItemTextDisabled:l,itemDisabledColor:l,colorDangerItemText:a,dangerItemColor:a,colorDangerItemTextHover:a,dangerItemHoverColor:a,colorDangerItemTextSelected:a,dangerItemSelectedColor:a,colorDangerItemBgActive:u,dangerItemActiveBg:u,colorDangerItemBgSelected:u,dangerItemSelectedBg:u,itemMarginInline:G,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:S,groupTitleLineHeight:B,collapsedWidth:S*2,popupBg:k,itemMarginBlock:$,itemPaddingInline:T,horizontalLineHeight:`${S*1.15}px`,iconSize:O,iconMarginInlineEnd:F-O,collapsedIconSize:P,groupTitleFontSize:O,darkItemDisabledColor:new kn(N).setA(.25).toRgbString(),darkItemColor:_,darkDangerItemColor:a,darkItemBg:"#001529",darkPopupBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:N,darkItemSelectedBg:o,darkDangerItemSelectedBg:a,darkItemHoverBg:"transparent",darkGroupTitleColor:_,darkItemHoverColor:N,darkDangerItemHoverColor:q,darkDangerItemSelectedColor:N,darkDangerItemActiveBg:a,itemWidth:R?`calc(100% + ${X}px)`:`calc(100% - ${G*2}px)`}},R3=(e,t=e,r=!0)=>Bi("Menu",o=>{const{colorBgElevated:a,controlHeightLG:l,fontSize:u,darkItemColor:f,darkDangerItemColor:d,darkItemBg:m,darkSubMenuItemBg:g,darkItemSelectedColor:v,darkItemSelectedBg:y,darkDangerItemSelectedBg:b,darkItemHoverBg:C,darkGroupTitleColor:p,darkItemHoverColor:S,darkItemDisabledColor:B,darkDangerItemHoverColor:k,darkDangerItemSelectedColor:$,darkDangerItemActiveBg:T,popupBg:O,darkPopupBg:F}=o,P=o.calc(u).div(7).mul(5).equal(),N=Jo(o,{menuArrowSize:P,menuHorizontalHeight:o.calc(l).mul(1.15).equal(),menuArrowOffset:o.calc(P).mul(.25).equal(),menuSubMenuBg:a,calc:o.calc,popupBg:O}),q=Jo(N,{itemColor:f,itemHoverColor:S,groupTitleColor:p,itemSelectedColor:v,subMenuItemSelectedColor:v,itemBg:m,popupBg:F,subMenuItemBg:g,itemActiveBg:"transparent",itemSelectedBg:y,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:C,itemDisabledColor:B,dangerItemColor:d,dangerItemHoverColor:k,dangerItemSelectedColor:$,dangerItemActiveBg:T,dangerItemSelectedBg:b,menuSubMenuBg:g,horizontalItemSelectedColor:v,horizontalItemSelectedBg:y});return[M3(N),$3(N),O3(N),Ff(N,"light"),Ff(q,"dark"),N3(N),Jm(N),Ts(N,"slide-up"),Ts(N,"slide-down"),lc(N,"zoom-big")]},I3,{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]],injectStyle:r,unitless:{groupTitleLineHeight:!0}})(e,t),w1=e=>{var t;const{popupClassName:r,icon:n,title:o,theme:a}=e,l=D.useContext(zs),{prefixCls:u,inlineCollapsed:f,theme:d}=l,m=$a();let g;if(!n)g=f&&!m.length&&o&&typeof o=="string"?D.createElement("div",{className:`${u}-inline-collapsed-noicon`},o.charAt(0)):D.createElement("span",{className:`${u}-title-content`},o);else{const b=D.isValidElement(o)&&o.type==="span";g=D.createElement(D.Fragment,null,Ca(n,{className:ft(D.isValidElement(n)?(t=n.props)===null||t===void 0?void 0:t.className:void 0,`${u}-item-icon`)}),b?o:D.createElement("span",{className:`${u}-title-content`},o))}const v=D.useMemo(()=>Object.assign(Object.assign({},l),{firstLevel:!1}),[l]),[y]=rl("Menu");return D.createElement(zs.Provider,{value:v},D.createElement(sl,Object.assign({},wo(e,["icon"]),{title:g,popupClassName:ft(u,r,`${u}-${a||d}`),popupStyle:Object.assign({zIndex:y},e.popupStyle)})))};var P3=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};function ou(e){return e===null||e===!1}const z3={item:y1,submenu:w1,divider:b1},_3=_o((e,t)=>{var r;const n=D.useContext(_s),o=n||{},{getPrefixCls:a,getPopupContainer:l,direction:u,menu:f}=D.useContext(Co),d=a(),{prefixCls:m,className:g,style:v,theme:y="light",expandIcon:b,_internalDisableMenuItemTitleTooltip:C,inlineCollapsed:p,siderCollapsed:S,rootClassName:B,mode:k,selectable:$,onClick:T,overflowedIndicatorPopupClassName:O}=e,F=P3(e,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),P=wo(F,["collapsedWidth"]);(r=o.validator)===null||r===void 0||r.call(o,{mode:k});const N=Un((...be)=>{var he;T==null||T.apply(void 0,be),(he=o.onClick)===null||he===void 0||he.call(o)}),q=o.mode||k,R=$??o.selectable,X=p??S,G={horizontal:{motionName:`${d}-slide-up`},inline:Qm(d),other:{motionName:`${d}-zoom-big`}},_=a("menu",m||o.prefixCls),j=Ti(_),[W,U,ee]=R3(_,j,!n),V=ft(`${_}-${y}`,f==null?void 0:f.className,g),Y=D.useMemo(()=>{var be,he;if(typeof b=="function"||ou(b))return b||null;if(typeof o.expandIcon=="function"||ou(o.expandIcon))return o.expandIcon||null;if(typeof(f==null?void 0:f.expandIcon)=="function"||ou(f==null?void 0:f.expandIcon))return(f==null?void 0:f.expandIcon)||null;const De=(be=b??(o==null?void 0:o.expandIcon))!==null&&be!==void 0?be:f==null?void 0:f.expandIcon;return Ca(De,{className:ft(`${_}-submenu-expand-icon`,D.isValidElement(De)?(he=De.props)===null||he===void 0?void 0:he.className:void 0)})},[b,o==null?void 0:o.expandIcon,f==null?void 0:f.expandIcon,_]),fe=D.useMemo(()=>({prefixCls:_,inlineCollapsed:X||!1,direction:u,firstLevel:!0,theme:y,mode:q,disableMenuItemTitleTooltip:C}),[_,X,u,C,y]);return W(D.createElement(_s.Provider,{value:null},D.createElement(zs.Provider,{value:fe},D.createElement($i,Object.assign({getPopupContainer:l,overflowedIndicator:D.createElement(v1,null),overflowedIndicatorPopupClassName:ft(_,`${_}-${y}`,O),mode:q,selectable:R,onClick:N},P,{inlineCollapsed:X,style:Object.assign(Object.assign({},f==null?void 0:f.style),v),className:V,prefixCls:_,direction:u,defaultMotions:G,expandIcon:Y,ref:t,rootClassName:ft(B,U,o.rootClassName,ee,j),_internalComponents:z3})))))}),Na=_o((e,t)=>{const r=Vt(null),n=D.useContext(g1);return nc(t,()=>({menu:r.current,focus:o=>{var a;(a=r.current)===null||a===void 0||a.focus(o)}})),D.createElement(_3,Object.assign({ref:r},e,n))});Na.Item=y1;Na.SubMenu=w1;Na.Divider=b1;Na.ItemGroup=yc;const j3=e=>{const{componentCls:t,menuCls:r,colorError:n,colorTextLightSolid:o}=e,a=`${r}-item`;return{[`${t}, ${t}-menu-submenu`]:{[`${r} ${a}`]:{[`&${a}-danger:not(${a}-disabled)`]:{color:n,"&:hover":{color:o,backgroundColor:n}}}}}},L3=e=>{const{componentCls:t,menuCls:r,zIndexPopup:n,dropdownArrowDistance:o,sizePopupArrow:a,antCls:l,iconCls:u,motionDurationMid:f,paddingBlock:d,fontSize:m,dropdownEdgeChildPadding:g,colorTextDisabled:v,fontSizeIcon:y,controlPaddingHorizontal:b,colorBgElevated:C}=e;return[{[t]:{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:n,display:"block","&::before":{position:"absolute",insetBlock:e.calc(a).div(2).sub(o).equal(),zIndex:-9999,opacity:1e-4,content:'""'},"&-menu-vertical":{maxHeight:"100vh",overflowY:"auto"},[`&-trigger${l}-btn`]:{[`& > ${u}-down, & > ${l}-btn-icon > ${u}-down`]:{fontSize:y}},[`${t}-wrap`]:{position:"relative",[`${l}-btn > ${u}-down`]:{fontSize:y},[`${u}-down::before`]:{transition:`transform ${f}`}},[`${t}-wrap-open`]:{[`${u}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${l}-slide-down-enter${l}-slide-down-enter-active${t}-placement-bottomLeft,
14
+ &${l}-slide-down-appear${l}-slide-down-appear-active${t}-placement-bottomLeft,
15
+ &${l}-slide-down-enter${l}-slide-down-enter-active${t}-placement-bottom,
16
+ &${l}-slide-down-appear${l}-slide-down-appear-active${t}-placement-bottom,
17
+ &${l}-slide-down-enter${l}-slide-down-enter-active${t}-placement-bottomRight,
18
+ &${l}-slide-down-appear${l}-slide-down-appear-active${t}-placement-bottomRight`]:{animationName:J4},[`&${l}-slide-up-enter${l}-slide-up-enter-active${t}-placement-topLeft,
19
+ &${l}-slide-up-appear${l}-slide-up-appear-active${t}-placement-topLeft,
20
+ &${l}-slide-up-enter${l}-slide-up-enter-active${t}-placement-top,
21
+ &${l}-slide-up-appear${l}-slide-up-appear-active${t}-placement-top,
22
+ &${l}-slide-up-enter${l}-slide-up-enter-active${t}-placement-topRight,
23
+ &${l}-slide-up-appear${l}-slide-up-appear-active${t}-placement-topRight`]:{animationName:Z4},[`&${l}-slide-down-leave${l}-slide-down-leave-active${t}-placement-bottomLeft,
24
+ &${l}-slide-down-leave${l}-slide-down-leave-active${t}-placement-bottom,
25
+ &${l}-slide-down-leave${l}-slide-down-leave-active${t}-placement-bottomRight`]:{animationName:Y4},[`&${l}-slide-up-leave${l}-slide-up-leave-active${t}-placement-topLeft,
26
+ &${l}-slide-up-leave${l}-slide-up-leave-active${t}-placement-top,
27
+ &${l}-slide-up-leave${l}-slide-up-leave-active${t}-placement-topRight`]:{animationName:G4}}},Q4(e,C,{arrowPlacement:{top:!0,bottom:!0}}),{[`${t} ${r}`]:{position:"relative",margin:0},[`${r}-submenu-popup`]:{position:"absolute",zIndex:n,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${t}, ${t}-menu-submenu`]:Object.assign(Object.assign({},Fi(e)),{[r]:Object.assign(Object.assign({padding:g,listStyleType:"none",backgroundColor:C,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary},vf(e)),{"&:empty":{padding:0,boxShadow:"none"},[`${r}-item-group-title`]:{padding:`${rt(d)} ${rt(b)}`,color:e.colorTextDescription,transition:`all ${f}`},[`${r}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${r}-item-icon`]:{minWidth:m,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},[`${r}-title-content`]:{flex:"auto","&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},"> a":{color:"inherit",transition:`all ${f}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}},[`${r}-item-extra`]:{paddingInlineStart:e.padding,marginInlineStart:"auto",fontSize:e.fontSizeSM,color:e.colorTextDescription}},[`${r}-item, ${r}-submenu-title`]:Object.assign(Object.assign({display:"flex",margin:0,padding:`${rt(d)} ${rt(b)}`,color:e.colorText,fontWeight:"normal",fontSize:m,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${f}`,borderRadius:e.borderRadiusSM,"&:hover, &-active":{backgroundColor:e.controlItemBgHover}},vf(e)),{"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}},"&-disabled":{color:v,cursor:"not-allowed","&:hover":{color:v,backgroundColor:C,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${rt(e.marginXXS)} 0`,overflow:"hidden",lineHeight:0,backgroundColor:e.colorSplit},[`${t}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:e.paddingXS,[`${t}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:e.colorIcon,fontSize:y,fontStyle:"normal"}}}),[`${r}-item-group-list`]:{margin:`0 ${rt(e.marginXS)}`,padding:0,listStyle:"none"},[`${r}-submenu-title`]:{paddingInlineEnd:e.calc(b).add(e.fontSizeSM).equal()},[`${r}-submenu-vertical`]:{position:"relative"},[`${r}-submenu${r}-submenu-disabled ${t}-menu-submenu-title`]:{[`&, ${t}-menu-submenu-arrow-icon`]:{color:v,backgroundColor:C,cursor:"not-allowed"}},[`${r}-submenu-selected ${t}-menu-submenu-title`]:{color:e.colorPrimary}})})},[Ts(e,"slide-up"),Ts(e,"slide-down"),gf(e,"move-up"),gf(e,"move-down"),lc(e,"zoom-big")]]},H3=e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+50,paddingBlock:(e.controlHeight-e.fontSize*e.lineHeight)/2},ev({contentRadius:e.borderRadiusLG,limitVerticalRadius:!0})),tv(e)),K3=Bi("Dropdown",e=>{const{marginXXS:t,sizePopupArrow:r,paddingXXS:n,componentCls:o}=e,a=Jo(e,{menuCls:`${o}-menu`,dropdownArrowDistance:e.calc(r).div(2).add(t).equal(),dropdownEdgeChildPadding:n});return[L3(a),j3(a)]},H3,{resetStyle:!1}),ll=e=>{var t;const{menu:r,arrow:n,prefixCls:o,children:a,trigger:l,disabled:u,dropdownRender:f,popupRender:d,getPopupContainer:m,overlayClassName:g,rootClassName:v,overlayStyle:y,open:b,onOpenChange:C,visible:p,onVisibleChange:S,mouseEnterDelay:B=.15,mouseLeaveDelay:k=.1,autoAdjustOverflow:$=!0,placement:T="",overlay:O,transitionName:F,destroyOnHidden:P,destroyPopupOnHide:N}=e,{getPopupContainer:q,getPrefixCls:R,direction:X,dropdown:G}=D.useContext(Co),_=d||f;nl();const j=D.useMemo(()=>{const Ce=R();return F!==void 0?F:T.includes("top")?`${Ce}-slide-down`:`${Ce}-slide-up`},[R,T,F]),W=D.useMemo(()=>T?T.includes("Center")?T.slice(0,T.indexOf("Center")):T:X==="rtl"?"bottomRight":"bottomLeft",[T,X]),U=R("dropdown",o),ee=Ti(U),[V,Y,fe]=K3(U,ee),[,be]=uc(),he=D.Children.only(Vv(a)?D.createElement("span",null,a):a),De=Ca(he,{className:ft(`${U}-trigger`,{[`${U}-rtl`]:X==="rtl"},he.props.className),disabled:(t=he.props.disabled)!==null&&t!==void 0?t:u}),$e=u?[]:l,Z=!!($e!=null&&$e.includes("contextMenu")),[ie,le]=bo(!1,{value:b??p}),ue=Un(Ce=>{C==null||C(Ce,{source:"trigger"}),S==null||S(Ce),le(Ce)}),Se=ft(g,v,Y,fe,ee,G==null?void 0:G.className,{[`${U}-rtl`]:X==="rtl"}),Be=rv({arrowPointAtCenter:typeof n=="object"&&n.pointAtCenter,autoAdjustOverflow:$,offset:be.marginXXS,arrowWidth:n?be.sizePopupArrow:0,borderRadius:be.borderRadius}),ge=Un(()=>{r!=null&&r.selectable&&(r!=null&&r.multiple)||(C==null||C(!1,{source:"menu"}),le(!1))}),Ee=()=>{let Ce;return r!=null&&r.items?Ce=D.createElement(Na,Object.assign({},r)):typeof O=="function"?Ce=O():Ce=O,_&&(Ce=_(Ce)),Ce=D.Children.only(typeof Ce=="string"?D.createElement("span",null,Ce):Ce),D.createElement(x1,{prefixCls:`${U}-menu`,rootClassName:ft(fe,ee),expandIcon:D.createElement("span",{className:`${U}-menu-submenu-arrow`},X==="rtl"?D.createElement(Is,{className:`${U}-menu-submenu-arrow-icon`}):D.createElement(Rs,{className:`${U}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:ge,validator:({mode:_e})=>{}},Ce)},[Ae,Fe]=rl("Dropdown",y==null?void 0:y.zIndex);let xe=D.createElement(qv,Object.assign({alignPoint:Z},wo(e,["rootClassName"]),{mouseEnterDelay:B,mouseLeaveDelay:k,visible:ie,builtinPlacements:Be,arrow:!!n,overlayClassName:Se,prefixCls:U,getPopupContainer:m||q,transitionName:j,trigger:$e,overlay:Ee,placement:W,onVisibleChange:ue,overlayStyle:Object.assign(Object.assign(Object.assign({},G==null?void 0:G.style),y),{zIndex:Ae}),autoDestroy:P??N}),De);return Ae&&(xe=D.createElement(nv.Provider,{value:Fe},xe)),V(xe)},q3=ov(ll,"align",void 0,"dropdown",e=>e),V3=e=>D.createElement(q3,Object.assign({},e),D.createElement("span",null));ll._InternalPanelDoNotUseOrYouWillBeFired=V3;function Dn(e,t){return e[t]}var W3=["children"];function C1(e,t){return"".concat(e,"-").concat(t)}function U3(e){return e&&e.type&&e.type.isTreeNode}function Ni(e,t){return e??t}function Da(e){var t=e||{},r=t.title,n=t._title,o=t.key,a=t.children,l=r||"title";return{title:l,_title:n||[l],key:o||"key",children:a||"children"}}function D1(e){function t(r){var n=tl(r);return n.map(function(o){if(!U3(o))return io(!o,"Tree/TreeNode can only accept TreeNode as children."),null;var a=o.key,l=o.props,u=l.children,f=kr(l,W3),d=Ve({key:a},f),m=t(u);return m.length&&(d.children=m),d}).filter(function(o){return o})}return t(e)}function au(e,t,r){var n=Da(r),o=n._title,a=n.key,l=n.children,u=new Set(t===!0?[]:t),f=[];function d(m){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return m.map(function(v,y){for(var b=C1(g?g.pos:"0",y),C=Ni(v[a],b),p,S=0;S<o.length;S+=1){var B=o[S];if(v[B]!==void 0){p=v[B];break}}var k=Object.assign(wo(v,[].concat(Gt(o),[a,l])),{title:p,key:C,parent:g,pos:b,children:null,data:v,isStart:[].concat(Gt(g?g.isStart:[]),[y===0]),isEnd:[].concat(Gt(g?g.isEnd:[]),[y===m.length-1])});return f.push(k),t===!0||u.has(C)?k.children=d(v[l]||[],k):k.children=[],k})}return d(e),f}function X3(e,t,r){var n={};$n(r)==="object"?n=r:n={externalGetKey:r},n=n||{};var o=n,a=o.childrenPropName,l=o.externalGetKey,u=o.fieldNames,f=Da(u),d=f.key,m=f.children,g=a||m,v;l?typeof l=="string"?v=function(C){return C[l]}:typeof l=="function"&&(v=function(C){return l(C)}):v=function(C,p){return Ni(C[d],p)};function y(b,C,p,S){var B=b?b[g]:e,k=b?C1(p.pos,C):"0",$=b?[].concat(Gt(S),[b]):[];if(b){var T=v(b,k),O={node:b,index:C,pos:k,key:T,parentPos:p.node?p.pos:null,level:p.level+1,nodes:$};t(O)}B&&B.forEach(function(F,P){y(F,P,{node:b,pos:k,level:p?p.level+1:-1},$)})}y(null)}function xc(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.initWrapper,n=t.processEntity,o=t.onProcessFinished,a=t.externalGetKey,l=t.childrenPropName,u=t.fieldNames,f=arguments.length>2?arguments[2]:void 0,d=a||f,m={},g={},v={posEntities:m,keyEntities:g};return r&&(v=r(v)||v),X3(e,function(y){var b=y.node,C=y.index,p=y.pos,S=y.key,B=y.parentPos,k=y.level,$=y.nodes,T={node:b,nodes:$,index:C,key:S,pos:p,level:k},O=Ni(S,p);m[p]=T,g[O]=T,T.parent=m[B],T.parent&&(T.parent.children=T.parent.children||[],T.parent.children.push(T)),n&&n(T,v)},{externalGetKey:d,childrenPropName:l,fieldNames:u}),o&&o(v),v}function ii(e,t){var r=t.expandedKeys,n=t.selectedKeys,o=t.loadedKeys,a=t.loadingKeys,l=t.checkedKeys,u=t.halfCheckedKeys,f=t.dragOverNodeKey,d=t.dropPosition,m=t.keyEntities,g=Dn(m,e),v={eventKey:e,expanded:r.indexOf(e)!==-1,selected:n.indexOf(e)!==-1,loaded:o.indexOf(e)!==-1,loading:a.indexOf(e)!==-1,checked:l.indexOf(e)!==-1,halfChecked:u.indexOf(e)!==-1,pos:String(g?g.pos:""),dragOver:f===e&&d===0,dragOverGapTop:f===e&&d===-1,dragOverGapBottom:f===e&&d===1};return v}function Ur(e){var t=e.data,r=e.expanded,n=e.selected,o=e.checked,a=e.loaded,l=e.loading,u=e.halfChecked,f=e.dragOver,d=e.dragOverGapTop,m=e.dragOverGapBottom,g=e.pos,v=e.active,y=e.eventKey,b=Ve(Ve({},t),{},{expanded:r,selected:n,checked:o,loaded:a,loading:l,halfChecked:u,dragOver:f,dragOverGapTop:d,dragOverGapBottom:m,pos:g,active:v,key:y});return"props"in b||Object.defineProperty(b,"props",{get:function(){return io(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),b}function k1(e,t){var r=new Set;return e.forEach(function(n){t.has(n)||r.add(n)}),r}function G3(e){var t=e||{},r=t.disabled,n=t.disableCheckbox,o=t.checkable;return!!(r||n)||o===!1}function Y3(e,t,r,n){for(var o=new Set(e),a=new Set,l=0;l<=r;l+=1){var u=t.get(l)||new Set;u.forEach(function(g){var v=g.key,y=g.node,b=g.children,C=b===void 0?[]:b;o.has(v)&&!n(y)&&C.filter(function(p){return!n(p.node)}).forEach(function(p){o.add(p.key)})})}for(var f=new Set,d=r;d>=0;d-=1){var m=t.get(d)||new Set;m.forEach(function(g){var v=g.parent,y=g.node;if(!(n(y)||!g.parent||f.has(g.parent.key))){if(n(g.parent.node)){f.add(v.key);return}var b=!0,C=!1;(v.children||[]).filter(function(p){return!n(p.node)}).forEach(function(p){var S=p.key,B=o.has(S);b&&!B&&(b=!1),!C&&(B||a.has(S))&&(C=!0)}),b&&o.add(v.key),C&&a.add(v.key),f.add(v.key)}})}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(k1(a,o))}}function Z3(e,t,r,n,o){for(var a=new Set(e),l=new Set(t),u=0;u<=n;u+=1){var f=r.get(u)||new Set;f.forEach(function(v){var y=v.key,b=v.node,C=v.children,p=C===void 0?[]:C;!a.has(y)&&!l.has(y)&&!o(b)&&p.filter(function(S){return!o(S.node)}).forEach(function(S){a.delete(S.key)})})}l=new Set;for(var d=new Set,m=n;m>=0;m-=1){var g=r.get(m)||new Set;g.forEach(function(v){var y=v.parent,b=v.node;if(!(o(b)||!v.parent||d.has(v.parent.key))){if(o(v.parent.node)){d.add(y.key);return}var C=!0,p=!1;(y.children||[]).filter(function(S){return!o(S.node)}).forEach(function(S){var B=S.key,k=a.has(B);C&&!k&&(C=!1),!p&&(k||l.has(B))&&(p=!0)}),C||a.delete(y.key),p&&l.add(y.key),d.add(y.key)}})}return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(k1(l,a))}}function ba(e,t,r,n){var o=[],a;n?a=n:a=G3;var l=new Set(e.filter(function(m){var g=!!Dn(r,m);return g||o.push(m),g})),u=new Map,f=0;Object.keys(r).forEach(function(m){var g=r[m],v=g.level,y=u.get(v);y||(y=new Set,u.set(v,y)),y.add(g),f=Math.max(f,v)}),io(!o.length,"Tree missing follow keys: ".concat(o.slice(0,100).map(function(m){return"'".concat(m,"'")}).join(", ")));var d;return t===!0?d=Y3(l,u,f,a):d=Z3(l,t.halfCheckedKeys,u,f,a),d}var J3=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const E1=e=>{const{getPopupContainer:t,getPrefixCls:r,direction:n}=D.useContext(Co),{prefixCls:o,type:a="default",danger:l,disabled:u,loading:f,onClick:d,htmlType:m,children:g,className:v,menu:y,arrow:b,autoFocus:C,overlay:p,trigger:S,align:B,open:k,onOpenChange:$,placement:T,getPopupContainer:O,href:F,icon:P=D.createElement(v1,null),title:N,buttonsRender:q=Be=>Be,mouseEnterDelay:R,mouseLeaveDelay:X,overlayClassName:G,overlayStyle:_,destroyOnHidden:j,destroyPopupOnHide:W,dropdownRender:U,popupRender:ee}=e,V=J3(e,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyOnHidden","destroyPopupOnHide","dropdownRender","popupRender"]),Y=r("dropdown",o),fe=`${Y}-button`,he={menu:y,arrow:b,autoFocus:C,align:B,disabled:u,trigger:u?[]:S,onOpenChange:$,getPopupContainer:O||t,mouseEnterDelay:R,mouseLeaveDelay:X,overlayClassName:G,overlayStyle:_,destroyOnHidden:j,popupRender:ee||U},{compactSize:De,compactItemClassnames:$e}=av(Y,n),Z=ft(fe,$e,v);"destroyPopupOnHide"in e&&(he.destroyPopupOnHide=W),"overlay"in e&&(he.overlay=p),"open"in e&&(he.open=k),"placement"in e?he.placement=T:he.placement=n==="rtl"?"bottomLeft":"bottomRight";const ie=D.createElement($s,{type:a,danger:l,disabled:u,loading:f,onClick:d,htmlType:m,href:F,title:N},g),le=D.createElement($s,{type:a,danger:l,icon:P}),[ue,Se]=q([ie,le]);return D.createElement(Av.Compact,Object.assign({className:Z,size:De,block:!0},V),ue,D.createElement(ll,Object.assign({},he),Se))};E1.__ANT_BUTTON=!0;const wc=ll;wc.Button=E1;function S1(){var e=document.documentElement.clientWidth,t=window.innerHeight||document.documentElement.clientHeight;return{width:e,height:t}}function Q3(e){var t=e.getBoundingClientRect(),r=document.documentElement;return{left:t.left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||document.body.clientLeft||0),top:t.top+(window.pageYOffset||r.scrollTop)-(r.clientTop||document.body.clientTop||0)}}function Oo(e,t,r,n){var o=a0.unstable_batchedUpdates?function(l){a0.unstable_batchedUpdates(r,l)}:r;return e!=null&&e.addEventListener&&e.addEventListener(t,o,n),{remove:function(){e!=null&&e.removeEventListener&&e.removeEventListener(t,o,n)}}}var Oi=D.createContext(null),e5=function(t){var r=t.visible,n=t.maskTransitionName,o=t.getContainer,a=t.prefixCls,l=t.rootClassName,u=t.icons,f=t.countRender,d=t.showSwitch,m=t.showProgress,g=t.current,v=t.transform,y=t.count,b=t.scale,C=t.minScale,p=t.maxScale,S=t.closeIcon,B=t.onActive,k=t.onClose,$=t.onZoomIn,T=t.onZoomOut,O=t.onRotateRight,F=t.onRotateLeft,P=t.onFlipX,N=t.onFlipY,q=t.onReset,R=t.toolbarRender,X=t.zIndex,G=t.image,_=jo(Oi),j=u.rotateLeft,W=u.rotateRight,U=u.zoomIn,ee=u.zoomOut,V=u.close,Y=u.left,fe=u.right,be=u.flipX,he=u.flipY,De="".concat(a,"-operations-operation");D.useEffect(function(){var xe=function(_e){_e.keyCode===qr.ESC&&k()};return r&&window.addEventListener("keydown",xe),function(){window.removeEventListener("keydown",xe)}},[r]);var $e=function(Ce,_e){Ce.preventDefault(),Ce.stopPropagation(),B(_e)},Z=D.useCallback(function(xe){var Ce=xe.type,_e=xe.disabled,ht=xe.onClick,ot=xe.icon;return D.createElement("div",{key:Ce,className:ft(De,"".concat(a,"-operations-operation-").concat(Ce),Me({},"".concat(a,"-operations-operation-disabled"),!!_e)),onClick:ht},ot)},[De,a]),ie=d?Z({icon:Y,onClick:function(Ce){return $e(Ce,-1)},type:"prev",disabled:g===0}):void 0,le=d?Z({icon:fe,onClick:function(Ce){return $e(Ce,1)},type:"next",disabled:g===y-1}):void 0,ue=Z({icon:he,onClick:N,type:"flipY"}),Se=Z({icon:be,onClick:P,type:"flipX"}),Be=Z({icon:j,onClick:F,type:"rotateLeft"}),ge=Z({icon:W,onClick:O,type:"rotateRight"}),Ee=Z({icon:ee,onClick:T,type:"zoomOut",disabled:b<=C}),Ae=Z({icon:U,onClick:$,type:"zoomIn",disabled:b===p}),Fe=D.createElement("div",{className:"".concat(a,"-operations")},ue,Se,Be,ge,Ee,Ae);return D.createElement(ic,{visible:r,motionName:n},function(xe){var Ce=xe.className,_e=xe.style;return D.createElement(iv,{open:!0,getContainer:o??document.body},D.createElement("div",{className:ft("".concat(a,"-operations-wrapper"),Ce,l),style:Ve(Ve({},_e),{},{zIndex:X})},S===null?null:D.createElement("button",{className:"".concat(a,"-close"),onClick:k},S||V),d&&D.createElement(D.Fragment,null,D.createElement("div",{className:ft("".concat(a,"-switch-left"),Me({},"".concat(a,"-switch-left-disabled"),g===0)),onClick:function(ot){return $e(ot,-1)}},Y),D.createElement("div",{className:ft("".concat(a,"-switch-right"),Me({},"".concat(a,"-switch-right-disabled"),g===y-1)),onClick:function(ot){return $e(ot,1)}},fe)),D.createElement("div",{className:"".concat(a,"-footer")},m&&D.createElement("div",{className:"".concat(a,"-progress")},f?f(g+1,y):D.createElement("bdi",null,"".concat(g+1," / ").concat(y))),R?R(Fe,Ve(Ve({icons:{prevIcon:ie,nextIcon:le,flipYIcon:ue,flipXIcon:Se,rotateLeftIcon:Be,rotateRightIcon:ge,zoomOutIcon:Ee,zoomInIcon:Ae},actions:{onActive:B,onFlipY:N,onFlipX:P,onRotateLeft:F,onRotateRight:O,onZoomOut:T,onZoomIn:$,onReset:q,onClose:k},transform:v},_?{current:g,total:y}:{}),{},{image:G})):Fe)))})},Gi={x:0,y:0,rotate:0,scale:1,flipX:!1,flipY:!1};function t5(e,t,r,n){var o=Vt(null),a=Vt([]),l=Ht(Gi),u=Dt(l,2),f=u[0],d=u[1],m=function(b){d(Gi),Io(Gi,f)||n==null||n({transform:Gi,action:b})},g=function(b,C){o.current===null&&(a.current=[],o.current=Rn(function(){d(function(p){var S=p;return a.current.forEach(function(B){S=Ve(Ve({},S),B)}),o.current=null,n==null||n({transform:S,action:C}),S})})),a.current.push(Ve(Ve({},f),b))},v=function(b,C,p,S,B){var k=e.current,$=k.width,T=k.height,O=k.offsetWidth,F=k.offsetHeight,P=k.offsetLeft,N=k.offsetTop,q=b,R=f.scale*b;R>r?(R=r,q=r/f.scale):R<t&&(R=B?R:t,q=R/f.scale);var X=p??innerWidth/2,G=S??innerHeight/2,_=q-1,j=_*$*.5,W=_*T*.5,U=_*(X-f.x-P),ee=_*(G-f.y-N),V=f.x-(U-j),Y=f.y-(ee-W);if(b<1&&R===1){var fe=O*R,be=F*R,he=S1(),De=he.width,$e=he.height;fe<=De&&be<=$e&&(V=0,Y=0)}g({x:V,y:Y,scale:R},C)};return{transform:f,resetTransform:m,updateTransform:g,dispatchZoomChange:v}}function Of(e,t,r,n){var o=t+r,a=(r-n)/2;if(r>n){if(t>0)return Me({},e,a);if(t<0&&o<n)return Me({},e,-a)}else if(t<0||o>n)return Me({},e,t<0?a:-a);return{}}function A1(e,t,r,n){var o=S1(),a=o.width,l=o.height,u=null;return e<=a&&t<=l?u={x:0,y:0}:(e>a||t>l)&&(u=Ve(Ve({},Of("x",r,e,a)),Of("y",n,t,l))),u}var ha=1,r5=1;function n5(e,t,r,n,o,a,l){var u=o.rotate,f=o.scale,d=o.x,m=o.y,g=Ht(!1),v=Dt(g,2),y=v[0],b=v[1],C=Vt({diffX:0,diffY:0,transformX:0,transformY:0}),p=function(T){!t||T.button!==0||(T.preventDefault(),T.stopPropagation(),C.current={diffX:T.pageX-d,diffY:T.pageY-m,transformX:d,transformY:m},b(!0))},S=function(T){r&&y&&a({x:T.pageX-C.current.diffX,y:T.pageY-C.current.diffY},"move")},B=function(){if(r&&y){b(!1);var T=C.current,O=T.transformX,F=T.transformY,P=d!==O&&m!==F;if(!P)return;var N=e.current.offsetWidth*f,q=e.current.offsetHeight*f,R=e.current.getBoundingClientRect(),X=R.left,G=R.top,_=u%180!==0,j=A1(_?q:N,_?N:q,X,G);j&&a(Ve({},j),"dragRebound")}},k=function(T){if(!(!r||T.deltaY==0)){var O=Math.abs(T.deltaY/100),F=Math.min(O,r5),P=ha+F*n;T.deltaY>0&&(P=ha/P),l(P,"wheel",T.clientX,T.clientY)}};return sr(function(){var $,T,O,F;if(t){O=Oo(window,"mouseup",B,!1),F=Oo(window,"mousemove",S,!1);try{window.top!==window.self&&($=Oo(window.top,"mouseup",B,!1),T=Oo(window.top,"mousemove",S,!1))}catch{}}return function(){var P,N,q,R;(P=O)===null||P===void 0||P.remove(),(N=F)===null||N===void 0||N.remove(),(q=$)===null||q===void 0||q.remove(),(R=T)===null||R===void 0||R.remove()}},[r,y,d,m,u,t]),{isMoving:y,onMouseDown:p,onMouseMove:S,onMouseUp:B,onWheel:k}}function o5(e){return new Promise(function(t){if(!e){t(!1);return}var r=document.createElement("img");r.onerror=function(){return t(!1)},r.onload=function(){return t(!0)},r.src=e})}function B1(e){var t=e.src,r=e.isCustomPlaceholder,n=e.fallback,o=Ht(r?"loading":"normal"),a=Dt(o,2),l=a[0],u=a[1],f=Vt(!1),d=l==="error";sr(function(){var y=!0;return o5(t).then(function(b){!b&&y&&u("error")}),function(){y=!1}},[t]),sr(function(){r&&!f.current?u("loading"):d&&u("normal")},[t]);var m=function(){u("normal")},g=function(b){f.current=!1,l==="loading"&&b!==null&&b!==void 0&&b.complete&&(b.naturalWidth||b.naturalHeight)&&(f.current=!0,m())},v=d&&n?{src:n}:{onLoad:m,src:t};return[g,v,l]}function js(e,t){var r=e.x-t.x,n=e.y-t.y;return Math.hypot(r,n)}function a5(e,t,r,n){var o=js(e,r),a=js(t,n);if(o===0&&a===0)return[e.x,e.y];var l=o/(o+a),u=e.x+l*(t.x-e.x),f=e.y+l*(t.y-e.y);return[u,f]}function i5(e,t,r,n,o,a,l){var u=o.rotate,f=o.scale,d=o.x,m=o.y,g=Ht(!1),v=Dt(g,2),y=v[0],b=v[1],C=Vt({point1:{x:0,y:0},point2:{x:0,y:0},eventType:"none"}),p=function(T){C.current=Ve(Ve({},C.current),T)},S=function(T){if(t){T.stopPropagation(),b(!0);var O=T.touches,F=O===void 0?[]:O;F.length>1?p({point1:{x:F[0].clientX,y:F[0].clientY},point2:{x:F[1].clientX,y:F[1].clientY},eventType:"touchZoom"}):p({point1:{x:F[0].clientX-d,y:F[0].clientY-m},eventType:"move"})}},B=function(T){var O=T.touches,F=O===void 0?[]:O,P=C.current,N=P.point1,q=P.point2,R=P.eventType;if(F.length>1&&R==="touchZoom"){var X={x:F[0].clientX,y:F[0].clientY},G={x:F[1].clientX,y:F[1].clientY},_=a5(N,q,X,G),j=Dt(_,2),W=j[0],U=j[1],ee=js(X,G)/js(N,q);l(ee,"touchZoom",W,U,!0),p({point1:X,point2:G,eventType:"touchZoom"})}else R==="move"&&(a({x:F[0].clientX-N.x,y:F[0].clientY-N.y},"move"),p({eventType:"move"}))},k=function(){if(r){if(y&&b(!1),p({eventType:"none"}),n>f)return a({x:0,y:0,scale:n},"touchZoom");var T=e.current.offsetWidth*f,O=e.current.offsetHeight*f,F=e.current.getBoundingClientRect(),P=F.left,N=F.top,q=u%180!==0,R=A1(q?O:T,q?T:O,P,N);R&&a(Ve({},R),"dragRebound")}};return sr(function(){var $;return r&&t&&($=Oo(window,"touchmove",function(T){return T.preventDefault()},{passive:!1})),function(){var T;(T=$)===null||T===void 0||T.remove()}},[r,t]),{isTouching:y,onTouchStart:S,onTouchMove:B,onTouchEnd:k}}var s5=["fallback","src","imgRef"],l5=["prefixCls","src","alt","imageInfo","fallback","movable","onClose","visible","icons","rootClassName","closeIcon","getContainer","current","count","countRender","scaleStep","minScale","maxScale","transitionName","maskTransitionName","imageRender","imgCommonProps","toolbarRender","onTransform","onChange"],u5=function(t){var r=t.fallback,n=t.src,o=t.imgRef,a=kr(t,s5),l=B1({src:n,fallback:r}),u=Dt(l,2),f=u[0],d=u[1];return We.createElement("img",Et({ref:function(g){o.current=g,f(g)}},a,d))},F1=function(t){var r=t.prefixCls,n=t.src,o=t.alt,a=t.imageInfo,l=t.fallback,u=t.movable,f=u===void 0?!0:u,d=t.onClose,m=t.visible,g=t.icons,v=g===void 0?{}:g,y=t.rootClassName,b=t.closeIcon,C=t.getContainer,p=t.current,S=p===void 0?0:p,B=t.count,k=B===void 0?1:B,$=t.countRender,T=t.scaleStep,O=T===void 0?.5:T,F=t.minScale,P=F===void 0?1:F,N=t.maxScale,q=N===void 0?50:N,R=t.transitionName,X=R===void 0?"zoom":R,G=t.maskTransitionName,_=G===void 0?"fade":G,j=t.imageRender,W=t.imgCommonProps,U=t.toolbarRender,ee=t.onTransform,V=t.onChange,Y=kr(t,l5),fe=Vt(),be=jo(Oi),he=be&&k>1,De=be&&k>=1,$e=Ht(!0),Z=Dt($e,2),ie=Z[0],le=Z[1],ue=t5(fe,P,q,ee),Se=ue.transform,Be=ue.resetTransform,ge=ue.updateTransform,Ee=ue.dispatchZoomChange,Ae=n5(fe,f,m,O,Se,ge,Ee),Fe=Ae.isMoving,xe=Ae.onMouseDown,Ce=Ae.onWheel,_e=i5(fe,f,m,P,Se,ge,Ee),ht=_e.isTouching,ot=_e.onTouchStart,Ie=_e.onTouchMove,Ke=_e.onTouchEnd,Ue=Se.rotate,vt=Se.scale,tt=ft(Me({},"".concat(r,"-moving"),Fe));sr(function(){ie||le(!0)},[ie]);var nt=function(){Be("close")},It=function(){Ee(ha+O,"zoomIn")},$t=function(){Ee(ha/(ha+O),"zoomOut")},Bt=function(){ge({rotate:Ue+90},"rotateRight")},Mt=function(){ge({rotate:Ue-90},"rotateLeft")},je=function(){ge({flipX:!Se.flipX},"flipX")},pe=function(){ge({flipY:!Se.flipY},"flipY")},it=function(){Be("reset")},Nt=function(tr){var lr=S+tr;!Number.isInteger(lr)||lr<0||lr>k-1||(le(!1),Be(tr<0?"prev":"next"),V==null||V(lr,S))},Ft=function(tr){!m||!he||(tr.keyCode===qr.LEFT?Nt(-1):tr.keyCode===qr.RIGHT&&Nt(1))},yt=function(tr){m&&(vt!==1?ge({x:0,y:0,scale:1},"doubleClick"):Ee(ha+O,"doubleClick",tr.clientX,tr.clientY))};sr(function(){var Kt=Oo(window,"keydown",Ft,!1);return function(){Kt.remove()}},[m,he,S]);var Rt=We.createElement(u5,Et({},W,{width:t.width,height:t.height,imgRef:fe,className:"".concat(r,"-img"),alt:o,style:{transform:"translate3d(".concat(Se.x,"px, ").concat(Se.y,"px, 0) scale3d(").concat(Se.flipX?"-":"").concat(vt,", ").concat(Se.flipY?"-":"").concat(vt,", 1) rotate(").concat(Ue,"deg)"),transitionDuration:(!ie||ht)&&"0s"},fallback:l,src:n,onWheel:Ce,onMouseDown:xe,onDoubleClick:yt,onTouchStart:ot,onTouchMove:Ie,onTouchEnd:Ke,onTouchCancel:Ke})),St=Ve({url:n,alt:o},a);return We.createElement(We.Fragment,null,We.createElement(sv,Et({transitionName:X,maskTransitionName:_,closable:!1,keyboard:!0,prefixCls:r,onClose:d,visible:m,classNames:{wrapper:tt},rootClassName:y,getContainer:C},Y,{afterClose:nt}),We.createElement("div",{className:"".concat(r,"-img-wrapper")},j?j(Rt,Ve({transform:Se,image:St},be?{current:S}:{})):Rt)),We.createElement(e5,{visible:m,transform:Se,maskTransitionName:_,closeIcon:b,getContainer:C,prefixCls:r,rootClassName:y,icons:v,countRender:$,showSwitch:he,showProgress:De,current:S,count:k,scale:vt,minScale:P,maxScale:q,toolbarRender:U,onActive:Nt,onZoomIn:It,onZoomOut:$t,onRotateRight:Bt,onRotateLeft:Mt,onFlipX:je,onFlipY:pe,onClose:d,onReset:it,zIndex:Y.zIndex!==void 0?Y.zIndex+1:void 0,image:St}))},p0=["crossOrigin","decoding","draggable","loading","referrerPolicy","sizes","srcSet","useMap","alt"];function c5(e){var t=D.useState({}),r=Dt(t,2),n=r[0],o=r[1],a=D.useCallback(function(u,f){return o(function(d){return Ve(Ve({},d),{},Me({},u,f))}),function(){o(function(d){var m=Ve({},d);return delete m[u],m})}},[]),l=D.useMemo(function(){return e?e.map(function(u){if(typeof u=="string")return{data:{src:u}};var f={};return Object.keys(u).forEach(function(d){["src"].concat(Gt(p0)).includes(d)&&(f[d]=u[d])}),{data:f}}):Object.keys(n).reduce(function(u,f){var d=n[f],m=d.canPreview,g=d.data;return m&&u.push({data:g,id:f}),u},[])},[e,n]);return[l,a,!!e]}var d5=["visible","onVisibleChange","getContainer","current","movable","minScale","maxScale","countRender","closeIcon","onChange","onTransform","toolbarRender","imageRender"],f5=["src"],h5=function(t){var r,n=t.previewPrefixCls,o=n===void 0?"rc-image-preview":n,a=t.children,l=t.icons,u=l===void 0?{}:l,f=t.items,d=t.preview,m=t.fallback,g=$n(d)==="object"?d:{},v=g.visible,y=g.onVisibleChange,b=g.getContainer,C=g.current,p=g.movable,S=g.minScale,B=g.maxScale,k=g.countRender,$=g.closeIcon,T=g.onChange,O=g.onTransform,F=g.toolbarRender,P=g.imageRender,N=kr(g,d5),q=c5(f),R=Dt(q,3),X=R[0],G=R[1],_=R[2],j=bo(0,{value:C}),W=Dt(j,2),U=W[0],ee=W[1],V=Ht(!1),Y=Dt(V,2),fe=Y[0],be=Y[1],he=((r=X[U])===null||r===void 0?void 0:r.data)||{},De=he.src,$e=kr(he,f5),Z=bo(!!v,{value:v,onChange:function(ht,ot){y==null||y(ht,ot,U)}}),ie=Dt(Z,2),le=ie[0],ue=ie[1],Se=Ht(null),Be=Dt(Se,2),ge=Be[0],Ee=Be[1],Ae=D.useCallback(function(_e,ht,ot,Ie){var Ke=_?X.findIndex(function(Ue){return Ue.data.src===ht}):X.findIndex(function(Ue){return Ue.id===_e});ee(Ke<0?0:Ke),ue(!0),Ee({x:ot,y:Ie}),be(!0)},[X,_]);D.useEffect(function(){le?fe||ee(0):be(!1)},[le]);var Fe=function(ht,ot){ee(ht),T==null||T(ht,ot)},xe=function(){ue(!1),Ee(null)},Ce=D.useMemo(function(){return{register:G,onPreview:Ae}},[G,Ae]);return D.createElement(Oi.Provider,{value:Ce},a,D.createElement(F1,Et({"aria-hidden":!le,movable:p,visible:le,prefixCls:o,closeIcon:$,onClose:xe,mousePosition:ge,imgCommonProps:$e,src:De,fallback:m,icons:u,minScale:S,maxScale:B,getContainer:b,current:U,count:X.length,countRender:k,onTransform:O,toolbarRender:F,imageRender:P,onChange:Fe},N)))},Mf=0;function p5(e,t){var r=D.useState(function(){return Mf+=1,String(Mf)}),n=Dt(r,1),o=n[0],a=D.useContext(Oi),l={data:t,canPreview:e};return D.useEffect(function(){if(a)return a.register(o,l)},[]),D.useEffect(function(){a&&a.register(o,l)},[e,t]),o}var m5=["src","alt","onPreviewClose","prefixCls","previewPrefixCls","placeholder","fallback","width","height","style","preview","className","onClick","onError","wrapperClassName","wrapperStyle","rootClassName"],g5=["src","visible","onVisibleChange","getContainer","mask","maskClassName","movable","icons","scaleStep","minScale","maxScale","imageRender","toolbarRender"],Cc=function(t){var r=t.src,n=t.alt,o=t.onPreviewClose,a=t.prefixCls,l=a===void 0?"rc-image":a,u=t.previewPrefixCls,f=u===void 0?"".concat(l,"-preview"):u,d=t.placeholder,m=t.fallback,g=t.width,v=t.height,y=t.style,b=t.preview,C=b===void 0?!0:b,p=t.className,S=t.onClick,B=t.onError,k=t.wrapperClassName,$=t.wrapperStyle,T=t.rootClassName,O=kr(t,m5),F=d&&d!==!0,P=$n(C)==="object"?C:{},N=P.src,q=P.visible,R=q===void 0?void 0:q,X=P.onVisibleChange,G=X===void 0?o:X,_=P.getContainer,j=_===void 0?void 0:_,W=P.mask,U=P.maskClassName,ee=P.movable,V=P.icons,Y=P.scaleStep,fe=P.minScale,be=P.maxScale,he=P.imageRender,De=P.toolbarRender,$e=kr(P,g5),Z=N??r,ie=bo(!!R,{value:R,onChange:G}),le=Dt(ie,2),ue=le[0],Se=le[1],Be=B1({src:r,isCustomPlaceholder:F,fallback:m}),ge=Dt(Be,3),Ee=ge[0],Ae=ge[1],Fe=ge[2],xe=Ht(null),Ce=Dt(xe,2),_e=Ce[0],ht=Ce[1],ot=jo(Oi),Ie=!!C,Ke=function(){Se(!1),ht(null)},Ue=ft(l,k,T,Me({},"".concat(l,"-error"),Fe==="error")),vt=At(function(){var $t={};return p0.forEach(function(Bt){t[Bt]!==void 0&&($t[Bt]=t[Bt])}),$t},p0.map(function($t){return t[$t]})),tt=At(function(){return Ve(Ve({},vt),{},{src:Z})},[Z,vt]),nt=p5(Ie,tt),It=function(Bt){var Mt=Q3(Bt.target),je=Mt.left,pe=Mt.top;ot?ot.onPreview(nt,Z,je,pe):(ht({x:je,y:pe}),Se(!0)),S==null||S(Bt)};return D.createElement(D.Fragment,null,D.createElement("div",Et({},O,{className:Ue,onClick:Ie?It:S,style:Ve({width:g,height:v},$)}),D.createElement("img",Et({},vt,{className:ft("".concat(l,"-img"),Me({},"".concat(l,"-img-placeholder"),d===!0),p),style:Ve({height:v},y),ref:Ee},Ae,{width:g,height:v,onError:B})),Fe==="loading"&&D.createElement("div",{"aria-hidden":"true",className:"".concat(l,"-placeholder")},d),W&&Ie&&D.createElement("div",{className:ft("".concat(l,"-mask"),U),style:{display:(y==null?void 0:y.display)==="none"?"none":void 0}},W)),!ot&&Ie&&D.createElement(F1,Et({"aria-hidden":!ue,visible:ue,prefixCls:f,onClose:Ke,mousePosition:_e,src:Z,alt:n,imageInfo:{width:g,height:v},fallback:m,getContainer:j,icons:V,movable:ee,scaleStep:Y,minScale:fe,maxScale:be,rootClassName:T,imageRender:he,imgCommonProps:vt,toolbarRender:De},$e)))};Cc.PreviewGroup=h5;var v5={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M672 418H144c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H188V494h440v326z"}},{tag:"path",attrs:{d:"M819.3 328.5c-78.8-100.7-196-153.6-314.6-154.2l-.2-64c0-6.5-7.6-10.1-12.6-6.1l-128 101c-4 3.1-3.9 9.1 0 12.3L492 318.6c5.1 4 12.7.4 12.6-6.1v-63.9c12.9.1 25.9.9 38.8 2.5 42.1 5.2 82.1 18.2 119 38.7 38.1 21.2 71.2 49.7 98.4 84.3 27.1 34.7 46.7 73.7 58.1 115.8a325.95 325.95 0 016.5 140.9h74.9c14.8-103.6-11.3-213-81-302.3z"}}]},name:"rotate-left",theme:"outlined"},b5=function(t,r){return D.createElement(sn,Et({},t,{ref:r,icon:v5}))},y5=D.forwardRef(b5),x5={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M480.5 251.2c13-1.6 25.9-2.4 38.8-2.5v63.9c0 6.5 7.5 10.1 12.6 6.1L660 217.6c4-3.2 4-9.2 0-12.3l-128-101c-5.1-4-12.6-.4-12.6 6.1l-.2 64c-118.6.5-235.8 53.4-314.6 154.2A399.75 399.75 0 00123.5 631h74.9c-.9-5.3-1.7-10.7-2.4-16.1-5.1-42.1-2.1-84.1 8.9-124.8 11.4-42.2 31-81.1 58.1-115.8 27.2-34.7 60.3-63.2 98.4-84.3 37-20.6 76.9-33.6 119.1-38.8z"}},{tag:"path",attrs:{d:"M880 418H352c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H396V494h440v326z"}}]},name:"rotate-right",theme:"outlined"},w5=function(t,r){return D.createElement(sn,Et({},t,{ref:r,icon:x5}))},C5=D.forwardRef(w5),D5={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"swap",theme:"outlined"},k5=function(t,r){return D.createElement(sn,Et({},t,{ref:r,icon:D5}))},If=D.forwardRef(k5),E5={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}}]},name:"zoom-in",theme:"outlined"},S5=function(t,r){return D.createElement(sn,Et({},t,{ref:r,icon:E5}))},A5=D.forwardRef(S5),B5={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}}]},name:"zoom-out",theme:"outlined"},F5=function(t,r){return D.createElement(sn,Et({},t,{ref:r,icon:B5}))},T5=D.forwardRef(F5);const m0=e=>({position:e||"absolute",inset:0}),$5=e=>{const{iconCls:t,motionDurationSlow:r,paddingXXS:n,marginXXS:o,prefixCls:a,colorTextLightSolid:l}=e;return{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:l,background:new kn("#000").setA(.5).toRgbString(),cursor:"pointer",opacity:0,transition:`opacity ${r}`,[`.${a}-mask-info`]:Object.assign(Object.assign({},sc),{padding:`0 ${rt(n)}`,[t]:{marginInlineEnd:o,svg:{verticalAlign:"baseline"}}})}},N5=e=>{const{previewCls:t,modalMaskBg:r,paddingSM:n,marginXL:o,margin:a,paddingLG:l,previewOperationColorDisabled:u,previewOperationHoverColor:f,motionDurationSlow:d,iconCls:m,colorTextLightSolid:g}=e,v=new kn(r).setA(.1),y=v.clone().setA(.2);return{[`${t}-footer`]:{position:"fixed",bottom:o,left:{_skip_check_:!0,value:"50%"},display:"flex",flexDirection:"column",alignItems:"center",color:e.previewOperationColor,transform:"translateX(-50%)"},[`${t}-progress`]:{marginBottom:a},[`${t}-close`]:{position:"fixed",top:o,right:{_skip_check_:!0,value:o},display:"flex",color:g,backgroundColor:v.toRgbString(),borderRadius:"50%",padding:n,outline:0,border:0,cursor:"pointer",transition:`all ${d}`,"&:hover":{backgroundColor:y.toRgbString()},[`& > ${m}`]:{fontSize:e.previewOperationSize}},[`${t}-operations`]:{display:"flex",alignItems:"center",padding:`0 ${rt(l)}`,backgroundColor:v.toRgbString(),borderRadius:100,"&-operation":{marginInlineStart:n,padding:n,cursor:"pointer",transition:`all ${d}`,userSelect:"none",[`&:not(${t}-operations-operation-disabled):hover > ${m}`]:{color:f},"&-disabled":{color:u,cursor:"not-allowed"},"&:first-of-type":{marginInlineStart:0},[`& > ${m}`]:{fontSize:e.previewOperationSize}}}}},O5=e=>{const{modalMaskBg:t,iconCls:r,previewOperationColorDisabled:n,previewCls:o,zIndexPopup:a,motionDurationSlow:l}=e,u=new kn(t).setA(.1),f=u.clone().setA(.2);return{[`${o}-switch-left, ${o}-switch-right`]:{position:"fixed",insetBlockStart:"50%",zIndex:e.calc(a).add(1).equal(),display:"flex",alignItems:"center",justifyContent:"center",width:e.imagePreviewSwitchSize,height:e.imagePreviewSwitchSize,marginTop:e.calc(e.imagePreviewSwitchSize).mul(-1).div(2).equal(),color:e.previewOperationColor,background:u.toRgbString(),borderRadius:"50%",transform:"translateY(-50%)",cursor:"pointer",transition:`all ${l}`,userSelect:"none","&:hover":{background:f.toRgbString()},"&-disabled":{"&, &:hover":{color:n,background:"transparent",cursor:"not-allowed",[`> ${r}`]:{cursor:"not-allowed"}}},[`> ${r}`]:{fontSize:e.previewOperationSize}},[`${o}-switch-left`]:{insetInlineStart:e.marginSM},[`${o}-switch-right`]:{insetInlineEnd:e.marginSM}}},M5=e=>{const{motionEaseOut:t,previewCls:r,motionDurationSlow:n,componentCls:o}=e;return[{[`${o}-preview-root`]:{[r]:{height:"100%",textAlign:"center",pointerEvents:"none"},[`${r}-body`]:Object.assign(Object.assign({},m0()),{overflow:"hidden"}),[`${r}-img`]:{maxWidth:"100%",maxHeight:"70%",verticalAlign:"middle",transform:"scale3d(1, 1, 1)",cursor:"grab",transition:`transform ${n} ${t} 0s`,userSelect:"none","&-wrapper":Object.assign(Object.assign({},m0()),{transition:`transform ${n} ${t} 0s`,display:"flex",justifyContent:"center",alignItems:"center","& > *":{pointerEvents:"auto"},"&::before":{display:"inline-block",width:1,height:"50%",marginInlineEnd:-1,content:'""'}})},[`${r}-moving`]:{[`${r}-preview-img`]:{cursor:"grabbing","&-wrapper":{transitionDuration:"0s"}}}}},{[`${o}-preview-root`]:{[`${r}-wrap`]:{zIndex:e.zIndexPopup}}},{[`${o}-preview-operations-wrapper`]:{position:"fixed",zIndex:e.calc(e.zIndexPopup).add(1).equal()},"&":[N5(e),O5(e)]}]},I5=e=>{const{componentCls:t}=e;return{[t]:{position:"relative",display:"inline-block",[`${t}-img`]:{width:"100%",height:"auto",verticalAlign:"middle"},[`${t}-img-placeholder`]:{backgroundColor:e.colorBgContainerDisabled,backgroundImage:"url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"30%"},[`${t}-mask`]:Object.assign({},$5(e)),[`${t}-mask:hover`]:{opacity:1},[`${t}-placeholder`]:Object.assign({},m0())}}},R5=e=>{const{previewCls:t}=e;return{[`${t}-root`]:lc(e,"zoom"),"&":uv(e,!0)}},P5=e=>({zIndexPopup:e.zIndexPopupBase+80,previewOperationColor:new kn(e.colorTextLightSolid).setA(.65).toRgbString(),previewOperationHoverColor:new kn(e.colorTextLightSolid).setA(.85).toRgbString(),previewOperationColorDisabled:new kn(e.colorTextLightSolid).setA(.25).toRgbString(),previewOperationSize:e.fontSizeIcon*1.5}),T1=Bi("Image",e=>{const t=`${e.componentCls}-preview`,r=Jo(e,{previewCls:t,modalMaskBg:new kn("#000").setA(.45).toRgbString(),imagePreviewSwitchSize:e.controlHeightLG});return[I5(r),M5(r),lv(Jo(r,{componentCls:t})),R5(r)]},P5);var z5=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const $1={rotateLeft:D.createElement(y5,null),rotateRight:D.createElement(C5,null),zoomIn:D.createElement(A5,null),zoomOut:D.createElement(T5,null),close:D.createElement(cv,null),left:D.createElement(Is,null),right:D.createElement(Rs,null),flipX:D.createElement(If,null),flipY:D.createElement(If,{rotate:90})},_5=e=>{var{previewPrefixCls:t,preview:r}=e,n=z5(e,["previewPrefixCls","preview"]);const{getPrefixCls:o,direction:a}=D.useContext(Co),l=o("image",t),u=`${l}-preview`,f=o(),d=Ti(l),[m,g,v]=T1(l,d),[y]=rl("ImagePreview",typeof r=="object"?r.zIndex:void 0),b=D.useMemo(()=>Object.assign(Object.assign({},$1),{left:a==="rtl"?D.createElement(Rs,null):D.createElement(Is,null),right:a==="rtl"?D.createElement(Is,null):D.createElement(Rs,null)}),[a]),C=D.useMemo(()=>{var p;if(r===!1)return r;const S=typeof r=="object"?r:{},B=ft(g,v,d,(p=S.rootClassName)!==null&&p!==void 0?p:"");return Object.assign(Object.assign({},S),{transitionName:Ns(f,"zoom",S.transitionName),maskTransitionName:Ns(f,"fade",S.maskTransitionName),rootClassName:B,zIndex:y})},[r,f,y,g,v,d]);return m(D.createElement(Cc.PreviewGroup,Object.assign({preview:C,previewPrefixCls:u,icons:b},n)))};var Rf=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const N1=e=>{const{prefixCls:t,preview:r,className:n,rootClassName:o,style:a,fallback:l}=e,u=Rf(e,["prefixCls","preview","className","rootClassName","style","fallback"]),{getPrefixCls:f,getPopupContainer:d,className:m,style:g,preview:v,fallback:y}=dv("image"),[b]=fv("Image"),C=f("image",t),p=f(),S=Ti(C),[B,k,$]=T1(C,S),T=ft(o,k,$,S),O=ft(n,k,m),[F]=rl("ImagePreview",typeof r=="object"?r.zIndex:void 0),P=D.useMemo(()=>{if(r===!1)return r;const R=typeof r=="object"?r:{},{getContainer:X,closeIcon:G,rootClassName:_,destroyOnClose:j,destroyOnHidden:W}=R,U=Rf(R,["getContainer","closeIcon","rootClassName","destroyOnClose","destroyOnHidden"]);return Object.assign(Object.assign({mask:D.createElement("div",{className:`${C}-mask-info`},D.createElement(hv,null),b==null?void 0:b.preview),icons:$1},U),{destroyOnClose:W??j,rootClassName:ft(T,_),getContainer:X??d,transitionName:Ns(p,"zoom",R.transitionName),maskTransitionName:Ns(p,"fade",R.maskTransitionName),zIndex:F,closeIcon:G??(v==null?void 0:v.closeIcon)})},[r,b,v==null?void 0:v.closeIcon]),N=Object.assign(Object.assign({},g),a),q=l??y;return B(D.createElement(Cc,Object.assign({prefixCls:C,preview:P,rootClassName:T,className:O,style:N,fallback:q},u)))};N1.PreviewGroup=_5;var To={},Mi="rc-table-internal-hook";function Dc(e){var t=D.createContext(void 0),r=function(o){var a=o.value,l=o.children,u=D.useRef(a);u.current=a;var f=D.useState(function(){return{getValue:function(){return u.current},listeners:new Set}}),d=Dt(f,1),m=d[0];return Ro(function(){K4(function(){m.listeners.forEach(function(g){g(a)})})},[a]),D.createElement(t.Provider,{value:m},l)};return{Context:t,Provider:r,defaultValue:e}}function tn(e,t){var r=Un(typeof t=="function"?t:function(g){if(t===void 0)return g;if(!Array.isArray(t))return g[t];var v={};return t.forEach(function(y){v[y]=g[y]}),v}),n=D.useContext(e==null?void 0:e.Context),o=n||{},a=o.listeners,l=o.getValue,u=D.useRef();u.current=r(n?l():e==null?void 0:e.defaultValue);var f=D.useState({}),d=Dt(f,2),m=d[1];return Ro(function(){if(!n)return;function g(v){var y=r(v);Io(u.current,y,!0)||m({})}return a.add(g),function(){a.delete(g)}},[n]),u.current}function j5(){var e=D.createContext(null);function t(){return D.useContext(e)}function r(o,a){var l=Bs(o),u=function(d,m){var g=l?{ref:m}:{},v=D.useRef(0),y=D.useRef(d),b=t();return b!==null?D.createElement(o,Et({},d,g)):((!a||a(y.current,d))&&(v.current+=1),y.current=d,D.createElement(e.Provider,{value:v.current},D.createElement(o,Et({},d,g))))};return l?D.forwardRef(u):u}function n(o,a){var l=Bs(o),u=function(d,m){var g=l?{ref:m}:{};return t(),D.createElement(o,Et({},d,g))};return l?D.memo(D.forwardRef(u),a):D.memo(u,a)}return{makeImmutable:r,responseImmutable:n,useImmutableMark:t}}var kc=j5(),O1=kc.makeImmutable,Oa=kc.responseImmutable,L5=kc.useImmutableMark,ln=Dc(),M1=D.createContext({renderWithProps:!1}),H5="RC_TABLE_KEY";function K5(e){return e==null?[]:Array.isArray(e)?e:[e]}function ul(e){var t=[],r={};return e.forEach(function(n){for(var o=n||{},a=o.key,l=o.dataIndex,u=a||K5(l).join("-")||H5;r[u];)u="".concat(u,"_next");r[u]=!0,t.push(u)}),t}function g0(e){return e!=null}function q5(e){return typeof e=="number"&&!Number.isNaN(e)}function V5(e){return e&&$n(e)==="object"&&!Array.isArray(e)&&!D.isValidElement(e)}function W5(e,t,r,n,o,a){var l=D.useContext(M1),u=L5(),f=ac(function(){if(g0(n))return[n];var d=t==null||t===""?[]:Array.isArray(t)?t:[t],m=cc(e,d),g=m,v=void 0;if(o){var y=o(m,e,r);V5(y)?(g=y.children,v=y.props,l.renderWithProps=!0):g=y}return[g,v]},[u,e,n,t,o,r],function(d,m){if(a){var g=Dt(d,2),v=g[1],y=Dt(m,2),b=y[1];return a(b,v)}return l.renderWithProps?!0:!Io(d,m,!0)});return f}function U5(e,t,r,n){var o=e+t-1;return e<=n&&o>=r}function X5(e,t){return tn(ln,function(r){var n=U5(e,t||1,r.hoverStartRow,r.hoverEndRow);return[n,r.onHover]})}var G5=function(t){var r=t.ellipsis,n=t.rowType,o=t.children,a,l=r===!0?{showTitle:!0}:r;return l&&(l.showTitle||n==="header")&&(typeof o=="string"||typeof o=="number"?a=o.toString():D.isValidElement(o)&&typeof o.props.children=="string"&&(a=o.props.children)),a};function Y5(e){var t,r,n,o,a,l,u,f,d=e.component,m=e.children,g=e.ellipsis,v=e.scope,y=e.prefixCls,b=e.className,C=e.align,p=e.record,S=e.render,B=e.dataIndex,k=e.renderIndex,$=e.shouldCellUpdate,T=e.index,O=e.rowType,F=e.colSpan,P=e.rowSpan,N=e.fixLeft,q=e.fixRight,R=e.firstFixLeft,X=e.lastFixLeft,G=e.firstFixRight,_=e.lastFixRight,j=e.appendNode,W=e.additionalProps,U=W===void 0?{}:W,ee=e.isSticky,V="".concat(y,"-cell"),Y=tn(ln,["supportSticky","allColumnsFixedLeft","rowHoverable"]),fe=Y.supportSticky,be=Y.allColumnsFixedLeft,he=Y.rowHoverable,De=W5(p,B,k,m,S,$),$e=Dt(De,2),Z=$e[0],ie=$e[1],le={},ue=typeof N=="number"&&fe,Se=typeof q=="number"&&fe;ue&&(le.position="sticky",le.left=N),Se&&(le.position="sticky",le.right=q);var Be=(t=(r=(n=ie==null?void 0:ie.colSpan)!==null&&n!==void 0?n:U.colSpan)!==null&&r!==void 0?r:F)!==null&&t!==void 0?t:1,ge=(o=(a=(l=ie==null?void 0:ie.rowSpan)!==null&&l!==void 0?l:U.rowSpan)!==null&&a!==void 0?a:P)!==null&&o!==void 0?o:1,Ee=X5(T,ge),Ae=Dt(Ee,2),Fe=Ae[0],xe=Ae[1],Ce=Un(function(vt){var tt;p&&xe(T,T+ge-1),U==null||(tt=U.onMouseEnter)===null||tt===void 0||tt.call(U,vt)}),_e=Un(function(vt){var tt;p&&xe(-1,-1),U==null||(tt=U.onMouseLeave)===null||tt===void 0||tt.call(U,vt)});if(Be===0||ge===0)return null;var ht=(u=U.title)!==null&&u!==void 0?u:G5({rowType:O,ellipsis:g,children:Z}),ot=ft(V,b,(f={},Me(Me(Me(Me(Me(Me(Me(Me(Me(Me(f,"".concat(V,"-fix-left"),ue&&fe),"".concat(V,"-fix-left-first"),R&&fe),"".concat(V,"-fix-left-last"),X&&fe),"".concat(V,"-fix-left-all"),X&&be&&fe),"".concat(V,"-fix-right"),Se&&fe),"".concat(V,"-fix-right-first"),G&&fe),"".concat(V,"-fix-right-last"),_&&fe),"".concat(V,"-ellipsis"),g),"".concat(V,"-with-append"),j),"".concat(V,"-fix-sticky"),(ue||Se)&&ee&&fe),Me(f,"".concat(V,"-row-hover"),!ie&&Fe)),U.className,ie==null?void 0:ie.className),Ie={};C&&(Ie.textAlign=C);var Ke=Ve(Ve(Ve(Ve({},ie==null?void 0:ie.style),le),Ie),U.style),Ue=Z;return $n(Ue)==="object"&&!Array.isArray(Ue)&&!D.isValidElement(Ue)&&(Ue=null),g&&(X||G)&&(Ue=D.createElement("span",{className:"".concat(V,"-content")},Ue)),D.createElement(d,Et({},ie,U,{className:ot,style:Ke,title:ht,scope:v,onMouseEnter:he?Ce:void 0,onMouseLeave:he?_e:void 0,colSpan:Be!==1?Be:null,rowSpan:ge!==1?ge:null}),j,Ue)}const Ma=D.memo(Y5);function Ec(e,t,r,n,o){var a=r[e]||{},l=r[t]||{},u,f;a.fixed==="left"?u=n.left[o==="rtl"?t:e]:l.fixed==="right"&&(f=n.right[o==="rtl"?e:t]);var d=!1,m=!1,g=!1,v=!1,y=r[t+1],b=r[e-1],C=y&&!y.fixed||b&&!b.fixed||r.every(function($){return $.fixed==="left"});if(o==="rtl"){if(u!==void 0){var p=b&&b.fixed==="left";v=!p&&C}else if(f!==void 0){var S=y&&y.fixed==="right";g=!S&&C}}else if(u!==void 0){var B=y&&y.fixed==="left";d=!B&&C}else if(f!==void 0){var k=b&&b.fixed==="right";m=!k&&C}return{fixLeft:u,fixRight:f,lastFixLeft:d,firstFixRight:m,lastFixRight:g,firstFixLeft:v,isSticky:n.isSticky}}var I1=D.createContext({});function Z5(e){var t=e.className,r=e.index,n=e.children,o=e.colSpan,a=o===void 0?1:o,l=e.rowSpan,u=e.align,f=tn(ln,["prefixCls","direction"]),d=f.prefixCls,m=f.direction,g=D.useContext(I1),v=g.scrollColumnIndex,y=g.stickyOffsets,b=g.flattenColumns,C=r+a-1,p=C+1===v?a+1:a,S=Ec(r,r+p-1,b,y,m);return D.createElement(Ma,Et({className:t,index:r,component:"td",prefixCls:d,record:null,dataIndex:null,align:u,colSpan:p,rowSpan:l,render:function(){return n}},S))}var J5=["children"];function Q5(e){var t=e.children,r=kr(e,J5);return D.createElement("tr",r,t)}function cl(e){var t=e.children;return t}cl.Row=Q5;cl.Cell=Z5;function e6(e){var t=e.children,r=e.stickyOffsets,n=e.flattenColumns,o=tn(ln,"prefixCls"),a=n.length-1,l=n[a],u=D.useMemo(function(){return{stickyOffsets:r,flattenColumns:n,scrollColumnIndex:l!=null&&l.scrollbar?a:null}},[l,n,a,r]);return D.createElement(I1.Provider,{value:u},D.createElement("tfoot",{className:"".concat(o,"-summary")},t))}const Yi=Oa(e6);var R1=cl;function t6(e){return null}function r6(e){return null}function P1(e,t,r,n,o,a,l){var u=a(t,l);e.push({record:t,indent:r,index:l,rowKey:u});var f=o==null?void 0:o.has(u);if(t&&Array.isArray(t[n])&&f)for(var d=0;d<t[n].length;d+=1)P1(e,t[n][d],r+1,n,o,a,d)}function z1(e,t,r,n){var o=D.useMemo(function(){if(r!=null&&r.size){for(var a=[],l=0;l<(e==null?void 0:e.length);l+=1){var u=e[l];P1(a,u,0,t,r,n,l)}return a}return e==null?void 0:e.map(function(f,d){return{record:f,indent:0,index:d,rowKey:n(f,d)}})},[e,t,r,n]);return o}function _1(e,t,r,n){var o=tn(ln,["prefixCls","fixedInfoList","flattenColumns","expandableType","expandRowByClick","onTriggerExpand","rowClassName","expandedRowClassName","indentSize","expandIcon","expandedRowRender","expandIconColumnIndex","expandedKeys","childrenColumnName","rowExpandable","onRow"]),a=o.flattenColumns,l=o.expandableType,u=o.expandedKeys,f=o.childrenColumnName,d=o.onTriggerExpand,m=o.rowExpandable,g=o.onRow,v=o.expandRowByClick,y=o.rowClassName,b=l==="nest",C=l==="row"&&(!m||m(e)),p=C||b,S=u&&u.has(t),B=f&&e&&e[f],k=Un(d),$=g==null?void 0:g(e,r),T=$==null?void 0:$.onClick,O=function(q){v&&p&&d(e,q);for(var R=arguments.length,X=new Array(R>1?R-1:0),G=1;G<R;G++)X[G-1]=arguments[G];T==null||T.apply(void 0,[q].concat(X))},F;typeof y=="string"?F=y:typeof y=="function"&&(F=y(e,r,n));var P=ul(a);return Ve(Ve({},o),{},{columnsKey:P,nestExpandable:b,expanded:S,hasNestChildren:B,record:e,onTriggerExpand:k,rowSupportExpand:C,expandable:p,rowProps:Ve(Ve({},$),{},{className:ft(F,$==null?void 0:$.className),onClick:O})})}function j1(e){var t=e.prefixCls,r=e.children,n=e.component,o=e.cellComponent,a=e.className,l=e.expanded,u=e.colSpan,f=e.isEmpty,d=e.stickyOffset,m=d===void 0?0:d,g=tn(ln,["scrollbarSize","fixHeader","fixColumn","componentWidth","horizonScroll"]),v=g.scrollbarSize,y=g.fixHeader,b=g.fixColumn,C=g.componentWidth,p=g.horizonScroll,S=r;return(f?p&&C:b)&&(S=D.createElement("div",{style:{width:C-m-(y&&!f?v:0),position:"sticky",left:m,overflow:"hidden"},className:"".concat(t,"-expanded-row-fixed")},S)),D.createElement(n,{className:a,style:{display:l?null:"none"}},D.createElement(Ma,{component:o,prefixCls:t,colSpan:u},S))}function n6(e){var t=e.prefixCls,r=e.record,n=e.onExpand,o=e.expanded,a=e.expandable,l="".concat(t,"-row-expand-icon");if(!a)return D.createElement("span",{className:ft(l,"".concat(t,"-row-spaced"))});var u=function(d){n(r,d),d.stopPropagation()};return D.createElement("span",{className:ft(l,Me(Me({},"".concat(t,"-row-expanded"),o),"".concat(t,"-row-collapsed"),!o)),onClick:u})}function o6(e,t,r){var n=[];function o(a){(a||[]).forEach(function(l,u){n.push(t(l,u)),o(l[r])})}return o(e),n}function L1(e,t,r,n){return typeof e=="string"?e:typeof e=="function"?e(t,r,n):""}function H1(e,t,r,n,o){var a,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0,f=e.record,d=e.prefixCls,m=e.columnsKey,g=e.fixedInfoList,v=e.expandIconColumnIndex,y=e.nestExpandable,b=e.indentSize,C=e.expandIcon,p=e.expanded,S=e.hasNestChildren,B=e.onTriggerExpand,k=e.expandable,$=e.expandedKeys,T=m[r],O=g[r],F;r===(v||0)&&y&&(F=D.createElement(D.Fragment,null,D.createElement("span",{style:{paddingLeft:"".concat(b*n,"px")},className:"".concat(d,"-row-indent indent-level-").concat(n)}),C({prefixCls:d,expanded:p,expandable:S,record:f,onExpand:B})));var P=((a=t.onCell)===null||a===void 0?void 0:a.call(t,f,o))||{};if(u){var N=P.rowSpan,q=N===void 0?1:N;if(k&&q&&r<u){for(var R=q,X=o;X<o+q;X+=1){var G=l[X];$.has(G)&&(R+=1)}P.rowSpan=R}}return{key:T,fixedInfo:O,appendCellNode:F,additionalCellProps:P}}function a6(e){var t=e.className,r=e.style,n=e.record,o=e.index,a=e.renderIndex,l=e.rowKey,u=e.rowKeys,f=e.indent,d=f===void 0?0:f,m=e.rowComponent,g=e.cellComponent,v=e.scopeCellComponent,y=e.expandedRowInfo,b=_1(n,l,o,d),C=b.prefixCls,p=b.flattenColumns,S=b.expandedRowClassName,B=b.expandedRowRender,k=b.rowProps,$=b.expanded,T=b.rowSupportExpand,O=D.useRef(!1);O.current||(O.current=$);var F=L1(S,n,o,d),P=D.createElement(m,Et({},k,{"data-row-key":l,className:ft(t,"".concat(C,"-row"),"".concat(C,"-row-level-").concat(d),k==null?void 0:k.className,Me({},F,d>=1)),style:Ve(Ve({},r),k==null?void 0:k.style)}),p.map(function(R,X){var G=R.render,_=R.dataIndex,j=R.className,W=H1(b,R,X,d,o,u,y==null?void 0:y.offset),U=W.key,ee=W.fixedInfo,V=W.appendCellNode,Y=W.additionalCellProps;return D.createElement(Ma,Et({className:j,ellipsis:R.ellipsis,align:R.align,scope:R.rowScope,component:R.rowScope?v:g,prefixCls:C,key:U,record:n,index:o,renderIndex:a,dataIndex:_,render:G,shouldCellUpdate:R.shouldCellUpdate},ee,{appendNode:V,additionalProps:Y}))})),N;if(T&&(O.current||$)){var q=B(n,o,d+1,$);N=D.createElement(j1,{expanded:$,className:ft("".concat(C,"-expanded-row"),"".concat(C,"-expanded-row-level-").concat(d+1),F),prefixCls:C,component:m,cellComponent:g,colSpan:y?y.colSpan:p.length,stickyOffset:y==null?void 0:y.sticky,isEmpty:!1},q)}return D.createElement(D.Fragment,null,P,N)}const i6=Oa(a6);function s6(e){var t=e.columnKey,r=e.onColumnResize,n=e.prefixCls,o=e.title,a=D.useRef();return Ro(function(){a.current&&r(t,a.current.offsetWidth)},[]),D.createElement(dc,{data:t},D.createElement("th",{ref:a,className:"".concat(n,"-measure-cell")},D.createElement("div",{className:"".concat(n,"-measure-cell-content")},o||"\xA0")))}function l6(e){var t=e.prefixCls,r=e.columnsKey,n=e.onColumnResize,o=e.columns,a=D.useRef(null),l=tn(ln,["measureRowRender"]),u=l.measureRowRender,f=D.createElement("tr",{"aria-hidden":"true",className:"".concat(t,"-measure-row"),ref:a,tabIndex:-1},D.createElement(dc.Collection,{onBatchResize:function(m){Vm(a.current)&&m.forEach(function(g){var v=g.data,y=g.size;n(v,y.offsetWidth)})}},r.map(function(d){var m=o.find(function(y){return y.key===d}),g=m==null?void 0:m.title,v=D.isValidElement(g)?D.cloneElement(g,{ref:null}):g;return D.createElement(s6,{prefixCls:t,key:d,columnKey:d,onColumnResize:n,title:v})})));return u?u(f):f}function u6(e){var t=e.data,r=e.measureColumnWidth,n=tn(ln,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode","expandedRowOffset","fixedInfoList","colWidths"]),o=n.prefixCls,a=n.getComponent,l=n.onColumnResize,u=n.flattenColumns,f=n.getRowKey,d=n.expandedKeys,m=n.childrenColumnName,g=n.emptyNode,v=n.expandedRowOffset,y=v===void 0?0:v,b=n.colWidths,C=z1(t,m,d,f),p=D.useMemo(function(){return C.map(function(N){return N.rowKey})},[C]),S=D.useRef({renderWithProps:!1}),B=D.useMemo(function(){for(var N=u.length-y,q=0,R=0;R<y;R+=1)q+=b[R]||0;return{offset:y,colSpan:N,sticky:q}},[u.length,y,b]),k=a(["body","wrapper"],"tbody"),$=a(["body","row"],"tr"),T=a(["body","cell"],"td"),O=a(["body","cell"],"th"),F;t.length?F=C.map(function(N,q){var R=N.record,X=N.indent,G=N.index,_=N.rowKey;return D.createElement(i6,{key:_,rowKey:_,rowKeys:p,record:R,index:q,renderIndex:G,rowComponent:$,cellComponent:T,scopeCellComponent:O,indent:X,expandedRowInfo:B})}):F=D.createElement(j1,{expanded:!0,className:"".concat(o,"-placeholder"),prefixCls:o,component:$,cellComponent:T,colSpan:u.length,isEmpty:!0},g);var P=ul(u);return D.createElement(M1.Provider,{value:S.current},D.createElement(k,{className:"".concat(o,"-tbody")},r&&D.createElement(l6,{prefixCls:o,columnsKey:P,onColumnResize:l,columns:u}),F))}const c6=Oa(u6);var d6=["expandable"],si="RC_TABLE_INTERNAL_COL_DEFINE";function f6(e){var t=e.expandable,r=kr(e,d6),n;return"expandable"in e?n=Ve(Ve({},r),t):n=r,n.showExpandColumn===!1&&(n.expandIconColumnIndex=-1),n}var h6=["columnType"];function K1(e){for(var t=e.colWidths,r=e.columns,n=e.columCount,o=tn(ln,["tableLayout"]),a=o.tableLayout,l=[],u=n||r.length,f=!1,d=u-1;d>=0;d-=1){var m=t[d],g=r&&r[d],v=void 0,y=void 0;if(g&&(v=g[si],a==="auto"&&(y=g.minWidth)),m||y||v||f){var b=v||{};b.columnType;var C=kr(b,h6);l.unshift(D.createElement("col",Et({key:d,style:{width:m,minWidth:y}},C))),f=!0}}return l.length>0?D.createElement("colgroup",null,l):null}var p6=["className","noData","columns","flattenColumns","colWidths","colGroup","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","scrollX","tableLayout","onScroll","children"];function m6(e,t){return At(function(){for(var r=[],n=0;n<t;n+=1){var o=e[n];if(o!==void 0)r[n]=o;else return null}return r},[e.join("_"),t])}var g6=D.forwardRef(function(e,t){var r=e.className,n=e.noData,o=e.columns,a=e.flattenColumns,l=e.colWidths,u=e.colGroup,f=e.columCount,d=e.stickyOffsets,m=e.direction,g=e.fixHeader,v=e.stickyTopOffset,y=e.stickyBottomOffset,b=e.stickyClassName,C=e.scrollX,p=e.tableLayout,S=p===void 0?"fixed":p,B=e.onScroll,k=e.children,$=kr(e,p6),T=tn(ln,["prefixCls","scrollbarSize","isSticky","getComponent"]),O=T.prefixCls,F=T.scrollbarSize,P=T.isSticky,N=T.getComponent,q=N(["header","table"],"table"),R=P&&!g?0:F,X=D.useRef(null),G=D.useCallback(function(fe){bf(t,fe),bf(X,fe)},[]);D.useEffect(function(){function fe(he){var De=he,$e=De.currentTarget,Z=De.deltaX;Z&&(B({currentTarget:$e,scrollLeft:$e.scrollLeft+Z}),he.preventDefault())}var be=X.current;return be==null||be.addEventListener("wheel",fe,{passive:!1}),function(){be==null||be.removeEventListener("wheel",fe)}},[]);var _=a[a.length-1],j={fixed:_?_.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(O,"-cell-scrollbar")}}},W=At(function(){return R?[].concat(Gt(o),[j]):o},[R,o]),U=At(function(){return R?[].concat(Gt(a),[j]):a},[R,a]),ee=At(function(){var fe=d.right,be=d.left;return Ve(Ve({},d),{},{left:m==="rtl"?[].concat(Gt(be.map(function(he){return he+R})),[0]):be,right:m==="rtl"?fe:[].concat(Gt(fe.map(function(he){return he+R})),[0]),isSticky:P})},[R,d,P]),V=m6(l,f),Y=At(function(){var fe=!V||!V.length||V.every(function(be){return!be});return n||fe},[n,V]);return D.createElement("div",{style:Ve({overflow:"hidden"},P?{top:v,bottom:y}:{}),ref:G,className:ft(r,Me({},b,!!b))},D.createElement(q,{style:{tableLayout:S,minWidth:"100%",width:C}},Y?u:D.createElement(K1,{colWidths:[].concat(Gt(V),[R]),columCount:f+1,columns:U}),k(Ve(Ve({},$),{},{stickyOffsets:ee,columns:W,flattenColumns:U}))))});const Pf=D.memo(g6);var v6=function(t){var r=t.cells,n=t.stickyOffsets,o=t.flattenColumns,a=t.rowComponent,l=t.cellComponent,u=t.onHeaderRow,f=t.index,d=tn(ln,["prefixCls","direction"]),m=d.prefixCls,g=d.direction,v;u&&(v=u(r.map(function(b){return b.column}),f));var y=ul(r.map(function(b){return b.column}));return D.createElement(a,v,r.map(function(b,C){var p=b.column,S=Ec(b.colStart,b.colEnd,o,n,g),B;return p&&p.onHeaderCell&&(B=b.column.onHeaderCell(p)),D.createElement(Ma,Et({},b,{scope:p.title?b.colSpan>1?"colgroup":"col":null,ellipsis:p.ellipsis,align:p.align,component:l,prefixCls:m,key:y[C]},S,{additionalProps:B,rowType:"header"}))}))};function b6(e){var t=[];function r(l,u){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;t[f]=t[f]||[];var d=u,m=l.filter(Boolean).map(function(g){var v={key:g.key,className:g.className||"",children:g.title,column:g,colStart:d},y=1,b=g.children;return b&&b.length>0&&(y=r(b,d,f+1).reduce(function(C,p){return C+p},0),v.hasSubColumns=!0),"colSpan"in g&&(y=g.colSpan),"rowSpan"in g&&(v.rowSpan=g.rowSpan),v.colSpan=y,v.colEnd=v.colStart+y-1,t[f].push(v),d+=y,y});return m}r(e,0);for(var n=t.length,o=function(u){t[u].forEach(function(f){!("rowSpan"in f)&&!f.hasSubColumns&&(f.rowSpan=n-u)})},a=0;a<n;a+=1)o(a);return t}var y6=function(t){var r=t.stickyOffsets,n=t.columns,o=t.flattenColumns,a=t.onHeaderRow,l=tn(ln,["prefixCls","getComponent"]),u=l.prefixCls,f=l.getComponent,d=D.useMemo(function(){return b6(n)},[n]),m=f(["header","wrapper"],"thead"),g=f(["header","row"],"tr"),v=f(["header","cell"],"th");return D.createElement(m,{className:"".concat(u,"-thead")},d.map(function(y,b){var C=D.createElement(v6,{key:b,flattenColumns:o,cells:y,stickyOffsets:r,rowComponent:g,cellComponent:v,onHeaderRow:a,index:b});return C}))};const zf=Oa(y6);function _f(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return typeof t=="number"?t:t.endsWith("%")?e*parseFloat(t)/100:null}function x6(e,t,r){return D.useMemo(function(){if(t&&t>0){var n=0,o=0;e.forEach(function(v){var y=_f(t,v.width);y?n+=y:o+=1});var a=Math.max(t,r),l=Math.max(a-n,o),u=o,f=l/o,d=0,m=e.map(function(v){var y=Ve({},v),b=_f(t,y.width);if(b)y.width=b;else{var C=Math.floor(f);y.width=u===1?l:C,l-=C,u-=1}return d+=y.width,y});if(d<a){var g=a/d;l=a,m.forEach(function(v,y){var b=Math.floor(v.width*g);v.width=y===m.length-1?l:b,l-=b})}return[m,Math.max(d,a)]}return[e,t]},[e,t,r])}var w6=["children"],C6=["fixed"];function Sc(e){return tl(e).filter(function(t){return D.isValidElement(t)}).map(function(t){var r=t.key,n=t.props,o=n.children,a=kr(n,w6),l=Ve({key:r},a);return o&&(l.children=Sc(o)),l})}function q1(e){return e.filter(function(t){return t&&$n(t)==="object"&&!t.hidden}).map(function(t){var r=t.children;return r&&r.length>0?Ve(Ve({},t),{},{children:q1(r)}):t})}function v0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"key";return e.filter(function(r){return r&&$n(r)==="object"}).reduce(function(r,n,o){var a=n.fixed,l=a===!0?"left":a,u="".concat(t,"-").concat(o),f=n.children;return f&&f.length>0?[].concat(Gt(r),Gt(v0(f,u).map(function(d){var m;return Ve(Ve({},d),{},{fixed:(m=d.fixed)!==null&&m!==void 0?m:l})}))):[].concat(Gt(r),[Ve(Ve({key:u},n),{},{fixed:l})])},[])}function D6(e){return e.map(function(t){var r=t.fixed,n=kr(t,C6),o=r;return r==="left"?o="right":r==="right"&&(o="left"),Ve({fixed:o},n)})}function k6(e,t){var r=e.prefixCls,n=e.columns,o=e.children,a=e.expandable,l=e.expandedKeys,u=e.columnTitle,f=e.getRowKey,d=e.onTriggerExpand,m=e.expandIcon,g=e.rowExpandable,v=e.expandIconColumnIndex,y=e.expandedRowOffset,b=y===void 0?0:y,C=e.direction,p=e.expandRowByClick,S=e.columnWidth,B=e.fixed,k=e.scrollWidth,$=e.clientWidth,T=D.useMemo(function(){var _=n||Sc(o)||[];return q1(_.slice())},[n,o]),O=D.useMemo(function(){if(a){var _=T.slice();if(!_.includes(To)){var j=v||0,W=j===0&&B==="right"?T.length:j;W>=0&&_.splice(W,0,To)}var U=_.indexOf(To);_=_.filter(function(fe,be){return fe!==To||be===U});var ee=T[U],V;B?V=B:V=ee?ee.fixed:null;var Y=Me(Me(Me(Me(Me(Me({},si,{className:"".concat(r,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",u),"fixed",V),"className","".concat(r,"-row-expand-icon-cell")),"width",S),"render",function(be,he,De){var $e=f(he,De),Z=l.has($e),ie=g?g(he):!0,le=m({prefixCls:r,expanded:Z,expandable:ie,record:he,onExpand:d});return p?D.createElement("span",{onClick:function(Se){return Se.stopPropagation()}},le):le});return _.map(function(fe,be){var he=fe===To?Y:fe;return be<b?Ve(Ve({},he),{},{fixed:he.fixed||"left"}):he})}return T.filter(function(fe){return fe!==To})},[a,T,f,l,m,C,b]),F=D.useMemo(function(){var _=O;return t&&(_=t(_)),_.length||(_=[{render:function(){return null}}]),_},[t,O,C]),P=D.useMemo(function(){return C==="rtl"?D6(v0(F)):v0(F)},[F,C,k]),N=D.useMemo(function(){for(var _=-1,j=P.length-1;j>=0;j-=1){var W=P[j].fixed;if(W==="left"||W===!0){_=j;break}}if(_>=0)for(var U=0;U<=_;U+=1){var ee=P[U].fixed;if(ee!=="left"&&ee!==!0)return!0}var V=P.findIndex(function(be){var he=be.fixed;return he==="right"});if(V>=0)for(var Y=V;Y<P.length;Y+=1){var fe=P[Y].fixed;if(fe!=="right")return!0}return!1},[P]),q=x6(P,k,$),R=Dt(q,2),X=R[0],G=R[1];return[F,X,G,N]}function E6(e,t,r){var n=f6(e),o=n.expandIcon,a=n.expandedRowKeys,l=n.defaultExpandedRowKeys,u=n.defaultExpandAllRows,f=n.expandedRowRender,d=n.onExpand,m=n.onExpandedRowsChange,g=n.childrenColumnName,v=o||n6,y=g||"children",b=D.useMemo(function(){return f?"row":e.expandable&&e.internalHooks===Mi&&e.expandable.__PARENT_RENDER_ICON__||t.some(function(T){return T&&$n(T)==="object"&&T[y]})?"nest":!1},[!!f,t]),C=D.useState(function(){return l||(u?o6(t,r,y):[])}),p=Dt(C,2),S=p[0],B=p[1],k=D.useMemo(function(){return new Set(a||S||[])},[a,S]),$=D.useCallback(function(T){var O=r(T,t.indexOf(T)),F,P=k.has(O);P?(k.delete(O),F=Gt(k)):F=[].concat(Gt(k),[O]),B(F),d&&d(!P,T),m&&m(F)},[r,k,t,d,m]);return[n,b,k,v,y,$]}function S6(e,t,r){var n=e.map(function(o,a){return Ec(a,a,e,t,r)});return ac(function(){return n},[n],function(o,a){return!Io(o,a)})}function A6(e){var t=Vt(e),r=Ht({}),n=Dt(r,2),o=n[1],a=Vt(null),l=Vt([]);function u(f){l.current.push(f);var d=Promise.resolve();a.current=d,d.then(function(){if(a.current===d){var m=l.current,g=t.current;l.current=[],m.forEach(function(v){t.current=v(t.current)}),a.current=null,g!==t.current&&o({})}})}return sr(function(){return function(){a.current=null}},[]),[t.current,u]}function B6(e){var t=Vt(null),r=Vt();function n(){window.clearTimeout(r.current)}function o(l){t.current=l,n(),r.current=window.setTimeout(function(){t.current=null,r.current=void 0},100)}function a(){return t.current}return sr(function(){return n},[]),[o,a]}function F6(){var e=D.useState(-1),t=Dt(e,2),r=t[0],n=t[1],o=D.useState(-1),a=Dt(o,2),l=a[0],u=a[1],f=D.useCallback(function(d,m){n(d),u(m)},[]);return[r,l,f]}var jf=Hm()?window:null;function T6(e,t){var r=$n(e)==="object"?e:{},n=r.offsetHeader,o=n===void 0?0:n,a=r.offsetSummary,l=a===void 0?0:a,u=r.offsetScroll,f=u===void 0?0:u,d=r.getContainer,m=d===void 0?function(){return jf}:d,g=m()||jf,v=!!e;return D.useMemo(function(){return{isSticky:v,stickyClassName:v?"".concat(t,"-sticky-holder"):"",offsetHeader:o,offsetSummary:l,offsetScroll:f,container:g}},[v,f,o,l,t,g])}function $6(e,t,r){var n=At(function(){var o=t.length,a=function(d,m,g){for(var v=[],y=0,b=d;b!==m;b+=g)v.push(y),t[b].fixed&&(y+=e[b]||0);return v},l=a(0,o,1),u=a(o-1,-1,-1).reverse();return r==="rtl"?{left:u,right:l}:{left:l,right:u}},[e,t,r]);return n}function Lf(e){var t=e.className,r=e.children;return D.createElement("div",{className:t},r)}function Hf(e){var t=fc(e),r=t.getBoundingClientRect(),n=document.documentElement;return{left:r.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:r.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}var N6=function(t,r){var n,o,a=t.scrollBodyRef,l=t.onScroll,u=t.offsetScroll,f=t.container,d=t.direction,m=tn(ln,"prefixCls"),g=((n=a.current)===null||n===void 0?void 0:n.scrollWidth)||0,v=((o=a.current)===null||o===void 0?void 0:o.clientWidth)||0,y=g&&v*(v/g),b=D.useRef(),C=A6({scrollLeft:0,isHiddenScrollBar:!0}),p=Dt(C,2),S=p[0],B=p[1],k=D.useRef({delta:0,x:0}),$=D.useState(!1),T=Dt($,2),O=T[0],F=T[1],P=D.useRef(null);D.useEffect(function(){return function(){Rn.cancel(P.current)}},[]);var N=function(){F(!1)},q=function(j){j.persist(),k.current.delta=j.pageX-S.scrollLeft,k.current.x=0,F(!0),j.preventDefault()},R=function(j){var W,U=j||((W=window)===null||W===void 0?void 0:W.event),ee=U.buttons;if(!O||ee===0){O&&F(!1);return}var V=k.current.x+j.pageX-k.current.x-k.current.delta,Y=d==="rtl";V=Math.max(Y?y-v:0,Math.min(Y?0:v-y,V));var fe=!Y||Math.abs(V)+Math.abs(y)<v;fe&&(l({scrollLeft:V/v*(g+2)}),k.current.x=j.pageX)},X=function(){Rn.cancel(P.current),P.current=Rn(function(){if(a.current){var j=Hf(a.current).top,W=j+a.current.offsetHeight,U=f===window?document.documentElement.scrollTop+window.innerHeight:Hf(f).top+f.clientHeight;B(function(ee){return Ve(Ve({},ee),{},{isHiddenScrollBar:W-yf()<=U||j>=U-u})})}})},G=function(j){B(function(W){return Ve(Ve({},W),{},{scrollLeft:g?j/g*v:0})})};return D.useImperativeHandle(r,function(){return{setScrollLeft:G,checkScrollBarVisible:X}}),D.useEffect(function(){var _=Oo(document.body,"mouseup",N,!1),j=Oo(document.body,"mousemove",R,!1);return X(),function(){_.remove(),j.remove()}},[y,O]),D.useEffect(function(){if(a.current){for(var _=[],j=fc(a.current);j;)_.push(j),j=j.parentElement;return _.forEach(function(W){return W.addEventListener("scroll",X,!1)}),window.addEventListener("resize",X,!1),window.addEventListener("scroll",X,!1),f.addEventListener("scroll",X,!1),function(){_.forEach(function(W){return W.removeEventListener("scroll",X)}),window.removeEventListener("resize",X),window.removeEventListener("scroll",X),f.removeEventListener("scroll",X)}}},[f]),D.useEffect(function(){S.isHiddenScrollBar||B(function(_){var j=a.current;return j?Ve(Ve({},_),{},{scrollLeft:j.scrollLeft/j.scrollWidth*j.clientWidth}):_})},[S.isHiddenScrollBar]),g<=v||!y||S.isHiddenScrollBar?null:D.createElement("div",{style:{height:yf(),width:v,bottom:u},className:"".concat(m,"-sticky-scroll")},D.createElement("div",{onMouseDown:q,ref:b,className:ft("".concat(m,"-sticky-scroll-bar"),Me({},"".concat(m,"-sticky-scroll-bar-active"),O)),style:{width:"".concat(y,"px"),transform:"translate3d(".concat(S.scrollLeft,"px, 0, 0)")}}))};const O6=D.forwardRef(N6);var V1="rc-table",M6=[],I6={};function R6(){return"No Data"}function P6(e,t){var r=Ve({rowKey:"key",prefixCls:V1,emptyText:R6},e),n=r.prefixCls,o=r.className,a=r.rowClassName,l=r.style,u=r.data,f=r.rowKey,d=r.scroll,m=r.tableLayout,g=r.direction,v=r.title,y=r.footer,b=r.summary,C=r.caption,p=r.id,S=r.showHeader,B=r.components,k=r.emptyText,$=r.onRow,T=r.onHeaderRow,O=r.measureRowRender,F=r.onScroll,P=r.internalHooks,N=r.transformColumns,q=r.internalRefs,R=r.tailor,X=r.getContainerWidth,G=r.sticky,_=r.rowHoverable,j=_===void 0?!0:_,W=u||M6,U=!!W.length,ee=P===Mi,V=D.useCallback(function(qt,Qt){return cc(B,qt)||Qt},[B]),Y=D.useMemo(function(){return typeof f=="function"?f:function(qt){var Qt=qt&&qt[f];return Qt}},[f]),fe=V(["body"]),be=F6(),he=Dt(be,3),De=he[0],$e=he[1],Z=he[2],ie=E6(r,W,Y),le=Dt(ie,6),ue=le[0],Se=le[1],Be=le[2],ge=le[3],Ee=le[4],Ae=le[5],Fe=d==null?void 0:d.x,xe=D.useState(0),Ce=Dt(xe,2),_e=Ce[0],ht=Ce[1],ot=k6(Ve(Ve(Ve({},r),ue),{},{expandable:!!ue.expandedRowRender,columnTitle:ue.columnTitle,expandedKeys:Be,getRowKey:Y,onTriggerExpand:Ae,expandIcon:ge,expandIconColumnIndex:ue.expandIconColumnIndex,direction:g,scrollWidth:ee&&R&&typeof Fe=="number"?Fe:null,clientWidth:_e}),ee?N:null),Ie=Dt(ot,4),Ke=Ie[0],Ue=Ie[1],vt=Ie[2],tt=Ie[3],nt=vt??Fe,It=D.useMemo(function(){return{columns:Ke,flattenColumns:Ue}},[Ke,Ue]),$t=D.useRef(),Bt=D.useRef(),Mt=D.useRef(),je=D.useRef();D.useImperativeHandle(t,function(){return{nativeElement:$t.current,scrollTo:function(Qt){var Gr;if(Mt.current instanceof HTMLElement){var cn=Qt.index,Hr=Qt.top,Ln=Qt.key;if(q5(Hr)){var mt;(mt=Mt.current)===null||mt===void 0||mt.scrollTo({top:Hr})}else{var dn,Gn=Ln??Y(W[cn]);(dn=Mt.current.querySelector('[data-row-key="'.concat(Gn,'"]')))===null||dn===void 0||dn.scrollIntoView()}}else(Gr=Mt.current)!==null&&Gr!==void 0&&Gr.scrollTo&&Mt.current.scrollTo(Qt)}}});var pe=D.useRef(),it=D.useState(!1),Nt=Dt(it,2),Ft=Nt[0],yt=Nt[1],Rt=D.useState(!1),St=Dt(Rt,2),Kt=St[0],tr=St[1],lr=D.useState(new Map),_t=Dt(lr,2),Er=_t[0],Cr=_t[1],Zr=ul(Ue),Ut=Zr.map(function(qt){return Er.get(qt)}),Sr=D.useMemo(function(){return Ut},[Ut.join("_")]),zr=$6(Sr,Ue,g),cr=d&&g0(d.y),ir=d&&g0(nt)||!!ue.fixed,Ot=ir&&Ue.some(function(qt){var Qt=qt.fixed;return Qt}),w=D.useRef(),E=T6(G,n),ze=E.isSticky,I=E.offsetHeader,re=E.offsetSummary,rr=E.offsetScroll,pt=E.stickyClassName,wt=E.container,xt=D.useMemo(function(){return b==null?void 0:b(W)},[b,W]),st=(cr||ze)&&D.isValidElement(xt)&&xt.type===cl&&xt.props.fixed,jt,Jt,yr;cr&&(Jt={overflowY:U?"scroll":"auto",maxHeight:d.y}),ir&&(jt={overflowX:"auto"},cr||(Jt={overflowY:"hidden"}),yr={width:nt===!0?"auto":nt,minWidth:"100%"});var te=D.useCallback(function(qt,Qt){Cr(function(Gr){if(Gr.get(qt)!==Qt){var cn=new Map(Gr);return cn.set(qt,Qt),cn}return Gr})},[]),ne=B6(),Q=Dt(ne,2),Je=Q[0],lt=Q[1];function mr(qt,Qt){Qt&&(typeof Qt=="function"?Qt(qt):Qt.scrollLeft!==qt&&(Qt.scrollLeft=qt,Qt.scrollLeft!==qt&&setTimeout(function(){Qt.scrollLeft=qt},0)))}var Lt=Un(function(qt){var Qt=qt.currentTarget,Gr=qt.scrollLeft,cn=g==="rtl",Hr=typeof Gr=="number"?Gr:Qt.scrollLeft,Ln=Qt||I6;if(!lt()||lt()===Ln){var mt;Je(Ln),mr(Hr,Bt.current),mr(Hr,Mt.current),mr(Hr,pe.current),mr(Hr,(mt=w.current)===null||mt===void 0?void 0:mt.setScrollLeft)}var dn=Qt||Bt.current;if(dn){var Gn=ee&&R&&typeof nt=="number"?nt:dn.scrollWidth,Tr=dn.clientWidth;if(Gn===Tr){yt(!1),tr(!1);return}cn?(yt(-Hr<Gn-Tr),tr(-Hr>0)):(yt(Hr>0),tr(Hr<Gn-Tr))}}),bt=Un(function(qt){Lt(qt),F==null||F(qt)}),Mr=function(){if(ir&&Mt.current){var Qt;Lt({currentTarget:fc(Mt.current),scrollLeft:(Qt=Mt.current)===null||Qt===void 0?void 0:Qt.scrollLeft})}else yt(!1),tr(!1)},Lr=function(Qt){var Gr,cn=Qt.width;(Gr=w.current)===null||Gr===void 0||Gr.checkScrollBarVisible();var Hr=$t.current?$t.current.offsetWidth:cn;ee&&X&&$t.current&&(Hr=X($t.current,Hr)||Hr),Hr!==_e&&(Mr(),ht(Hr))},Sn=D.useRef(!1);D.useEffect(function(){Sn.current&&Mr()},[ir,u,Ke.length]),D.useEffect(function(){Sn.current=!0},[]);var Fr=D.useState(0),nn=Dt(Fr,2),oe=nn[0],Te=nn[1],ct=D.useState(!0),Ye=Dt(ct,2),ae=Ye[0],Re=Ye[1];Ro(function(){(!R||!ee)&&(Mt.current instanceof Element?Te(xf(Mt.current).width):Te(xf(je.current).width)),Re(Rv("position","sticky"))},[]),D.useEffect(function(){ee&&q&&(q.body.current=Mt.current)});var Pe=D.useCallback(function(qt){return D.createElement(D.Fragment,null,D.createElement(zf,qt),st==="top"&&D.createElement(Yi,qt,xt))},[st,xt]),ut=D.useCallback(function(qt){return D.createElement(Yi,qt,xt)},[xt]),ve=V(["table"],"table"),me=D.useMemo(function(){return m||(Ot?nt==="max-content"?"auto":"fixed":cr||ze||Ue.some(function(qt){var Qt=qt.ellipsis;return Qt})?"fixed":"auto")},[cr,Ot,Ue,m,ze]),ce,He={colWidths:Sr,columCount:Ue.length,stickyOffsets:zr,onHeaderRow:T,fixHeader:cr,scroll:d},Qe=D.useMemo(function(){return U?null:typeof k=="function"?k():k},[U,k]),Tt=D.createElement(c6,{data:W,measureColumnWidth:cr||ir||ze}),dt=D.createElement(K1,{colWidths:Ue.map(function(qt){var Qt=qt.width;return Qt}),columns:Ue}),qe=C!=null?D.createElement("caption",{className:"".concat(n,"-caption")},C):void 0,Pt=Os(r,{data:!0}),dr=Os(r,{aria:!0});if(cr||ze){var Vr;typeof fe=="function"?(Vr=fe(W,{scrollbarSize:oe,ref:Mt,onScroll:Lt}),He.colWidths=Ue.map(function(qt,Qt){var Gr=qt.width,cn=Qt===Ue.length-1?Gr-oe:Gr;return typeof cn=="number"&&!Number.isNaN(cn)?cn:0})):Vr=D.createElement("div",{style:Ve(Ve({},jt),Jt),onScroll:bt,ref:Mt,className:ft("".concat(n,"-body"))},D.createElement(ve,Et({style:Ve(Ve({},yr),{},{tableLayout:me})},dr),qe,dt,Tt,!st&&xt&&D.createElement(Yi,{stickyOffsets:zr,flattenColumns:Ue},xt)));var un=Ve(Ve(Ve({noData:!W.length},He),It),{},{direction:g,stickyClassName:pt,scrollX:nt,tableLayout:me,onScroll:Lt});ce=D.createElement(D.Fragment,null,S!==!1&&D.createElement(Pf,Et({},un,{stickyTopOffset:I,className:"".concat(n,"-header"),ref:Bt,colGroup:dt}),Pe),Vr,st&&st!=="top"&&D.createElement(Pf,Et({},un,{stickyBottomOffset:re,className:"".concat(n,"-summary"),ref:pe,colGroup:dt}),ut),ze&&Mt.current&&Mt.current instanceof Element&&D.createElement(O6,{ref:w,offsetScroll:rr,scrollBodyRef:Mt,onScroll:Lt,container:wt,direction:g}))}else ce=D.createElement("div",{style:Ve(Ve({},jt),Jt),className:ft("".concat(n,"-content")),onScroll:Lt,ref:Mt},D.createElement(ve,Et({style:Ve(Ve({},yr),{},{tableLayout:me})},dr),qe,dt,S!==!1&&D.createElement(zf,Et({},He,It)),Tt,xt&&D.createElement(Yi,{stickyOffsets:zr,flattenColumns:Ue},xt)));var we=D.createElement("div",Et({className:ft(n,o,Me(Me(Me(Me(Me(Me(Me(Me(Me(Me({},"".concat(n,"-rtl"),g==="rtl"),"".concat(n,"-ping-left"),Ft),"".concat(n,"-ping-right"),Kt),"".concat(n,"-layout-fixed"),m==="fixed"),"".concat(n,"-fixed-header"),cr),"".concat(n,"-fixed-column"),Ot),"".concat(n,"-fixed-column-gapped"),Ot&&tt),"".concat(n,"-scroll-horizontal"),ir),"".concat(n,"-has-fix-left"),Ue[0]&&Ue[0].fixed),"".concat(n,"-has-fix-right"),Ue[Ue.length-1]&&Ue[Ue.length-1].fixed==="right")),style:l,id:p,ref:$t},Pt),v&&D.createElement(Lf,{className:"".concat(n,"-title")},v(W)),D.createElement("div",{ref:je,className:"".concat(n,"-container")},ce),y&&D.createElement(Lf,{className:"".concat(n,"-footer")},y(W)));ir&&(we=D.createElement(dc,{onResize:Lr},we));var fr=S6(Ue,zr,g),jn=D.useMemo(function(){return{scrollX:nt,prefixCls:n,getComponent:V,scrollbarSize:oe,direction:g,fixedInfoList:fr,isSticky:ze,supportSticky:ae,componentWidth:_e,fixHeader:cr,fixColumn:Ot,horizonScroll:ir,tableLayout:me,rowClassName:a,expandedRowClassName:ue.expandedRowClassName,expandIcon:ge,expandableType:Se,expandRowByClick:ue.expandRowByClick,expandedRowRender:ue.expandedRowRender,expandedRowOffset:ue.expandedRowOffset,onTriggerExpand:Ae,expandIconColumnIndex:ue.expandIconColumnIndex,indentSize:ue.indentSize,allColumnsFixedLeft:Ue.every(function(qt){return qt.fixed==="left"}),emptyNode:Qe,columns:Ke,flattenColumns:Ue,onColumnResize:te,colWidths:Sr,hoverStartRow:De,hoverEndRow:$e,onHover:Z,rowExpandable:ue.rowExpandable,onRow:$,getRowKey:Y,expandedKeys:Be,childrenColumnName:Ee,rowHoverable:j,measureRowRender:O}},[nt,n,V,oe,g,fr,ze,ae,_e,cr,Ot,ir,me,a,ue.expandedRowClassName,ge,Se,ue.expandRowByClick,ue.expandedRowRender,ue.expandedRowOffset,Ae,ue.expandIconColumnIndex,ue.indentSize,Qe,Ke,Ue,te,Sr,De,$e,Z,ue.rowExpandable,$,Y,Be,Ee,j,O]);return D.createElement(ln.Provider,{value:jn},we)}var z6=D.forwardRef(P6);function W1(e){return O1(z6,e)}var Ia=W1();Ia.EXPAND_COLUMN=To;Ia.INTERNAL_HOOKS=Mi;Ia.Column=t6;Ia.ColumnGroup=r6;Ia.Summary=R1;var Ac=Dc(null),U1=Dc(null);function _6(e,t,r){var n=t||1;return r[e+n]-(r[e]||0)}function j6(e){var t=e.rowInfo,r=e.column,n=e.colIndex,o=e.indent,a=e.index,l=e.component,u=e.renderIndex,f=e.record,d=e.style,m=e.className,g=e.inverse,v=e.getHeight,y=r.render,b=r.dataIndex,C=r.className,p=r.width,S=tn(U1,["columnsOffset"]),B=S.columnsOffset,k=H1(t,r,n,o,a),$=k.key,T=k.fixedInfo,O=k.appendCellNode,F=k.additionalCellProps,P=F.style,N=F.colSpan,q=N===void 0?1:N,R=F.rowSpan,X=R===void 0?1:R,G=n-1,_=_6(G,q,B),j=q>1?p-_:0,W=Ve(Ve(Ve({},P),d),{},{flex:"0 0 ".concat(_,"px"),width:"".concat(_,"px"),marginRight:j,pointerEvents:"auto"}),U=D.useMemo(function(){return g?X<=1:q===0||X===0||X>1},[X,q,g]);U?W.visibility="hidden":g&&(W.height=v==null?void 0:v(X));var ee=U?function(){return null}:y,V={};return(X===0||q===0)&&(V.rowSpan=1,V.colSpan=1),D.createElement(Ma,Et({className:ft(C,m),ellipsis:r.ellipsis,align:r.align,scope:r.rowScope,component:l,prefixCls:t.prefixCls,key:$,record:f,index:a,renderIndex:u,dataIndex:b,render:ee,shouldCellUpdate:r.shouldCellUpdate},T,{appendNode:O,additionalProps:Ve(Ve({},F),{},{style:W},V)}))}var L6=["data","index","className","rowKey","style","extra","getHeight"],H6=D.forwardRef(function(e,t){var r=e.data,n=e.index,o=e.className,a=e.rowKey,l=e.style,u=e.extra,f=e.getHeight,d=kr(e,L6),m=r.record,g=r.indent,v=r.index,y=tn(ln,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),b=y.scrollX,C=y.flattenColumns,p=y.prefixCls,S=y.fixColumn,B=y.componentWidth,k=tn(Ac,["getComponent"]),$=k.getComponent,T=_1(m,a,n,g),O=$(["body","row"],"div"),F=$(["body","cell"],"div"),P=T.rowSupportExpand,N=T.expanded,q=T.rowProps,R=T.expandedRowRender,X=T.expandedRowClassName,G;if(P&&N){var _=R(m,n,g+1,N),j=L1(X,m,n,g),W={};S&&(W={style:Me({},"--virtual-width","".concat(B,"px"))});var U="".concat(p,"-expanded-row-cell");G=D.createElement(O,{className:ft("".concat(p,"-expanded-row"),"".concat(p,"-expanded-row-level-").concat(g+1),j)},D.createElement(Ma,{component:F,prefixCls:p,className:ft(U,Me({},"".concat(U,"-fixed"),S)),additionalProps:W},_))}var ee=Ve(Ve({},l),{},{width:b});u&&(ee.position="absolute",ee.pointerEvents="none");var V=D.createElement(O,Et({},q,d,{"data-row-key":a,ref:P?null:t,className:ft(o,"".concat(p,"-row"),q==null?void 0:q.className,Me({},"".concat(p,"-row-extra"),u)),style:Ve(Ve({},ee),q==null?void 0:q.style)}),C.map(function(Y,fe){return D.createElement(j6,{key:fe,component:F,rowInfo:T,column:Y,colIndex:fe,indent:g,index:n,renderIndex:v,record:m,inverse:u,getHeight:f})}));return P?D.createElement("div",{ref:t},V,G):V}),Kf=Oa(H6),K6=D.forwardRef(function(e,t){var r=e.data,n=e.onScroll,o=tn(ln,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","scrollX","direction"]),a=o.flattenColumns,l=o.onColumnResize,u=o.getRowKey,f=o.expandedKeys,d=o.prefixCls,m=o.childrenColumnName,g=o.scrollX,v=o.direction,y=tn(Ac),b=y.sticky,C=y.scrollY,p=y.listItemHeight,S=y.getComponent,B=y.onScroll,k=D.useRef(),$=z1(r,m,f,u),T=D.useMemo(function(){var G=0;return a.map(function(_){var j=_.width,W=_.minWidth,U=_.key,ee=Math.max(j||0,W||0);return G+=ee,[U,ee,G]})},[a]),O=D.useMemo(function(){return T.map(function(G){return G[2]})},[T]);D.useEffect(function(){T.forEach(function(G){var _=Dt(G,2),j=_[0],W=_[1];l(j,W)})},[T]),D.useImperativeHandle(t,function(){var G,_={scrollTo:function(W){var U;(U=k.current)===null||U===void 0||U.scrollTo(W)},nativeElement:(G=k.current)===null||G===void 0?void 0:G.nativeElement};return Object.defineProperty(_,"scrollLeft",{get:function(){var W;return((W=k.current)===null||W===void 0?void 0:W.getScrollInfo().x)||0},set:function(W){var U;(U=k.current)===null||U===void 0||U.scrollTo({left:W})}}),Object.defineProperty(_,"scrollTop",{get:function(){var W;return((W=k.current)===null||W===void 0?void 0:W.getScrollInfo().y)||0},set:function(W){var U;(U=k.current)===null||U===void 0||U.scrollTo({top:W})}}),_});var F=function(_,j){var W,U=(W=$[j])===null||W===void 0?void 0:W.record,ee=_.onCell;if(ee){var V,Y=ee(U,j);return(V=Y==null?void 0:Y.rowSpan)!==null&&V!==void 0?V:1}return 1},P=function(_){var j=_.start,W=_.end,U=_.getSize,ee=_.offsetY;if(W<0)return null;for(var V=a.filter(function(Be){return F(Be,j)===0}),Y=j,fe=function(ge){if(V=V.filter(function(Ee){return F(Ee,ge)===0}),!V.length)return Y=ge,1},be=j;be>=0&&!fe(be);be-=1);for(var he=a.filter(function(Be){return F(Be,W)!==1}),De=W,$e=function(ge){if(he=he.filter(function(Ee){return F(Ee,ge)!==1}),!he.length)return De=Math.max(ge-1,W),1},Z=W;Z<$.length&&!$e(Z);Z+=1);for(var ie=[],le=function(ge){var Ee=$[ge];if(!Ee)return 1;a.some(function(Ae){return F(Ae,ge)>1})&&ie.push(ge)},ue=Y;ue<=De;ue+=1)le(ue);var Se=ie.map(function(Be){var ge=$[Be],Ee=u(ge.record,Be),Ae=function(Ce){var _e=Be+Ce-1,ht=u($[_e].record,_e),ot=U(Ee,ht);return ot.bottom-ot.top},Fe=U(Ee);return D.createElement(Kf,{key:Be,data:ge,rowKey:Ee,index:Be,style:{top:-ee+Fe.top},extra:!0,getHeight:Ae})});return Se},N=D.useMemo(function(){return{columnsOffset:O}},[O]),q="".concat(d,"-tbody"),R=S(["body","wrapper"]),X={};return b&&(X.position="sticky",X.bottom=0,$n(b)==="object"&&b.offsetScroll&&(X.bottom=b.offsetScroll)),D.createElement(U1.Provider,{value:N},D.createElement(e1,{fullHeight:!1,ref:k,prefixCls:"".concat(q,"-virtual"),styles:{horizontalScrollBar:X},className:q,height:C,itemHeight:p||24,data:$,itemKey:function(_){return u(_.record)},component:R,scrollWidth:g,direction:v,onVirtualScroll:function(_){var j,W=_.x;n({currentTarget:(j=k.current)===null||j===void 0?void 0:j.nativeElement,scrollLeft:W})},onScroll:B,extraRender:P},function(G,_,j){var W=u(G.record,_);return D.createElement(Kf,{data:G,rowKey:W,index:_,style:j.style})}))}),q6=Oa(K6),V6=function(t,r){var n=r.ref,o=r.onScroll;return D.createElement(q6,{ref:n,data:t,onScroll:o})};function W6(e,t){var r=e.data,n=e.columns,o=e.scroll,a=e.sticky,l=e.prefixCls,u=l===void 0?V1:l,f=e.className,d=e.listItemHeight,m=e.components,g=e.onScroll,v=o||{},y=v.x,b=v.y;typeof y!="number"&&(y=1),typeof b!="number"&&(b=500);var C=Un(function(B,k){return cc(m,B)||k}),p=Un(g),S=D.useMemo(function(){return{sticky:a,scrollY:b,listItemHeight:d,getComponent:C,onScroll:p}},[a,b,d,C,p]);return D.createElement(Ac.Provider,{value:S},D.createElement(Ia,Et({},e,{className:ft(f,"".concat(u,"-virtual")),scroll:Ve(Ve({},o),{},{x:y}),components:Ve(Ve({},m),{},{body:r!=null&&r.length?V6:void 0}),columns:n,internalHooks:Mi,tailor:!0,ref:t})))}var U6=D.forwardRef(W6);function X1(e){return O1(U6,e)}X1();const X6=e=>null,G6=e=>null;var Bc=D.createContext(null),Y6=D.createContext({}),Z6=function(t){for(var r=t.prefixCls,n=t.level,o=t.isStart,a=t.isEnd,l="".concat(r,"-indent-unit"),u=[],f=0;f<n;f+=1)u.push(D.createElement("span",{key:f,className:ft(l,Me(Me({},"".concat(l,"-start"),o[f]),"".concat(l,"-end"),a[f]))}));return D.createElement("span",{"aria-hidden":"true",className:"".concat(r,"-indent")},u)};const J6=D.memo(Z6);var Q6=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],qf="open",Vf="close",e7="---",mi=function(t){var r,n,o,a=t.eventKey,l=t.className,u=t.style,f=t.dragOver,d=t.dragOverGapTop,m=t.dragOverGapBottom,g=t.isLeaf,v=t.isStart,y=t.isEnd,b=t.expanded,C=t.selected,p=t.checked,S=t.halfChecked,B=t.loading,k=t.domRef,$=t.active,T=t.data,O=t.onMouseMove,F=t.selectable,P=kr(t,Q6),N=We.useContext(Bc),q=We.useContext(Y6),R=We.useRef(null),X=We.useState(!1),G=Dt(X,2),_=G[0],j=G[1],W=!!(N.disabled||t.disabled||(r=q.nodeDisabled)!==null&&r!==void 0&&r.call(q,T)),U=We.useMemo(function(){return!N.checkable||t.checkable===!1?!1:N.checkable},[N.checkable,t.checkable]),ee=function(pe){W||N.onNodeSelect(pe,Ur(t))},V=function(pe){W||!U||t.disableCheckbox||N.onNodeCheck(pe,Ur(t),!p)},Y=We.useMemo(function(){return typeof F=="boolean"?F:N.selectable},[F,N.selectable]),fe=function(pe){N.onNodeClick(pe,Ur(t)),Y?ee(pe):V(pe)},be=function(pe){N.onNodeDoubleClick(pe,Ur(t))},he=function(pe){N.onNodeMouseEnter(pe,Ur(t))},De=function(pe){N.onNodeMouseLeave(pe,Ur(t))},$e=function(pe){N.onNodeContextMenu(pe,Ur(t))},Z=We.useMemo(function(){return!!(N.draggable&&(!N.draggable.nodeDraggable||N.draggable.nodeDraggable(T)))},[N.draggable,T]),ie=function(pe){pe.stopPropagation(),j(!0),N.onNodeDragStart(pe,t);try{pe.dataTransfer.setData("text/plain","")}catch{}},le=function(pe){pe.preventDefault(),pe.stopPropagation(),N.onNodeDragEnter(pe,t)},ue=function(pe){pe.preventDefault(),pe.stopPropagation(),N.onNodeDragOver(pe,t)},Se=function(pe){pe.stopPropagation(),N.onNodeDragLeave(pe,t)},Be=function(pe){pe.stopPropagation(),j(!1),N.onNodeDragEnd(pe,t)},ge=function(pe){pe.preventDefault(),pe.stopPropagation(),j(!1),N.onNodeDrop(pe,t)},Ee=function(pe){B||N.onNodeExpand(pe,Ur(t))},Ae=We.useMemo(function(){var je=Dn(N.keyEntities,a)||{},pe=je.children;return!!(pe||[]).length},[N.keyEntities,a]),Fe=We.useMemo(function(){return g===!1?!1:g||!N.loadData&&!Ae||N.loadData&&t.loaded&&!Ae},[g,N.loadData,Ae,t.loaded]);We.useEffect(function(){B||typeof N.loadData=="function"&&b&&!Fe&&!t.loaded&&N.onNodeLoad(Ur(t))},[B,N.loadData,N.onNodeLoad,b,Fe,t]);var xe=We.useMemo(function(){var je;return(je=N.draggable)!==null&&je!==void 0&&je.icon?We.createElement("span",{className:"".concat(N.prefixCls,"-draggable-icon")},N.draggable.icon):null},[N.draggable]),Ce=function(pe){var it=t.switcherIcon||N.switcherIcon;return typeof it=="function"?it(Ve(Ve({},t),{},{isLeaf:pe})):it},_e=function(){if(Fe){var pe=Ce(!0);return pe!==!1?We.createElement("span",{className:ft("".concat(N.prefixCls,"-switcher"),"".concat(N.prefixCls,"-switcher-noop"))},pe):null}var it=Ce(!1);return it!==!1?We.createElement("span",{onClick:Ee,className:ft("".concat(N.prefixCls,"-switcher"),"".concat(N.prefixCls,"-switcher_").concat(b?qf:Vf))},it):null},ht=We.useMemo(function(){if(!U)return null;var je=typeof U!="boolean"?U:null;return We.createElement("span",{className:ft("".concat(N.prefixCls,"-checkbox"),Me(Me(Me({},"".concat(N.prefixCls,"-checkbox-checked"),p),"".concat(N.prefixCls,"-checkbox-indeterminate"),!p&&S),"".concat(N.prefixCls,"-checkbox-disabled"),W||t.disableCheckbox)),onClick:V,role:"checkbox","aria-checked":S?"mixed":p,"aria-disabled":W||t.disableCheckbox,"aria-label":"Select ".concat(typeof t.title=="string"?t.title:"tree node")},je)},[U,p,S,W,t.disableCheckbox,t.title]),ot=We.useMemo(function(){return Fe?null:b?qf:Vf},[Fe,b]),Ie=We.useMemo(function(){return We.createElement("span",{className:ft("".concat(N.prefixCls,"-iconEle"),"".concat(N.prefixCls,"-icon__").concat(ot||"docu"),Me({},"".concat(N.prefixCls,"-icon_loading"),B))})},[N.prefixCls,ot,B]),Ke=We.useMemo(function(){var je=!!N.draggable,pe=!t.disabled&&je&&N.dragOverNodeKey===a;return pe?N.dropIndicatorRender({dropPosition:N.dropPosition,dropLevelOffset:N.dropLevelOffset,indent:N.indent,prefixCls:N.prefixCls,direction:N.direction}):null},[N.dropPosition,N.dropLevelOffset,N.indent,N.prefixCls,N.direction,N.draggable,N.dragOverNodeKey,N.dropIndicatorRender]),Ue=We.useMemo(function(){var je=t.title,pe=je===void 0?e7:je,it="".concat(N.prefixCls,"-node-content-wrapper"),Nt;if(N.showIcon){var Ft=t.icon||N.icon;Nt=Ft?We.createElement("span",{className:ft("".concat(N.prefixCls,"-iconEle"),"".concat(N.prefixCls,"-icon__customize"))},typeof Ft=="function"?Ft(t):Ft):Ie}else N.loadData&&B&&(Nt=Ie);var yt;return typeof pe=="function"?yt=pe(T):N.titleRender?yt=N.titleRender(T):yt=pe,We.createElement("span",{ref:R,title:typeof pe=="string"?pe:"",className:ft(it,"".concat(it,"-").concat(ot||"normal"),Me({},"".concat(N.prefixCls,"-node-selected"),!W&&(C||_))),onMouseEnter:he,onMouseLeave:De,onContextMenu:$e,onClick:fe,onDoubleClick:be},Nt,We.createElement("span",{className:"".concat(N.prefixCls,"-title")},yt),Ke)},[N.prefixCls,N.showIcon,t,N.icon,Ie,N.titleRender,T,ot,he,De,$e,fe,be]),vt=Os(P,{aria:!0,data:!0}),tt=Dn(N.keyEntities,a)||{},nt=tt.level,It=y[y.length-1],$t=!W&&Z,Bt=N.draggingNodeKey===a,Mt=F!==void 0?{"aria-selected":!!F}:void 0;return We.createElement("div",Et({ref:k,role:"treeitem","aria-expanded":g?void 0:b,className:ft(l,"".concat(N.prefixCls,"-treenode"),(o={},Me(Me(Me(Me(Me(Me(Me(Me(Me(Me(o,"".concat(N.prefixCls,"-treenode-disabled"),W),"".concat(N.prefixCls,"-treenode-switcher-").concat(b?"open":"close"),!g),"".concat(N.prefixCls,"-treenode-checkbox-checked"),p),"".concat(N.prefixCls,"-treenode-checkbox-indeterminate"),S),"".concat(N.prefixCls,"-treenode-selected"),C),"".concat(N.prefixCls,"-treenode-loading"),B),"".concat(N.prefixCls,"-treenode-active"),$),"".concat(N.prefixCls,"-treenode-leaf-last"),It),"".concat(N.prefixCls,"-treenode-draggable"),Z),"dragging",Bt),Me(Me(Me(Me(Me(Me(Me(o,"drop-target",N.dropTargetKey===a),"drop-container",N.dropContainerKey===a),"drag-over",!W&&f),"drag-over-gap-top",!W&&d),"drag-over-gap-bottom",!W&&m),"filter-node",(n=N.filterTreeNode)===null||n===void 0?void 0:n.call(N,Ur(t))),"".concat(N.prefixCls,"-treenode-leaf"),Fe))),style:u,draggable:$t,onDragStart:$t?ie:void 0,onDragEnter:Z?le:void 0,onDragOver:Z?ue:void 0,onDragLeave:Z?Se:void 0,onDrop:Z?ge:void 0,onDragEnd:Z?Be:void 0,onMouseMove:O},Mt,vt),We.createElement(J6,{prefixCls:N.prefixCls,level:nt,isStart:v,isEnd:y}),xe,_e(),ht,Ue)};mi.isTreeNode=1;function to(e,t){if(!e)return[];var r=e.slice(),n=r.indexOf(t);return n>=0&&r.splice(n,1),r}function fo(e,t){var r=(e||[]).slice();return r.indexOf(t)===-1&&r.push(t),r}function Fc(e){return e.split("-")}function t7(e,t){var r=[],n=Dn(t,e);function o(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];a.forEach(function(l){var u=l.key,f=l.children;r.push(u),o(f)})}return o(n.children),r}function r7(e){if(e.parent){var t=Fc(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function n7(e){var t=Fc(e.pos);return Number(t[t.length-1])===0}function Wf(e,t,r,n,o,a,l,u,f,d){var m,g=e.clientX,v=e.clientY,y=e.target.getBoundingClientRect(),b=y.top,C=y.height,p=(d==="rtl"?-1:1)*(((o==null?void 0:o.x)||0)-g),S=(p-12)/n,B=f.filter(function(W){var U;return(U=u[W])===null||U===void 0||(U=U.children)===null||U===void 0?void 0:U.length}),k=Dn(u,r.eventKey);if(v<b+C/2){var $=l.findIndex(function(W){return W.key===k.key}),T=$<=0?0:$-1,O=l[T].key;k=Dn(u,O)}var F=k.key,P=k,N=k.key,q=0,R=0;if(!B.includes(F))for(var X=0;X<S&&r7(k);X+=1)k=k.parent,R+=1;var G=t.data,_=k.node,j=!0;return n7(k)&&k.level===0&&v<b+C/2&&a({dragNode:G,dropNode:_,dropPosition:-1})&&k.key===r.eventKey?q=-1:(P.children||[]).length&&B.includes(N)?a({dragNode:G,dropNode:_,dropPosition:0})?q=0:j=!1:R===0?S>-1.5?a({dragNode:G,dropNode:_,dropPosition:1})?q=1:j=!1:a({dragNode:G,dropNode:_,dropPosition:0})?q=0:a({dragNode:G,dropNode:_,dropPosition:1})?q=1:j=!1:a({dragNode:G,dropNode:_,dropPosition:1})?q=1:j=!1,{dropPosition:q,dropLevelOffset:R,dropTargetKey:k.key,dropTargetPos:k.pos,dragOverNodeKey:N,dropContainerKey:q===0?null:((m=k.parent)===null||m===void 0?void 0:m.key)||null,dropAllowed:j}}function Uf(e,t){if(e){var r=t.multiple;return r?e.slice():e.length?[e[0]]:e}}function iu(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else if($n(e)==="object")t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0};else return io(!1,"`checkedKeys` is not an array or an object"),null;return t}function b0(e,t){var r=new Set;function n(o){if(!r.has(o)){var a=Dn(t,o);if(a){r.add(o);var l=a.parent,u=a.node;u.disabled||l&&n(l.key)}}}return(e||[]).forEach(function(o){n(o)}),Gt(r)}const Bo={},y0="SELECT_ALL",x0="SELECT_INVERT",w0="SELECT_NONE",Xf=[],G1=(e,t,r=[])=>((t||[]).forEach(n=>{r.push(n),n&&typeof n=="object"&&e in n&&G1(e,n[e],r)}),r),o7=(e,t)=>{const{preserveSelectedRowKeys:r,selectedRowKeys:n,defaultSelectedRowKeys:o,getCheckboxProps:a,getTitleCheckboxProps:l,onChange:u,onSelect:f,onSelectAll:d,onSelectInvert:m,onSelectNone:g,onSelectMultiple:v,columnWidth:y,type:b,selections:C,fixed:p,renderCell:S,hideSelectAll:B,checkStrictly:k=!0}=t||{},{prefixCls:$,data:T,pageData:O,getRecordByKey:F,getRowKey:P,expandType:N,childrenColumnName:q,locale:R,getPopupContainer:X}=e,G=nl(),[_,j]=$v(ge=>ge),[W,U]=bo(n||o||Xf,{value:n}),ee=D.useRef(new Map),V=zt(ge=>{if(r){const Ee=new Map;ge.forEach(Ae=>{let Fe=F(Ae);!Fe&&ee.current.has(Ae)&&(Fe=ee.current.get(Ae)),Ee.set(Ae,Fe)}),ee.current=Ee}},[F,r]);D.useEffect(()=>{V(W)},[W]);const Y=At(()=>G1(q,O),[q,O]),{keyEntities:fe}=At(()=>{if(k)return{keyEntities:null};let ge=T;if(r){const Ee=new Set(Y.map((Fe,xe)=>P(Fe,xe))),Ae=Array.from(ee.current).reduce((Fe,[xe,Ce])=>Ee.has(xe)?Fe:Fe.concat(Ce),[]);ge=[].concat(Gt(ge),Gt(Ae))}return xc(ge,{externalGetKey:P,childrenPropName:q})},[T,P,k,q,r,Y]),be=At(()=>{const ge=new Map;return Y.forEach((Ee,Ae)=>{const Fe=P(Ee,Ae),xe=(a?a(Ee):null)||{};ge.set(Fe,xe)}),ge},[Y,P,a]),he=zt(ge=>{const Ee=P(ge);let Ae;return be.has(Ee)?Ae=be.get(P(ge)):Ae=a?a(ge):void 0,!!(Ae!=null&&Ae.disabled)},[be,P]),[De,$e]=At(()=>{if(k)return[W||[],[]];const{checkedKeys:ge,halfCheckedKeys:Ee}=ba(W,!0,fe,he);return[ge||[],Ee]},[W,k,fe,he]),Z=At(()=>{const ge=b==="radio"?De.slice(0,1):De;return new Set(ge)},[De,b]),ie=At(()=>b==="radio"?new Set:new Set($e),[$e,b]);D.useEffect(()=>{t||U(Xf)},[!!t]);const le=zt((ge,Ee)=>{let Ae,Fe;V(ge),r?(Ae=ge,Fe=ge.map(xe=>ee.current.get(xe))):(Ae=[],Fe=[],ge.forEach(xe=>{const Ce=F(xe);Ce!==void 0&&(Ae.push(xe),Fe.push(Ce))})),U(Ae),u==null||u(Ae,Fe,{type:Ee})},[U,F,u,r]),ue=zt((ge,Ee,Ae,Fe)=>{if(f){const xe=Ae.map(Ce=>F(Ce));f(F(ge),Ee,xe,Fe)}le(Ae,"single")},[f,F,le]),Se=At(()=>!C||B?null:(C===!0?[y0,x0,w0]:C).map(Ee=>Ee===y0?{key:"all",text:R.selectionAll,onSelect(){le(T.map((Ae,Fe)=>P(Ae,Fe)).filter(Ae=>{const Fe=be.get(Ae);return!(Fe!=null&&Fe.disabled)||Z.has(Ae)}),"all")}}:Ee===x0?{key:"invert",text:R.selectInvert,onSelect(){const Ae=new Set(Z);O.forEach((xe,Ce)=>{const _e=P(xe,Ce),ht=be.get(_e);ht!=null&&ht.disabled||(Ae.has(_e)?Ae.delete(_e):Ae.add(_e))});const Fe=Array.from(Ae);m&&(G.deprecated(!1,"onSelectInvert","onChange"),m(Fe)),le(Fe,"invert")}}:Ee===w0?{key:"none",text:R.selectNone,onSelect(){g==null||g(),le(Array.from(Z).filter(Ae=>{const Fe=be.get(Ae);return Fe==null?void 0:Fe.disabled}),"none")}}:Ee).map(Ee=>Object.assign(Object.assign({},Ee),{onSelect:(...Ae)=>{var Fe,xe;(xe=Ee.onSelect)===null||xe===void 0||(Fe=xe).call.apply(Fe,[Ee].concat(Ae)),j(null)}})),[C,Z,O,P,m,le]);return[zt(ge=>{var Ee;if(!t)return ge.filter(je=>je!==Bo);let Ae=Gt(ge);const Fe=new Set(Z),xe=Y.map(P).filter(je=>!be.get(je).disabled),Ce=xe.every(je=>Fe.has(je)),_e=xe.some(je=>Fe.has(je)),ht=()=>{const je=[];Ce?xe.forEach(it=>{Fe.delete(it),je.push(it)}):xe.forEach(it=>{Fe.has(it)||(Fe.add(it),je.push(it))});const pe=Array.from(Fe);d==null||d(!Ce,pe.map(it=>F(it)),je.map(it=>F(it))),le(pe,"all"),j(null)};let ot,Ie;if(b!=="radio"){let je;if(Se){const Kt={getPopupContainer:X,items:Se.map((tr,lr)=>{const{key:_t,text:Er,onSelect:Cr}=tr;return{key:_t??lr,onClick:()=>{Cr==null||Cr(xe)},label:Er}})};je=D.createElement("div",{className:`${$}-selection-extra`},D.createElement(wc,{menu:Kt,getPopupContainer:X},D.createElement("span",null,D.createElement(pv,null))))}const pe=Y.map((Kt,tr)=>{const lr=P(Kt,tr),_t=be.get(lr)||{};return Object.assign({checked:Fe.has(lr)},_t)}).filter(({disabled:Kt})=>Kt),it=!!pe.length&&pe.length===Y.length,Nt=it&&pe.every(({checked:Kt})=>Kt),Ft=it&&pe.some(({checked:Kt})=>Kt),yt=(l==null?void 0:l())||{},{onChange:Rt,disabled:St}=yt;Ie=D.createElement(Ms,Object.assign({"aria-label":je?"Custom selection":"Select all"},yt,{checked:it?Nt:!!Y.length&&Ce,indeterminate:it?!Nt&&Ft:!Ce&&_e,onChange:Kt=>{ht(),Rt==null||Rt(Kt)},disabled:St??(Y.length===0||it),skipGroup:!0})),ot=!B&&D.createElement("div",{className:`${$}-selection`},Ie,je)}let Ke;b==="radio"?Ke=(je,pe,it)=>{const Nt=P(pe,it),Ft=Fe.has(Nt),yt=be.get(Nt);return{node:D.createElement(Lm,Object.assign({},yt,{checked:Ft,onClick:Rt=>{var St;Rt.stopPropagation(),(St=yt==null?void 0:yt.onClick)===null||St===void 0||St.call(yt,Rt)},onChange:Rt=>{var St;Fe.has(Nt)||ue(Nt,!0,[Nt],Rt.nativeEvent),(St=yt==null?void 0:yt.onChange)===null||St===void 0||St.call(yt,Rt)}})),checked:Ft}}:Ke=(je,pe,it)=>{var Nt;const Ft=P(pe,it),yt=Fe.has(Ft),Rt=ie.has(Ft),St=be.get(Ft);let Kt;return N==="nest"?Kt=Rt:Kt=(Nt=St==null?void 0:St.indeterminate)!==null&&Nt!==void 0?Nt:Rt,{node:D.createElement(Ms,Object.assign({},St,{indeterminate:Kt,checked:yt,skipGroup:!0,onClick:tr=>{var lr;tr.stopPropagation(),(lr=St==null?void 0:St.onClick)===null||lr===void 0||lr.call(St,tr)},onChange:tr=>{var lr;const{nativeEvent:_t}=tr,{shiftKey:Er}=_t,Cr=xe.indexOf(Ft),Zr=De.some(Ut=>xe.includes(Ut));if(Er&&k&&Zr){const Ut=_(Cr,xe,Fe),Sr=Array.from(Fe);v==null||v(!yt,Sr.map(zr=>F(zr)),Ut.map(zr=>F(zr))),le(Sr,"multiple")}else{const Ut=De;if(k){const Sr=yt?to(Ut,Ft):fo(Ut,Ft);ue(Ft,!yt,Sr,_t)}else{const Sr=ba([].concat(Gt(Ut),[Ft]),!0,fe,he),{checkedKeys:zr,halfCheckedKeys:cr}=Sr;let ir=zr;if(yt){const Ot=new Set(zr);Ot.delete(Ft),ir=ba(Array.from(Ot),{halfCheckedKeys:cr},fe,he).checkedKeys}ue(Ft,!yt,ir,_t)}}j(yt?null:Cr),(lr=St==null?void 0:St.onChange)===null||lr===void 0||lr.call(St,tr)}})),checked:yt}};const Ue=(je,pe,it)=>{const{node:Nt,checked:Ft}=Ke(je,pe,it);return S?S(Ft,pe,it,Nt):Nt};if(!Ae.includes(Bo))if(Ae.findIndex(je=>{var pe;return((pe=je[si])===null||pe===void 0?void 0:pe.columnType)==="EXPAND_COLUMN"})===0){const[je,...pe]=Ae;Ae=[je,Bo].concat(Gt(pe))}else Ae=[Bo].concat(Gt(Ae));const vt=Ae.indexOf(Bo);Ae=Ae.filter((je,pe)=>je!==Bo||pe===vt);const tt=Ae[vt-1],nt=Ae[vt+1];let It=p;It===void 0&&((nt==null?void 0:nt.fixed)!==void 0?It=nt.fixed:(tt==null?void 0:tt.fixed)!==void 0&&(It=tt.fixed)),It&&tt&&((Ee=tt[si])===null||Ee===void 0?void 0:Ee.columnType)==="EXPAND_COLUMN"&&tt.fixed===void 0&&(tt.fixed=It);const $t=ft(`${$}-selection-col`,{[`${$}-selection-col-with-dropdown`]:C&&b==="checkbox"}),Bt=()=>t!=null&&t.columnTitle?typeof t.columnTitle=="function"?t.columnTitle(Ie):t.columnTitle:ot,Mt={fixed:It,width:y,className:`${$}-selection-column`,title:Bt(),render:Ue,onCell:t.onCell,align:t.align,[si]:{className:$t}};return Ae.map(je=>je===Bo?Mt:je)},[P,Y,t,De,Z,ie,y,Se,N,be,v,ue,he]),Z]};function a7(e){return t=>{const{prefixCls:r,onExpand:n,record:o,expanded:a,expandable:l}=t,u=`${r}-row-expand-icon`;return D.createElement("button",{type:"button",onClick:f=>{n(o,f),f.stopPropagation()},className:ft(u,{[`${u}-spaced`]:!l,[`${u}-expanded`]:l&&a,[`${u}-collapsed`]:l&&!a}),"aria-label":a?e.collapse:e.expand,"aria-expanded":a})}}function i7(e){return(r,n)=>{const o=r.querySelector(`.${e}-container`);let a=n;if(o){const l=getComputedStyle(o),u=Number.parseInt(l.borderLeftWidth,10),f=Number.parseInt(l.borderRightWidth,10);a=n-u-f}return a}}const Po=(e,t)=>"key"in e&&e.key!==void 0&&e.key!==null?e.key:e.dataIndex?Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex:t;function Ra(e,t){return t?`${t}-${e}`:`${e}`}const dl=(e,t)=>typeof e=="function"?e(t):e,s7=(e,t)=>{const r=dl(e,t);return Object.prototype.toString.call(r)==="[object Object]"?"":r};var l7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"},u7=function(t,r){return D.createElement(sn,Et({},t,{ref:r,icon:l7}))},c7=D.forwardRef(u7),d7=function(t){var r=t.dropPosition,n=t.dropLevelOffset,o=t.indent,a={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(r){case-1:a.top=0,a.left=-n*o;break;case 1:a.bottom=0,a.left=-n*o;break;case 0:a.bottom=0,a.left=o;break}return We.createElement("div",{style:a})};function Y1(e){if(e==null)throw new TypeError("Cannot destructure "+e)}function f7(e,t){var r=D.useState(!1),n=Dt(r,2),o=n[0],a=n[1];Ro(function(){if(o)return e(),function(){t()}},[o]),Ro(function(){return a(!0),function(){a(!1)}},[])}var h7=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],p7=D.forwardRef(function(e,t){var r=e.className,n=e.style,o=e.motion,a=e.motionNodes,l=e.motionType,u=e.onMotionStart,f=e.onMotionEnd,d=e.active,m=e.treeNodeRequiredProps,g=kr(e,h7),v=D.useState(!0),y=Dt(v,2),b=y[0],C=y[1],p=D.useContext(Bc),S=p.prefixCls,B=a&&l!=="hide";Ro(function(){a&&B!==b&&C(B)},[a]);var k=function(){a&&u()},$=D.useRef(!1),T=function(){a&&!$.current&&($.current=!0,f())};f7(k,T);var O=function(P){B===P&&T()};return a?D.createElement(ic,Et({ref:t,visible:b},o,{motionAppear:l==="show",onVisibleChanged:O}),function(F,P){var N=F.className,q=F.style;return D.createElement("div",{ref:P,className:ft("".concat(S,"-treenode-motion"),N),style:q},a.map(function(R){var X=Object.assign({},(Y1(R.data),R.data)),G=R.title,_=R.key,j=R.isStart,W=R.isEnd;delete X.children;var U=ii(_,m);return D.createElement(mi,Et({},X,U,{title:G,active:d,data:R.data,key:_,isStart:j,isEnd:W}))}))}):D.createElement(mi,Et({domRef:t,className:r,style:n},g,{active:d}))});function m7(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=e.length,n=t.length;if(Math.abs(r-n)!==1)return{add:!1,key:null};function o(a,l){var u=new Map;a.forEach(function(d){u.set(d,!0)});var f=l.filter(function(d){return!u.has(d)});return f.length===1?f[0]:null}return r<n?{add:!0,key:o(e,t)}:{add:!1,key:o(t,e)}}function Gf(e,t,r){var n=e.findIndex(function(u){return u.key===r}),o=e[n+1],a=t.findIndex(function(u){return u.key===r});if(o){var l=t.findIndex(function(u){return u.key===o.key});return t.slice(a+1,l)}return t.slice(a+1)}var g7=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","scrollWidth","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],Yf={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},v7=function(){},Qo="RC_TREE_MOTION_".concat(Math.random()),C0={key:Qo},Z1={key:Qo,level:0,index:0,pos:"0",node:C0,nodes:[C0]},Zf={parent:null,children:[],pos:Z1.pos,data:C0,title:null,key:Qo,isStart:[],isEnd:[]};function Jf(e,t,r,n){return t===!1||!r?e:e.slice(0,Math.ceil(r/n)+1)}function Qf(e){var t=e.key,r=e.pos;return Ni(t,r)}function b7(e){for(var t=String(e.data.key),r=e;r.parent;)r=r.parent,t="".concat(r.data.key," > ").concat(t);return t}var y7=D.forwardRef(function(e,t){var r=e.prefixCls,n=e.data;e.selectable,e.checkable;var o=e.expandedKeys,a=e.selectedKeys,l=e.checkedKeys,u=e.loadedKeys,f=e.loadingKeys,d=e.halfCheckedKeys,m=e.keyEntities,g=e.disabled,v=e.dragging,y=e.dragOverNodeKey,b=e.dropPosition,C=e.motion,p=e.height,S=e.itemHeight,B=e.virtual,k=e.scrollWidth,$=e.focusable,T=e.activeItem,O=e.focused,F=e.tabIndex,P=e.onKeyDown,N=e.onFocus,q=e.onBlur,R=e.onActiveChange,X=e.onListChangeStart,G=e.onListChangeEnd,_=kr(e,g7),j=D.useRef(null),W=D.useRef(null);D.useImperativeHandle(t,function(){return{scrollTo:function(Ke){j.current.scrollTo(Ke)},getIndentWidth:function(){return W.current.offsetWidth}}});var U=D.useState(o),ee=Dt(U,2),V=ee[0],Y=ee[1],fe=D.useState(n),be=Dt(fe,2),he=be[0],De=be[1],$e=D.useState(n),Z=Dt($e,2),ie=Z[0],le=Z[1],ue=D.useState([]),Se=Dt(ue,2),Be=Se[0],ge=Se[1],Ee=D.useState(null),Ae=Dt(Ee,2),Fe=Ae[0],xe=Ae[1],Ce=D.useRef(n);Ce.current=n;function _e(){var Ie=Ce.current;De(Ie),le(Ie),ge([]),xe(null),G()}Ro(function(){Y(o);var Ie=m7(V,o);if(Ie.key!==null)if(Ie.add){var Ke=he.findIndex(function($t){var Bt=$t.key;return Bt===Ie.key}),Ue=Jf(Gf(he,n,Ie.key),B,p,S),vt=he.slice();vt.splice(Ke+1,0,Zf),le(vt),ge(Ue),xe("show")}else{var tt=n.findIndex(function($t){var Bt=$t.key;return Bt===Ie.key}),nt=Jf(Gf(n,he,Ie.key),B,p,S),It=n.slice();It.splice(tt+1,0,Zf),le(It),ge(nt),xe("hide")}else he!==n&&(De(n),le(n))},[o,n]),D.useEffect(function(){v||_e()},[v]);var ht=C?ie:n,ot={expandedKeys:o,selectedKeys:a,loadedKeys:u,loadingKeys:f,checkedKeys:l,halfCheckedKeys:d,dragOverNodeKey:y,dropPosition:b,keyEntities:m};return D.createElement(D.Fragment,null,O&&T&&D.createElement("span",{style:Yf,"aria-live":"assertive"},b7(T)),D.createElement("div",null,D.createElement("input",{style:Yf,disabled:$===!1||g,tabIndex:$!==!1?F:null,onKeyDown:P,onFocus:N,onBlur:q,value:"",onChange:v7,"aria-label":"for screen reader"})),D.createElement("div",{className:"".concat(r,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},D.createElement("div",{className:"".concat(r,"-indent")},D.createElement("div",{ref:W,className:"".concat(r,"-indent-unit")}))),D.createElement(e1,Et({},_,{data:ht,itemKey:Qf,height:p,fullHeight:!1,virtual:B,itemHeight:S,scrollWidth:k,prefixCls:"".concat(r,"-list"),ref:j,role:"tree",onVisibleChange:function(Ke){Ke.every(function(Ue){return Qf(Ue)!==Qo})&&_e()}}),function(Ie){var Ke=Ie.pos,Ue=Object.assign({},(Y1(Ie.data),Ie.data)),vt=Ie.title,tt=Ie.key,nt=Ie.isStart,It=Ie.isEnd,$t=Ni(tt,Ke);delete Ue.key,delete Ue.children;var Bt=ii($t,ot);return D.createElement(p7,Et({},Ue,Bt,{title:vt,active:!!T&&tt===T.key,pos:Ke,data:Ie.data,isStart:nt,isEnd:It,motion:C,motionNodes:tt===Qo?Be:null,motionType:Fe,onMotionStart:X,onMotionEnd:_e,treeNodeRequiredProps:ot,onMouseMove:function(){R(null)}}))}))}),x7=10,Tc=(function(e){Um(r,e);var t=Xm(r);function r(){var n;Gm(this,r);for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return n=t.call.apply(t,[this].concat(a)),Me(or(n),"destroyed",!1),Me(or(n),"delayedDragEnterLogic",void 0),Me(or(n),"loadingRetryTimes",{}),Me(or(n),"state",{keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:Da()}),Me(or(n),"dragStartMousePosition",null),Me(or(n),"dragNodeProps",null),Me(or(n),"currentMouseOverDroppableNodeKey",null),Me(or(n),"listRef",D.createRef()),Me(or(n),"onNodeDragStart",function(u,f){var d=n.state,m=d.expandedKeys,g=d.keyEntities,v=n.props.onDragStart,y=f.eventKey;n.dragNodeProps=f,n.dragStartMousePosition={x:u.clientX,y:u.clientY};var b=to(m,y);n.setState({draggingNodeKey:y,dragChildrenKeys:t7(y,g),indent:n.listRef.current.getIndentWidth()}),n.setExpandedKeys(b),window.addEventListener("dragend",n.onWindowDragEnd),v==null||v({event:u,node:Ur(f)})}),Me(or(n),"onNodeDragEnter",function(u,f){var d=n.state,m=d.expandedKeys,g=d.keyEntities,v=d.dragChildrenKeys,y=d.flattenNodes,b=d.indent,C=n.props,p=C.onDragEnter,S=C.onExpand,B=C.allowDrop,k=C.direction,$=f.pos,T=f.eventKey;if(n.currentMouseOverDroppableNodeKey!==T&&(n.currentMouseOverDroppableNodeKey=T),!n.dragNodeProps){n.resetDragState();return}var O=Wf(u,n.dragNodeProps,f,b,n.dragStartMousePosition,B,y,g,m,k),F=O.dropPosition,P=O.dropLevelOffset,N=O.dropTargetKey,q=O.dropContainerKey,R=O.dropTargetPos,X=O.dropAllowed,G=O.dragOverNodeKey;if(v.includes(N)||!X){n.resetDragState();return}if(n.delayedDragEnterLogic||(n.delayedDragEnterLogic={}),Object.keys(n.delayedDragEnterLogic).forEach(function(_){clearTimeout(n.delayedDragEnterLogic[_])}),n.dragNodeProps.eventKey!==f.eventKey&&(u.persist(),n.delayedDragEnterLogic[$]=window.setTimeout(function(){if(n.state.draggingNodeKey!==null){var _=Gt(m),j=Dn(g,f.eventKey);j&&(j.children||[]).length&&(_=fo(m,f.eventKey)),n.props.hasOwnProperty("expandedKeys")||n.setExpandedKeys(_),S==null||S(_,{node:Ur(f),expanded:!0,nativeEvent:u.nativeEvent})}},800)),n.dragNodeProps.eventKey===N&&P===0){n.resetDragState();return}n.setState({dragOverNodeKey:G,dropPosition:F,dropLevelOffset:P,dropTargetKey:N,dropContainerKey:q,dropTargetPos:R,dropAllowed:X}),p==null||p({event:u,node:Ur(f),expandedKeys:m})}),Me(or(n),"onNodeDragOver",function(u,f){var d=n.state,m=d.dragChildrenKeys,g=d.flattenNodes,v=d.keyEntities,y=d.expandedKeys,b=d.indent,C=n.props,p=C.onDragOver,S=C.allowDrop,B=C.direction;if(n.dragNodeProps){var k=Wf(u,n.dragNodeProps,f,b,n.dragStartMousePosition,S,g,v,y,B),$=k.dropPosition,T=k.dropLevelOffset,O=k.dropTargetKey,F=k.dropContainerKey,P=k.dropTargetPos,N=k.dropAllowed,q=k.dragOverNodeKey;m.includes(O)||!N||(n.dragNodeProps.eventKey===O&&T===0?n.state.dropPosition===null&&n.state.dropLevelOffset===null&&n.state.dropTargetKey===null&&n.state.dropContainerKey===null&&n.state.dropTargetPos===null&&n.state.dropAllowed===!1&&n.state.dragOverNodeKey===null||n.resetDragState():$===n.state.dropPosition&&T===n.state.dropLevelOffset&&O===n.state.dropTargetKey&&F===n.state.dropContainerKey&&P===n.state.dropTargetPos&&N===n.state.dropAllowed&&q===n.state.dragOverNodeKey||n.setState({dropPosition:$,dropLevelOffset:T,dropTargetKey:O,dropContainerKey:F,dropTargetPos:P,dropAllowed:N,dragOverNodeKey:q}),p==null||p({event:u,node:Ur(f)}))}}),Me(or(n),"onNodeDragLeave",function(u,f){n.currentMouseOverDroppableNodeKey===f.eventKey&&!u.currentTarget.contains(u.relatedTarget)&&(n.resetDragState(),n.currentMouseOverDroppableNodeKey=null);var d=n.props.onDragLeave;d==null||d({event:u,node:Ur(f)})}),Me(or(n),"onWindowDragEnd",function(u){n.onNodeDragEnd(u,null,!0),window.removeEventListener("dragend",n.onWindowDragEnd)}),Me(or(n),"onNodeDragEnd",function(u,f){var d=n.props.onDragEnd;n.setState({dragOverNodeKey:null}),n.cleanDragState(),d==null||d({event:u,node:Ur(f)}),n.dragNodeProps=null,window.removeEventListener("dragend",n.onWindowDragEnd)}),Me(or(n),"onNodeDrop",function(u,f){var d,m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,g=n.state,v=g.dragChildrenKeys,y=g.dropPosition,b=g.dropTargetKey,C=g.dropTargetPos,p=g.dropAllowed;if(p){var S=n.props.onDrop;if(n.setState({dragOverNodeKey:null}),n.cleanDragState(),b!==null){var B=Ve(Ve({},ii(b,n.getTreeNodeRequiredProps())),{},{active:((d=n.getActiveItem())===null||d===void 0?void 0:d.key)===b,data:Dn(n.state.keyEntities,b).node}),k=v.includes(b);io(!k,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var $=Fc(C),T={event:u,node:Ur(B),dragNode:n.dragNodeProps?Ur(n.dragNodeProps):null,dragNodesKeys:[n.dragNodeProps.eventKey].concat(v),dropToGap:y!==0,dropPosition:y+Number($[$.length-1])};m||S==null||S(T),n.dragNodeProps=null}}}),Me(or(n),"cleanDragState",function(){var u=n.state.draggingNodeKey;u!==null&&n.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),n.dragStartMousePosition=null,n.currentMouseOverDroppableNodeKey=null}),Me(or(n),"triggerExpandActionExpand",function(u,f){var d=n.state,m=d.expandedKeys,g=d.flattenNodes,v=f.expanded,y=f.key,b=f.isLeaf;if(!(b||u.shiftKey||u.metaKey||u.ctrlKey)){var C=g.filter(function(S){return S.key===y})[0],p=Ur(Ve(Ve({},ii(y,n.getTreeNodeRequiredProps())),{},{data:C.data}));n.setExpandedKeys(v?to(m,y):fo(m,y)),n.onNodeExpand(u,p)}}),Me(or(n),"onNodeClick",function(u,f){var d=n.props,m=d.onClick,g=d.expandAction;g==="click"&&n.triggerExpandActionExpand(u,f),m==null||m(u,f)}),Me(or(n),"onNodeDoubleClick",function(u,f){var d=n.props,m=d.onDoubleClick,g=d.expandAction;g==="doubleClick"&&n.triggerExpandActionExpand(u,f),m==null||m(u,f)}),Me(or(n),"onNodeSelect",function(u,f){var d=n.state.selectedKeys,m=n.state,g=m.keyEntities,v=m.fieldNames,y=n.props,b=y.onSelect,C=y.multiple,p=f.selected,S=f[v.key],B=!p;B?C?d=fo(d,S):d=[S]:d=to(d,S);var k=d.map(function($){var T=Dn(g,$);return T?T.node:null}).filter(Boolean);n.setUncontrolledState({selectedKeys:d}),b==null||b(d,{event:"select",selected:B,node:f,selectedNodes:k,nativeEvent:u.nativeEvent})}),Me(or(n),"onNodeCheck",function(u,f,d){var m=n.state,g=m.keyEntities,v=m.checkedKeys,y=m.halfCheckedKeys,b=n.props,C=b.checkStrictly,p=b.onCheck,S=f.key,B,k={event:"check",node:f,checked:d,nativeEvent:u.nativeEvent};if(C){var $=d?fo(v,S):to(v,S),T=to(y,S);B={checked:$,halfChecked:T},k.checkedNodes=$.map(function(R){return Dn(g,R)}).filter(Boolean).map(function(R){return R.node}),n.setUncontrolledState({checkedKeys:$})}else{var O=ba([].concat(Gt(v),[S]),!0,g),F=O.checkedKeys,P=O.halfCheckedKeys;if(!d){var N=new Set(F);N.delete(S);var q=ba(Array.from(N),{halfCheckedKeys:P},g);F=q.checkedKeys,P=q.halfCheckedKeys}B=F,k.checkedNodes=[],k.checkedNodesPositions=[],k.halfCheckedKeys=P,F.forEach(function(R){var X=Dn(g,R);if(X){var G=X.node,_=X.pos;k.checkedNodes.push(G),k.checkedNodesPositions.push({node:G,pos:_})}}),n.setUncontrolledState({checkedKeys:F},!1,{halfCheckedKeys:P})}p==null||p(B,k)}),Me(or(n),"onNodeLoad",function(u){var f,d=u.key,m=n.state.keyEntities,g=Dn(m,d);if(!(g!=null&&(f=g.children)!==null&&f!==void 0&&f.length)){var v=new Promise(function(y,b){n.setState(function(C){var p=C.loadedKeys,S=p===void 0?[]:p,B=C.loadingKeys,k=B===void 0?[]:B,$=n.props,T=$.loadData,O=$.onLoad;if(!T||S.includes(d)||k.includes(d))return null;var F=T(u);return F.then(function(){var P=n.state.loadedKeys,N=fo(P,d);O==null||O(N,{event:"load",node:u}),n.setUncontrolledState({loadedKeys:N}),n.setState(function(q){return{loadingKeys:to(q.loadingKeys,d)}}),y()}).catch(function(P){if(n.setState(function(q){return{loadingKeys:to(q.loadingKeys,d)}}),n.loadingRetryTimes[d]=(n.loadingRetryTimes[d]||0)+1,n.loadingRetryTimes[d]>=x7){var N=n.state.loadedKeys;io(!1,"Retry for `loadData` many times but still failed. No more retry."),n.setUncontrolledState({loadedKeys:fo(N,d)}),y()}b(P)}),{loadingKeys:fo(k,d)}})});return v.catch(function(){}),v}}),Me(or(n),"onNodeMouseEnter",function(u,f){var d=n.props.onMouseEnter;d==null||d({event:u,node:f})}),Me(or(n),"onNodeMouseLeave",function(u,f){var d=n.props.onMouseLeave;d==null||d({event:u,node:f})}),Me(or(n),"onNodeContextMenu",function(u,f){var d=n.props.onRightClick;d&&(u.preventDefault(),d({event:u,node:f}))}),Me(or(n),"onFocus",function(){var u=n.props.onFocus;n.setState({focused:!0});for(var f=arguments.length,d=new Array(f),m=0;m<f;m++)d[m]=arguments[m];u==null||u.apply(void 0,d)}),Me(or(n),"onBlur",function(){var u=n.props.onBlur;n.setState({focused:!1}),n.onActiveChange(null);for(var f=arguments.length,d=new Array(f),m=0;m<f;m++)d[m]=arguments[m];u==null||u.apply(void 0,d)}),Me(or(n),"getTreeNodeRequiredProps",function(){var u=n.state,f=u.expandedKeys,d=u.selectedKeys,m=u.loadedKeys,g=u.loadingKeys,v=u.checkedKeys,y=u.halfCheckedKeys,b=u.dragOverNodeKey,C=u.dropPosition,p=u.keyEntities;return{expandedKeys:f||[],selectedKeys:d||[],loadedKeys:m||[],loadingKeys:g||[],checkedKeys:v||[],halfCheckedKeys:y||[],dragOverNodeKey:b,dropPosition:C,keyEntities:p}}),Me(or(n),"setExpandedKeys",function(u){var f=n.state,d=f.treeData,m=f.fieldNames,g=au(d,u,m);n.setUncontrolledState({expandedKeys:u,flattenNodes:g},!0)}),Me(or(n),"onNodeExpand",function(u,f){var d=n.state.expandedKeys,m=n.state,g=m.listChanging,v=m.fieldNames,y=n.props,b=y.onExpand,C=y.loadData,p=f.expanded,S=f[v.key];if(!g){var B=d.includes(S),k=!p;if(io(p&&B||!p&&!B,"Expand state not sync with index check"),d=k?fo(d,S):to(d,S),n.setExpandedKeys(d),b==null||b(d,{node:f,expanded:k,nativeEvent:u.nativeEvent}),k&&C){var $=n.onNodeLoad(f);$&&$.then(function(){var T=au(n.state.treeData,d,v);n.setUncontrolledState({flattenNodes:T})}).catch(function(){var T=n.state.expandedKeys,O=to(T,S);n.setExpandedKeys(O)})}}}),Me(or(n),"onListChangeStart",function(){n.setUncontrolledState({listChanging:!0})}),Me(or(n),"onListChangeEnd",function(){setTimeout(function(){n.setUncontrolledState({listChanging:!1})})}),Me(or(n),"onActiveChange",function(u){var f=n.state.activeKey,d=n.props,m=d.onActiveChange,g=d.itemScrollOffset,v=g===void 0?0:g;f!==u&&(n.setState({activeKey:u}),u!==null&&n.scrollTo({key:u,offset:v}),m==null||m(u))}),Me(or(n),"getActiveItem",function(){var u=n.state,f=u.activeKey,d=u.flattenNodes;return f===null?null:d.find(function(m){var g=m.key;return g===f})||null}),Me(or(n),"offsetActiveKey",function(u){var f=n.state,d=f.flattenNodes,m=f.activeKey,g=d.findIndex(function(b){var C=b.key;return C===m});g===-1&&u<0&&(g=d.length),g=(g+u+d.length)%d.length;var v=d[g];if(v){var y=v.key;n.onActiveChange(y)}else n.onActiveChange(null)}),Me(or(n),"onKeyDown",function(u){var f=n.state,d=f.activeKey,m=f.expandedKeys,g=f.checkedKeys,v=f.fieldNames,y=n.props,b=y.onKeyDown,C=y.checkable,p=y.selectable;switch(u.which){case qr.UP:{n.offsetActiveKey(-1),u.preventDefault();break}case qr.DOWN:{n.offsetActiveKey(1),u.preventDefault();break}}var S=n.getActiveItem();if(S&&S.data){var B=n.getTreeNodeRequiredProps(),k=S.data.isLeaf===!1||!!(S.data[v.children]||[]).length,$=Ur(Ve(Ve({},ii(d,B)),{},{data:S.data,active:!0}));switch(u.which){case qr.LEFT:{k&&m.includes(d)?n.onNodeExpand({},$):S.parent&&n.onActiveChange(S.parent.key),u.preventDefault();break}case qr.RIGHT:{k&&!m.includes(d)?n.onNodeExpand({},$):S.children&&S.children.length&&n.onActiveChange(S.children[0].key),u.preventDefault();break}case qr.ENTER:case qr.SPACE:{C&&!$.disabled&&$.checkable!==!1&&!$.disableCheckbox?n.onNodeCheck({},$,!g.includes(d)):!C&&p&&!$.disabled&&$.selectable!==!1&&n.onNodeSelect({},$);break}}}b==null||b(u)}),Me(or(n),"setUncontrolledState",function(u){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!n.destroyed){var m=!1,g=!0,v={};Object.keys(u).forEach(function(y){if(n.props.hasOwnProperty(y)){g=!1;return}m=!0,v[y]=u[y]}),m&&(!f||g)&&n.setState(Ve(Ve({},v),d))}}),Me(or(n),"scrollTo",function(u){n.listRef.current.scrollTo(u)}),n}return Ym(r,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var o=this.props,a=o.activeKey,l=o.itemScrollOffset,u=l===void 0?0:l;a!==void 0&&a!==this.state.activeKey&&(this.setState({activeKey:a}),a!==null&&this.scrollTo({key:a,offset:u}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var o=this.state,a=o.focused,l=o.flattenNodes,u=o.keyEntities,f=o.draggingNodeKey,d=o.activeKey,m=o.dropLevelOffset,g=o.dropContainerKey,v=o.dropTargetKey,y=o.dropPosition,b=o.dragOverNodeKey,C=o.indent,p=this.props,S=p.prefixCls,B=p.className,k=p.style,$=p.showLine,T=p.focusable,O=p.tabIndex,F=O===void 0?0:O,P=p.selectable,N=p.showIcon,q=p.icon,R=p.switcherIcon,X=p.draggable,G=p.checkable,_=p.checkStrictly,j=p.disabled,W=p.motion,U=p.loadData,ee=p.filterTreeNode,V=p.height,Y=p.itemHeight,fe=p.scrollWidth,be=p.virtual,he=p.titleRender,De=p.dropIndicatorRender,$e=p.onContextMenu,Z=p.onScroll,ie=p.direction,le=p.rootClassName,ue=p.rootStyle,Se=Os(this.props,{aria:!0,data:!0}),Be;X&&($n(X)==="object"?Be=X:typeof X=="function"?Be={nodeDraggable:X}:Be={});var ge={prefixCls:S,selectable:P,showIcon:N,icon:q,switcherIcon:R,draggable:Be,draggingNodeKey:f,checkable:G,checkStrictly:_,disabled:j,keyEntities:u,dropLevelOffset:m,dropContainerKey:g,dropTargetKey:v,dropPosition:y,dragOverNodeKey:b,indent:C,direction:ie,dropIndicatorRender:De,loadData:U,filterTreeNode:ee,titleRender:he,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop};return D.createElement(Bc.Provider,{value:ge},D.createElement("div",{className:ft(S,B,le,Me(Me(Me({},"".concat(S,"-show-line"),$),"".concat(S,"-focused"),a),"".concat(S,"-active-focused"),d!==null)),style:ue},D.createElement(y7,Et({ref:this.listRef,prefixCls:S,style:k,data:l,disabled:j,selectable:P,checkable:!!G,motion:W,dragging:f!==null,height:V,itemHeight:Y,virtual:be,focusable:T,focused:a,tabIndex:F,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:$e,onScroll:Z,scrollWidth:fe},this.getTreeNodeRequiredProps(),Se))))}}],[{key:"getDerivedStateFromProps",value:function(o,a){var l=a.prevProps,u={prevProps:o};function f(F){return!l&&o.hasOwnProperty(F)||l&&l[F]!==o[F]}var d,m=a.fieldNames;if(f("fieldNames")&&(m=Da(o.fieldNames),u.fieldNames=m),f("treeData")?d=o.treeData:f("children")&&(io(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),d=D1(o.children)),d){u.treeData=d;var g=xc(d,{fieldNames:m});u.keyEntities=Ve(Me({},Qo,Z1),g.keyEntities)}var v=u.keyEntities||a.keyEntities;if(f("expandedKeys")||l&&f("autoExpandParent"))u.expandedKeys=o.autoExpandParent||!l&&o.defaultExpandParent?b0(o.expandedKeys,v):o.expandedKeys;else if(!l&&o.defaultExpandAll){var y=Ve({},v);delete y[Qo];var b=[];Object.keys(y).forEach(function(F){var P=y[F];P.children&&P.children.length&&b.push(P.key)}),u.expandedKeys=b}else!l&&o.defaultExpandedKeys&&(u.expandedKeys=o.autoExpandParent||o.defaultExpandParent?b0(o.defaultExpandedKeys,v):o.defaultExpandedKeys);if(u.expandedKeys||delete u.expandedKeys,d||u.expandedKeys){var C=au(d||a.treeData,u.expandedKeys||a.expandedKeys,m);u.flattenNodes=C}if(o.selectable&&(f("selectedKeys")?u.selectedKeys=Uf(o.selectedKeys,o):!l&&o.defaultSelectedKeys&&(u.selectedKeys=Uf(o.defaultSelectedKeys,o))),o.checkable){var p;if(f("checkedKeys")?p=iu(o.checkedKeys)||{}:!l&&o.defaultCheckedKeys?p=iu(o.defaultCheckedKeys)||{}:d&&(p=iu(o.checkedKeys)||{checkedKeys:a.checkedKeys,halfCheckedKeys:a.halfCheckedKeys}),p){var S=p,B=S.checkedKeys,k=B===void 0?[]:B,$=S.halfCheckedKeys,T=$===void 0?[]:$;if(!o.checkStrictly){var O=ba(k,!0,v);k=O.checkedKeys,T=O.halfCheckedKeys}u.checkedKeys=k,u.halfCheckedKeys=T}}return f("loadedKeys")&&(u.loadedKeys=o.loadedKeys),u}}]),r})(D.Component);Me(Tc,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:d7,allowDrop:function(){return!0},expandAction:!1});Me(Tc,"TreeNode",mi);var w7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},C7=function(t,r){return D.createElement(sn,Et({},t,{ref:r,icon:w7}))},J1=D.forwardRef(C7),D7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},k7=function(t,r){return D.createElement(sn,Et({},t,{ref:r,icon:D7}))},E7=D.forwardRef(k7),S7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},A7=function(t,r){return D.createElement(sn,Et({},t,{ref:r,icon:S7}))},B7=D.forwardRef(A7),F7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},T7=function(t,r){return D.createElement(sn,Et({},t,{ref:r,icon:F7}))},$7=D.forwardRef(T7);const N7=({treeCls:e,treeNodeCls:t,directoryNodeSelectedBg:r,directoryNodeSelectedColor:n,motionDurationMid:o,borderRadius:a,controlItemBgHover:l})=>({[`${e}${e}-directory ${t}`]:{[`${e}-node-content-wrapper`]:{position:"static",[`&:has(${e}-drop-indicator)`]:{position:"relative"},[`> *:not(${e}-drop-indicator)`]:{position:"relative"},"&:hover":{background:"transparent"},"&:before":{position:"absolute",inset:0,transition:`background-color ${o}`,content:'""',borderRadius:a},"&:hover:before":{background:l}},[`${e}-switcher, ${e}-checkbox, ${e}-draggable-icon`]:{zIndex:1},"&-selected":{background:r,borderRadius:a,[`${e}-switcher, ${e}-draggable-icon`]:{color:n},[`${e}-node-content-wrapper`]:{color:n,background:"transparent","&, &:hover":{color:n},"&:before, &:hover:before":{background:r}}}}}),O7=new gv("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),M7=(e,t)=>({[`.${e}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${t.motionDurationSlow}`}}}),I7=(e,t)=>({[`.${e}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${rt(t.lineWidthBold)} solid ${t.colorPrimary}`,borderRadius:"50%",content:'""'}}}),R7=(e,t)=>{const{treeCls:r,treeNodeCls:n,treeNodePadding:o,titleHeight:a,indentSize:l,nodeSelectedBg:u,nodeHoverBg:f,colorTextQuaternary:d,controlItemBgActiveDisabled:m}=t;return{[r]:Object.assign(Object.assign({},Fi(t)),{"--rc-virtual-list-scrollbar-bg":t.colorSplit,background:t.colorBgContainer,borderRadius:t.borderRadius,transition:`background-color ${t.motionDurationSlow}`,"&-rtl":{direction:"rtl"},[`&${r}-rtl ${r}-switcher_close ${r}-switcher-icon svg`]:{transform:"rotate(90deg)"},[`&-focused:not(:hover):not(${r}-active-focused)`]:Zm(t),[`${r}-list-holder-inner`]:{alignItems:"flex-start"},[`&${r}-block-node`]:{[`${r}-list-holder-inner`]:{alignItems:"stretch",[`${r}-node-content-wrapper`]:{flex:"auto"},[`${n}.dragging:after`]:{position:"absolute",inset:0,border:`1px solid ${t.colorPrimary}`,opacity:0,animationName:O7,animationDuration:t.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none",borderRadius:t.borderRadius}}},[n]:{display:"flex",alignItems:"flex-start",marginBottom:o,lineHeight:rt(a),position:"relative","&:before":{content:'""',position:"absolute",zIndex:1,insetInlineStart:0,width:"100%",top:"100%",height:o},[`&-disabled ${r}-node-content-wrapper`]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}},[`${r}-checkbox-disabled + ${r}-node-selected,&${n}-disabled${n}-selected ${r}-node-content-wrapper`]:{backgroundColor:m},[`${r}-checkbox-disabled`]:{pointerEvents:"unset"},[`&:not(${n}-disabled)`]:{[`${r}-node-content-wrapper`]:{"&:hover":{color:t.nodeHoverColor}}},[`&-active ${r}-node-content-wrapper`]:{background:t.controlItemBgHover},[`&:not(${n}-disabled).filter-node ${r}-title`]:{color:t.colorPrimary,fontWeight:t.fontWeightStrong},"&-draggable":{cursor:"grab",[`${r}-draggable-icon`]:{flexShrink:0,width:a,textAlign:"center",visibility:"visible",color:d},[`&${n}-disabled ${r}-draggable-icon`]:{visibility:"hidden"}}},[`${r}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:l}},[`${r}-draggable-icon`]:{visibility:"hidden"},[`${r}-switcher, ${r}-checkbox`]:{marginInlineEnd:t.calc(t.calc(a).sub(t.controlInteractiveSize)).div(2).equal()},[`${r}-switcher`]:Object.assign(Object.assign({},M7(e,t)),{position:"relative",flex:"none",alignSelf:"stretch",width:a,textAlign:"center",cursor:"pointer",userSelect:"none",transition:`all ${t.motionDurationSlow}`,"&-noop":{cursor:"unset"},"&:before":{pointerEvents:"none",content:'""',width:a,height:a,position:"absolute",left:{_skip_check_:!0,value:0},top:0,borderRadius:t.borderRadius,transition:`all ${t.motionDurationSlow}`},[`&:not(${r}-switcher-noop):hover:before`]:{backgroundColor:t.colorBgTextHover},[`&_close ${r}-switcher-icon svg`]:{transform:"rotate(-90deg)"},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:`1px solid ${t.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:t.calc(t.calc(a).div(2).equal()).mul(.8).equal(),height:t.calc(a).div(2).equal(),borderBottom:`1px solid ${t.colorBorder}`,content:'""'}}}),[`${r}-node-content-wrapper`]:Object.assign(Object.assign({position:"relative",minHeight:a,paddingBlock:0,paddingInline:t.paddingXS,background:"transparent",borderRadius:t.borderRadius,cursor:"pointer",transition:`all ${t.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`},I7(e,t)),{"&:hover":{backgroundColor:f},[`&${r}-node-selected`]:{color:t.nodeSelectedColor,backgroundColor:u},[`${r}-iconEle`]:{display:"inline-block",width:a,height:a,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}}),[`${r}-unselectable ${r}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${n}.drop-container > [draggable]`]:{boxShadow:`0 0 0 2px ${t.colorPrimary}`},"&-show-line":{[`${r}-indent-unit`]:{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),borderInlineEnd:`1px solid ${t.colorBorder}`,content:'""'},"&-end:before":{display:"none"}},[`${r}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${n}-leaf-last ${r}-switcher-leaf-line:before`]:{top:"auto !important",bottom:"auto !important",height:`${rt(t.calc(a).div(2).equal())} !important`}})}},P7=(e,t,r=!0)=>{const n=`.${e}`,o=`${n}-treenode`,a=t.calc(t.paddingXS).div(2).equal(),l=Jo(t,{treeCls:n,treeNodeCls:o,treeNodePadding:a});return[R7(e,l),r&&N7(l)].filter(Boolean)},z7=e=>{const{controlHeightSM:t,controlItemBgHover:r,controlItemBgActive:n}=e,o=t;return{titleHeight:o,indentSize:o,nodeHoverBg:r,nodeHoverColor:e.colorText,nodeSelectedBg:n,nodeSelectedColor:e.colorText}},_7=e=>{const{colorTextLightSolid:t,colorPrimary:r}=e;return Object.assign(Object.assign({},z7(e)),{directoryNodeSelectedColor:t,directoryNodeSelectedBg:r})},j7=Bi("Tree",(e,{prefixCls:t})=>[{[e.componentCls]:mv(`${t}-checkbox`,e)},P7(t,e),Jm(e)],_7),eh=4;function L7(e){const{dropPosition:t,dropLevelOffset:r,prefixCls:n,indent:o,direction:a="ltr"}=e,l=a==="ltr"?"left":"right",u=a==="ltr"?"right":"left",f={[l]:-r*o+eh,[u]:0};switch(t){case-1:f.top=-3;break;case 1:f.bottom=-3;break;default:f.bottom=-3,f[l]=o+eh;break}return We.createElement("div",{style:f,className:`${n}-drop-indicator`})}var H7={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},K7=function(t,r){return D.createElement(sn,Et({},t,{ref:r,icon:H7}))},q7=D.forwardRef(K7),V7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},W7=function(t,r){return D.createElement(sn,Et({},t,{ref:r,icon:V7}))},U7=D.forwardRef(W7),X7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},G7=function(t,r){return D.createElement(sn,Et({},t,{ref:r,icon:X7}))},Y7=D.forwardRef(G7);const Z7=e=>{var t,r;const{prefixCls:n,switcherIcon:o,treeNodeProps:a,showLine:l,switcherLoadingIcon:u}=e,{isLeaf:f,expanded:d,loading:m}=a;if(m)return D.isValidElement(u)?u:D.createElement(vv,{className:`${n}-switcher-loading-icon`});let g;if(l&&typeof l=="object"&&(g=l.showLeafIcon),f){if(!l)return null;if(typeof g!="boolean"&&g){const b=typeof g=="function"?g(a):g,C=`${n}-switcher-line-custom-icon`;return D.isValidElement(b)?Ca(b,{className:ft((t=b.props)===null||t===void 0?void 0:t.className,C)}):b}return g?D.createElement(J1,{className:`${n}-switcher-line-icon`}):D.createElement("span",{className:`${n}-switcher-leaf-line`})}const v=`${n}-switcher-icon`,y=typeof o=="function"?o(a):o;return D.isValidElement(y)?Ca(y,{className:ft((r=y.props)===null||r===void 0?void 0:r.className,v)}):y!==void 0?y:l?d?D.createElement(U7,{className:`${n}-switcher-line-icon`}):D.createElement(Y7,{className:`${n}-switcher-line-icon`}):D.createElement(q7,{className:v})},Q1=We.forwardRef((e,t)=>{var r;const{getPrefixCls:n,direction:o,virtual:a,tree:l}=We.useContext(Co),{prefixCls:u,className:f,showIcon:d=!1,showLine:m,switcherIcon:g,switcherLoadingIcon:v,blockNode:y=!1,children:b,checkable:C=!1,selectable:p=!0,draggable:S,disabled:B,motion:k,style:$}=e,T=n("tree",u),O=n(),F=We.useContext(bv),P=B??F,N=k??Object.assign(Object.assign({},Qm(O)),{motionAppear:!1}),q=Object.assign(Object.assign({},e),{checkable:C,selectable:p,showIcon:d,motion:N,blockNode:y,disabled:P,showLine:!!m,dropIndicatorRender:L7}),[R,X,G]=j7(T),[,_]=uc(),j=_.paddingXS/2+(((r=_.Tree)===null||r===void 0?void 0:r.titleHeight)||_.controlHeightSM),W=We.useMemo(()=>{if(!S)return!1;let ee={};switch(typeof S){case"function":ee.nodeDraggable=S;break;case"object":ee=Object.assign({},S);break}return ee.icon!==!1&&(ee.icon=ee.icon||We.createElement($7,null)),ee},[S]),U=ee=>We.createElement(Z7,{prefixCls:T,switcherIcon:g,switcherLoadingIcon:v,treeNodeProps:ee,showLine:m});return R(We.createElement(Tc,Object.assign({itemHeight:j,ref:t,virtual:a},q,{style:Object.assign(Object.assign({},l==null?void 0:l.style),$),prefixCls:T,className:ft({[`${T}-icon-hide`]:!d,[`${T}-block-node`]:y,[`${T}-unselectable`]:!p,[`${T}-rtl`]:o==="rtl",[`${T}-disabled`]:P},l==null?void 0:l.className,f,X,G),direction:o,checkable:C&&We.createElement("span",{className:`${T}-checkbox-inner`}),selectable:p,switcherIcon:U,draggable:W}),b))}),th=0,su=1,rh=2;function $c(e,t,r){const{key:n,children:o}=r;function a(l){const u=l[n],f=l[o];t(u,l)!==!1&&$c(f||[],t,r)}e.forEach(a)}function J7({treeData:e,expandedKeys:t,startKey:r,endKey:n,fieldNames:o}){const a=[];let l=th;if(r&&r===n)return[r];if(!r||!n)return[];function u(f){return f===r||f===n}return $c(e,f=>{if(l===rh)return!1;if(u(f)){if(a.push(f),l===th)l=su;else if(l===su)return l=rh,!1}else l===su&&a.push(f);return t.includes(f)},Da(o)),a}function lu(e,t,r){const n=Gt(t),o=[];return $c(e,(a,l)=>{const u=n.indexOf(a);return u!==-1&&(o.push(l),n.splice(u,1)),!!n.length},Da(r)),o}var nh=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};function Q7(e){const{isLeaf:t,expanded:r}=e;return t?D.createElement(J1,null):r?D.createElement(E7,null):D.createElement(B7,null)}function oh({treeData:e,children:t}){return e||D1(t)}const eb=(e,t)=>{var{defaultExpandAll:r,defaultExpandParent:n,defaultExpandedKeys:o}=e,a=nh(e,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const l=D.useRef(null),u=D.useRef(null),f=()=>{const{keyEntities:P}=xc(oh(a),{fieldNames:a.fieldNames});let N;return r?N=Object.keys(P):n?N=b0(a.expandedKeys||o||[],P):N=a.expandedKeys||o||[],N},[d,m]=D.useState(a.selectedKeys||a.defaultSelectedKeys||[]),[g,v]=D.useState(()=>f());D.useEffect(()=>{"selectedKeys"in a&&m(a.selectedKeys)},[a.selectedKeys]),D.useEffect(()=>{"expandedKeys"in a&&v(a.expandedKeys)},[a.expandedKeys]);const y=(P,N)=>{var q;return"expandedKeys"in a||v(P),(q=a.onExpand)===null||q===void 0?void 0:q.call(a,P,N)},b=(P,N)=>{var q;const{multiple:R,fieldNames:X}=a,{node:G,nativeEvent:_}=N,{key:j=""}=G,W=oh(a),U=Object.assign(Object.assign({},N),{selected:!0}),ee=(_==null?void 0:_.ctrlKey)||(_==null?void 0:_.metaKey),V=_==null?void 0:_.shiftKey;let Y;R&&ee?(Y=P,l.current=j,u.current=Y,U.selectedNodes=lu(W,Y,X)):R&&V?(Y=Array.from(new Set([].concat(Gt(u.current||[]),Gt(J7({treeData:W,expandedKeys:g,startKey:j,endKey:l.current,fieldNames:X}))))),U.selectedNodes=lu(W,Y,X)):(Y=[j],l.current=j,u.current=Y,U.selectedNodes=lu(W,Y,X)),(q=a.onSelect)===null||q===void 0||q.call(a,Y,U),"selectedKeys"in a||m(Y)},{getPrefixCls:C,direction:p}=D.useContext(Co),{prefixCls:S,className:B,showIcon:k=!0,expandAction:$="click"}=a,T=nh(a,["prefixCls","className","showIcon","expandAction"]),O=C("tree",S),F=ft(`${O}-directory`,{[`${O}-directory-rtl`]:p==="rtl"},B);return D.createElement(Q1,Object.assign({icon:Q7,ref:t,blockNode:!0},T,{showIcon:k,expandAction:$,prefixCls:O,className:F,expandedKeys:g,selectedKeys:d,onSelect:b,onExpand:y}))},tb=D.forwardRef(eb),Nc=Q1;Nc.DirectoryTree=tb;Nc.TreeNode=mi;const ah=e=>{const{value:t,filterSearch:r,tablePrefixCls:n,locale:o,onChange:a}=e;return r?D.createElement("div",{className:`${n}-filter-dropdown-search`},D.createElement(yv,{prefix:D.createElement(xv,null),placeholder:o.filterSearchPlaceholder,onChange:a,value:t,htmlSize:1,className:`${n}-filter-dropdown-search-input`})):null},rb=e=>{const{keyCode:t}=e;t===qr.ENTER&&e.stopPropagation()},nb=D.forwardRef((e,t)=>D.createElement("div",{className:e.className,onClick:r=>r.stopPropagation(),onKeyDown:rb,ref:t},e.children));function ya(e){let t=[];return(e||[]).forEach(({value:r,children:n})=>{t.push(r),n&&(t=[].concat(Gt(t),Gt(ya(n))))}),t}function ob(e){return e.some(({children:t})=>t)}function eg(e,t){return typeof t=="string"||typeof t=="number"?t==null?void 0:t.toString().toLowerCase().includes(e.trim().toLowerCase()):!1}function tg({filters:e,prefixCls:t,filteredKeys:r,filterMultiple:n,searchValue:o,filterSearch:a}){return e.map((l,u)=>{const f=String(l.value);if(l.children)return{key:f||u,label:l.text,popupClassName:`${t}-dropdown-submenu`,children:tg({filters:l.children,prefixCls:t,filteredKeys:r,filterMultiple:n,searchValue:o,filterSearch:a})};const d=n?Ms:Lm,m={key:l.value!==void 0?f:u,label:D.createElement(D.Fragment,null,D.createElement(d,{checked:r.includes(f)}),D.createElement("span",null,l.text))};return o.trim()?typeof a=="function"?a(o,l)?m:null:eg(o,l.text)?m:null:m})}function uu(e){return e||[]}const ab=e=>{var t,r,n,o;const{tablePrefixCls:a,prefixCls:l,column:u,dropdownPrefixCls:f,columnKey:d,filterOnClose:m,filterMultiple:g,filterMode:v="menu",filterSearch:y=!1,filterState:b,triggerFilter:C,locale:p,children:S,getPopupContainer:B,rootClassName:k}=e,{filterResetToDefaultFilteredValue:$,defaultFilteredValue:T,filterDropdownProps:O={},filterDropdownOpen:F,filterDropdownVisible:P,onFilterDropdownVisibleChange:N,onFilterDropdownOpenChange:q}=u,[R,X]=D.useState(!1),G=!!(b&&(!((t=b.filteredKeys)===null||t===void 0)&&t.length||b.forceFiltered)),_=Ie=>{var Ke;X(Ie),(Ke=O.onOpenChange)===null||Ke===void 0||Ke.call(O,Ie),q==null||q(Ie),N==null||N(Ie)},j=(o=(n=(r=O.open)!==null&&r!==void 0?r:F)!==null&&n!==void 0?n:P)!==null&&o!==void 0?o:R,W=b==null?void 0:b.filteredKeys,[U,ee]=Mv(uu(W)),V=({selectedKeys:Ie})=>{ee(Ie)},Y=(Ie,{node:Ke,checked:Ue})=>{V(g?{selectedKeys:Ie}:{selectedKeys:Ue&&Ke.key?[Ke.key]:[]})};D.useEffect(()=>{R&&V({selectedKeys:uu(W)})},[W]);const[fe,be]=D.useState([]),he=Ie=>{be(Ie)},[De,$e]=D.useState(""),Z=Ie=>{const{value:Ke}=Ie.target;$e(Ke)};D.useEffect(()=>{R||$e("")},[R]);const ie=Ie=>{const Ke=Ie!=null&&Ie.length?Ie:null;if(Ke===null&&(!b||!b.filteredKeys)||Io(Ke,b==null?void 0:b.filteredKeys,!0))return null;C({column:u,key:d,filteredKeys:Ke})},le=()=>{_(!1),ie(U())},ue=({confirm:Ie,closeDropdown:Ke}={confirm:!1,closeDropdown:!1})=>{Ie&&ie([]),Ke&&_(!1),$e(""),ee($?(T||[]).map(Ue=>String(Ue)):[])},Se=({closeDropdown:Ie}={closeDropdown:!0})=>{Ie&&_(!1),ie(U())},Be=(Ie,Ke)=>{Ke.source==="trigger"&&(Ie&&W!==void 0&&ee(uu(W)),_(Ie),!Ie&&!u.filterDropdown&&m&&le())},ge=ft({[`${f}-menu-without-submenu`]:!ob(u.filters||[])}),Ee=Ie=>{if(Ie.target.checked){const Ke=ya(u==null?void 0:u.filters).map(Ue=>String(Ue));ee(Ke)}else ee([])},Ae=({filters:Ie})=>(Ie||[]).map((Ke,Ue)=>{const vt=String(Ke.value),tt={title:Ke.text,key:Ke.value!==void 0?vt:String(Ue)};return Ke.children&&(tt.children=Ae({filters:Ke.children})),tt}),Fe=Ie=>{var Ke;return Object.assign(Object.assign({},Ie),{text:Ie.title,value:Ie.key,children:((Ke=Ie.children)===null||Ke===void 0?void 0:Ke.map(Ue=>Fe(Ue)))||[]})};let xe;const{direction:Ce,renderEmpty:_e}=D.useContext(Co);if(typeof u.filterDropdown=="function")xe=u.filterDropdown({prefixCls:`${f}-custom`,setSelectedKeys:Ie=>V({selectedKeys:Ie}),selectedKeys:U(),confirm:Se,clearFilters:ue,filters:u.filters,visible:j,close:()=>{_(!1)}});else if(u.filterDropdown)xe=u.filterDropdown;else{const Ie=U()||[],Ke=()=>{var vt,tt;const nt=(vt=_e==null?void 0:_e("Table.filter"))!==null&&vt!==void 0?vt:D.createElement(wf,{image:wf.PRESENTED_IMAGE_SIMPLE,description:p.filterEmptyText,styles:{image:{height:24}},style:{margin:0,padding:"16px 0"}});if((u.filters||[]).length===0)return nt;if(v==="tree")return D.createElement(D.Fragment,null,D.createElement(ah,{filterSearch:y,value:De,onChange:Z,tablePrefixCls:a,locale:p}),D.createElement("div",{className:`${a}-filter-dropdown-tree`},g?D.createElement(Ms,{checked:Ie.length===ya(u.filters).length,indeterminate:Ie.length>0&&Ie.length<ya(u.filters).length,className:`${a}-filter-dropdown-checkall`,onChange:Ee},(tt=p==null?void 0:p.filterCheckall)!==null&&tt!==void 0?tt:p==null?void 0:p.filterCheckAll):null,D.createElement(Nc,{checkable:!0,selectable:!1,blockNode:!0,multiple:g,checkStrictly:!g,className:`${f}-menu`,onCheck:Y,checkedKeys:Ie,selectedKeys:Ie,showIcon:!1,treeData:Ae({filters:u.filters}),autoExpandParent:!0,defaultExpandAll:!0,filterTreeNode:De.trim()?Bt=>typeof y=="function"?y(De,Fe(Bt)):eg(De,Bt.title):void 0})));const It=tg({filters:u.filters||[],filterSearch:y,prefixCls:l,filteredKeys:U(),filterMultiple:g,searchValue:De}),$t=It.every(Bt=>Bt===null);return D.createElement(D.Fragment,null,D.createElement(ah,{filterSearch:y,value:De,onChange:Z,tablePrefixCls:a,locale:p}),$t?nt:D.createElement(Na,{selectable:!0,multiple:g,prefixCls:`${f}-menu`,className:ge,onSelect:V,onDeselect:V,selectedKeys:Ie,getPopupContainer:B,openKeys:fe,onOpenChange:he,items:It}))},Ue=()=>$?Io((T||[]).map(vt=>String(vt)),Ie,!0):Ie.length===0;xe=D.createElement(D.Fragment,null,Ke(),D.createElement("div",{className:`${l}-dropdown-btns`},D.createElement($s,{type:"link",size:"small",disabled:Ue(),onClick:()=>ue()},p.filterReset),D.createElement($s,{type:"primary",size:"small",onClick:le},p.filterConfirm)))}u.filterDropdown&&(xe=D.createElement(x1,{selectable:void 0},xe)),xe=D.createElement(nb,{className:`${l}-dropdown`},xe);const ot=t1({trigger:["click"],placement:Ce==="rtl"?"bottomLeft":"bottomRight",children:(()=>{let Ie;return typeof u.filterIcon=="function"?Ie=u.filterIcon(G):u.filterIcon?Ie=u.filterIcon:Ie=D.createElement(c7,null),D.createElement("span",{role:"button",tabIndex:-1,className:ft(`${l}-trigger`,{active:G}),onClick:Ke=>{Ke.stopPropagation()}},Ie)})(),getPopupContainer:B},Object.assign(Object.assign({},O),{rootClassName:ft(k,O.rootClassName),open:j,onOpenChange:Be,popupRender:()=>typeof(O==null?void 0:O.dropdownRender)=="function"?O.dropdownRender(xe):xe}));return D.createElement("div",{className:`${l}-column`},D.createElement("span",{className:`${a}-column-title`},S),D.createElement(wc,Object.assign({},ot)))},D0=(e,t,r)=>{let n=[];return(e||[]).forEach((o,a)=>{var l;const u=Ra(a,r),f=o.filterDropdown!==void 0;if(o.filters||f||"onFilter"in o)if("filteredValue"in o){let d=o.filteredValue;f||(d=(l=d==null?void 0:d.map(String))!==null&&l!==void 0?l:d),n.push({column:o,key:Po(o,u),filteredKeys:d,forceFiltered:o.filtered})}else n.push({column:o,key:Po(o,u),filteredKeys:t&&o.defaultFilteredValue?o.defaultFilteredValue:void 0,forceFiltered:o.filtered});"children"in o&&(n=[].concat(Gt(n),Gt(D0(o.children,t,u))))}),n};function rg(e,t,r,n,o,a,l,u,f){return r.map((d,m)=>{const g=Ra(m,u),{filterOnClose:v=!0,filterMultiple:y=!0,filterMode:b,filterSearch:C}=d;let p=d;if(p.filters||p.filterDropdown){const S=Po(p,g),B=n.find(({key:k})=>S===k);p=Object.assign(Object.assign({},p),{title:k=>D.createElement(ab,{tablePrefixCls:e,prefixCls:`${e}-filter`,dropdownPrefixCls:t,column:p,columnKey:S,filterState:B,filterOnClose:v,filterMultiple:y,filterMode:b,filterSearch:C,triggerFilter:a,locale:o,getPopupContainer:l,rootClassName:f},dl(d.title,k))})}return"children"in p&&(p=Object.assign(Object.assign({},p),{children:rg(e,t,p.children,n,o,a,l,g,f)})),p})}const ih=e=>{const t={};return e.forEach(({key:r,filteredKeys:n,column:o})=>{const a=r,{filters:l,filterDropdown:u}=o;if(u)t[a]=n||null;else if(Array.isArray(n)){const f=ya(l);t[a]=f.filter(d=>n.includes(String(d)))}else t[a]=null}),t},k0=(e,t,r)=>t.reduce((o,a)=>{const{column:{onFilter:l,filters:u},filteredKeys:f}=a;return l&&f&&f.length?o.map(d=>Object.assign({},d)).filter(d=>f.some(m=>{const g=ya(u),v=g.findIndex(b=>String(b)===String(m)),y=v!==-1?g[v]:m;return d[r]&&(d[r]=k0(d[r],t,r)),l(y,d)})):o},e),ng=e=>e.flatMap(t=>"children"in t?[t].concat(Gt(ng(t.children||[]))):[t]),ib=e=>{const{prefixCls:t,dropdownPrefixCls:r,mergedColumns:n,onFilterChange:o,getPopupContainer:a,locale:l,rootClassName:u}=e;nl();const f=D.useMemo(()=>ng(n||[]),[n]),[d,m]=D.useState(()=>D0(f,!0)),g=D.useMemo(()=>{const C=D0(f,!1);if(C.length===0)return C;let p=!0;if(C.forEach(({filteredKeys:S})=>{S!==void 0&&(p=!1)}),p){const S=(f||[]).map((B,k)=>Po(B,Ra(k)));return d.filter(({key:B})=>S.includes(B)).map(B=>{const k=f[S.indexOf(B.key)];return Object.assign(Object.assign({},B),{column:Object.assign(Object.assign({},B.column),k),forceFiltered:k.filtered})})}return C},[f,d]),v=D.useMemo(()=>ih(g),[g]),y=C=>{const p=g.filter(({key:S})=>S!==C.key);p.push(C),m(p),o(ih(p),p)};return[C=>rg(t,r,C,g,l,y,a,void 0,u),g,v]},sb=(e,t,r)=>{const n=D.useRef({});function o(a){var l;if(!n.current||n.current.data!==e||n.current.childrenColumnName!==t||n.current.getRowKey!==r){let f=function(d){d.forEach((m,g)=>{const v=r(m,g);u.set(v,m),m&&typeof m=="object"&&t in m&&f(m[t]||[])})};const u=new Map;f(e),n.current={data:e,childrenColumnName:t,kvMap:u,getRowKey:r}}return(l=n.current.kvMap)===null||l===void 0?void 0:l.get(a)}return[o]};var lb=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const og=10;function ub(e,t){const r={current:e.current,pageSize:e.pageSize};return Object.keys(t&&typeof t=="object"?t:{}).forEach(o=>{const a=e[o];typeof a!="function"&&(r[o]=a)}),r}function cb(e,t,r){const n=r&&typeof r=="object"?r:{},{total:o=0}=n,a=lb(n,["total"]),[l,u]=Ht(()=>({current:"defaultCurrent"in a?a.defaultCurrent:1,pageSize:"defaultPageSize"in a?a.defaultPageSize:og})),f=t1(l,a,{total:o>0?o:e}),d=Math.ceil((o||e)/f.pageSize);f.current>d&&(f.current=d||1);const m=(v,y)=>{u({current:v??1,pageSize:y||f.pageSize})},g=(v,y)=>{var b;r&&((b=r.onChange)===null||b===void 0||b.call(r,v,y)),m(v,y),t(v,y||(f==null?void 0:f.pageSize))};return r===!1?[{},()=>{}]:[Object.assign(Object.assign({},f),{onChange:g}),m]}var db={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"},fb=function(t,r){return D.createElement(sn,Et({},t,{ref:r,icon:db}))},hb=D.forwardRef(fb),pb={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"},mb=function(t,r){return D.createElement(sn,Et({},t,{ref:r,icon:pb}))},gb=D.forwardRef(mb);const hs="ascend",cu="descend",Ls=e=>typeof e.sorter=="object"&&typeof e.sorter.multiple=="number"?e.sorter.multiple:!1,sh=e=>typeof e=="function"?e:e&&typeof e=="object"&&e.compare?e.compare:!1,vb=(e,t)=>t?e[e.indexOf(t)+1]:e[0],E0=(e,t,r)=>{let n=[];const o=(a,l)=>{n.push({column:a,key:Po(a,l),multiplePriority:Ls(a),sortOrder:a.sortOrder})};return(e||[]).forEach((a,l)=>{const u=Ra(l,r);a.children?("sortOrder"in a&&o(a,u),n=[].concat(Gt(n),Gt(E0(a.children,t,u)))):a.sorter&&("sortOrder"in a?o(a,u):t&&a.defaultSortOrder&&n.push({column:a,key:Po(a,u),multiplePriority:Ls(a),sortOrder:a.defaultSortOrder}))}),n},ag=(e,t,r,n,o,a,l,u)=>(t||[]).map((d,m)=>{const g=Ra(m,u);let v=d;if(v.sorter){const y=v.sortDirections||o,b=v.showSorterTooltip===void 0?l:v.showSorterTooltip,C=Po(v,g),p=r.find(({key:N})=>N===C),S=p?p.sortOrder:null,B=vb(y,S);let k;if(d.sortIcon)k=d.sortIcon({sortOrder:S});else{const N=y.includes(hs)&&D.createElement(gb,{className:ft(`${e}-column-sorter-up`,{active:S===hs})}),q=y.includes(cu)&&D.createElement(hb,{className:ft(`${e}-column-sorter-down`,{active:S===cu})});k=D.createElement("span",{className:ft(`${e}-column-sorter`,{[`${e}-column-sorter-full`]:!!(N&&q)})},D.createElement("span",{className:`${e}-column-sorter-inner`,"aria-hidden":"true"},N,q))}const{cancelSort:$,triggerAsc:T,triggerDesc:O}=a||{};let F=$;B===cu?F=O:B===hs&&(F=T);const P=typeof b=="object"?Object.assign({title:F},b):{title:F};v=Object.assign(Object.assign({},v),{className:ft(v.className,{[`${e}-column-sort`]:S}),title:N=>{const q=`${e}-column-sorters`,R=D.createElement("span",{className:`${e}-column-title`},dl(d.title,N)),X=D.createElement("div",{className:q},R,k);return b?typeof b!="boolean"&&(b==null?void 0:b.target)==="sorter-icon"?D.createElement("div",{className:`${q} ${e}-column-sorters-tooltip-target-sorter`},R,D.createElement(Fs,Object.assign({},P),k)):D.createElement(Fs,Object.assign({},P),X):X},onHeaderCell:N=>{var q;const R=((q=d.onHeaderCell)===null||q===void 0?void 0:q.call(d,N))||{},X=R.onClick,G=R.onKeyDown;R.onClick=W=>{n({column:d,key:C,sortOrder:B,multiplePriority:Ls(d)}),X==null||X(W)},R.onKeyDown=W=>{W.keyCode===qr.ENTER&&(n({column:d,key:C,sortOrder:B,multiplePriority:Ls(d)}),G==null||G(W))};const _=s7(d.title,{}),j=_==null?void 0:_.toString();return S&&(R["aria-sort"]=S==="ascend"?"ascending":"descending"),R["aria-label"]=j||"",R.className=ft(R.className,`${e}-column-has-sorters`),R.tabIndex=0,d.ellipsis&&(R.title=(_??"").toString()),R}})}return"children"in v&&(v=Object.assign(Object.assign({},v),{children:ag(e,v.children,r,n,o,a,l,g)})),v}),lh=e=>{const{column:t,sortOrder:r}=e;return{column:t,order:r,field:t.dataIndex,columnKey:t.key}},uh=e=>{const t=e.filter(({sortOrder:r})=>r).map(lh);if(t.length===0&&e.length){const r=e.length-1;return Object.assign(Object.assign({},lh(e[r])),{column:void 0,order:void 0,field:void 0,columnKey:void 0})}return t.length<=1?t[0]||{}:t},S0=(e,t,r)=>{const n=t.slice().sort((l,u)=>u.multiplePriority-l.multiplePriority),o=e.slice(),a=n.filter(({column:{sorter:l},sortOrder:u})=>sh(l)&&u);return a.length?o.sort((l,u)=>{for(let f=0;f<a.length;f+=1){const d=a[f],{column:{sorter:m},sortOrder:g}=d,v=sh(m);if(v&&g){const y=v(l,u,g);if(y!==0)return g===hs?y:-y}}return 0}).map(l=>{const u=l[r];return u?Object.assign(Object.assign({},l),{[r]:S0(u,t,r)}):l}):o},bb=e=>{const{prefixCls:t,mergedColumns:r,sortDirections:n,tableLocale:o,showSorterTooltip:a,onSorterChange:l}=e,[u,f]=D.useState(()=>E0(r,!0)),d=(C,p)=>{const S=[];return C.forEach((B,k)=>{const $=Ra(k,p);if(S.push(Po(B,$)),Array.isArray(B.children)){const T=d(B.children,$);S.push.apply(S,Gt(T))}}),S},m=D.useMemo(()=>{let C=!0;const p=E0(r,!1);if(!p.length){const $=d(r);return u.filter(({key:T})=>$.includes(T))}const S=[];function B($){C?S.push($):S.push(Object.assign(Object.assign({},$),{sortOrder:null}))}let k=null;return p.forEach($=>{k===null?(B($),$.sortOrder&&($.multiplePriority===!1?C=!1:k=!0)):(k&&$.multiplePriority!==!1||(C=!1),B($))}),S},[r,u]),g=D.useMemo(()=>{var C,p;const S=m.map(({column:B,sortOrder:k})=>({column:B,order:k}));return{sortColumns:S,sortColumn:(C=S[0])===null||C===void 0?void 0:C.column,sortOrder:(p=S[0])===null||p===void 0?void 0:p.order}},[m]),v=C=>{let p;C.multiplePriority===!1||!m.length||m[0].multiplePriority===!1?p=[C]:p=[].concat(Gt(m.filter(({key:S})=>S!==C.key)),[C]),f(p),l(uh(p),p)};return[C=>ag(t,C,m,v,n,o,a),m,g,()=>uh(m)]},ig=(e,t)=>e.map(n=>{const o=Object.assign({},n);return o.title=dl(n.title,t),"children"in o&&(o.children=ig(o.children,t)),o}),yb=e=>[D.useCallback(r=>ig(r,e),[e])],xb=W1((e,t)=>{const{_renderTimes:r}=e,{_renderTimes:n}=t;return r!==n}),wb=X1((e,t)=>{const{_renderTimes:r}=e,{_renderTimes:n}=t;return r!==n}),Cb=e=>{const{componentCls:t,lineWidth:r,lineType:n,tableBorderColor:o,tableHeaderBg:a,tablePaddingVertical:l,tablePaddingHorizontal:u,calc:f}=e,d=`${rt(r)} ${n} ${o}`,m=(g,v,y)=>({[`&${t}-${g}`]:{[`> ${t}-container`]:{[`> ${t}-content, > ${t}-body`]:{"\n > table > tbody > tr > th,\n > table > tbody > tr > td\n ":{[`> ${t}-expanded-row-fixed`]:{margin:`${rt(f(v).mul(-1).equal())}
28
+ ${rt(f(f(y).add(r)).mul(-1).equal())}`}}}}}});return{[`${t}-wrapper`]:{[`${t}${t}-bordered`]:Object.assign(Object.assign(Object.assign({[`> ${t}-title`]:{border:d,borderBottom:0},[`> ${t}-container`]:{borderInlineStart:d,borderTop:d,[`
29
+ > ${t}-content,
30
+ > ${t}-header,
31
+ > ${t}-body,
32
+ > ${t}-summary
33
+ `]:{"> table":{"\n > thead > tr > th,\n > thead > tr > td,\n > tbody > tr > th,\n > tbody > tr > td,\n > tfoot > tr > th,\n > tfoot > tr > td\n ":{borderInlineEnd:d},"> thead":{"> tr:not(:last-child) > th":{borderBottom:d},"> tr > th::before":{backgroundColor:"transparent !important"}},"\n > thead > tr,\n > tbody > tr,\n > tfoot > tr\n ":{[`> ${t}-cell-fix-right-first::after`]:{borderInlineEnd:d}},"\n > tbody > tr > th,\n > tbody > tr > td\n ":{[`> ${t}-expanded-row-fixed`]:{margin:`${rt(f(l).mul(-1).equal())} ${rt(f(f(u).add(r)).mul(-1).equal())}`,"&::after":{position:"absolute",top:0,insetInlineEnd:r,bottom:0,borderInlineEnd:d,content:'""'}}}}}},[`&${t}-scroll-horizontal`]:{[`> ${t}-container > ${t}-body`]:{"> table > tbody":{[`
34
+ > tr${t}-expanded-row,
35
+ > tr${t}-placeholder
36
+ `]:{"> th, > td":{borderInlineEnd:0}}}}}},m("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle)),m("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall)),{[`> ${t}-footer`]:{border:d,borderTop:0}}),[`${t}-cell`]:{[`${t}-container:first-child`]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:`0 ${rt(r)} 0 ${rt(r)} ${a}`}},[`${t}-bordered ${t}-cell-scrollbar`]:{borderInlineEnd:d}}}},Db=e=>{const{componentCls:t}=e;return{[`${t}-wrapper`]:{[`${t}-cell-ellipsis`]:Object.assign(Object.assign({},sc),{wordBreak:"keep-all",[`
37
+ &${t}-cell-fix-left-last,
38
+ &${t}-cell-fix-right-first
39
+ `]:{overflow:"visible",[`${t}-cell-content`]:{display:"block",overflow:"hidden",textOverflow:"ellipsis"}},[`${t}-column-title`]:{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"keep-all"}})}}},kb=e=>{const{componentCls:t}=e;return{[`${t}-wrapper`]:{[`${t}-tbody > tr${t}-placeholder`]:{textAlign:"center",color:e.colorTextDisabled,"\n &:hover > th,\n &:hover > td,\n ":{background:e.colorBgContainer}}}}},Eb=e=>{const{componentCls:t,antCls:r,motionDurationSlow:n,lineWidth:o,paddingXS:a,lineType:l,tableBorderColor:u,tableExpandIconBg:f,tableExpandColumnWidth:d,borderRadius:m,tablePaddingVertical:g,tablePaddingHorizontal:v,tableExpandedRowBg:y,paddingXXS:b,expandIconMarginTop:C,expandIconSize:p,expandIconHalfInner:S,expandIconScale:B,calc:k}=e,$=`${rt(o)} ${l} ${u}`,T=k(b).sub(o).equal();return{[`${t}-wrapper`]:{[`${t}-expand-icon-col`]:{width:d},[`${t}-row-expand-icon-cell`]:{textAlign:"center",[`${t}-row-expand-icon`]:{display:"inline-flex",float:"none",verticalAlign:"sub"}},[`${t}-row-indent`]:{height:1,float:"left"},[`${t}-row-expand-icon`]:Object.assign(Object.assign({},wv(e)),{position:"relative",float:"left",width:p,height:p,color:"inherit",lineHeight:rt(p),background:f,border:$,borderRadius:m,transform:`scale(${B})`,"&:focus, &:hover, &:active":{borderColor:"currentcolor"},"&::before, &::after":{position:"absolute",background:"currentcolor",transition:`transform ${n} ease-out`,content:'""'},"&::before":{top:S,insetInlineEnd:T,insetInlineStart:T,height:o},"&::after":{top:T,bottom:T,insetInlineStart:S,width:o,transform:"rotate(90deg)"},"&-collapsed::before":{transform:"rotate(-180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"},"&-spaced":{"&::before, &::after":{display:"none",content:"none"},background:"transparent",border:0,visibility:"hidden"}}),[`${t}-row-indent + ${t}-row-expand-icon`]:{marginTop:C,marginInlineEnd:a},[`tr${t}-expanded-row`]:{"&, &:hover":{"> th, > td":{background:y}},[`${r}-descriptions-view`]:{display:"flex",table:{flex:"auto",width:"100%"}}},[`${t}-expanded-row-fixed`]:{position:"relative",margin:`${rt(k(g).mul(-1).equal())} ${rt(k(v).mul(-1).equal())}`,padding:`${rt(g)} ${rt(v)}`}}}},Sb=e=>{const{componentCls:t,antCls:r,iconCls:n,tableFilterDropdownWidth:o,tableFilterDropdownSearchWidth:a,paddingXXS:l,paddingXS:u,colorText:f,lineWidth:d,lineType:m,tableBorderColor:g,headerIconColor:v,fontSizeSM:y,tablePaddingHorizontal:b,borderRadius:C,motionDurationSlow:p,colorIcon:S,colorPrimary:B,tableHeaderFilterActiveBg:k,colorTextDisabled:$,tableFilterDropdownBg:T,tableFilterDropdownHeight:O,controlItemBgHover:F,controlItemBgActive:P,boxShadowSecondary:N,filterDropdownMenuBg:q,calc:R}=e,X=`${r}-dropdown`,G=`${t}-filter-dropdown`,_=`${r}-tree`,j=`${rt(d)} ${m} ${g}`;return[{[`${t}-wrapper`]:{[`${t}-filter-column`]:{display:"flex",justifyContent:"space-between"},[`${t}-filter-trigger`]:{position:"relative",display:"flex",alignItems:"center",marginBlock:R(l).mul(-1).equal(),marginInline:`${rt(l)} ${rt(R(b).div(2).mul(-1).equal())}`,padding:`0 ${rt(l)}`,color:v,fontSize:y,borderRadius:C,cursor:"pointer",transition:`all ${p}`,"&:hover":{color:S,background:k},"&.active":{color:B}}}},{[`${r}-dropdown`]:{[G]:Object.assign(Object.assign({},Fi(e)),{minWidth:o,backgroundColor:T,borderRadius:C,boxShadow:N,overflow:"hidden",[`${X}-menu`]:{maxHeight:O,overflowX:"hidden",border:0,boxShadow:"none",borderRadius:"unset",backgroundColor:q,"&:empty::after":{display:"block",padding:`${rt(u)} 0`,color:$,fontSize:y,textAlign:"center",content:'"Not Found"'}},[`${G}-tree`]:{paddingBlock:`${rt(u)} 0`,paddingInline:u,[_]:{padding:0},[`${_}-treenode ${_}-node-content-wrapper:hover`]:{backgroundColor:F},[`${_}-treenode-checkbox-checked ${_}-node-content-wrapper`]:{"&, &:hover":{backgroundColor:P}}},[`${G}-search`]:{padding:u,borderBottom:j,"&-input":{input:{minWidth:a},[n]:{color:$}}},[`${G}-checkall`]:{width:"100%",marginBottom:l,marginInlineStart:l},[`${G}-btns`]:{display:"flex",justifyContent:"space-between",padding:`${rt(R(u).sub(d).equal())} ${rt(u)}`,overflow:"hidden",borderTop:j}})}},{[`${r}-dropdown ${G}, ${G}-submenu`]:{[`${r}-checkbox-wrapper + span`]:{paddingInlineStart:u,color:f},"> ul":{maxHeight:"calc(100vh - 130px)",overflowX:"hidden",overflowY:"auto"}}}]},Ab=e=>{const{componentCls:t,lineWidth:r,colorSplit:n,motionDurationSlow:o,zIndexTableFixed:a,tableBg:l,zIndexTableSticky:u,calc:f}=e,d=n;return{[`${t}-wrapper`]:{[`
40
+ ${t}-cell-fix-left,
41
+ ${t}-cell-fix-right
42
+ `]:{position:"sticky !important",zIndex:a,background:l},[`
43
+ ${t}-cell-fix-left-first::after,
44
+ ${t}-cell-fix-left-last::after
45
+ `]:{position:"absolute",top:0,right:{_skip_check_:!0,value:0},bottom:f(r).mul(-1).equal(),width:30,transform:"translateX(100%)",transition:`box-shadow ${o}`,content:'""',pointerEvents:"none",willChange:"transform"},[`${t}-cell-fix-left-all::after`]:{display:"none"},[`
46
+ ${t}-cell-fix-right-first::after,
47
+ ${t}-cell-fix-right-last::after
48
+ `]:{position:"absolute",top:0,bottom:f(r).mul(-1).equal(),left:{_skip_check_:!0,value:0},width:30,transform:"translateX(-100%)",transition:`box-shadow ${o}`,content:'""',pointerEvents:"none"},[`${t}-container`]:{position:"relative","&::before, &::after":{position:"absolute",top:0,bottom:0,zIndex:f(u).add(1).equal({unit:!1}),width:30,transition:`box-shadow ${o}`,content:'""',pointerEvents:"none"},"&::before":{insetInlineStart:0},"&::after":{insetInlineEnd:0}},[`${t}-ping-left`]:{[`&:not(${t}-has-fix-left) ${t}-container::before`]:{boxShadow:`inset 10px 0 8px -8px ${d}`},[`
49
+ ${t}-cell-fix-left-first::after,
50
+ ${t}-cell-fix-left-last::after
51
+ `]:{boxShadow:`inset 10px 0 8px -8px ${d}`},[`${t}-cell-fix-left-last::before`]:{backgroundColor:"transparent !important"}},[`${t}-ping-right`]:{[`&:not(${t}-has-fix-right) ${t}-container::after`]:{boxShadow:`inset -10px 0 8px -8px ${d}`},[`
52
+ ${t}-cell-fix-right-first::after,
53
+ ${t}-cell-fix-right-last::after
54
+ `]:{boxShadow:`inset -10px 0 8px -8px ${d}`}},[`${t}-fixed-column-gapped`]:{[`
55
+ ${t}-cell-fix-left-first::after,
56
+ ${t}-cell-fix-left-last::after,
57
+ ${t}-cell-fix-right-first::after,
58
+ ${t}-cell-fix-right-last::after
59
+ `]:{boxShadow:"none"}}}}},Bb=e=>{const{componentCls:t,antCls:r,margin:n}=e;return{[`${t}-wrapper ${t}-pagination${r}-pagination`]:{margin:`${rt(n)} 0`}}},Fb=e=>{const{componentCls:t,tableRadius:r}=e;return{[`${t}-wrapper`]:{[t]:{[`${t}-title, ${t}-header`]:{borderRadius:`${rt(r)} ${rt(r)} 0 0`},[`${t}-title + ${t}-container`]:{borderStartStartRadius:0,borderStartEndRadius:0,[`${t}-header, table`]:{borderRadius:0},"table > thead > tr:first-child":{"th:first-child, th:last-child, td:first-child, td:last-child":{borderRadius:0}}},"&-container":{borderStartStartRadius:r,borderStartEndRadius:r,"table > thead > tr:first-child":{"> *:first-child":{borderStartStartRadius:r},"> *:last-child":{borderStartEndRadius:r}}},"&-footer":{borderRadius:`0 0 ${rt(r)} ${rt(r)}`}}}}},Tb=e=>{const{componentCls:t}=e;return{[`${t}-wrapper-rtl`]:{direction:"rtl",table:{direction:"rtl"},[`${t}-pagination-left`]:{justifyContent:"flex-end"},[`${t}-pagination-right`]:{justifyContent:"flex-start"},[`${t}-row-expand-icon`]:{float:"right","&::after":{transform:"rotate(-90deg)"},"&-collapsed::before":{transform:"rotate(180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"}},[`${t}-container`]:{"&::before":{insetInlineStart:"unset",insetInlineEnd:0},"&::after":{insetInlineStart:0,insetInlineEnd:"unset"},[`${t}-row-indent`]:{float:"right"}}}}},$b=e=>{const{componentCls:t,antCls:r,iconCls:n,fontSizeIcon:o,padding:a,paddingXS:l,headerIconColor:u,headerIconHoverColor:f,tableSelectionColumnWidth:d,tableSelectedRowBg:m,tableSelectedRowHoverBg:g,tableRowHoverBg:v,tablePaddingHorizontal:y,calc:b}=e;return{[`${t}-wrapper`]:{[`${t}-selection-col`]:{width:d,[`&${t}-selection-col-with-dropdown`]:{width:b(d).add(o).add(b(a).div(4)).equal()}},[`${t}-bordered ${t}-selection-col`]:{width:b(d).add(b(l).mul(2)).equal(),[`&${t}-selection-col-with-dropdown`]:{width:b(d).add(o).add(b(a).div(4)).add(b(l).mul(2)).equal()}},[`
60
+ table tr th${t}-selection-column,
61
+ table tr td${t}-selection-column,
62
+ ${t}-selection-column
63
+ `]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS,textAlign:"center",[`${r}-radio-wrapper`]:{marginInlineEnd:0}},[`table tr th${t}-selection-column${t}-cell-fix-left`]:{zIndex:b(e.zIndexTableFixed).add(1).equal({unit:!1})},[`table tr th${t}-selection-column::after`]:{backgroundColor:"transparent !important"},[`${t}-selection`]:{position:"relative",display:"inline-flex",flexDirection:"column"},[`${t}-selection-extra`]:{position:"absolute",top:0,zIndex:1,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,marginInlineStart:"100%",paddingInlineStart:rt(b(y).div(4).equal()),[n]:{color:u,fontSize:o,verticalAlign:"baseline","&:hover":{color:f}}},[`${t}-tbody`]:{[`${t}-row`]:{[`&${t}-row-selected`]:{[`> ${t}-cell`]:{background:m,"&-row-hover":{background:g}}},[`> ${t}-cell-row-hover`]:{background:v}}}}}},Nb=e=>{const{componentCls:t,tableExpandColumnWidth:r,calc:n}=e,o=(a,l,u,f)=>({[`${t}${t}-${a}`]:{fontSize:f,[`
64
+ ${t}-title,
65
+ ${t}-footer,
66
+ ${t}-cell,
67
+ ${t}-thead > tr > th,
68
+ ${t}-tbody > tr > th,
69
+ ${t}-tbody > tr > td,
70
+ tfoot > tr > th,
71
+ tfoot > tr > td
72
+ `]:{padding:`${rt(l)} ${rt(u)}`},[`${t}-filter-trigger`]:{marginInlineEnd:rt(n(u).div(2).mul(-1).equal())},[`${t}-expanded-row-fixed`]:{margin:`${rt(n(l).mul(-1).equal())} ${rt(n(u).mul(-1).equal())}`},[`${t}-tbody`]:{[`${t}-wrapper:only-child ${t}`]:{marginBlock:rt(n(l).mul(-1).equal()),marginInline:`${rt(n(r).sub(u).equal())} ${rt(n(u).mul(-1).equal())}`}},[`${t}-selection-extra`]:{paddingInlineStart:rt(n(u).div(4).equal())}}});return{[`${t}-wrapper`]:Object.assign(Object.assign({},o("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle,e.tableFontSizeMiddle)),o("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall,e.tableFontSizeSmall))}},Ob=e=>{const{componentCls:t,marginXXS:r,fontSizeIcon:n,headerIconColor:o,headerIconHoverColor:a}=e;return{[`${t}-wrapper`]:{[`${t}-thead th${t}-column-has-sorters`]:{outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}, left 0s`,"&:hover":{background:e.tableHeaderSortHoverBg,"&::before":{backgroundColor:"transparent !important"}},"&:focus-visible":{color:e.colorPrimary},[`
73
+ &${t}-cell-fix-left:hover,
74
+ &${t}-cell-fix-right:hover
75
+ `]:{background:e.tableFixedHeaderSortActiveBg}},[`${t}-thead th${t}-column-sort`]:{background:e.tableHeaderSortBg,"&::before":{backgroundColor:"transparent !important"}},[`td${t}-column-sort`]:{background:e.tableBodySortBg},[`${t}-column-title`]:{position:"relative",zIndex:1,flex:1,minWidth:0},[`${t}-column-sorters`]:{display:"flex",flex:"auto",alignItems:"center",justifyContent:"space-between","&::after":{position:"absolute",inset:0,width:"100%",height:"100%",content:'""'}},[`${t}-column-sorters-tooltip-target-sorter`]:{"&::after":{content:"none"}},[`${t}-column-sorter`]:{marginInlineStart:r,color:o,fontSize:0,transition:`color ${e.motionDurationSlow}`,"&-inner":{display:"inline-flex",flexDirection:"column",alignItems:"center"},"&-up, &-down":{fontSize:n,"&.active":{color:e.colorPrimary}},[`${t}-column-sorter-up + ${t}-column-sorter-down`]:{marginTop:"-0.3em"}},[`${t}-column-sorters:hover ${t}-column-sorter`]:{color:a}}}},Mb=e=>{const{componentCls:t,opacityLoading:r,tableScrollThumbBg:n,tableScrollThumbBgHover:o,tableScrollThumbSize:a,tableScrollBg:l,zIndexTableSticky:u,stickyScrollBarBorderRadius:f,lineWidth:d,lineType:m,tableBorderColor:g}=e,v=`${rt(d)} ${m} ${g}`;return{[`${t}-wrapper`]:{[`${t}-sticky`]:{"&-holder":{position:"sticky",zIndex:u,background:e.colorBgContainer},"&-scroll":{position:"sticky",bottom:0,height:`${rt(a)} !important`,zIndex:u,display:"flex",alignItems:"center",background:l,borderTop:v,opacity:r,"&:hover":{transformOrigin:"center bottom"},"&-bar":{height:a,backgroundColor:n,borderRadius:f,transition:`all ${e.motionDurationSlow}, transform 0s`,position:"absolute",bottom:0,"&:hover, &-active":{backgroundColor:o}}}}}}},ch=e=>{const{componentCls:t,lineWidth:r,tableBorderColor:n,calc:o}=e,a=`${rt(r)} ${e.lineType} ${n}`;return{[`${t}-wrapper`]:{[`${t}-summary`]:{position:"relative",zIndex:e.zIndexTableFixed,background:e.tableBg,"> tr":{"> th, > td":{borderBottom:a}}},[`div${t}-summary`]:{boxShadow:`0 ${rt(o(r).mul(-1).equal())} 0 ${n}`}}}},Ib=e=>{const{componentCls:t,motionDurationMid:r,lineWidth:n,lineType:o,tableBorderColor:a,calc:l}=e,u=`${rt(n)} ${o} ${a}`,f=`${t}-expanded-row-cell`;return{[`${t}-wrapper`]:{[`${t}-tbody-virtual`]:{[`${t}-tbody-virtual-holder-inner`]:{[`
76
+ & > ${t}-row,
77
+ & > div:not(${t}-row) > ${t}-row
78
+ `]:{display:"flex",boxSizing:"border-box",width:"100%"}},[`${t}-cell`]:{borderBottom:u,transition:`background ${r}`},[`${t}-expanded-row`]:{[`${f}${f}-fixed`]:{position:"sticky",insetInlineStart:0,overflow:"hidden",width:`calc(var(--virtual-width) - ${rt(n)})`,borderInlineEnd:"none"}}},[`${t}-bordered`]:{[`${t}-tbody-virtual`]:{"&:after":{content:'""',insetInline:0,bottom:0,borderBottom:u,position:"absolute"},[`${t}-cell`]:{borderInlineEnd:u,[`&${t}-cell-fix-right-first:before`]:{content:'""',position:"absolute",insetBlock:0,insetInlineStart:l(n).mul(-1).equal(),borderInlineStart:u}}},[`&${t}-virtual`]:{[`${t}-placeholder ${t}-cell`]:{borderInlineEnd:u,borderBottom:u}}}}}},Rb=e=>{const{componentCls:t,fontWeightStrong:r,tablePaddingVertical:n,tablePaddingHorizontal:o,tableExpandColumnWidth:a,lineWidth:l,lineType:u,tableBorderColor:f,tableFontSize:d,tableBg:m,tableRadius:g,tableHeaderTextColor:v,motionDurationMid:y,tableHeaderBg:b,tableHeaderCellSplitColor:C,tableFooterTextColor:p,tableFooterBg:S,calc:B}=e,k=`${rt(l)} ${u} ${f}`;return{[`${t}-wrapper`]:Object.assign(Object.assign({clear:"both",maxWidth:"100%","--rc-virtual-list-scrollbar-bg":e.tableScrollBg},i0()),{[t]:Object.assign(Object.assign({},Fi(e)),{fontSize:d,background:m,borderRadius:`${rt(g)} ${rt(g)} 0 0`,scrollbarColor:`${e.tableScrollThumbBg} ${e.tableScrollBg}`}),table:{width:"100%",textAlign:"start",borderRadius:`${rt(g)} ${rt(g)} 0 0`,borderCollapse:"separate",borderSpacing:0},[`
79
+ ${t}-cell,
80
+ ${t}-thead > tr > th,
81
+ ${t}-tbody > tr > th,
82
+ ${t}-tbody > tr > td,
83
+ tfoot > tr > th,
84
+ tfoot > tr > td
85
+ `]:{position:"relative",padding:`${rt(n)} ${rt(o)}`,overflowWrap:"break-word"},[`${t}-title`]:{padding:`${rt(n)} ${rt(o)}`},[`${t}-thead`]:{"\n > tr > th,\n > tr > td\n ":{position:"relative",color:v,fontWeight:r,textAlign:"start",background:b,borderBottom:k,transition:`background ${y} ease`,"&[colspan]:not([colspan='1'])":{textAlign:"center"},[`&:not(:last-child):not(${t}-selection-column):not(${t}-row-expand-icon-cell):not([colspan])::before`]:{position:"absolute",top:"50%",insetInlineEnd:0,width:1,height:"1.6em",backgroundColor:C,transform:"translateY(-50%)",transition:`background-color ${y}`,content:'""'}},"> tr:not(:last-child) > th[colspan]":{borderBottom:0}},[`${t}-tbody`]:{"> tr":{"> th, > td":{transition:`background ${y}, border-color ${y}`,borderBottom:k,[`
86
+ > ${t}-wrapper:only-child,
87
+ > ${t}-expanded-row-fixed > ${t}-wrapper:only-child
88
+ `]:{[t]:{marginBlock:rt(B(n).mul(-1).equal()),marginInline:`${rt(B(a).sub(o).equal())}
89
+ ${rt(B(o).mul(-1).equal())}`,[`${t}-tbody > tr:last-child > td`]:{borderBottomWidth:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:"relative",color:v,fontWeight:r,textAlign:"start",background:b,borderBottom:k,transition:`background ${y} ease`},[`& > ${t}-measure-cell`]:{paddingBlock:"0 !important",borderBlock:"0 !important",[`${t}-measure-cell-content`]:{height:0,overflow:"hidden",pointerEvents:"none"}}}},[`${t}-footer`]:{padding:`${rt(n)} ${rt(o)}`,color:p,background:S}})}},Pb=e=>{const{colorFillAlter:t,colorBgContainer:r,colorTextHeading:n,colorFillSecondary:o,colorFillContent:a,controlItemBgActive:l,controlItemBgActiveHover:u,padding:f,paddingSM:d,paddingXS:m,colorBorderSecondary:g,borderRadiusLG:v,controlHeight:y,colorTextPlaceholder:b,fontSize:C,fontSizeSM:p,lineHeight:S,lineWidth:B,colorIcon:k,colorIconHover:$,opacityLoading:T,controlInteractiveSize:O}=e,F=new kn(o).onBackground(r).toHexString(),P=new kn(a).onBackground(r).toHexString(),N=new kn(t).onBackground(r).toHexString(),q=new kn(k),R=new kn($),X=O/2-B,G=X*2+B*3;return{headerBg:N,headerColor:n,headerSortActiveBg:F,headerSortHoverBg:P,bodySortBg:N,rowHoverBg:N,rowSelectedBg:l,rowSelectedHoverBg:u,rowExpandedBg:t,cellPaddingBlock:f,cellPaddingInline:f,cellPaddingBlockMD:d,cellPaddingInlineMD:m,cellPaddingBlockSM:m,cellPaddingInlineSM:m,borderColor:g,headerBorderRadius:v,footerBg:N,footerColor:n,cellFontSize:C,cellFontSizeMD:C,cellFontSizeSM:C,headerSplitColor:g,fixedHeaderSortActiveBg:F,headerFilterHoverBg:a,filterDropdownMenuBg:r,filterDropdownBg:r,expandIconBg:r,selectionColumnWidth:y,stickyScrollBarBg:b,stickyScrollBarBorderRadius:100,expandIconMarginTop:(C*S-B*3)/2-Math.ceil((p*1.4-B*3)/2),headerIconColor:q.clone().setA(q.a*T).toRgbString(),headerIconHoverColor:R.clone().setA(R.a*T).toRgbString(),expandIconHalfInner:X,expandIconSize:G,expandIconScale:O/G}},dh=2,zb=Bi("Table",e=>{const{colorTextHeading:t,colorSplit:r,colorBgContainer:n,controlInteractiveSize:o,headerBg:a,headerColor:l,headerSortActiveBg:u,headerSortHoverBg:f,bodySortBg:d,rowHoverBg:m,rowSelectedBg:g,rowSelectedHoverBg:v,rowExpandedBg:y,cellPaddingBlock:b,cellPaddingInline:C,cellPaddingBlockMD:p,cellPaddingInlineMD:S,cellPaddingBlockSM:B,cellPaddingInlineSM:k,borderColor:$,footerBg:T,footerColor:O,headerBorderRadius:F,cellFontSize:P,cellFontSizeMD:N,cellFontSizeSM:q,headerSplitColor:R,fixedHeaderSortActiveBg:X,headerFilterHoverBg:G,filterDropdownBg:_,expandIconBg:j,selectionColumnWidth:W,stickyScrollBarBg:U,calc:ee}=e,V=Jo(e,{tableFontSize:P,tableBg:n,tableRadius:F,tablePaddingVertical:b,tablePaddingHorizontal:C,tablePaddingVerticalMiddle:p,tablePaddingHorizontalMiddle:S,tablePaddingVerticalSmall:B,tablePaddingHorizontalSmall:k,tableBorderColor:$,tableHeaderTextColor:l,tableHeaderBg:a,tableFooterTextColor:O,tableFooterBg:T,tableHeaderCellSplitColor:R,tableHeaderSortBg:u,tableHeaderSortHoverBg:f,tableBodySortBg:d,tableFixedHeaderSortActiveBg:X,tableHeaderFilterActiveBg:G,tableFilterDropdownBg:_,tableRowHoverBg:m,tableSelectedRowBg:g,tableSelectedRowHoverBg:v,zIndexTableFixed:dh,zIndexTableSticky:ee(dh).add(1).equal({unit:!1}),tableFontSizeMiddle:N,tableFontSizeSmall:q,tableSelectionColumnWidth:W,tableExpandIconBg:j,tableExpandColumnWidth:ee(o).add(ee(e.padding).mul(2)).equal(),tableExpandedRowBg:y,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:U,tableScrollThumbBgHover:t,tableScrollBg:r});return[Rb(V),Bb(V),ch(V),Ob(V),Sb(V),Cb(V),Fb(V),Eb(V),ch(V),kb(V),$b(V),Ab(V),Mb(V),Db(V),Nb(V),Tb(V),Ib(V)]},Pb,{unitless:{expandIconScale:!0}}),fh=[],_b=(e,t)=>{var r,n;const{prefixCls:o,className:a,rootClassName:l,style:u,size:f,bordered:d,dropdownPrefixCls:m,dataSource:g,pagination:v,rowSelection:y,rowKey:b="key",rowClassName:C,columns:p,children:S,childrenColumnName:B,onChange:k,getPopupContainer:$,loading:T,expandIcon:O,expandable:F,expandedRowRender:P,expandIconColumnIndex:N,indentSize:q,scroll:R,sortDirections:X,locale:G,showSorterTooltip:_={target:"full-header"},virtual:j}=e;nl();const W=D.useMemo(()=>p||Sc(S),[p,S]),U=D.useMemo(()=>W.some(wt=>wt.responsive),[W]),ee=Cv(U),V=D.useMemo(()=>{const wt=new Set(Object.keys(ee).filter(xt=>ee[xt]));return W.filter(xt=>!xt.responsive||xt.responsive.some(st=>wt.has(st)))},[W,ee]),Y=wo(e,["className","style","columns"]),{locale:fe=Dv,direction:be,table:he,renderEmpty:De,getPrefixCls:$e,getPopupContainer:Z}=D.useContext(Co),ie=kv(f),le=Object.assign(Object.assign({},fe.Table),G),ue=g||fh,Se=$e("table",o),Be=$e("dropdown",m),[,ge]=uc(),Ee=Ti(Se),[Ae,Fe,xe]=zb(Se,Ee),Ce=Object.assign(Object.assign({childrenColumnName:B,expandIconColumnIndex:N},F),{expandIcon:(r=F==null?void 0:F.expandIcon)!==null&&r!==void 0?r:(n=he==null?void 0:he.expandable)===null||n===void 0?void 0:n.expandIcon}),{childrenColumnName:_e="children"}=Ce,ht=D.useMemo(()=>ue.some(wt=>wt==null?void 0:wt[_e])?"nest":P||F!=null&&F.expandedRowRender?"row":null,[ue]),ot={body:D.useRef(null)},Ie=i7(Se),Ke=D.useRef(null),Ue=D.useRef(null);Ov(t,()=>Object.assign(Object.assign({},Ue.current),{nativeElement:Ke.current}));const vt=D.useMemo(()=>typeof b=="function"?b:wt=>wt==null?void 0:wt[b],[b]),[tt]=sb(ue,_e,vt),nt={},It=(wt,xt,st=!1)=>{var jt,Jt,yr,te;const ne=Object.assign(Object.assign({},nt),wt);st&&((jt=nt.resetPagination)===null||jt===void 0||jt.call(nt),!((Jt=ne.pagination)===null||Jt===void 0)&&Jt.current&&(ne.pagination.current=1),v&&((yr=v.onChange)===null||yr===void 0||yr.call(v,1,(te=ne.pagination)===null||te===void 0?void 0:te.pageSize))),R&&R.scrollToFirstRowOnChange!==!1&&ot.body.current&&Tv(0,{getContainer:()=>ot.body.current}),k==null||k(ne.pagination,ne.filters,ne.sorter,{currentDataSource:k0(S0(ue,ne.sorterStates,_e),ne.filterStates,_e),action:xt})},$t=(wt,xt)=>{It({sorter:wt,sorterStates:xt},"sort",!1)},[Bt,Mt,je,pe]=bb({prefixCls:Se,mergedColumns:V,onSorterChange:$t,sortDirections:X||["ascend","descend"],tableLocale:le,showSorterTooltip:_}),it=D.useMemo(()=>S0(ue,Mt,_e),[ue,Mt]);nt.sorter=pe(),nt.sorterStates=Mt;const Nt=(wt,xt)=>{It({filters:wt,filterStates:xt},"filter",!0)},[Ft,yt,Rt]=ib({prefixCls:Se,locale:le,dropdownPrefixCls:Be,mergedColumns:V,onFilterChange:Nt,getPopupContainer:$||Z,rootClassName:ft(l,Ee)}),St=k0(it,yt,_e);nt.filters=Rt,nt.filterStates=yt;const Kt=D.useMemo(()=>{const wt={};return Object.keys(Rt).forEach(xt=>{Rt[xt]!==null&&(wt[xt]=Rt[xt])}),Object.assign(Object.assign({},je),{filters:wt})},[je,Rt]),[tr]=yb(Kt),lr=(wt,xt)=>{It({pagination:Object.assign(Object.assign({},nt.pagination),{current:wt,pageSize:xt})},"paginate")},[_t,Er]=cb(St.length,lr,v);nt.pagination=v===!1?{}:ub(_t,v),nt.resetPagination=Er;const Cr=D.useMemo(()=>{if(v===!1||!_t.pageSize)return St;const{current:wt=1,total:xt,pageSize:st=og}=_t;return St.length<xt?St.length>st?St.slice((wt-1)*st,wt*st):St:St.slice((wt-1)*st,wt*st)},[!!v,St,_t==null?void 0:_t.current,_t==null?void 0:_t.pageSize,_t==null?void 0:_t.total]),[Zr,Ut]=o7({prefixCls:Se,data:St,pageData:Cr,getRowKey:vt,getRecordByKey:tt,expandType:ht,childrenColumnName:_e,locale:le,getPopupContainer:$||Z},y),Sr=(wt,xt,st)=>{let jt;return typeof C=="function"?jt=ft(C(wt,xt,st)):jt=ft(C),ft({[`${Se}-row-selected`]:Ut.has(vt(wt,xt))},jt)};Ce.__PARENT_RENDER_ICON__=Ce.expandIcon,Ce.expandIcon=Ce.expandIcon||O||a7(le),ht==="nest"&&Ce.expandIconColumnIndex===void 0?Ce.expandIconColumnIndex=y?1:0:Ce.expandIconColumnIndex>0&&y&&(Ce.expandIconColumnIndex-=1),typeof Ce.indentSize!="number"&&(Ce.indentSize=typeof q=="number"?q:15);const zr=D.useCallback(wt=>tr(Zr(Ft(Bt(wt)))),[Bt,Ft,Zr]),cr=()=>{if(v===!1||!(_t!=null&&_t.total))return{};const wt=()=>_t.size||(ie==="small"||ie==="middle"?"small":void 0),xt=Lt=>{const bt=Lt==="left"?"start":Lt==="right"?"end":Lt;return D.createElement(n1,Object.assign({},_t,{align:_t.align||bt,className:ft(`${Se}-pagination`,_t.className),size:wt()}))},st=be==="rtl"?"left":"right",jt=_t.position;if(jt===null||!Array.isArray(jt))return{bottom:xt(st)};const Jt=jt.find(Lt=>typeof Lt=="string"&&Lt.toLowerCase().includes("top")),yr=jt.find(Lt=>typeof Lt=="string"&&Lt.toLowerCase().includes("bottom")),te=jt.every(Lt=>`${Lt}`=="none"),ne=Jt?Jt.toLowerCase().replace("top",""):"",Q=yr?yr.toLowerCase().replace("bottom",""):"",Je=!Jt&&!yr&&!te,lt=()=>ne?xt(ne):void 0,mr=()=>{if(Q)return xt(Q);if(Je)return xt(st)};return{top:lt(),bottom:mr()}},ir=D.useMemo(()=>typeof T=="boolean"?{spinning:T}:typeof T=="object"&&T!==null?Object.assign({spinning:!0},T):void 0,[T]),Ot=ft(xe,Ee,`${Se}-wrapper`,he==null?void 0:he.className,{[`${Se}-wrapper-rtl`]:be==="rtl"},a,l,Fe),w=Object.assign(Object.assign({},he==null?void 0:he.style),u),E=D.useMemo(()=>ir!=null&&ir.spinning&&ue===fh?null:typeof(G==null?void 0:G.emptyText)<"u"?G.emptyText:(De==null?void 0:De("Table"))||D.createElement(Ev,{componentName:"Table"}),[ir==null?void 0:ir.spinning,ue,G==null?void 0:G.emptyText,De]),ze=j?wb:xb,I={},re=D.useMemo(()=>{const{fontSize:wt,lineHeight:xt,lineWidth:st,padding:jt,paddingXS:Jt,paddingSM:yr}=ge,te=Math.floor(wt*xt);switch(ie){case"middle":return yr*2+te+st;case"small":return Jt*2+te+st;default:return jt*2+te+st}},[ge,ie]);j&&(I.listItemHeight=re);const{top:rr,bottom:pt}=cr();return Ae(D.createElement("div",{ref:Ke,className:Ot,style:w},D.createElement(r1,Object.assign({spinning:!1},ir),rr,D.createElement(ze,Object.assign({},I,Y,{ref:Ue,columns:V,direction:be,expandable:Ce,prefixCls:Se,className:ft({[`${Se}-middle`]:ie==="middle",[`${Se}-small`]:ie==="small",[`${Se}-bordered`]:d,[`${Se}-empty`]:ue.length===0},xe,Ee,Fe),data:Cr,rowKey:vt,rowClassName:Sr,emptyText:E,internalHooks:Mi,internalRefs:ot,transformColumns:zr,getContainerWidth:Ie,measureRowRender:wt=>D.createElement(Sv,{getPopupContainer:xt=>xt},wt)})),pt)))},jb=D.forwardRef(_b),Lb=(e,t)=>{const r=D.useRef(0);return r.current+=1,D.createElement(jb,Object.assign({},e,{ref:t,_renderTimes:r.current}))},Do=D.forwardRef(Lb);Do.SELECTION_COLUMN=Bo;Do.EXPAND_COLUMN=To;Do.SELECTION_ALL=y0;Do.SELECTION_INVERT=x0;Do.SELECTION_NONE=w0;Do.Column=X6;Do.ColumnGroup=G6;Do.Summary=R1;var Fn={},Hb=Object.defineProperty,Kb=(e,t,r)=>t in e?Hb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Br=(e,t,r)=>Kb(e,typeof t!="symbol"?t+"":t,r),pa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ii(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hh={exports:{}},Va={};/**
90
+ * @license React
91
+ * react-jsx-runtime.production.min.js
92
+ *
93
+ * Copyright (c) Facebook, Inc. and its affiliates.
94
+ *
95
+ * This source code is licensed under the MIT license found in the
96
+ * LICENSE file in the root directory of this source tree.
97
+ */var ph;function qb(){if(ph)return Va;ph=1;var e=We,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(u,f,d){var m,g={},v=null,y=null;d!==void 0&&(v=""+d),f.key!==void 0&&(v=""+f.key),f.ref!==void 0&&(y=f.ref);for(m in f)n.call(f,m)&&!a.hasOwnProperty(m)&&(g[m]=f[m]);if(u&&u.defaultProps)for(m in f=u.defaultProps,f)g[m]===void 0&&(g[m]=f[m]);return{$$typeof:t,type:u,key:v,ref:y,props:g,_owner:o.current}}return Va.Fragment=r,Va.jsx=l,Va.jsxs=l,Va}var mh;function Vb(){return mh||(mh=1,hh.exports=qb()),hh.exports}var K=Vb();/*!
98
+ * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
99
+ *
100
+ * Copyright (c) 2014-2017, Jon Schlinkert.
101
+ * Released under the MIT License.
102
+ */function gh(e){return Object.prototype.toString.call(e)==="[object Object]"}function an(e){var t,r;return gh(e)===!1?!1:(t=e.constructor,t===void 0?!0:(r=t.prototype,!(gh(r)===!1||r.hasOwnProperty("isPrototypeOf")===!1)))}var sg=Symbol.for("immer-nothing"),vh=Symbol.for("immer-draftable"),Tn=Symbol.for("immer-state");function qn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var gi=Object.getPrototypeOf;function ea(e){return!!e&&!!e[Tn]}function ta(e){var t;return e?lg(e)||Array.isArray(e)||!!e[vh]||!!((t=e.constructor)!=null&&t[vh])||Ri(e)||hl(e):!1}var Wb=Object.prototype.constructor.toString(),bh=new WeakMap;function lg(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=bh.get(r);return n===void 0&&(n=Function.toString.call(r),bh.set(r,n)),n===Wb}function Hs(e,t,r=!0){fl(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,o)=>t(o,n,e))}function fl(e){const t=e[Tn];return t?t.type_:Array.isArray(e)?1:Ri(e)?2:hl(e)?3:0}function A0(e,t){return fl(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ug(e,t,r){const n=fl(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Ub(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ri(e){return e instanceof Map}function hl(e){return e instanceof Set}function Ko(e){return e.copy_||e.base_}function B0(e,t){if(Ri(e))return new Map(e);if(hl(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=lg(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Tn];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){const l=o[a],u=n[l];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(n[l]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[l]})}return Object.create(gi(e),n)}else{const n=gi(e);if(n!==null&&r)return{...e};const o=Object.create(n);return Object.assign(o,e)}}function Oc(e,t=!1){return pl(e)||ea(e)||!ta(e)||(fl(e)>1&&Object.defineProperties(e,{set:Zi,add:Zi,clear:Zi,delete:Zi}),Object.freeze(e),t&&Object.values(e).forEach(r=>Oc(r,!0))),e}function Xb(){qn(2)}var Zi={value:Xb};function pl(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Gb={};function ra(e){const t=Gb[e];return t||qn(0,e),t}var vi;function cg(){return vi}function Yb(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function yh(e,t){t&&(ra("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function F0(e){T0(e),e.drafts_.forEach(Zb),e.drafts_=null}function T0(e){e===vi&&(vi=e.parent_)}function xh(e){return vi=Yb(vi,e)}function Zb(e){const t=e[Tn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function wh(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Tn].modified_&&(F0(t),qn(4)),ta(e)&&(e=Ks(t,e),t.parent_||qs(t,e)),t.patches_&&ra("Patches").generateReplacementPatches_(r[Tn].base_,e,t.patches_,t.inversePatches_)):e=Ks(t,r,[]),F0(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==sg?e:void 0}function Ks(e,t,r){if(pl(t))return t;const n=e.immer_.shouldUseStrictIteration(),o=t[Tn];if(!o)return Hs(t,(a,l)=>Ch(e,o,t,a,l,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return qs(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const a=o.copy_;let l=a,u=!1;o.type_===3&&(l=new Set(a),a.clear(),u=!0),Hs(l,(f,d)=>Ch(e,o,a,f,d,r,u),n),qs(e,a,!1),r&&e.patches_&&ra("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function Ch(e,t,r,n,o,a,l){if(o==null||typeof o!="object"&&!l)return;const u=pl(o);if(!(u&&!l)){if(ea(o)){const f=a&&t&&t.type_!==3&&!A0(t.assigned_,n)?a.concat(n):void 0,d=Ks(e,o,f);if(ug(r,n,d),ea(d))e.canAutoFreeze_=!1;else return}else l&&r.add(o);if(ta(o)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&u)return;Ks(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Ri(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&qs(e,o)}}}function qs(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Oc(t,r)}function Jb(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:cg(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,a=Mc;r&&(o=[n],a=bi);const{revoke:l,proxy:u}=Proxy.revocable(o,a);return n.draft_=u,n.revoke_=l,u}var Mc={get(e,t){if(t===Tn)return e;const r=Ko(e);if(!A0(r,t))return Qb(e,r,t);const n=r[t];return e.finalized_||!ta(n)?n:n===du(e.base_,t)?(fu(e),e.copy_[t]=N0(n,e)):n},has(e,t){return t in Ko(e)},ownKeys(e){return Reflect.ownKeys(Ko(e))},set(e,t,r){const n=dg(Ko(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const o=du(Ko(e),t),a=o==null?void 0:o[Tn];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Ub(r,o)&&(r!==void 0||A0(e.base_,t)))return!0;fu(e),$0(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return du(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,fu(e),$0(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Ko(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){qn(11)},getPrototypeOf(e){return gi(e.base_)},setPrototypeOf(){qn(12)}},bi={};Hs(Mc,(e,t)=>{bi[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});bi.deleteProperty=function(e,t){return bi.set.call(this,e,t,void 0)};bi.set=function(e,t,r){return Mc.set.call(this,e[0],t,r,e[0])};function du(e,t){const r=e[Tn];return(r?Ko(r):e)[t]}function Qb(e,t,r){var o;const n=dg(t,r);return n?"value"in n?n.value:(o=n.get)==null?void 0:o.call(e.draft_):void 0}function dg(e,t){if(!(t in e))return;let r=gi(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=gi(r)}}function $0(e){e.modified_||(e.modified_=!0,e.parent_&&$0(e.parent_))}function fu(e){e.copy_||(e.copy_=B0(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ey=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const a=r;r=t;const l=this;return function(u=a,...f){return l.produce(u,d=>r.call(this,d,...f))}}typeof r!="function"&&qn(6),n!==void 0&&typeof n!="function"&&qn(7);let o;if(ta(t)){const a=xh(this),l=N0(t,void 0);let u=!0;try{o=r(l),u=!1}finally{u?F0(a):T0(a)}return yh(a,n),wh(o,a)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===sg&&(o=void 0),this.autoFreeze_&&Oc(o,!0),n){const a=[],l=[];ra("Patches").generateReplacementPatches_(t,o,a,l),n(a,l)}return o}else qn(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...l)=>this.produceWithPatches(a,u=>t(u,...l));let n,o;return[this.produce(t,r,(a,l)=>{n=a,o=l}),n,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ta(e)||qn(8),ea(e)&&(e=ty(e));const t=xh(this),r=N0(e,void 0);return r[Tn].isManual_=!0,T0(t),r}finishDraft(e,t){const r=e&&e[Tn];(!r||!r.isManual_)&&qn(9);const{scope_:n}=r;return yh(n,t),wh(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));const n=ra("Patches").applyPatches_;return ea(e)?n(e,t):this.produce(e,o=>n(o,t))}};function N0(e,t){const r=Ri(e)?ra("MapSet").proxyMap_(e,t):hl(e)?ra("MapSet").proxySet_(e,t):Jb(e,t);return(t?t.scope_:cg()).drafts_.push(r),r}function ty(e){return ea(e)||qn(10,e),fg(e)}function fg(e){if(!ta(e)||pl(e))return e;const t=e[Tn];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=B0(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=B0(e,!0);return Hs(r,(o,a)=>{ug(r,o,fg(a))},n),t&&(t.finalized_=!1),r}var yi=new ey,Ic=yi.produce,Dh=yi.createDraft.bind(yi),kh=yi.finishDraft.bind(yi),ry={transform(e,t){var{current:r,affinity:n}=e;if(r!=null){var o=de.transform(r,t,{affinity:n});e.current=o,o==null&&e.unref()}}},ny={transform(e,t){var{current:r,affinity:n}=e;if(r!=null){var o=er.transform(r,t,{affinity:n});e.current=o,o==null&&e.unref()}}},oy={transform(e,t){var{current:r,affinity:n}=e;if(r!=null){var o=Oe.transform(r,t,{affinity:n});e.current=o,o==null&&e.unref()}}},Vs=new WeakMap,Ws=new WeakMap,li=new WeakMap,hg=new WeakMap,Eh=new WeakMap,Sh=new WeakMap,Ah=new WeakMap,de={ancestors(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=t,n=de.levels(e,t);return r?n=n.slice(1):n=n.slice(0,-1),n},common(e,t){for(var r=[],n=0;n<e.length&&n<t.length;n++){var o=e[n],a=t[n];if(o!==a)break;r.push(o)}return r},compare(e,t){for(var r=Math.min(e.length,t.length),n=0;n<r;n++){if(e[n]<t[n])return-1;if(e[n]>t[n])return 1}return 0},endsAfter(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),a=e[r],l=t[r];return de.equals(n,o)&&a>l},endsAt(e,t){var r=e.length,n=e.slice(0,r),o=t.slice(0,r);return de.equals(n,o)},endsBefore(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),a=e[r],l=t[r];return de.equals(n,o)&&a<l},equals(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])},hasPrevious(e){return e[e.length-1]>0},isAfter(e,t){return de.compare(e,t)===1},isAncestor(e,t){return e.length<t.length&&de.compare(e,t)===0},isBefore(e,t){return de.compare(e,t)===-1},isChild(e,t){return e.length===t.length+1&&de.compare(e,t)===0},isCommon(e,t){return e.length<=t.length&&de.compare(e,t)===0},isDescendant(e,t){return e.length>t.length&&de.compare(e,t)===0},isParent(e,t){return e.length+1===t.length&&de.compare(e,t)===0},isPath(e){return Array.isArray(e)&&(e.length===0||typeof e[0]=="number")},isSibling(e,t){if(e.length!==t.length)return!1;var r=e.slice(0,-1),n=t.slice(0,-1),o=e[e.length-1],a=t[t.length-1];return o!==a&&de.equals(r,n)},levels(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=t,n=[],o=0;o<=e.length;o++)n.push(e.slice(0,o));return r&&n.reverse(),n},next(e){if(e.length===0)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(e.length===0)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(e.length===0)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!de.isAncestor(t,e)&&!de.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e)return null;var n=[...e],{affinity:o="forward"}=r;if(e.length===0)return n;switch(t.type){case"insert_node":{var{path:a}=t;(de.equals(a,n)||de.endsBefore(a,n)||de.isAncestor(a,n))&&(n[a.length-1]+=1);break}case"remove_node":{var{path:l}=t;if(de.equals(l,n)||de.isAncestor(l,n))return null;de.endsBefore(l,n)&&(n[l.length-1]-=1);break}case"merge_node":{var{path:u,position:f}=t;de.equals(u,n)||de.endsBefore(u,n)?n[u.length-1]-=1:de.isAncestor(u,n)&&(n[u.length-1]-=1,n[u.length]+=f);break}case"split_node":{var{path:d,position:m}=t;if(de.equals(d,n)){if(o==="forward")n[n.length-1]+=1;else if(o!=="backward")return null}else de.endsBefore(d,n)?n[d.length-1]+=1:de.isAncestor(d,n)&&e[d.length]>=m&&(n[d.length-1]+=1,n[d.length]-=m);break}case"move_node":{var{path:g,newPath:v}=t;if(de.equals(g,v))return n;if(de.isAncestor(g,n)||de.equals(g,n)){var y=v.slice();return de.endsBefore(g,v)&&g.length<v.length&&(y[g.length-1]-=1),y.concat(n.slice(g.length))}else de.isSibling(g,v)&&(de.isAncestor(v,n)||de.equals(v,n))?de.endsBefore(g,n)?n[g.length-1]-=1:n[g.length-1]+=1:de.endsBefore(v,n)||de.equals(v,n)||de.isAncestor(v,n)?(de.endsBefore(g,n)&&(n[g.length-1]-=1),n[v.length-1]+=1):de.endsBefore(g,n)&&(de.equals(v,n)&&(n[v.length-1]+=1),n[g.length-1]-=1);break}}return n}};function xi(e){"@babel/helpers - typeof";return xi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xi(e)}function ay(e,t){if(xi(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(xi(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iy(e){var t=ay(e,"string");return xi(t)==="symbol"?t:String(t)}function yn(e,t,r){return t=iy(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Wa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bh(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var sy=(e,t,r)=>{switch(r.type){case"insert_node":{var{path:n,node:o}=r,a=at.parent(e,n),l=n[n.length-1];if(l>a.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(n,"] because the destination is past the end of the node."));if(a.children.splice(l,0,o),t)for(var[u,f]of Oe.points(t))t[f]=er.transform(u,r);break}case"insert_text":{var{path:d,offset:m,text:g}=r;if(g.length===0)break;var v=at.leaf(e,d),y=v.text.slice(0,m),b=v.text.slice(m);if(v.text=y+g+b,t)for(var[C,p]of Oe.points(t))t[p]=er.transform(C,r);break}case"merge_node":{var{path:S}=r,B=at.get(e,S),k=de.previous(S),$=at.get(e,k),T=at.parent(e,S),O=S[S.length-1];if(Ct.isText(B)&&Ct.isText($))$.text+=B.text;else if(!Ct.isText(B)&&!Ct.isText($))$.children.push(...B.children);else throw new Error('Cannot apply a "merge_node" operation at path ['.concat(S,"] to nodes of different interfaces: ").concat(en.stringify(B)," ").concat(en.stringify($)));if(T.children.splice(O,1),t)for(var[F,P]of Oe.points(t))t[P]=er.transform(F,r);break}case"move_node":{var{path:N,newPath:q}=r;if(de.isAncestor(N,q))throw new Error("Cannot move a path [".concat(N,"] to new path [").concat(q,"] because the destination is inside itself."));var R=at.get(e,N),X=at.parent(e,N),G=N[N.length-1];X.children.splice(G,1);var _=de.transform(N,r),j=at.get(e,de.parent(_)),W=_[_.length-1];if(j.children.splice(W,0,R),t)for(var[U,ee]of Oe.points(t))t[ee]=er.transform(U,r);break}case"remove_node":{var{path:V}=r,Y=V[V.length-1],fe=at.parent(e,V);if(fe.children.splice(Y,1),t)for(var[be,he]of Oe.points(t)){var De=er.transform(be,r);if(t!=null&&De!=null)t[he]=De;else{var $e=void 0,Z=void 0;for(var[ie,le]of at.texts(e))if(de.compare(le,V)===-1)$e=[ie,le];else{Z=[ie,le];break}var ue=!1;$e&&Z&&(de.equals(Z[1],V)?ue=!de.hasPrevious(Z[1]):ue=de.common($e[1],V).length<de.common(Z[1],V).length),$e&&!ue?(be.path=$e[1],be.offset=$e[0].text.length):Z?(be.path=Z[1],be.offset=0):t=null}}break}case"remove_text":{var{path:Se,offset:Be,text:ge}=r;if(ge.length===0)break;var Ee=at.leaf(e,Se),Ae=Ee.text.slice(0,Be),Fe=Ee.text.slice(Be+ge.length);if(Ee.text=Ae+Fe,t)for(var[xe,Ce]of Oe.points(t))t[Ce]=er.transform(xe,r);break}case"set_node":{var{path:_e,properties:ht,newProperties:ot}=r;if(_e.length===0)throw new Error("Cannot set properties on the root node!");var Ie=at.get(e,_e);for(var Ke in ot){if(Ke==="children"||Ke==="text")throw new Error('Cannot set the "'.concat(Ke,'" property of nodes!'));var Ue=ot[Ke];Ue==null?delete Ie[Ke]:Ie[Ke]=Ue}for(var vt in ht)ot.hasOwnProperty(vt)||delete Ie[vt];break}case"set_selection":{var{newProperties:tt}=r;if(tt==null)t=tt;else{if(t==null){if(!Oe.isRange(tt))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(en.stringify(tt)," when there is no current selection."));t=Wa({},tt)}for(var nt in tt){var It=tt[nt];if(It==null){if(nt==="anchor"||nt==="focus")throw new Error('Cannot remove the "'.concat(nt,'" selection property'));delete t[nt]}else t[nt]=It}}break}case"split_node":{var{path:$t,position:Bt,properties:Mt}=r;if($t.length===0)throw new Error('Cannot apply a "split_node" operation at path ['.concat($t,"] because the root node cannot be split."));var je=at.get(e,$t),pe=at.parent(e,$t),it=$t[$t.length-1],Nt;if(Ct.isText(je)){var Ft=je.text.slice(0,Bt),yt=je.text.slice(Bt);je.text=Ft,Nt=Wa(Wa({},Mt),{},{text:yt})}else{var Rt=je.children.slice(0,Bt),St=je.children.slice(Bt);je.children=Rt,Nt=Wa(Wa({},Mt),{},{children:St})}if(pe.children.splice(it+1,0,Nt),t)for(var[Kt,tr]of Oe.points(t))t[tr]=er.transform(Kt,r);break}}return t},ly={transform(e,t){e.children=Dh(e.children);var r=e.selection&&Dh(e.selection);try{r=sy(e,r,t)}finally{e.children=kh(e.children),r?e.selection=ea(r)?kh(r):r:e.selection=null}}},uy={insertNodes(e,t,r){e.insertNodes(t,r)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,r){e.setNodes(t,r)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,r){e.unsetNodes(t,r)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,r){e.wrapNodes(t,r)}},cy={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,r){e.setPoint(t,r)},setSelection(e,t){e.setSelection(t)}},pg=(e,t)=>{for(var r in e){var n=e[r],o=t[r];if(an(n)&&an(o)){if(!pg(n,o))return!1}else if(Array.isArray(n)&&Array.isArray(o)){if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++)if(n[a]!==o[a])return!1}else if(n!==o)return!1}for(var l in t)if(e[l]===void 0&&t[l]!==void 0)return!1;return!0};function dy(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function yo(e,t){if(e==null)return{};var r=dy(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var fy=["anchor","focus"];function Fh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function hy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fh(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Oe={edges(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:r=!1}=t,{anchor:n,focus:o}=e;return Oe.isBackward(e)===r?[n,o]:[o,n]},end(e){var[,t]=Oe.edges(e);return t},equals(e,t){return er.equals(e.anchor,t.anchor)&&er.equals(e.focus,t.focus)},includes(e,t){if(Oe.isRange(t)){if(Oe.includes(e,t.anchor)||Oe.includes(e,t.focus))return!0;var[r,n]=Oe.edges(e),[o,a]=Oe.edges(t);return er.isBefore(r,o)&&er.isAfter(n,a)}var[l,u]=Oe.edges(e),f=!1,d=!1;return er.isPoint(t)?(f=er.compare(t,l)>=0,d=er.compare(t,u)<=0):(f=de.compare(t,l.path)>=0,d=de.compare(t,u.path)<=0),f&&d},intersection(e,t){var r=yo(e,fy),[n,o]=Oe.edges(e),[a,l]=Oe.edges(t),u=er.isBefore(n,a)?a:n,f=er.isBefore(o,l)?o:l;return er.isBefore(f,u)?null:hy({anchor:u,focus:f},r)},isBackward(e){var{anchor:t,focus:r}=e;return er.isAfter(t,r)},isCollapsed(e){var{anchor:t,focus:r}=e;return er.equals(t,r)},isExpanded(e){return!Oe.isCollapsed(e)},isForward(e){return!Oe.isBackward(e)},isRange(e){return an(e)&&er.isPoint(e.anchor)&&er.isPoint(e.focus)},*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=Oe.edges(e);return t},transform(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Ic(e,n=>{if(n===null)return null;var{affinity:o="inward"}=r,a,l;if(o==="inward"){var u=Oe.isCollapsed(n);Oe.isForward(n)?(a="forward",l=u?a:"backward"):(a="backward",l=u?a:"forward")}else o==="outward"?Oe.isForward(n)?(a="backward",l="forward"):(a="forward",l="backward"):(a=o,l=o);var f=er.transform(n.anchor,t,{affinity:a}),d=er.transform(n.focus,t,{affinity:l});if(!f||!d)return null;n.anchor=f,n.focus=d})}},Th=e=>an(e)&&at.isNodeList(e.children)&&!z.isEditor(e),kt={isAncestor(e){return an(e)&&at.isNodeList(e.children)},isElement:Th,isElementList(e){return Array.isArray(e)&&e.every(t=>kt.isElement(t))},isElementProps(e){return e.children!==void 0},isElementType:function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"type";return Th(e)&&e[r]===t},matches(e,t){for(var r in t)if(r!=="children"&&e[r]!==t[r])return!1;return!0}},py=["children"],my=["text"],$h=new WeakMap,at={ancestor(e,t){var r=at.get(e,t);if(Ct.isText(r))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(en.stringify(r)));return r},ancestors(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return(function*(){for(var n of de.ancestors(t,r)){var o=at.ancestor(e,n),a=[o,n];yield a}})()},child(e,t){if(Ct.isText(e))throw new Error("Cannot get the child of a text node: ".concat(en.stringify(e)));var r=e.children[t];if(r==null)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(en.stringify(e)));return r},children(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return(function*(){for(var{reverse:n=!1}=r,o=at.ancestor(e,t),{children:a}=o,l=n?a.length-1:0;n?l>=0:l<a.length;){var u=at.child(o,l),f=t.concat(l);yield[u,f],l=n?l-1:l+1}})()},common(e,t,r){var n=de.common(t,r),o=at.get(e,n);return[o,n]},descendant(e,t){var r=at.get(e,t);if(z.isEditor(r))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(en.stringify(r)));return r},descendants(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(function*(){for(var[r,n]of at.nodes(e,t))n.length!==0&&(yield[r,n])})()},elements(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(function*(){for(var[r,n]of at.nodes(e,t))kt.isElement(r)&&(yield[r,n])})()},extractProps(e){if(kt.isAncestor(e)){var t=yo(e,py);return t}else{var t=yo(e,my);return t}},first(e,t){for(var r=t.slice(),n=at.get(e,r);n&&!(Ct.isText(n)||n.children.length===0);)n=n.children[0],r.push(0);return[n,r]},fragment(e,t){if(Ct.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(en.stringify(e)));var r=Ic({children:e.children},n=>{var[o,a]=Oe.edges(t),l=at.nodes(n,{reverse:!0,pass:v=>{var[,y]=v;return!Oe.includes(t,y)}});for(var[,u]of l){if(!Oe.includes(t,u)){var f=at.parent(n,u),d=u[u.length-1];f.children.splice(d,1)}if(de.equals(u,a.path)){var m=at.leaf(n,u);m.text=m.text.slice(0,a.offset)}if(de.equals(u,o.path)){var g=at.leaf(n,u);g.text=g.text.slice(o.offset)}}z.isEditor(n)&&(n.selection=null)});return r.children},get(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(Ct.isText(r)||!r.children[o])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(en.stringify(e)));r=r.children[o]}return r},has(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(Ct.isText(r)||!r.children[o])return!1;r=r.children[o]}return!0},isNode(e){return Ct.isText(e)||kt.isElement(e)||z.isEditor(e)},isNodeList(e){if(!Array.isArray(e))return!1;var t=$h.get(e);if(t!==void 0)return t;var r=e.every(n=>at.isNode(n));return $h.set(e,r),r},last(e,t){for(var r=t.slice(),n=at.get(e,r);n&&!(Ct.isText(n)||n.children.length===0);){var o=n.children.length-1;n=n.children[o],r.push(o)}return[n,r]},leaf(e,t){var r=at.get(e,t);if(!Ct.isText(r))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(en.stringify(r)));return r},levels(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return(function*(){for(var n of de.levels(t,r)){var o=at.get(e,n);yield[o,n]}})()},matches(e,t){return kt.isElement(e)&&kt.isElementProps(t)&&kt.matches(e,t)||Ct.isText(e)&&Ct.isTextProps(t)&&Ct.matches(e,t)},nodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(function*(){for(var{pass:r,reverse:n=!1}=t,{from:o=[],to:a}=t,l=new Set,u=[],f=e;!(a&&(n?de.isBefore(u,a):de.isAfter(u,a)));){if(l.has(f)||(yield[f,u]),!l.has(f)&&!Ct.isText(f)&&f.children.length!==0&&(r==null||r([f,u])===!1)){l.add(f);var d=n?f.children.length-1:0;de.isAncestor(u,o)&&(d=o[u.length]),u=u.concat(d),f=at.get(e,u);continue}if(u.length===0)break;if(!n){var m=de.next(u);if(at.has(e,m)){u=m,f=at.get(e,u);continue}}if(n&&u[u.length-1]!==0){var g=de.previous(u);u=g,f=at.get(e,u);continue}u=de.parent(u),f=at.get(e,u),l.add(f)}})()},parent(e,t){var r=de.parent(t),n=at.get(e,r);if(Ct.isText(n))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return n},string(e){return Ct.isText(e)?e.text:e.children.map(at.string).join("")},texts(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(function*(){for(var[r,n]of at.nodes(e,t))Ct.isText(r)&&(yield[r,n])})()}};function Nh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Rr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Nh(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var ti={isNodeOperation(e){return ti.isOperation(e)&&e.type.endsWith("_node")},isOperation(e){if(!an(e))return!1;switch(e.type){case"insert_node":return de.isPath(e.path)&&at.isNode(e.node);case"insert_text":return typeof e.offset=="number"&&typeof e.text=="string"&&de.isPath(e.path);case"merge_node":return typeof e.position=="number"&&de.isPath(e.path)&&an(e.properties);case"move_node":return de.isPath(e.path)&&de.isPath(e.newPath);case"remove_node":return de.isPath(e.path)&&at.isNode(e.node);case"remove_text":return typeof e.offset=="number"&&typeof e.text=="string"&&de.isPath(e.path);case"set_node":return de.isPath(e.path)&&an(e.properties)&&an(e.newProperties);case"set_selection":return e.properties===null&&Oe.isRange(e.newProperties)||e.newProperties===null&&Oe.isRange(e.properties)||an(e.properties)&&an(e.newProperties);case"split_node":return de.isPath(e.path)&&typeof e.position=="number"&&an(e.properties);default:return!1}},isOperationList(e){return Array.isArray(e)&&e.every(t=>ti.isOperation(t))},isSelectionOperation(e){return ti.isOperation(e)&&e.type.endsWith("_selection")},isTextOperation(e){return ti.isOperation(e)&&e.type.endsWith("_text")},inverse(e){switch(e.type){case"insert_node":return Rr(Rr({},e),{},{type:"remove_node"});case"insert_text":return Rr(Rr({},e),{},{type:"remove_text"});case"merge_node":return Rr(Rr({},e),{},{type:"split_node",path:de.previous(e.path)});case"move_node":{var{newPath:t,path:r}=e;if(de.equals(t,r))return e;if(de.isSibling(r,t))return Rr(Rr({},e),{},{path:t,newPath:r});var n=de.transform(r,e),o=de.transform(de.next(r),e);return Rr(Rr({},e),{},{path:n,newPath:o})}case"remove_node":return Rr(Rr({},e),{},{type:"insert_node"});case"remove_text":return Rr(Rr({},e),{},{type:"insert_text"});case"set_node":{var{properties:a,newProperties:l}=e;return Rr(Rr({},e),{},{properties:l,newProperties:a})}case"set_selection":{var{properties:u,newProperties:f}=e;return u==null?Rr(Rr({},e),{},{properties:f,newProperties:null}):f==null?Rr(Rr({},e),{},{properties:null,newProperties:u}):Rr(Rr({},e),{},{properties:f,newProperties:u})}case"split_node":return Rr(Rr({},e),{},{type:"merge_node",path:de.next(e.path)})}}},Oh=new WeakMap,gy=e=>{var t=Oh.get(e);if(t!==void 0)return t;if(!an(e))return!1;var r=typeof e.addMark=="function"&&typeof e.apply=="function"&&typeof e.deleteFragment=="function"&&typeof e.insertBreak=="function"&&typeof e.insertSoftBreak=="function"&&typeof e.insertFragment=="function"&&typeof e.insertNode=="function"&&typeof e.insertText=="function"&&typeof e.isElementReadOnly=="function"&&typeof e.isInline=="function"&&typeof e.isSelectable=="function"&&typeof e.isVoid=="function"&&typeof e.normalizeNode=="function"&&typeof e.onChange=="function"&&typeof e.removeMark=="function"&&typeof e.getDirtyPaths=="function"&&(e.marks===null||an(e.marks))&&(e.selection===null||Oe.isRange(e.selection))&&at.isNodeList(e.children)&&ti.isOperationList(e.operations);return Oh.set(e,r),r},z={above(e,t){return e.above(t)},addMark(e,t,r){e.addMark(t,r)},after(e,t,r){return e.after(t,r)},before(e,t,r){return e.before(t,r)},deleteBackward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:r="character"}=t;e.deleteBackward(r)},deleteForward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:r="character"}=t;e.deleteForward(r)},deleteFragment(e,t){e.deleteFragment(t)},edges(e,t){return e.edges(t)},elementReadOnly(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.elementReadOnly(t)},end(e,t){return e.end(t)},first(e,t){return e.first(t)},fragment(e,t){return e.fragment(t)},hasBlocks(e,t){return e.hasBlocks(t)},hasInlines(e,t){return e.hasInlines(t)},hasPath(e,t){return e.hasPath(t)},hasTexts(e,t){return e.hasTexts(t)},insertBreak(e){e.insertBreak()},insertFragment(e,t,r){e.insertFragment(t,r)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock(e,t){return e.isBlock(t)},isEdge(e,t,r){return e.isEdge(t,r)},isEditor(e){return gy(e)},isElementReadOnly(e,t){return e.isElementReadOnly(t)},isEmpty(e,t){return e.isEmpty(t)},isEnd(e,t,r){return e.isEnd(t,r)},isInline(e,t){return e.isInline(t)},isNormalizing(e){return e.isNormalizing()},isSelectable(e,t){return e.isSelectable(t)},isStart(e,t,r){return e.isStart(t,r)},isVoid(e,t){return e.isVoid(t)},last(e,t){return e.last(t)},leaf(e,t,r){return e.leaf(t,r)},levels(e,t){return e.levels(t)},marks(e){return e.getMarks()},next(e,t){return e.next(t)},node(e,t,r){return e.node(t,r)},nodes(e,t){return e.nodes(t)},normalize(e,t){e.normalize(t)},parent(e,t,r){return e.parent(t,r)},path(e,t,r){return e.path(t,r)},pathRef(e,t,r){return e.pathRef(t,r)},pathRefs(e){return e.pathRefs()},point(e,t,r){return e.point(t,r)},pointRef(e,t,r){return e.pointRef(t,r)},pointRefs(e){return e.pointRefs()},positions(e,t){return e.positions(t)},previous(e,t){return e.previous(t)},range(e,t,r){return e.range(t,r)},rangeRef(e,t,r){return e.rangeRef(t,r)},rangeRefs(e){return e.rangeRefs()},removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start(e,t){return e.start(t)},string(e,t,r){return e.string(t,r)},unhangRange(e,t,r){return e.unhangRange(t,r)},void(e,t){return e.void(t)},withoutNormalizing(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:(e,t,r)=>e.shouldMergeNodesRemovePrevNode(t,r)},vy={isSpan(e){return Array.isArray(e)&&e.length===2&&e.every(de.isPath)}};function Mh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ih(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mh(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var er={compare(e,t){var r=de.compare(e.path,t.path);return r===0?e.offset<t.offset?-1:e.offset>t.offset?1:0:r},isAfter(e,t){return er.compare(e,t)===1},isBefore(e,t){return er.compare(e,t)===-1},equals(e,t){return e.offset===t.offset&&de.equals(e.path,t.path)},isPoint(e){return an(e)&&typeof e.offset=="number"&&de.isPath(e.path)},transform(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Ic(e,n=>{if(n===null)return null;var{affinity:o="forward"}=r,{path:a,offset:l}=n;switch(t.type){case"insert_node":case"move_node":{n.path=de.transform(a,t,r);break}case"insert_text":{de.equals(t.path,a)&&(t.offset<l||t.offset===l&&o==="forward")&&(n.offset+=t.text.length);break}case"merge_node":{de.equals(t.path,a)&&(n.offset+=t.position),n.path=de.transform(a,t,r);break}case"remove_text":{de.equals(t.path,a)&&t.offset<=l&&(n.offset-=Math.min(l-t.offset,t.text.length));break}case"remove_node":{if(de.equals(t.path,a)||de.isAncestor(t.path,a))return null;n.path=de.transform(a,t,r);break}case"split_node":{if(de.equals(t.path,a)){if(t.position===l&&o==null)return null;(t.position<l||t.position===l&&o==="forward")&&(n.offset-=t.position,n.path=de.transform(a,t,Ih(Ih({},r),{},{affinity:"forward"})))}else n.path=de.transform(a,t,r);break}}})}},Rh=void 0,en={setScrubber(e){Rh=e},stringify(e){return JSON.stringify(e,Rh)}},by=["text"],yy=["anchor","focus"];function Ph(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function co(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ph(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ph(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Ct={equals(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{loose:n=!1}=r;function o(a){var l=yo(a,by);return l}return pg(n?o(e):e,n?o(t):t)},isText(e){return an(e)&&typeof e.text=="string"},isTextList(e){return Array.isArray(e)&&e.every(t=>Ct.isText(t))},isTextProps(e){return e.text!==void 0},matches(e,t){for(var r in t)if(r!=="text"&&(!e.hasOwnProperty(r)||e[r]!==t[r]))return!1;return!0},decorations(e,t){var r=[co({},e)];for(var n of t){var o=yo(n,yy),[a,l]=Oe.edges(n),u=[],f=0,d=a.offset,m=l.offset;for(var g of r){var{length:v}=g.text,y=f;if(f+=v,d<=y&&f<=m){Object.assign(g,o),u.push(g);continue}if(d!==m&&(d===f||m===y)||d>f||m<y||m===y&&y!==0){u.push(g);continue}var b=g,C=void 0,p=void 0;if(m<f){var S=m-y;p=co(co({},b),{},{text:b.text.slice(S)}),b=co(co({},b),{},{text:b.text.slice(0,S)})}if(d>y){var B=d-y;C=co(co({},b),{},{text:b.text.slice(0,B)}),b=co(co({},b),{},{text:b.text.slice(B)})}Object.assign(b,o),C&&u.push(C),u.push(b),p&&u.push(p)}r=u}return r}},Rc=e=>e.selection?e.selection:e.children.length>0?z.end(e,[]):[0],Pa=(e,t)=>{var[r]=z.node(e,t);return n=>n===r},Pc=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=!t,n=t?Ey(e):e,o=Wt.None,a=Wt.None,l=0,u=null,f=null;for(var d of n){var m=d.codePointAt(0);if(!m)break;var g=Py(d,m);if([o,a]=r?[a,g]:[g,o],ma(o,Wt.ZWJ)&&ma(a,Wt.ExtPict)&&(r?u=zh(e.substring(0,l)):u=zh(e.substring(0,e.length-l)),!u)||ma(o,Wt.RI)&&ma(a,Wt.RI)&&(f!==null?f=!f:r?f=!0:f=Hy(e.substring(0,e.length-l)),!f)||o!==Wt.None&&a!==Wt.None&&_y(o,a))break;l+=d.length}return l||1},xy=/\s/,wy=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\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]/,Cy=/['\u2018\u2019]/,Dy=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0,n=!1;e.length>0;){var o=Pc(e,t),[a,l]=zc(e,o,t);if(ky(a,l,t))n=!0,r+=o;else if(!n)r+=o;else break;e=l}return r},zc=(e,t,r)=>{if(r){var n=e.length-t;return[e.slice(n,e.length),e.slice(0,n)]}return[e.slice(0,t),e.slice(t)]},ky=function e(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(xy.test(t))return!1;if(Cy.test(t)){var o=Pc(r,n),[a,l]=zc(r,o,n);if(e(a,l,n))return!0}return!wy.test(t)},Ey=function*(e){for(var t=e.length-1,r=0;r<e.length;r++){var n=e.charAt(t-r);if(Ay(n.charCodeAt(0))){var o=e.charAt(t-r-1);if(Sy(o.charCodeAt(0))){yield o+n,r++;continue}}yield n}},Sy=e=>e>=55296&&e<=56319,Ay=e=>e>=56320&&e<=57343,Wt;(function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"})(Wt||(Wt={}));var By=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,Fy=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,Ty=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,$y=/^[\u1100-\u115F\uA960-\uA97C]$/,Ny=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,Oy=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,My=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,Iy=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,Ry=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,Py=(e,t)=>{var r=Wt.Any;return e.search(By)!==-1&&(r|=Wt.Extend),t===8205&&(r|=Wt.ZWJ),t>=127462&&t<=127487&&(r|=Wt.RI),e.search(Fy)!==-1&&(r|=Wt.Prepend),e.search(Ty)!==-1&&(r|=Wt.SpacingMark),e.search($y)!==-1&&(r|=Wt.L),e.search(Ny)!==-1&&(r|=Wt.V),e.search(Oy)!==-1&&(r|=Wt.T),e.search(My)!==-1&&(r|=Wt.LV),e.search(Iy)!==-1&&(r|=Wt.LVT),e.search(Ry)!==-1&&(r|=Wt.ExtPict),r};function ma(e,t){return(e&t)!==0}var zy=[[Wt.L,Wt.L|Wt.V|Wt.LV|Wt.LVT],[Wt.LV|Wt.V,Wt.V|Wt.T],[Wt.LVT|Wt.T,Wt.T],[Wt.Any,Wt.Extend|Wt.ZWJ],[Wt.Any,Wt.SpacingMark],[Wt.Prepend,Wt.Any],[Wt.ZWJ,Wt.ExtPict],[Wt.RI,Wt.RI]];function _y(e,t){return zy.findIndex(r=>ma(e,r[0])&&ma(t,r[1]))===-1}var jy=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,zh=e=>e.search(jy)!==-1,Ly=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,Hy=e=>{var t=e.match(Ly);if(t===null)return!1;var r=t[0].length/2;return r%2===1},Ky={delete(e,t){e.delete(t)},insertFragment(e,t,r){e.insertFragment(t,r)},insertText(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};z.withoutNormalizing(e,()=>{var{voids:n=!1}=r,{at:o=Rc(e)}=r;if(de.isPath(o)&&(o=z.range(e,o)),Oe.isRange(o))if(Oe.isCollapsed(o))o=o.anchor;else{var a=Oe.end(o);if(!n&&z.void(e,{at:a}))return;var l=Oe.start(o),u=z.pointRef(e,l),f=z.pointRef(e,a);Ge.delete(e,{at:o,voids:n});var d=u.unref(),m=f.unref();o=d||m,Ge.setSelection(e,{anchor:o,focus:o})}if(!(!n&&z.void(e,{at:o})||z.elementReadOnly(e,{at:o}))){var{path:g,offset:v}=o;t.length>0&&e.apply({type:"insert_text",path:g,offset:v,text:t})}})}};function _h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ji(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_h(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_h(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Ge=Ji(Ji(Ji(Ji({},ly),uy),cy),Ky),ps=new WeakMap,qy=e=>ps.get(e)||!1,Vy=(e,t,r)=>{var n=ps.get(e)||!1;ps.set(e,!0);try{t(),r()}finally{ps.set(e,n)}};function mg(e,t,r){var n=Vs.get(e)||[],o=Ws.get(e)||new Set,a,l,u=g=>{if(g){var v=g.join(",");l.has(v)||(l.add(v),a.push(g))}};if(r){a=[],l=new Set;for(var f of n){var d=r(f);u(d)}}else a=n,l=o;for(var m of t)u(m);Vs.set(e,a),Ws.set(e,l)}var Wy=(e,t)=>{for(var r of z.pathRefs(e))ry.transform(r,t);for(var n of z.pointRefs(e))ny.transform(n,t);for(var o of z.rangeRefs(e))oy.transform(o,t);if(!qy(e)){var a=de.operationCanTransformPath(t)?l=>de.transform(l,t):void 0;mg(e,e.getDirtyPaths(t),a)}Ge.transform(e,t),e.operations.push(t),z.normalize(e,{operation:t}),t.type==="set_selection"&&(e.marks=null),li.get(e)||(li.set(e,!0),Promise.resolve().then(()=>{li.set(e,!1),e.onChange({operation:t}),e.operations=[]}))},Uy=(e,t)=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":{var{path:r}=t;return de.levels(r)}case"insert_node":{var{node:n,path:o}=t,a=de.levels(o),l=Ct.isText(n)?[]:Array.from(at.nodes(n),q=>{var[,R]=q;return o.concat(R)});return[...a,...l]}case"merge_node":{var{path:u}=t,f=de.ancestors(u),d=de.previous(u);return[...f,d]}case"move_node":{var{path:m,newPath:g}=t;if(de.equals(m,g))return[];var v=[],y=[];for(var b of de.ancestors(m)){var C=de.transform(b,t);v.push(C)}for(var p of de.ancestors(g)){var S=de.transform(p,t);y.push(S)}var B=y[y.length-1],k=g[g.length-1],$=B.concat(k);return[...v,...y,$]}case"remove_node":{var{path:T}=t,O=de.ancestors(T);return[...O]}case"split_node":{var{path:F}=t,P=de.levels(F),N=de.next(F);return[...P,N]}default:return[]}},Xy=e=>{var{selection:t}=e;return t?at.fragment(e,t):[]},Gy=(e,t)=>{var[r,n]=t;if(!Ct.isText(r)){if(kt.isElement(r)&&r.children.length===0){var o={text:""};Ge.insertNodes(e,o,{at:n.concat(0),voids:!0});return}for(var a=z.isEditor(r)?!1:kt.isElement(r)&&(e.isInline(r)||r.children.length===0||Ct.isText(r.children[0])||e.isInline(r.children[0])),l=0,u=0;u<r.children.length;u++,l++){var f=at.get(e,n);if(!Ct.isText(f)){var d=f.children[l],m=f.children[l-1],g=u===r.children.length-1,v=Ct.isText(d)||kt.isElement(d)&&e.isInline(d);if(v!==a)Ge.removeNodes(e,{at:n.concat(l),voids:!0}),l--;else if(kt.isElement(d)){if(e.isInline(d)){if(m==null||!Ct.isText(m)){var y={text:""};Ge.insertNodes(e,y,{at:n.concat(l),voids:!0}),l++}else if(g){var b={text:""};Ge.insertNodes(e,b,{at:n.concat(l+1),voids:!0}),l++}}}else{if(!Ct.isText(d)&&!("children"in d)){var C=d;C.children=[]}m!=null&&Ct.isText(m)&&(Ct.equals(d,m,{loose:!0})?(Ge.mergeNodes(e,{at:n.concat(l),voids:!0}),l--):m.text===""?(Ge.removeNodes(e,{at:n.concat(l-1),voids:!0}),l--):d.text===""&&(Ge.removeNodes(e,{at:n.concat(l),voids:!0}),l--))}}}}},Yy=(e,t)=>{var{iteration:r,initialDirtyPathsLength:n}=t,o=n*42;if(r>o)throw new Error("Could not completely normalize the editor after ".concat(o," iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."));return!0},Zy=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{voids:r=!1,mode:n="lowest",at:o=e.selection,match:a}=t;if(o){var l=z.path(e,o),u=n==="lowest";for(var[f,d]of z.levels(e,{at:l,voids:r,match:a,reverse:u}))if(!Ct.isText(f)){if(Oe.isRange(o)){if(de.isAncestor(d,o.anchor.path)&&de.isAncestor(d,o.focus.path))return[f,d]}else if(!de.equals(l,d))return[f,d]}}};function jh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Lh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jh(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Jy=(e,t,r)=>{var{selection:n}=e;if(n){var o=(g,v)=>{if(!Ct.isText(g))return!1;var[y,b]=z.parent(e,v);return!e.isVoid(y)||e.markableVoid(y)},a=Oe.isExpanded(n),l=!1;if(!a){var[u,f]=z.node(e,n);if(u&&o(u,f)){var[d]=z.parent(e,f);l=d&&e.markableVoid(d)}}if(a||l)Ge.setNodes(e,{[t]:r},{match:o,split:!0,voids:!0});else{var m=Lh(Lh({},z.marks(e)||{}),{},{[t]:r});e.marks=m,li.get(e)||e.onChange()}}};function Hh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Kh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Hh(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Qy=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=z.point(e,t,{edge:"end"}),o=z.end(e,[]),a={anchor:n,focus:o},{distance:l=1}=r,u=0,f;for(var d of z.positions(e,Kh(Kh({},r),{},{at:a}))){if(u>l)break;u!==0&&(f=d),u++}return f};function qh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Vh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qh(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var e8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=z.start(e,[]),o=z.point(e,t,{edge:"start"}),a={anchor:n,focus:o},{distance:l=1}=r,u=0,f;for(var d of z.positions(e,Vh(Vh({},r),{},{at:a,reverse:!0}))){if(u>l)break;u!==0&&(f=d),u++}return f},t8=(e,t)=>{var{selection:r}=e;r&&Oe.isCollapsed(r)&&Ge.delete(e,{unit:t,reverse:!0})},r8=(e,t)=>{var{selection:r}=e;r&&Oe.isCollapsed(r)&&Ge.delete(e,{unit:t})},n8=function(e){var{direction:t="forward"}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=e;r&&Oe.isExpanded(r)&&Ge.delete(e,{reverse:t==="backward"})},o8=(e,t)=>[z.start(e,t),z.end(e,t)];function Wh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Uh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wh(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var a8=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return z.above(e,Uh(Uh({},t),{},{match:r=>kt.isElement(r)&&z.isElementReadOnly(e,r)}))},i8=(e,t)=>z.point(e,t,{edge:"end"}),s8=(e,t)=>{var r=z.path(e,t,{edge:"start"});return z.node(e,r)},l8=(e,t)=>{var r=z.range(e,t);return at.fragment(e,r)};function Xh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Gh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xh(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var u8=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return z.above(e,Gh(Gh({},t),{},{match:r=>kt.isElement(r)&&z.isVoid(e,r)}))},c8=(e,t)=>t.children.some(r=>kt.isElement(r)&&z.isBlock(e,r)),d8=(e,t)=>t.children.some(r=>Ct.isText(r)||z.isInline(e,r)),f8=(e,t)=>at.has(e,t),h8=(e,t)=>t.children.every(r=>Ct.isText(r)),p8=e=>{Ge.splitNodes(e,{always:!0})},m8=(e,t,r)=>{Ge.insertNodes(e,t,r)},g8=e=>{Ge.splitNodes(e,{always:!0})};function Yh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function v8(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yh(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var b8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:n,marks:o}=e;if(n){if(o){var a=v8({text:t},o);Ge.insertNodes(e,a,{at:r.at,voids:r.voids})}else Ge.insertText(e,t,r);e.marks=null}},y8=(e,t)=>!e.isInline(t),x8=(e,t,r)=>z.isStart(e,t,r)||z.isEnd(e,t,r),w8=(e,t)=>{var{children:r}=t,[n]=r;return r.length===0||r.length===1&&Ct.isText(n)&&n.text===""&&!e.isVoid(t)},C8=(e,t,r)=>{var n=z.end(e,r);return er.equals(t,n)},D8=e=>{var t=hg.get(e);return t===void 0?!0:t},k8=(e,t,r)=>{if(t.offset!==0)return!1;var n=z.start(e,r);return er.equals(t,n)},E8=(e,t)=>{var r=z.path(e,t,{edge:"end"});return z.node(e,r)},S8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=z.path(e,t,r),o=at.leaf(e,n);return[o,n]};function A8(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(function*(){var{at:r=e.selection,reverse:n=!1,voids:o=!1}=t,{match:a}=t;if(a==null&&(a=()=>!0),!!r){var l=[],u=z.path(e,r);for(var[f,d]of at.levels(e,u))if(a(f,d)&&(l.push([f,d]),!o&&kt.isElement(f)&&z.isVoid(e,f)))break;n&&l.reverse(),yield*l}})()}var B8=["text"],F8=["text"],T8=function(e){var{marks:t,selection:r}=e;if(!r)return null;var{anchor:n,focus:o}=r;if(t)return t;if(Oe.isExpanded(r)){var a=z.isEnd(e,n,n.path);if(a){var l=z.after(e,n);l&&(n=l)}var[u]=z.nodes(e,{match:Ct.isText,at:{anchor:n,focus:o}});if(u){var[f]=u,d=yo(f,B8);return d}else return{}}var{path:m}=n,[g]=z.leaf(e,m);if(n.offset===0){var v=z.previous(e,{at:m,match:Ct.isText}),y=z.above(e,{match:k=>kt.isElement(k)&&z.isVoid(e,k)&&e.markableVoid(k)});if(!y){var b=z.above(e,{match:k=>kt.isElement(k)&&z.isBlock(e,k)});if(v&&b){var[C,p]=v,[,S]=b;de.isAncestor(S,p)&&(g=C)}}}var B=yo(g,F8);return B},$8=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:n=!1}=t,{match:o,at:a=e.selection}=t;if(a){var l=z.after(e,a,{voids:n});if(l){var[,u]=z.last(e,[]),f=[l.path,u];if(de.isPath(a)&&a.length===0)throw new Error("Cannot get the next node from the root node!");if(o==null)if(de.isPath(a)){var[d]=z.parent(e,a);o=g=>d.children.includes(g)}else o=()=>!0;var[m]=z.nodes(e,{at:f,match:o,mode:r,voids:n});return m}}},N8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=z.path(e,t,r),o=at.get(e,n);return[o,n]};function O8(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(function*(){var{at:r=e.selection,mode:n="all",universal:o=!1,reverse:a=!1,voids:l=!1,ignoreNonSelectable:u=!1}=t,{match:f}=t;if(f||(f=()=>!0),!!r){var d,m;if(vy.isSpan(r))d=r[0],m=r[1];else{var g=z.path(e,r,{edge:"start"}),v=z.path(e,r,{edge:"end"});d=a?v:g,m=a?g:v}var y=at.nodes(e,{reverse:a,from:d,to:m,pass:$=>{var[T]=$;return kt.isElement(T)?!!(!l&&(z.isVoid(e,T)||z.isElementReadOnly(e,T))||u&&!z.isSelectable(e,T)):!1}}),b=[],C;for(var[p,S]of y)if(!(u&&kt.isElement(p)&&!z.isSelectable(e,p))){var B=C&&de.compare(S,C[1])===0;if(!(n==="highest"&&B)){if(!f(p,S)){if(o&&!B&&Ct.isText(p))return;continue}if(n==="lowest"&&B){C=[p,S];continue}var k=n==="lowest"?C:[p,S];k&&(o?b.push(k):yield k),C=[p,S]}}n==="lowest"&&C&&(o?b.push(C):yield C),o&&(yield*b)}})()}var M8=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{force:r=!1,operation:n}=t,o=d=>Vs.get(d)||[],a=d=>Ws.get(d)||new Set,l=d=>{var m=o(d).pop(),g=m.join(",");return a(d).delete(g),m};if(z.isNormalizing(e)){if(r){var u=Array.from(at.nodes(e),d=>{var[,m]=d;return m}),f=new Set(u.map(d=>d.join(",")));Vs.set(e,u),Ws.set(e,f)}o(e).length!==0&&z.withoutNormalizing(e,()=>{for(var d of o(e))if(at.has(e,d)){var m=z.node(e,d),[g,v]=m;kt.isElement(g)&&g.children.length===0&&e.normalizeNode(m,{operation:n})}for(var y=o(e),b=y.length,C=0;y.length!==0;){if(!e.shouldNormalize({dirtyPaths:y,iteration:C,initialDirtyPathsLength:b,operation:n}))return;var p=l(e);if(at.has(e,p)){var S=z.node(e,p);e.normalizeNode(S,{operation:n})}C++,y=o(e)}})}},I8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=z.path(e,t,r),o=de.parent(n),a=z.node(e,o);return a},R8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:n="forward"}=r,o={current:t,affinity:n,unref(){var{current:l}=o,u=z.pathRefs(e);return u.delete(o),o.current=null,l}},a=z.pathRefs(e);return a.add(o),o},P8=e=>{var t=Eh.get(e);return t||(t=new Set,Eh.set(e,t)),t},z8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{depth:n,edge:o}=r;if(de.isPath(t)){if(o==="start"){var[,a]=at.first(e,t);t=a}else if(o==="end"){var[,l]=at.last(e,t);t=l}}return Oe.isRange(t)&&(o==="start"?t=Oe.start(t):o==="end"?t=Oe.end(t):t=de.common(t.anchor.path,t.focus.path)),er.isPoint(t)&&(t=t.path),n!=null&&(t=t.slice(0,n)),t},_8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:n="forward"}=r,o={current:t,affinity:n,unref(){var{current:l}=o,u=z.pointRefs(e);return u.delete(o),o.current=null,l}},a=z.pointRefs(e);return a.add(o),o},j8=e=>{var t=Sh.get(e);return t||(t=new Set,Sh.set(e,t)),t},L8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{edge:n="start"}=r;if(de.isPath(t)){var o;if(n==="end"){var[,a]=at.last(e,t);o=a}else{var[,l]=at.first(e,t);o=l}var u=at.get(e,o);if(!Ct.isText(u))throw new Error("Cannot get the ".concat(n," point in the node at path [").concat(t,"] because it has no ").concat(n," text node."));return{path:o,offset:n==="end"?u.text.length:0}}if(Oe.isRange(t)){var[f,d]=Oe.edges(t);return n==="start"?f:d}return t};function H8(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(function*(){var{at:r=e.selection,unit:n="offset",reverse:o=!1,voids:a=!1,ignoreNonSelectable:l=!1}=t;if(!r)return;var u=z.range(e,r),[f,d]=Oe.edges(u),m=o?d:f,g=!1,v="",y=0,b=0,C=0;for(var[p,S]of z.nodes(e,{at:r,reverse:o,voids:a,ignoreNonSelectable:l})){if(kt.isElement(p)){if(!a&&(e.isVoid(p)||e.isElementReadOnly(p))){yield z.start(e,S);continue}if(e.isInline(p))continue;if(z.hasInlines(e,p)){var B=de.isAncestor(S,d.path)?d:z.end(e,S),k=de.isAncestor(S,f.path)?f:z.start(e,S);v=z.string(e,{anchor:k,focus:B},{voids:a}),g=!0}}if(Ct.isText(p)){var $=de.equals(S,m.path);for($?(b=o?m.offset:p.text.length-m.offset,C=m.offset):(b=p.text.length,C=o?b:0),($||g||n==="offset")&&(yield{path:S,offset:C},g=!1);;){if(y===0){if(v==="")break;y=T(v,n,o),v=zc(v,y,o)[1]}if(C=o?C-y:C+y,b=b-y,b<0){y=-b;break}y=0,yield{path:S,offset:C}}}}function T(O,F,P){return F==="character"?Pc(O,P):F==="word"?Dy(O,P):F==="line"||F==="block"?O.length:1}})()}var K8=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:r="lowest",voids:n=!1}=t,{match:o,at:a=e.selection}=t;if(a){var l=z.before(e,a,{voids:n});if(l){var[,u]=z.first(e,[]),f=[l.path,u];if(de.isPath(a)&&a.length===0)throw new Error("Cannot get the previous node from the root node!");if(o==null)if(de.isPath(a)){var[d]=z.parent(e,a);o=g=>d.children.includes(g)}else o=()=>!0;var[m]=z.nodes(e,{reverse:!0,at:f,match:o,mode:r,voids:n});return m}}},q8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:n="forward"}=r,o={current:t,affinity:n,unref(){var{current:l}=o,u=z.rangeRefs(e);return u.delete(o),o.current=null,l}},a=z.rangeRefs(e);return a.add(o),o},V8=e=>{var t=Ah.get(e);return t||(t=new Set,Ah.set(e,t)),t},W8=(e,t,r)=>{if(Oe.isRange(t)&&!r)return t;var n=z.start(e,t),o=z.end(e,r||t);return{anchor:n,focus:o}};function Zh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function U8(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Zh(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var X8=(e,t)=>{var{selection:r}=e;if(r){var n=(m,g)=>{if(!Ct.isText(m))return!1;var[v,y]=z.parent(e,g);return!e.isVoid(v)||e.markableVoid(v)},o=Oe.isExpanded(r),a=!1;if(!o){var[l,u]=z.node(e,r);if(l&&n(l,u)){var[f]=z.parent(e,u);a=f&&e.markableVoid(f)}}if(o||a)Ge.unsetNodes(e,t,{match:n,split:!0,voids:!0});else{var d=U8({},z.marks(e)||{});delete d[t],e.marks=d,li.get(e)||e.onChange()}}},G8=(e,t)=>{hg.set(e,t)},Y8=(e,t)=>z.point(e,t,{edge:"start"}),Z8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:n=!1}=r,o=z.range(e,t),[a,l]=Oe.edges(o),u="";for(var[f,d]of z.nodes(e,{at:o,match:Ct.isText,voids:n})){var m=f.text;de.equals(d,l.path)&&(m=m.slice(0,l.offset)),de.equals(d,a.path)&&(m=m.slice(a.offset)),u+=m}return u},J8=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:n=!1}=r,[o,a]=Oe.edges(t);if(o.offset!==0||a.offset!==0||Oe.isCollapsed(t)||de.hasPrevious(a.path))return t;var l=z.above(e,{at:a,match:y=>kt.isElement(y)&&z.isBlock(e,y),voids:n}),u=l?l[1]:[],f=z.start(e,o),d={anchor:f,focus:a},m=!0;for(var[g,v]of z.nodes(e,{at:d,match:Ct.isText,reverse:!0,voids:n})){if(m){m=!1;continue}if(g.text!==""||de.isBefore(v,u)){a={path:v,offset:g.text.length};break}}return{anchor:o,focus:a}},Q8=(e,t)=>{var r=z.isNormalizing(e);z.setNormalizing(e,!1);try{t()}finally{z.setNormalizing(e,r)}z.normalize(e)},ex=(e,t,r)=>{var[n,o]=t;return kt.isElement(n)&&z.isEmpty(e,n)||Ct.isText(n)&&n.text===""&&o[o.length-1]!==0},tx=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};z.withoutNormalizing(e,()=>{var r,n,{reverse:o=!1,unit:a="character",distance:l=1,voids:u=!1}=t,{at:f=e.selection,hanging:d=!1}=t;if(f){var m=!1;if(Oe.isRange(f)&&Oe.isCollapsed(f)&&(m=!0,f=f.anchor),er.isPoint(f)){var g=z.void(e,{at:f,mode:"highest"});if(!u&&g){var[,v]=g;f=v}else{var y={unit:a,distance:l},b=o?z.before(e,f,y)||z.start(e,[]):z.after(e,f,y)||z.end(e,[]);f={anchor:f,focus:b},d=!0}}if(de.isPath(f)){Ge.removeNodes(e,{at:f,voids:u});return}if(!Oe.isCollapsed(f)){if(!d){var[,C]=Oe.edges(f),p=z.end(e,[]);er.equals(C,p)||(f=z.unhangRange(e,f,{voids:u}))}var[S,B]=Oe.edges(f),k=z.above(e,{match:Ee=>kt.isElement(Ee)&&z.isBlock(e,Ee),at:S,voids:u}),$=z.above(e,{match:Ee=>kt.isElement(Ee)&&z.isBlock(e,Ee),at:B,voids:u}),T=k&&$&&!de.equals(k[1],$[1]),O=de.equals(S.path,B.path),F=u?null:(r=z.void(e,{at:S,mode:"highest"}))!==null&&r!==void 0?r:z.elementReadOnly(e,{at:S,mode:"highest"}),P=u?null:(n=z.void(e,{at:B,mode:"highest"}))!==null&&n!==void 0?n:z.elementReadOnly(e,{at:B,mode:"highest"});if(F){var N=z.before(e,S);N&&k&&de.isAncestor(k[1],N.path)&&(S=N)}if(P){var q=z.after(e,B);q&&$&&de.isAncestor($[1],q.path)&&(B=q)}var R=[],X;for(var G of z.nodes(e,{at:f,voids:u})){var[_,j]=G;X&&de.compare(j,X)===0||(!u&&kt.isElement(_)&&(z.isVoid(e,_)||z.isElementReadOnly(e,_))||!de.isCommon(j,S.path)&&!de.isCommon(j,B.path))&&(R.push(G),X=j)}var W=Array.from(R,Ee=>{var[,Ae]=Ee;return z.pathRef(e,Ae)}),U=z.pointRef(e,S),ee=z.pointRef(e,B),V="";if(!O&&!F){var Y=U.current,[fe]=z.leaf(e,Y),{path:be}=Y,{offset:he}=S,De=fe.text.slice(he);De.length>0&&(e.apply({type:"remove_text",path:be,offset:he,text:De}),V=De)}if(W.reverse().map(Ee=>Ee.unref()).filter(Ee=>Ee!==null).forEach(Ee=>Ge.removeNodes(e,{at:Ee,voids:u})),!P){var $e=ee.current,[Z]=z.leaf(e,$e),{path:ie}=$e,le=O?S.offset:0,ue=Z.text.slice(le,B.offset);ue.length>0&&(e.apply({type:"remove_text",path:ie,offset:le,text:ue}),V=ue)}!O&&T&&ee.current&&U.current&&Ge.mergeNodes(e,{at:ee.current,hanging:!0,voids:u}),m&&o&&a==="character"&&V.length>1&&V.match(/[\u0E00-\u0E7F]+/)&&Ge.insertText(e,V.slice(0,V.length-l));var Se=U.unref(),Be=ee.unref(),ge=o?Se||Be:Be||Se;t.at==null&&ge&&Ge.select(e,ge)}}})},rx=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};z.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:o=!1}=r,{at:a=Rc(e),batchDirty:l=!0}=r;if(t.length){if(Oe.isRange(a))if(n||(a=z.unhangRange(e,a,{voids:o})),Oe.isCollapsed(a))a=a.anchor;else{var[,u]=Oe.edges(a);if(!o&&z.void(e,{at:u}))return;var f=z.pointRef(e,u);Ge.delete(e,{at:a}),a=f.unref()}else de.isPath(a)&&(a=z.start(e,a));if(!(!o&&z.void(e,{at:a}))){var d=z.above(e,{at:a,match:De=>kt.isElement(De)&&z.isInline(e,De),mode:"highest",voids:o});if(d){var[,m]=d;if(z.isEnd(e,a,m)){var g=z.after(e,m);a=g}else if(z.isStart(e,a,m)){var v=z.before(e,m);a=v}}var y=z.above(e,{match:De=>kt.isElement(De)&&z.isBlock(e,De),at:a,voids:o}),[,b]=y,C=z.isStart(e,a,b),p=z.isEnd(e,a,b),S=C&&p,B=!C||C&&p,k=!p,[,$]=at.first({children:t},[]),[,T]=at.last({children:t},[]),O=[],F=De=>{var[$e,Z]=De,ie=Z.length===0;return ie?!1:S?!0:!(B&&de.isAncestor(Z,$)&&kt.isElement($e)&&!e.isVoid($e)&&!e.isInline($e)||k&&de.isAncestor(Z,T)&&kt.isElement($e)&&!e.isVoid($e)&&!e.isInline($e))};for(var P of at.nodes({children:t},{pass:F}))F(P)&&O.push(P);var N=[],q=[],R=[],X=!0,G=!1;for(var[_]of O)kt.isElement(_)&&!e.isInline(_)?(X=!1,G=!0,q.push(_)):X?N.push(_):R.push(_);var[j]=z.nodes(e,{at:a,match:De=>Ct.isText(De)||z.isInline(e,De),mode:"highest",voids:o}),[,W]=j,U=z.isStart(e,a,W),ee=z.isEnd(e,a,W),V=z.pathRef(e,p&&!R.length?de.next(b):b),Y=z.pathRef(e,ee?de.next(W):W);Ge.splitNodes(e,{at:a,match:De=>G?kt.isElement(De)&&z.isBlock(e,De):Ct.isText(De)||z.isInline(e,De),mode:G?"lowest":"highest",always:G&&(!C||N.length>0)&&(!p||R.length>0),voids:o});var fe=z.pathRef(e,!U||U&&ee?de.next(W):W);if(Ge.insertNodes(e,N,{at:fe.current,match:De=>Ct.isText(De)||z.isInline(e,De),mode:"highest",voids:o,batchDirty:l}),S&&!N.length&&q.length&&!R.length&&Ge.delete(e,{at:b,voids:o}),Ge.insertNodes(e,q,{at:V.current,match:De=>kt.isElement(De)&&z.isBlock(e,De),mode:"lowest",voids:o,batchDirty:l}),Ge.insertNodes(e,R,{at:Y.current,match:De=>Ct.isText(De)||z.isInline(e,De),mode:"highest",voids:o,batchDirty:l}),!r.at){var be;if(R.length>0&&Y.current?be=de.previous(Y.current):q.length>0&&V.current?be=de.previous(V.current):fe.current&&(be=de.previous(fe.current)),be){var he=z.end(e,be);Ge.select(e,he)}}fe.unref(),V.unref(),Y.unref()}}})},nx=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{edge:r="anchor"}=t,{selection:n}=e;if(n){if(r==="anchor")Ge.select(e,n.anchor);else if(r==="focus")Ge.select(e,n.focus);else if(r==="start"){var[o]=Oe.edges(n);Ge.select(e,o)}else if(r==="end"){var[,a]=Oe.edges(n);Ge.select(e,a)}}else return},ox=e=>{var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})},ax=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:r}=e,{distance:n=1,unit:o="character",reverse:a=!1}=t,{edge:l=null}=t;if(r){l==="start"&&(l=Oe.isBackward(r)?"focus":"anchor"),l==="end"&&(l=Oe.isBackward(r)?"anchor":"focus");var{anchor:u,focus:f}=r,d={distance:n,unit:o,ignoreNonSelectable:!0},m={};if(l==null||l==="anchor"){var g=a?z.before(e,u,d):z.after(e,u,d);g&&(m.anchor=g)}if(l==null||l==="focus"){var v=a?z.before(e,f,d):z.after(e,f,d);v&&(m.focus=v)}Ge.setSelection(e,m)}},ix=(e,t)=>{var{selection:r}=e;if(t=z.range(e,t),r){Ge.setSelection(e,t);return}if(!Oe.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(en.stringify(t)));e.apply({type:"set_selection",properties:r,newProperties:t})};function Jh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Qh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Jh(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var sx=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:n}=e,{edge:o="both"}=r;if(n){o==="start"&&(o=Oe.isBackward(n)?"focus":"anchor"),o==="end"&&(o=Oe.isBackward(n)?"anchor":"focus");var{anchor:a,focus:l}=n,u=o==="anchor"?a:l;Ge.setSelection(e,{[o==="anchor"?"anchor":"focus"]:Qh(Qh({},u),t)})}},lx=(e,t)=>{var{selection:r}=e,n={},o={};if(r){for(var a in t)(a==="anchor"&&t.anchor!=null&&!er.equals(t.anchor,r.anchor)||a==="focus"&&t.focus!=null&&!er.equals(t.focus,r.focus)||a!=="anchor"&&a!=="focus"&&t[a]!==r[a])&&(n[a]=r[a],o[a]=t[a]);Object.keys(n).length>0&&e.apply({type:"set_selection",properties:n,newProperties:o})}},ux=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};z.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:o=!1,mode:a="lowest",batchDirty:l=!0}=r,{at:u,match:f,select:d}=r;if(at.isNode(t)&&(t=[t]),t.length!==0){var[m]=t;if(u||(u=Rc(e),d!==!1&&(d=!0)),d==null&&(d=!1),Oe.isRange(u))if(n||(u=z.unhangRange(e,u,{voids:o})),Oe.isCollapsed(u))u=u.anchor;else{var[,g]=Oe.edges(u),v=z.pointRef(e,g);Ge.delete(e,{at:u}),u=v.unref()}if(er.isPoint(u)){f==null&&(Ct.isText(m)?f=N=>Ct.isText(N):e.isInline(m)?f=N=>Ct.isText(N)||z.isInline(e,N):f=N=>kt.isElement(N)&&z.isBlock(e,N));var[y]=z.nodes(e,{at:u.path,match:f,mode:a,voids:o});if(y){var[,b]=y,C=z.pathRef(e,b),p=z.isEnd(e,u,b);Ge.splitNodes(e,{at:u,match:f,mode:a,voids:o});var S=C.unref();u=p?de.next(S):S}else return}var B=de.parent(u),k=u[u.length-1];if(!(!o&&z.void(e,{at:B}))){if(l){var $=[],T=de.levels(B);Vy(e,()=>{var N=function(){var R=B.concat(k);k++;var X={type:"insert_node",path:R,node:q};e.apply(X),u=de.next(u),$.push(X),Ct.isText?T.push(...Array.from(at.nodes(q),G=>{var[,_]=G;return R.concat(_)})):T.push(R)};for(var q of t)N()},()=>{mg(e,T,N=>{var q=N;for(var R of $)if(de.operationCanTransformPath(R)&&(q=de.transform(q,R),!q))return null;return q})})}else for(var O of t){var F=B.concat(k);k++,e.apply({type:"insert_node",path:F,node:O}),u=de.next(u)}if(u=de.previous(u),d){var P=z.end(e,u);P&&Ge.select(e,P)}}}})},cx=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};z.withoutNormalizing(e,()=>{var{at:r=e.selection,mode:n="lowest",voids:o=!1}=t,{match:a}=t;if(a==null&&(a=de.isPath(r)?Pa(e,r):k=>kt.isElement(k)&&z.isBlock(e,k)),!!r){var l=z.nodes(e,{at:r,match:a,mode:n,voids:o}),u=Array.from(l,k=>{var[,$]=k;return z.pathRef(e,$)});for(var f of u){var d=f.unref();if(d.length<2)throw new Error("Cannot lift node at a path [".concat(d,"] because it has a depth of less than `2`."));var m=z.node(e,de.parent(d)),[g,v]=m,y=d[d.length-1],{length:b}=g.children;if(b===1){var C=de.next(v);Ge.moveNodes(e,{at:d,to:C,voids:o}),Ge.removeNodes(e,{at:v,voids:o})}else if(y===0)Ge.moveNodes(e,{at:d,to:v,voids:o});else if(y===b-1){var p=de.next(v);Ge.moveNodes(e,{at:d,to:p,voids:o})}else{var S=de.next(d),B=de.next(v);Ge.splitNodes(e,{at:S,voids:o}),Ge.moveNodes(e,{at:d,to:B,voids:o})}}}})},dx=["text"],fx=["children"],gg=(e,t)=>{if(kt.isElement(t)){var r=t;return z.isVoid(e,t)?!0:r.children.length===1?gg(e,r.children[0]):!1}else return!z.isEditor(t)},hx=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};z.withoutNormalizing(e,()=>{var{match:r,at:n=e.selection}=t,{hanging:o=!1,voids:a=!1,mode:l="lowest"}=t;if(n){if(r==null)if(de.isPath(n)){var[u]=z.parent(e,n);r=N=>u.children.includes(N)}else r=N=>kt.isElement(N)&&z.isBlock(e,N);if(!o&&Oe.isRange(n)&&(n=z.unhangRange(e,n,{voids:a})),Oe.isRange(n))if(Oe.isCollapsed(n))n=n.anchor;else{var[,f]=Oe.edges(n),d=z.pointRef(e,f);Ge.delete(e,{at:n}),n=d.unref(),t.at==null&&Ge.select(e,n)}var[m]=z.nodes(e,{at:n,match:r,voids:a,mode:l}),g=z.previous(e,{at:n,match:r,voids:a,mode:l});if(!(!m||!g)){var[v,y]=m,[b,C]=g;if(!(y.length===0||C.length===0)){var p=de.next(C),S=de.common(y,C),B=de.isSibling(y,C),k=Array.from(z.levels(e,{at:y}),N=>{var[q]=N;return q}).slice(S.length).slice(0,-1),$=z.above(e,{at:y,mode:"highest",match:N=>k.includes(N)&&gg(e,N)}),T=$&&z.pathRef(e,$[1]),O,F;if(Ct.isText(v)&&Ct.isText(b)){var P=yo(v,dx);F=b.text.length,O=P}else if(kt.isElement(v)&&kt.isElement(b)){var P=yo(v,fx);F=b.children.length,O=P}else throw new Error("Cannot merge the node at path [".concat(y,"] with the previous sibling because it is not the same kind: ").concat(en.stringify(v)," ").concat(en.stringify(b)));B||Ge.moveNodes(e,{at:y,to:p,voids:a}),T&&Ge.removeNodes(e,{at:T.current,voids:a}),z.shouldMergeNodesRemovePrevNode(e,g,m)?Ge.removeNodes(e,{at:C,voids:a}):e.apply({type:"merge_node",path:p,position:F,properties:O}),T&&T.unref()}}}})},px=(e,t)=>{z.withoutNormalizing(e,()=>{var{to:r,at:n=e.selection,mode:o="lowest",voids:a=!1}=t,{match:l}=t;if(n){l==null&&(l=de.isPath(n)?Pa(e,n):y=>kt.isElement(y)&&z.isBlock(e,y));var u=z.pathRef(e,r),f=z.nodes(e,{at:n,match:l,mode:o,voids:a}),d=Array.from(f,y=>{var[,b]=y;return z.pathRef(e,b)});for(var m of d){var g=m.unref(),v=u.current;g.length!==0&&e.apply({type:"move_node",path:g,newPath:v}),u.current&&de.isSibling(v,g)&&de.isAfter(v,g)&&(u.current=de.next(u.current))}u.unref()}})},mx=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};z.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:n=!1,mode:o="lowest"}=t,{at:a=e.selection,match:l}=t;if(a){l==null&&(l=de.isPath(a)?Pa(e,a):v=>kt.isElement(v)&&z.isBlock(e,v)),!r&&Oe.isRange(a)&&(a=z.unhangRange(e,a,{voids:n}));var u=z.nodes(e,{at:a,match:l,mode:o,voids:n}),f=Array.from(u,v=>{var[,y]=v;return z.pathRef(e,y)});for(var d of f){var m=d.unref();if(m){var[g]=z.node(e,m);e.apply({type:"remove_node",path:m,node:g})}}}})},gx=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};z.withoutNormalizing(e,()=>{var{match:n,at:o=e.selection,compare:a,merge:l}=r,{hanging:u=!1,mode:f="lowest",split:d=!1,voids:m=!1}=r;if(o){if(n==null&&(n=de.isPath(o)?Pa(e,o):F=>kt.isElement(F)&&z.isBlock(e,F)),!u&&Oe.isRange(o)&&(o=z.unhangRange(e,o,{voids:m})),d&&Oe.isRange(o)){if(Oe.isCollapsed(o)&&z.leaf(e,o.anchor)[0].text.length>0)return;var g=z.rangeRef(e,o,{affinity:"inward"}),[v,y]=Oe.edges(o),b=f==="lowest"?"lowest":"highest",C=z.isEnd(e,y,y.path);Ge.splitNodes(e,{at:y,match:n,mode:b,voids:m,always:!C});var p=z.isStart(e,v,v.path);Ge.splitNodes(e,{at:v,match:n,mode:b,voids:m,always:!p}),o=g.unref(),r.at==null&&Ge.select(e,o)}a||(a=(F,P)=>F!==P);for(var[S,B]of z.nodes(e,{at:o,match:n,mode:f,voids:m})){var k={},$={};if(B.length!==0){var T=!1;for(var O in t)O==="children"||O==="text"||a(t[O],S[O])&&(T=!0,S.hasOwnProperty(O)&&(k[O]=S[O]),l?t[O]!=null&&($[O]=l(S[O],t[O])):t[O]!=null&&($[O]=t[O]));T&&e.apply({type:"set_node",path:B,properties:k,newProperties:$})}}}})},vx=(e,t)=>{if(Oe.isCollapsed(t))return t.anchor;var[,r]=Oe.edges(t),n=z.pointRef(e,r);return Ge.delete(e,{at:t}),n.unref()},bx=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};z.withoutNormalizing(e,()=>{var{mode:r="lowest",voids:n=!1}=t,{match:o,at:a=e.selection,height:l=0,always:u=!1}=t;if(o==null&&(o=ee=>kt.isElement(ee)&&z.isBlock(e,ee)),Oe.isRange(a)&&(a=vx(e,a)),de.isPath(a)){var f=a,d=z.point(e,f),[m]=z.parent(e,f);o=ee=>ee===m,l=d.path.length-f.length+1,a=d,u=!0}if(a){var g=z.pointRef(e,a,{affinity:"backward"}),v;try{var[y]=z.nodes(e,{at:a,match:o,mode:r,voids:n});if(!y)return;var b=z.void(e,{at:a,mode:"highest"}),C=0;if(!n&&b){var[p,S]=b;if(kt.isElement(p)&&e.isInline(p)){var B=z.after(e,S);if(!B){var k={text:""},$=de.next(S);Ge.insertNodes(e,k,{at:$,voids:n}),B=z.point(e,$)}a=B,u=!0}var T=a.path.length-S.length;l=T+1,u=!0}v=z.pointRef(e,a);var O=a.path.length-l,[,F]=y,P=a.path.slice(0,O),N=l===0?a.offset:a.path[O]+C;for(var[q,R]of z.levels(e,{at:P,reverse:!0,voids:n})){var X=!1;if(R.length<F.length||R.length===0||!n&&kt.isElement(q)&&z.isVoid(e,q))break;var G=g.current,_=z.isEnd(e,G,R);if(u||!g||!z.isEdge(e,G,R)){X=!0;var j=at.extractProps(q);e.apply({type:"split_node",path:R,position:N,properties:j})}N=R[R.length-1]+(X||_?1:0)}if(t.at==null){var W=v.current||z.end(e,[]);Ge.select(e,W)}}finally{var U;g.unref(),(U=v)===null||U===void 0||U.unref()}}})},yx=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Array.isArray(t)||(t=[t]);var n={};for(var o of t)n[o]=null;Ge.setNodes(e,n,r)},xx=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};z.withoutNormalizing(e,()=>{var{mode:r="lowest",split:n=!1,voids:o=!1}=t,{at:a=e.selection,match:l}=t;if(a){l==null&&(l=de.isPath(a)?Pa(e,a):v=>kt.isElement(v)&&z.isBlock(e,v)),de.isPath(a)&&(a=z.range(e,a));var u=Oe.isRange(a)?z.rangeRef(e,a):null,f=z.nodes(e,{at:a,match:l,mode:r,voids:o}),d=Array.from(f,v=>{var[,y]=v;return z.pathRef(e,y)}).reverse(),m=function(){var v=g.unref(),[y]=z.node(e,v),b=z.range(e,v);n&&u&&(b=Oe.intersection(u.current,b)),Ge.liftNodes(e,{at:b,match:C=>kt.isAncestor(y)&&y.children.includes(C),voids:o})};for(var g of d)m();u&&u.unref()}})};function ep(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function tp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ep(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ep(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var wx=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};z.withoutNormalizing(e,()=>{var{mode:n="lowest",split:o=!1,voids:a=!1}=r,{match:l,at:u=e.selection}=r;if(u){if(l==null&&(de.isPath(u)?l=Pa(e,u):e.isInline(t)?l=b=>kt.isElement(b)&&z.isInline(e,b)||Ct.isText(b):l=b=>kt.isElement(b)&&z.isBlock(e,b)),o&&Oe.isRange(u)){var[f,d]=Oe.edges(u),m=z.rangeRef(e,u,{affinity:"inward"});Ge.splitNodes(e,{at:d,match:l,voids:a}),Ge.splitNodes(e,{at:f,match:l,voids:a}),u=m.unref(),r.at==null&&Ge.select(e,u)}var g=Array.from(z.nodes(e,{at:u,match:e.isInline(t)?b=>kt.isElement(b)&&z.isBlock(e,b):b=>z.isEditor(b),mode:"lowest",voids:a})),v=function(){var b=Oe.isRange(u)?Oe.intersection(u,z.range(e,y)):u;if(!b)return 0;var C=Array.from(z.nodes(e,{at:b,match:l,mode:n,voids:a}));if(C.length>0){var[p]=C,S=C[C.length-1],[,B]=p,[,k]=S;if(B.length===0&&k.length===0)return 0;var $=de.equals(B,k)?de.parent(B):de.common(B,k),T=z.range(e,B,k),O=z.node(e,$),[F]=O,P=$.length+1,N=de.next(k.slice(0,P)),q=tp(tp({},t),{},{children:[]});Ge.insertNodes(e,q,{at:N,voids:a}),Ge.moveNodes(e,{at:T,match:R=>kt.isAncestor(F)&&F.children.includes(R),to:N.concat(0),voids:a})}};for(var[,y]of g)v()}})},Cx=()=>{var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:()=>!1,isInline:()=>!1,isSelectable:()=>!0,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Wy(e,...r)},addMark:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Jy(e,...r)},deleteBackward:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return t8(e,...r)},deleteForward:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r8(e,...r)},deleteFragment:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return n8(e,...r)},getFragment:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Xy(e,...r)},insertBreak:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return p8(e,...r)},insertSoftBreak:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return g8(e,...r)},insertFragment:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return rx(e,...r)},insertNode:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return m8(e,...r)},insertText:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return b8(e,...r)},normalizeNode:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Gy(e,...r)},removeMark:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return X8(e,...r)},getDirtyPaths:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Uy(e,...r)},shouldNormalize:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Yy(e,...r)},above:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Zy(e,...r)},after:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Qy(e,...r)},before:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e8(e,...r)},collapse:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return nx(e,...r)},delete:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return tx(e,...r)},deselect:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ox(e,...r)},edges:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return o8(e,...r)},elementReadOnly:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return a8(e,...r)},end:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return i8(e,...r)},first:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return s8(e,...r)},fragment:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return l8(e,...r)},getMarks:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return T8(e,...r)},hasBlocks:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return c8(e,...r)},hasInlines:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return d8(e,...r)},hasPath:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return f8(e,...r)},hasTexts:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return h8(e,...r)},insertNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ux(e,...r)},isBlock:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return y8(e,...r)},isEdge:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return x8(e,...r)},isEmpty:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return w8(e,...r)},isEnd:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return C8(e,...r)},isNormalizing:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return D8(e,...r)},isStart:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return k8(e,...r)},last:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return E8(e,...r)},leaf:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return S8(e,...r)},levels:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return A8(e,...r)},liftNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return cx(e,...r)},mergeNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return hx(e,...r)},move:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ax(e,...r)},moveNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return px(e,...r)},next:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return $8(e,...r)},node:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return N8(e,...r)},nodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return O8(e,...r)},normalize:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return M8(e,...r)},parent:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return I8(e,...r)},path:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return z8(e,...r)},pathRef:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return R8(e,...r)},pathRefs:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return P8(e,...r)},point:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return L8(e,...r)},pointRef:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return _8(e,...r)},pointRefs:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return j8(e,...r)},positions:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return H8(e,...r)},previous:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return K8(e,...r)},range:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return W8(e,...r)},rangeRef:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return q8(e,...r)},rangeRefs:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return V8(e,...r)},removeNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return mx(e,...r)},select:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ix(e,...r)},setNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return gx(e,...r)},setNormalizing:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return G8(e,...r)},setPoint:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return sx(e,...r)},setSelection:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return lx(e,...r)},splitNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return bx(e,...r)},start:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Y8(e,...r)},string:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Z8(e,...r)},unhangRange:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return J8(e,...r)},unsetNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return yx(e,...r)},unwrapNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return xx(e,...r)},void:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return u8(e,...r)},withoutNormalizing:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Q8(e,...r)},wrapNodes:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return wx(e,...r)},shouldMergeNodesRemovePrevNode:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ex(e,...r)}};return e},hu,rp;function Dx(){if(rp)return hu;rp=1,hu=o;var e="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",t="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",r=new RegExp("^[^"+t+"]*["+e+"]"),n=new RegExp("^[^"+e+"]*["+t+"]");function o(a){return a=String(a||""),r.test(a)?"rtl":n.test(a)?"ltr":"neutral"}return hu}var kx=Dx();const vg=Ii(kx);var pu,np;function _c(){if(np)return pu;np=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return pu=e,pu}var mu,op;function Ex(){if(op)return mu;op=1;var e=typeof pa=="object"&&pa&&pa.Object===Object&&pa;return mu=e,mu}var gu,ap;function bg(){if(ap)return gu;ap=1;var e=Ex(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return gu=r,gu}var vu,ip;function Sx(){if(ip)return vu;ip=1;var e=bg(),t=function(){return e.Date.now()};return vu=t,vu}var bu,sp;function Ax(){if(sp)return bu;sp=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return bu=t,bu}var yu,lp;function Bx(){if(lp)return yu;lp=1;var e=Ax(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return yu=r,yu}var xu,up;function yg(){if(up)return xu;up=1;var e=bg(),t=e.Symbol;return xu=t,xu}var wu,cp;function Fx(){if(cp)return wu;cp=1;var e=yg(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,o=e?e.toStringTag:void 0;function a(l){var u=r.call(l,o),f=l[o];try{l[o]=void 0;var d=!0}catch{}var m=n.call(l);return d&&(u?l[o]=f:delete l[o]),m}return wu=a,wu}var Cu,dp;function Tx(){if(dp)return Cu;dp=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Cu=r,Cu}var Du,fp;function $x(){if(fp)return Du;fp=1;var e=yg(),t=Fx(),r=Tx(),n="[object Null]",o="[object Undefined]",a=e?e.toStringTag:void 0;function l(u){return u==null?u===void 0?o:n:a&&a in Object(u)?t(u):r(u)}return Du=l,Du}var ku,hp;function Nx(){if(hp)return ku;hp=1;function e(t){return t!=null&&typeof t=="object"}return ku=e,ku}var Eu,pp;function Ox(){if(pp)return Eu;pp=1;var e=$x(),t=Nx(),r="[object Symbol]";function n(o){return typeof o=="symbol"||t(o)&&e(o)==r}return Eu=n,Eu}var Su,mp;function Mx(){if(mp)return Su;mp=1;var e=Bx(),t=_c(),r=Ox(),n=NaN,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;function f(d){if(typeof d=="number")return d;if(r(d))return n;if(t(d)){var m=typeof d.valueOf=="function"?d.valueOf():d;d=t(m)?m+"":m}if(typeof d!="string")return d===0?d:+d;d=e(d);var g=a.test(d);return g||l.test(d)?u(d.slice(2),g?2:8):o.test(d)?n:+d}return Su=f,Su}var Au,gp;function xg(){if(gp)return Au;gp=1;var e=_c(),t=Sx(),r=Mx(),n="Expected a function",o=Math.max,a=Math.min;function l(u,f,d){var m,g,v,y,b,C,p=0,S=!1,B=!1,k=!0;if(typeof u!="function")throw new TypeError(n);f=r(f)||0,e(d)&&(S=!!d.leading,B="maxWait"in d,v=B?o(r(d.maxWait)||0,f):v,k="trailing"in d?!!d.trailing:k);function $(G){var _=m,j=g;return m=g=void 0,p=G,y=u.apply(j,_),y}function T(G){return p=G,b=setTimeout(P,f),S?$(G):y}function O(G){var _=G-C,j=G-p,W=f-_;return B?a(W,v-j):W}function F(G){var _=G-C,j=G-p;return C===void 0||_>=f||_<0||B&&j>=v}function P(){var G=t();if(F(G))return N(G);b=setTimeout(P,O(G))}function N(G){return b=void 0,k&&m?$(G):(m=g=void 0,y)}function q(){b!==void 0&&clearTimeout(b),p=0,m=C=g=b=void 0}function R(){return b===void 0?y:N(t())}function X(){var G=t(),_=F(G);if(m=arguments,g=this,C=G,_){if(b===void 0)return T(C);if(B)return clearTimeout(b),b=setTimeout(P,f),$(C)}return b===void 0&&(b=setTimeout(P,f)),y}return X.cancel=q,X.flush=R,X}return Au=l,Au}var Ix=xg();const Rx=Ii(Ix);var Bu,vp;function Px(){if(vp)return Bu;vp=1;var e=xg(),t=_c(),r="Expected a function";function n(o,a,l){var u=!0,f=!0;if(typeof o!="function")throw new TypeError(r);return t(l)&&(u="leading"in l?!!l.leading:u,f="trailing"in l?!!l.trailing:f),e(o,a,{leading:u,maxWait:a,trailing:f})}return Bu=n,Bu}var zx=Px();const _x=Ii(zx),bp=e=>typeof e=="object"&&e!=null&&e.nodeType===1,yp=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Qi=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const r=getComputedStyle(e,null);return yp(r.overflowY,t)||yp(r.overflowX,t)||(n=>{const o=(a=>{if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}})(n);return!!o&&(o.clientHeight<n.scrollHeight||o.clientWidth<n.scrollWidth)})(e)}return!1},es=(e,t,r,n,o,a,l,u)=>a<e&&l>t||a>e&&l<t?0:a<=e&&u<=r||l>=t&&u>=r?a-e-n:l>t&&u<r||a<e&&u>r?l-t+o:0,jx=e=>e.parentElement??(e.getRootNode().host||null),xp=(e,t)=>{var r,n,o,a;if(typeof document>"u")return[];const{scrollMode:l,block:u,inline:f,boundary:d,skipOverflowHiddenElements:m}=t,g=typeof d=="function"?d:W=>W!==d;if(!bp(e))throw new TypeError("Invalid target");const v=document.scrollingElement||document.documentElement,y=[];let b=e;for(;bp(b)&&g(b);){if(b=jx(b),b===v){y.push(b);break}b!=null&&b===document.body&&Qi(b)&&!Qi(document.documentElement)||b!=null&&Qi(b,m)&&y.push(b)}const C=(n=(r=window.visualViewport)==null?void 0:r.width)!=null?n:innerWidth,p=(a=(o=window.visualViewport)==null?void 0:o.height)!=null?a:innerHeight,{scrollX:S,scrollY:B}=window,{height:k,width:$,top:T,right:O,bottom:F,left:P}=e.getBoundingClientRect(),{top:N,right:q,bottom:R,left:X}=(W=>{const U=window.getComputedStyle(W);return{top:parseFloat(U.scrollMarginTop)||0,right:parseFloat(U.scrollMarginRight)||0,bottom:parseFloat(U.scrollMarginBottom)||0,left:parseFloat(U.scrollMarginLeft)||0}})(e);let G=u==="start"||u==="nearest"?T-N:u==="end"?F+R:T+k/2-N+R,_=f==="center"?P+$/2-X+q:f==="end"?O+q:P-X;const j=[];for(let W=0;W<y.length;W++){const U=y[W],{height:ee,width:V,top:Y,right:fe,bottom:be,left:he}=U.getBoundingClientRect();if(l==="if-needed"&&T>=0&&P>=0&&F<=p&&O<=C&&(U===v&&!Qi(U)||T>=Y&&F<=be&&P>=he&&O<=fe))return j;const De=getComputedStyle(U),$e=parseInt(De.borderLeftWidth,10),Z=parseInt(De.borderTopWidth,10),ie=parseInt(De.borderRightWidth,10),le=parseInt(De.borderBottomWidth,10);let ue=0,Se=0;const Be="offsetWidth"in U?U.offsetWidth-U.clientWidth-$e-ie:0,ge="offsetHeight"in U?U.offsetHeight-U.clientHeight-Z-le:0,Ee="offsetWidth"in U?U.offsetWidth===0?0:V/U.offsetWidth:0,Ae="offsetHeight"in U?U.offsetHeight===0?0:ee/U.offsetHeight:0;if(v===U)ue=u==="start"?G:u==="end"?G-p:u==="nearest"?es(B,B+p,p,Z,le,B+G,B+G+k,k):G-p/2,Se=f==="start"?_:f==="center"?_-C/2:f==="end"?_-C:es(S,S+C,C,$e,ie,S+_,S+_+$,$),ue=Math.max(0,ue+B),Se=Math.max(0,Se+S);else{ue=u==="start"?G-Y-Z:u==="end"?G-be+le+ge:u==="nearest"?es(Y,be,ee,Z,le+ge,G,G+k,k):G-(Y+ee/2)+ge/2,Se=f==="start"?_-he-$e:f==="center"?_-(he+V/2)+Be/2:f==="end"?_-fe+ie+Be:es(he,fe,V,$e,ie+Be,_,_+$,$);const{scrollLeft:Fe,scrollTop:xe}=U;ue=Ae===0?0:Math.max(0,Math.min(xe+ue/Ae,U.scrollHeight-ee/Ae+ge)),Se=Ee===0?0:Math.max(0,Math.min(Fe+Se/Ee,U.scrollWidth-V/Ee+Be)),G+=xe-ue,_+=Fe-Se}j.push({el:U,top:ue,left:Se})}return j},Lx=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function Hx(e,t){if(!e.isConnected||!(o=>{let a=o;for(;a&&a.parentNode;){if(a.parentNode===document)return!0;a=a.parentNode instanceof ShadowRoot?a.parentNode.host:a.parentNode}return!1})(e))return;const r=(o=>{const a=window.getComputedStyle(o);return{top:parseFloat(a.scrollMarginTop)||0,right:parseFloat(a.scrollMarginRight)||0,bottom:parseFloat(a.scrollMarginBottom)||0,left:parseFloat(a.scrollMarginLeft)||0}})(e);if((o=>typeof o=="object"&&typeof o.behavior=="function")(t))return t.behavior(xp(e,t));const n=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:o,top:a,left:l}of xp(e,Lx(t))){const u=a-r.top+r.bottom,f=l-r.left+r.right;o.scroll({top:u,left:f,behavior:n})}}var Uo=[],Kx=function(){return Uo.some(function(e){return e.activeTargets.length>0})},qx=function(){return Uo.some(function(e){return e.skippedTargets.length>0})},wp="ResizeObserver loop completed with undelivered notifications.",Vx=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:wp}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=wp),window.dispatchEvent(e)},wi;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(wi||(wi={}));var Xo=function(e){return Object.freeze(e)},Wx=(function(){function e(t,r){this.inlineSize=t,this.blockSize=r,Xo(this)}return e})(),wg=(function(){function e(t,r,n,o){return this.x=t,this.y=r,this.width=n,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Xo(this)}return e.prototype.toJSON=function(){var t=this,r=t.x,n=t.y,o=t.top,a=t.right,l=t.bottom,u=t.left,f=t.width,d=t.height;return{x:r,y:n,top:o,right:a,bottom:l,left:u,width:f,height:d}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e})(),jc=function(e){return e instanceof SVGElement&&"getBBox"in e},Cg=function(e){if(jc(e)){var t=e.getBBox(),r=t.width,n=t.height;return!r&&!n}var o=e,a=o.offsetWidth,l=o.offsetHeight;return!(a||l||e.getClientRects().length)},Cp=function(e){var t;if(e instanceof Element)return!0;var r=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(r&&e instanceof r.Element)},Ux=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},ui=typeof window<"u"?window:{},ts=new WeakMap,Dp=/auto|scroll/,Xx=/^tb|vertical/,Gx=/msie|trident/i.test(ui.navigator&&ui.navigator.userAgent),eo=function(e){return parseFloat(e||"0")},xa=function(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=!1),new Wx((r?t:e)||0,(r?e:t)||0)},kp=Xo({devicePixelContentBoxSize:xa(),borderBoxSize:xa(),contentBoxSize:xa(),contentRect:new wg(0,0,0,0)}),Dg=function(e,t){if(t===void 0&&(t=!1),ts.has(e)&&!t)return ts.get(e);if(Cg(e))return ts.set(e,kp),kp;var r=getComputedStyle(e),n=jc(e)&&e.ownerSVGElement&&e.getBBox(),o=!Gx&&r.boxSizing==="border-box",a=Xx.test(r.writingMode||""),l=!n&&Dp.test(r.overflowY||""),u=!n&&Dp.test(r.overflowX||""),f=n?0:eo(r.paddingTop),d=n?0:eo(r.paddingRight),m=n?0:eo(r.paddingBottom),g=n?0:eo(r.paddingLeft),v=n?0:eo(r.borderTopWidth),y=n?0:eo(r.borderRightWidth),b=n?0:eo(r.borderBottomWidth),C=n?0:eo(r.borderLeftWidth),p=g+d,S=f+m,B=C+y,k=v+b,$=u?e.offsetHeight-k-e.clientHeight:0,T=l?e.offsetWidth-B-e.clientWidth:0,O=o?p+B:0,F=o?S+k:0,P=n?n.width:eo(r.width)-O-T,N=n?n.height:eo(r.height)-F-$,q=P+p+T+B,R=N+S+$+k,X=Xo({devicePixelContentBoxSize:xa(Math.round(P*devicePixelRatio),Math.round(N*devicePixelRatio),a),borderBoxSize:xa(q,R,a),contentBoxSize:xa(P,N,a),contentRect:new wg(g,f,P,N)});return ts.set(e,X),X},kg=function(e,t,r){var n=Dg(e,r),o=n.borderBoxSize,a=n.contentBoxSize,l=n.devicePixelContentBoxSize;switch(t){case wi.DEVICE_PIXEL_CONTENT_BOX:return l;case wi.BORDER_BOX:return o;default:return a}},Yx=(function(){function e(t){var r=Dg(t);this.target=t,this.contentRect=r.contentRect,this.borderBoxSize=Xo([r.borderBoxSize]),this.contentBoxSize=Xo([r.contentBoxSize]),this.devicePixelContentBoxSize=Xo([r.devicePixelContentBoxSize])}return e})(),Eg=function(e){if(Cg(e))return 1/0;for(var t=0,r=e.parentNode;r;)t+=1,r=r.parentNode;return t},Zx=function(){var e=1/0,t=[];Uo.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(u){var f=new Yx(u.target),d=Eg(u.target);l.push(f),u.lastReportedSize=kg(u.target,u.observedBox),d<e&&(e=d)}),t.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var r=0,n=t;r<n.length;r++){var o=n[r];o()}return e},Ep=function(e){Uo.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(r){r.isActive()&&(Eg(r.target)>e?t.activeTargets.push(r):t.skippedTargets.push(r))})})},Jx=function(){var e=0;for(Ep(e);Kx();)e=Zx(),Ep(e);return qx()&&Vx(),e>0},Fu,Sg=[],Qx=function(){return Sg.splice(0).forEach(function(e){return e()})},ew=function(e){if(!Fu){var t=0,r=document.createTextNode(""),n={characterData:!0};new MutationObserver(function(){return Qx()}).observe(r,n),Fu=function(){r.textContent="".concat(t?t--:t++)}}Sg.push(e),Fu()},tw=function(e){ew(function(){requestAnimationFrame(e)})},ms=0,rw=function(){return!!ms},nw=250,ow={attributes:!0,characterData:!0,childList:!0,subtree:!0},Sp=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Ap=function(e){return e===void 0&&(e=0),Date.now()+e},Tu=!1,aw=(function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var r=this;if(t===void 0&&(t=nw),!Tu){Tu=!0;var n=Ap(t);tw(function(){var o=!1;try{o=Jx()}finally{if(Tu=!1,t=n-Ap(),!rw())return;o?r.run(1e3):t>0?r.run(t):r.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,r=function(){return t.observer&&t.observer.observe(document.body,ow)};document.body?r():ui.addEventListener("DOMContentLoaded",r)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Sp.forEach(function(r){return ui.addEventListener(r,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Sp.forEach(function(r){return ui.removeEventListener(r,t.listener,!0)}),this.stopped=!0)},e})(),O0=new aw,Bp=function(e){!ms&&e>0&&O0.start(),ms+=e,!ms&&O0.stop()},iw=function(e){return!jc(e)&&!Ux(e)&&getComputedStyle(e).display==="inline"},sw=(function(){function e(t,r){this.target=t,this.observedBox=r||wi.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=kg(this.target,this.observedBox,!0);return iw(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e})(),lw=(function(){function e(t,r){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=r}return e})(),rs=new WeakMap,Fp=function(e,t){for(var r=0;r<e.length;r+=1)if(e[r].target===t)return r;return-1},ns=(function(){function e(){}return e.connect=function(t,r){var n=new lw(t,r);rs.set(t,n)},e.observe=function(t,r,n){var o=rs.get(t),a=o.observationTargets.length===0;Fp(o.observationTargets,r)<0&&(a&&Uo.push(o),o.observationTargets.push(new sw(r,n&&n.box)),Bp(1),O0.schedule())},e.unobserve=function(t,r){var n=rs.get(t),o=Fp(n.observationTargets,r),a=n.observationTargets.length===1;o>=0&&(a&&Uo.splice(Uo.indexOf(n),1),n.observationTargets.splice(o,1),Bp(-1))},e.disconnect=function(t){var r=this,n=rs.get(t);n.observationTargets.slice().forEach(function(o){return r.unobserve(t,o.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e})(),uw=(function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");ns.connect(this,t)}return e.prototype.observe=function(t,r){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Cp(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ns.observe(this,t,r)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Cp(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ns.unobserve(this,t)},e.prototype.disconnect=function(){ns.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e})(),Hn={},Tp;function cw(){if(Tp)return Hn;Tp=1,Object.defineProperty(Hn,"__esModule",{value:!0});for(var e=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),t={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},r={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:e?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},n={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=1;o<20;o++)n["f"+o]=111+o;function a(v,y,b){y&&!("byKey"in y)&&(b=y,y=null),Array.isArray(v)||(v=[v]);var C=v.map(function(B){return f(B,y)}),p=function(B){return C.some(function(k){return d(k,B)})},S=b==null?p:p(b);return S}function l(v,y){return a(v,y)}function u(v,y){return a(v,{byKey:!0},y)}function f(v,y){var b=y&&y.byKey,C={};v=v.replace("++","+add");var p=v.split("+"),S=p.length;for(var B in t)C[t[B]]=!1;var k=!0,$=!1,T=void 0;try{for(var O=p[Symbol.iterator](),F;!(k=(F=O.next()).done);k=!0){var P=F.value,N=P.endsWith("?")&&P.length>1;N&&(P=P.slice(0,-1));var q=g(P),R=t[q];if(P.length>1&&!R&&!r[P]&&!n[q])throw new TypeError('Unknown modifier: "'+P+'"');(S===1||!R)&&(b?C.key=q:C.which=m(P)),R&&(C[R]=N?null:!0)}}catch(X){$=!0,T=X}finally{try{!k&&O.return&&O.return()}finally{if($)throw T}}return C}function d(v,y){for(var b in v){var C=v[b],p=void 0;if(C!=null&&(b==="key"&&y.key!=null?p=y.key.toLowerCase():b==="which"?p=C===91&&y.which===93?91:y.which:p=y[b],!(p==null&&C===!1)&&p!==C))return!1}return!0}function m(v){v=g(v);var y=n[v]||v.toUpperCase().charCodeAt(0);return y}function g(v){return v=v.toLowerCase(),v=r[v]||v,v}return Hn.default=a,Hn.isHotkey=a,Hn.isCodeHotkey=l,Hn.isKeyHotkey=u,Hn.parseHotkey=f,Hn.compareHotkey=d,Hn.toKeyCode=m,Hn.toKeyName=g,Hn}var $u=cw();function dw(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function ka(e,t){if(e==null)return{};var r=dw(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ci(e){"@babel/helpers - typeof";return Ci=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ci(e)}function fw(e,t){if(Ci(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ci(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hw(e){var t=fw(e,"string");return Ci(t)==="symbol"?t:String(t)}function Pn(e,t,r){return t=hw(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Lc=xo(null),Lo=()=>{var e=jo(Lc);if(!e)throw new Error("The `useSlateStatic` hook must be used inside the <Slate> component's context.");return e},Nu,Ou,Ag=parseInt(We.version.split(".")[0],10),Bg=typeof navigator<"u"&&typeof window<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,$p=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),mn=typeof navigator<"u"&&/Android/.test(navigator.userAgent),ga=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),qo=typeof navigator<"u"&&/AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent),pw=typeof navigator<"u"&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),Fg=typeof navigator<"u"&&/Chrome/i.test(navigator.userAgent),mw=typeof navigator<"u"&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),gw=mn&&typeof navigator<"u"&&/Chrome?\/(?:[0-5]?\d)(?:\.)/i.test(navigator.userAgent),vw=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent),bw=typeof navigator<"u"&&/.*UCBrowser/.test(navigator.userAgent),yw=typeof navigator<"u"&&/.*Wechat/.test(navigator.userAgent)&&!/.*MacWechat/.test(navigator.userAgent),gs=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&/Version\/(\d+)/.test(navigator.userAgent)&&(Nu=navigator.userAgent.match(/Version\/(\d+)/))!==null&&Nu!==void 0&&Nu[1]&&parseInt((Ou=navigator.userAgent.match(/Version\/(\d+)/))===null||Ou===void 0?void 0:Ou[1],10)<17;var Ao=(!mw||!gw)&&!pw&&typeof globalThis<"u"&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges=="function",wa=new WeakMap,Hc=new WeakMap,Kc=new WeakMap,Tg=new WeakMap,vs=new WeakMap,M0=new WeakMap,Di=new WeakMap,Go=new WeakMap,Us=new WeakMap,ml=new WeakMap,I0=new WeakMap,Mo=new WeakMap,Vo=new WeakMap,ci=new WeakMap,R0=new WeakMap,qc=new WeakMap,Vn=new WeakMap,mo=new WeakMap,Cn=new WeakMap,$o=new WeakMap,No=new WeakMap,$g=new WeakMap,Ea=Symbol("placeholder"),Ng=Symbol("mark-placeholder"),Og=globalThis.Node,xw=globalThis.Text,Vc=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||null,ww=e=>zo(e)&&e.nodeType===8,In=e=>zo(e)&&e.nodeType===1,zo=e=>{var t=Vc(e);return!!t&&e instanceof t.Node},P0=e=>{var t=e&&e.anchorNode&&Vc(e.anchorNode);return!!t&&e instanceof t.Selection},Mg=e=>zo(e)&&e.nodeType===3,Cw=e=>e.clipboardData&&e.clipboardData.getData("text/plain")!==""&&e.clipboardData.types.length===1,Dw=e=>{var[t,r]=e;if(In(t)&&t.childNodes.length){var n=r===t.childNodes.length,o=n?r-1:r;for([t,o]=Ig(t,o,n?"backward":"forward"),n=o<r;In(t)&&t.childNodes.length;){var a=n?t.childNodes.length-1:0;t=Ew(t,a,n?"backward":"forward")}r=n&&t.textContent!=null?t.textContent.length:0}return[t,r]},kw=e=>{for(var t=e&&e.parentNode;t;){if(t.toString()==="[object ShadowRoot]")return!0;t=t.parentNode}return!1},Ig=(e,t,r)=>{for(var{childNodes:n}=e,o=n[t],a=t,l=!1,u=!1;(ww(o)||In(o)&&o.childNodes.length===0||In(o)&&o.getAttribute("contenteditable")==="false")&&!(l&&u);){if(a>=n.length){l=!0,a=t-1,r="backward";continue}if(a<0){u=!0,a=t+1,r="forward";continue}o=n[a],t=a,a+=r==="forward"?1:-1}return[o,t]},Ew=(e,t,r)=>{var[n]=Ig(e,t,r);return n},Rg=e=>{var t="";if(Mg(e)&&e.nodeValue)return e.nodeValue;if(In(e)){for(var r of Array.from(e.childNodes))t+=Rg(r);var n=getComputedStyle(e).getPropertyValue("display");(n==="block"||n==="list"||e.tagName==="BR")&&(t+=`
103
+ `)}return t},Sw=/data-slate-fragment="(.+?)"/m,Aw=e=>{var t=e.getData("text/html"),[,r]=t.match(Sw)||[];return r},di=e=>e.getSelection!=null?e.getSelection():document.getSelection(),Wc=(e,t,r)=>{var{target:n}=t;if(In(n)&&n.matches('[contentEditable="false"]'))return!1;var{document:o}=Le.getWindow(e);if(o.contains(n))return Le.hasDOMNode(e,n,{editable:!0});var a=r.find(l=>{var{addedNodes:u,removedNodes:f}=l;for(var d of u)if(d===n||d.contains(n))return!0;for(var m of f)if(m===n||m.contains(n))return!0});return!a||a===t?!1:Wc(e,a,r)},Bw=()=>{for(var e=document.activeElement;(t=e)!==null&&t!==void 0&&t.shadowRoot&&(r=e.shadowRoot)!==null&&r!==void 0&&r.activeElement;){var t,r,n;e=(n=e)===null||n===void 0||(n=n.shadowRoot)===null||n===void 0?void 0:n.activeElement}return e},Np=(e,t)=>!!(e.compareDocumentPosition(t)&Og.DOCUMENT_POSITION_PRECEDING),Fw=(e,t)=>!!(e.compareDocumentPosition(t)&Og.DOCUMENT_POSITION_FOLLOWING),Tw=0;class $w{constructor(){Pn(this,"id",void 0),this.id="".concat(Tw++)}}var Le={androidPendingDiffs:e=>Cn.get(e),androidScheduleFlush:e=>{var t;(t=qc.get(e))===null||t===void 0||t()},blur:e=>{var t=Le.toDOMNode(e,e),r=Le.findDocumentOrShadowRoot(e);Mo.set(e,!1),r.activeElement===t&&t.blur()},deselect:e=>{var{selection:t}=e,r=Le.findDocumentOrShadowRoot(e),n=di(r);n&&n.rangeCount>0&&n.removeAllRanges(),t&&Ge.deselect(e)},findDocumentOrShadowRoot:e=>{var t=Le.toDOMNode(e,e),r=t.getRootNode();return r instanceof Document||r instanceof ShadowRoot?r:t.ownerDocument},findEventRange:(e,t)=>{"nativeEvent"in t&&(t=t.nativeEvent);var{clientX:r,clientY:n,target:o}=t;if(r==null||n==null)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var a=Le.toSlateNode(e,t.target),l=Le.findPath(e,a);if(kt.isElement(a)&&z.isVoid(e,a)){var u=o.getBoundingClientRect(),f=e.isInline(a)?r-u.left<u.left+u.width-r:n-u.top<u.top+u.height-n,d=z.point(e,l,{edge:f?"start":"end"}),m=f?z.before(e,d):z.after(e,d);if(m){var g=z.range(e,m);return g}}var v,{document:y}=Le.getWindow(e);if(y.caretRangeFromPoint)v=y.caretRangeFromPoint(r,n);else{var b=y.caretPositionFromPoint(r,n);b&&(v=y.createRange(),v.setStart(b.offsetNode,b.offset),v.setEnd(b.offsetNode,b.offset))}if(!v)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var C=Le.toSlateRange(e,v,{exactMatch:!1,suppressThrow:!1});return C},findKey:(e,t)=>{var r=Us.get(t);return r||(r=new $w,Us.set(t,r)),r},findPath:(e,t)=>{for(var r=[],n=t;;){var o=Kc.get(n);if(o==null){if(z.isEditor(n))return r;break}var a=Hc.get(n);if(a==null)break;r.unshift(a),n=o}throw new Error("Unable to find the path for Slate node: ".concat(en.stringify(t)))},focus:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{retries:5};if(!Mo.get(e)){if(t.retries<=0)throw new Error("Could not set focus, editor seems stuck with pending operations");if(e.operations.length>0){setTimeout(()=>{Le.focus(e,{retries:t.retries-1})},10);return}var r=Le.toDOMNode(e,e),n=Le.findDocumentOrShadowRoot(e);if(n.activeElement!==r){if(e.selection&&n instanceof Document){var o=di(n),a=Le.toDOMRange(e,e.selection);o==null||o.removeAllRanges(),o==null||o.addRange(a)}e.selection||Ge.select(e,z.start(e,[])),Mo.set(e,!0),r.focus({preventScroll:!0})}}},getWindow:e=>{var t=Tg.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},hasDOMNode:function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{editable:n=!1}=r,o=Le.toDOMNode(e,e),a;try{a=In(t)?t:t.parentElement}catch(l){if(l instanceof Error&&!l.message.includes('Permission denied to access property "nodeType"'))throw l}return a?a.closest("[data-slate-editor]")===o&&(!n||a.isContentEditable?!0:typeof a.isContentEditable=="boolean"&&a.closest('[contenteditable="false"]')===o||!!a.getAttribute("data-slate-zero-width")):!1},hasEditableTarget:(e,t)=>zo(t)&&Le.hasDOMNode(e,t,{editable:!0}),hasRange:(e,t)=>{var{anchor:r,focus:n}=t;return z.hasPath(e,r.path)&&z.hasPath(e,n.path)},hasSelectableTarget:(e,t)=>Le.hasEditableTarget(e,t)||Le.isTargetInsideNonReadonlyVoid(e,t),hasTarget:(e,t)=>zo(t)&&Le.hasDOMNode(e,t),insertData:(e,t)=>{e.insertData(t)},insertFragmentData:(e,t)=>e.insertFragmentData(t),insertTextData:(e,t)=>e.insertTextData(t),isComposing:e=>!!Vo.get(e),isFocused:e=>!!Mo.get(e),isReadOnly:e=>!!I0.get(e),isTargetInsideNonReadonlyVoid:(e,t)=>{if(I0.get(e))return!1;var r=Le.hasTarget(e,t)&&Le.toSlateNode(e,t);return kt.isElement(r)&&z.isVoid(e,r)},setFragmentData:(e,t,r)=>e.setFragmentData(t,r),toDOMNode:(e,t)=>{var r=ml.get(e),n=z.isEditor(t)?vs.get(e):r==null?void 0:r.get(Le.findKey(e,t));if(!n)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(en.stringify(t)));return n},toDOMPoint:(e,t)=>{var[r]=z.node(e,t.path),n=Le.toDOMNode(e,r),o;z.void(e,{at:t})&&(t={path:t.path,offset:0});for(var a="[data-slate-string], [data-slate-zero-width]",l=Array.from(n.querySelectorAll(a)),u=0,f=0;f<l.length;f++){var d=l[f],m=d.childNodes[0];if(!(m==null||m.textContent==null)){var{length:g}=m.textContent,v=d.getAttribute("data-slate-length"),y=v==null?g:parseInt(v,10),b=u+y,C=l[f+1];if(t.offset===b&&C!==null&&C!==void 0&&C.hasAttribute("data-slate-mark-placeholder")){var p,S=C.childNodes[0];o=[S instanceof xw?S:C,(p=C.textContent)!==null&&p!==void 0&&p.startsWith("\uFEFF")?1:0];break}if(t.offset<=b){var B=Math.min(g,Math.max(0,t.offset-u));o=[m,B];break}u=b}}if(!o)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(en.stringify(t)));return o},toDOMRange:(e,t)=>{var{anchor:r,focus:n}=t,o=Oe.isBackward(t),a=Le.toDOMPoint(e,r),l=Oe.isCollapsed(t)?a:Le.toDOMPoint(e,n),u=Le.getWindow(e),f=u.document.createRange(),[d,m]=o?l:a,[g,v]=o?a:l,y=In(d)?d:d.parentElement,b=!!y.getAttribute("data-slate-zero-width"),C=In(g)?g:g.parentElement,p=!!C.getAttribute("data-slate-zero-width");return f.setStart(d,b?1:m),f.setEnd(g,p?1:v),f},toSlateNode:(e,t)=>{var r=In(t)?t:t.parentElement;r&&!r.hasAttribute("data-slate-node")&&(r=r.closest("[data-slate-node]"));var n=r?Di.get(r):null;if(!n)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(r));return n},toSlatePoint:(e,t,r)=>{var{exactMatch:n,suppressThrow:o,searchDirection:a="backward"}=r,[l,u]=n?t:Dw(t),f=l.parentNode,d=null,m=0;if(f){var g,v,y=Le.toDOMNode(e,e),b=f.closest('[data-slate-void="true"]'),C=b&&y.contains(b)?b:null,p=f.closest('[contenteditable="false"]'),S=p&&y.contains(p)?p:null,B=f.closest("[data-slate-leaf]"),k=null;if(B){if(d=B.closest('[data-slate-node="text"]'),d){var $=Le.getWindow(e),T=$.document.createRange();T.setStart(d,0),T.setEnd(l,u);var O=T.cloneContents(),F=[...Array.prototype.slice.call(O.querySelectorAll("[data-slate-zero-width]")),...Array.prototype.slice.call(O.querySelectorAll("[contenteditable=false]"))];F.forEach(he=>{if(mn&&!n&&he.hasAttribute("data-slate-zero-width")&&he.textContent.length>0&&he.textContext!=="\uFEFF"){he.textContent.startsWith("\uFEFF")&&(he.textContent=he.textContent.slice(1));return}he.parentNode.removeChild(he)}),m=O.textContent.length,k=d}}else if(C){for(var P=C.querySelectorAll("[data-slate-leaf]"),N=0;N<P.length;N++){var q=P[N];if(Le.hasDOMNode(e,q)){B=q;break}}B?(d=B.closest('[data-slate-node="text"]'),k=B,m=k.textContent.length,k.querySelectorAll("[data-slate-zero-width]").forEach(he=>{m-=he.textContent.length})):m=1}else if(S){var R=he=>he?he.querySelectorAll("[data-slate-leaf]:not(:scope [data-slate-editor] [data-slate-leaf])"):[],X=S.closest('[data-slate-node="element"]');if(a==="forward"){var G,_=[...R(X),...R(X==null?void 0:X.nextElementSibling)];B=(G=_.find(he=>Fw(S,he)))!==null&&G!==void 0?G:null}else{var j,W=[...R(X==null?void 0:X.previousElementSibling),...R(X)];B=(j=W.findLast(he=>Np(S,he)))!==null&&j!==void 0?j:null}B&&(d=B.closest('[data-slate-node="text"]'),k=B,a==="forward"?m=0:(m=k.textContent.length,k.querySelectorAll("[data-slate-zero-width]").forEach(he=>{m-=he.textContent.length})))}k&&m===k.textContent.length&&mn&&k.getAttribute("data-slate-zero-width")==="z"&&(g=k.textContent)!==null&&g!==void 0&&g.startsWith("\uFEFF")&&(f.hasAttribute("data-slate-zero-width")||ga&&(v=k.textContent)!==null&&v!==void 0&&v.endsWith(`
104
+
105
+ `))&&m--}if(mn&&!d&&!n){var U=f.hasAttribute("data-slate-node")?f:f.closest("[data-slate-node]");if(U&&Le.hasDOMNode(e,U,{editable:!0})){var ee=Le.toSlateNode(e,U),{path:V,offset:Y}=z.start(e,Le.findPath(e,ee));return U.querySelector("[data-slate-leaf]")||(Y=u),{path:V,offset:Y}}}if(!d){if(o)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}var fe=Le.toSlateNode(e,d),be=Le.findPath(e,fe);return{path:be,offset:m}},toSlateRange:(e,t,r)=>{var n,{exactMatch:o,suppressThrow:a}=r,l=P0(t)?t.anchorNode:t.startContainer,u,f,d,m,g;if(l)if(P0(t)){if(ga&&t.rangeCount>1){d=t.focusNode;var v=t.getRangeAt(0),y=t.getRangeAt(t.rangeCount-1);if(d instanceof HTMLTableRowElement&&v.startContainer instanceof HTMLTableRowElement&&y.startContainer instanceof HTMLTableRowElement){let O=function(F){return F.childElementCount>0?O(F.children[0]):F};var b=v.startContainer,C=y.startContainer,p=O(b.children[v.startOffset]),S=O(C.children[y.startOffset]);m=0,S.childNodes.length>0?u=S.childNodes[0]:u=S,p.childNodes.length>0?d=p.childNodes[0]:d=p,S instanceof HTMLElement?f=S.innerHTML.length:f=0}else v.startContainer===d?(u=y.endContainer,f=y.endOffset,m=v.startOffset):(u=v.startContainer,f=v.endOffset,m=y.startOffset)}else u=t.anchorNode,f=t.anchorOffset,d=t.focusNode,m=t.focusOffset;Fg&&kw(u)||ga?g=t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:g=t.isCollapsed}else u=t.startContainer,f=t.startOffset,d=t.endContainer,m=t.endOffset,g=t.collapsed;if(u==null||d==null||f==null||m==null)throw new Error("Cannot resolve a Slate range from DOM range: ".concat(t));ga&&(n=d.textContent)!==null&&n!==void 0&&n.endsWith(`
106
+
107
+ `)&&m===d.textContent.length&&m--;var B=Le.toSlatePoint(e,[u,f],{exactMatch:o,suppressThrow:a});if(!B)return null;var k=Np(u,d)||u===d&&m<f,$=g?B:Le.toSlatePoint(e,[d,m],{exactMatch:o,suppressThrow:a,searchDirection:k?"forward":"backward"});if(!$)return null;var T={anchor:B,focus:$};return Oe.isExpanded(T)&&Oe.isForward(T)&&In(d)&&z.void(e,{at:T.focus,mode:"highest"})&&(T=z.unhangRange(e,T,{voids:!0})),T}};function Nw(e,t){var{path:r,diff:n}=t;if(!z.hasPath(e,r))return!1;var o=at.get(e,r);if(!Ct.isText(o))return!1;if(n.start!==o.text.length||n.text.length===0)return o.text.slice(n.start,n.start+n.text.length)===n.text;var a=de.next(r);if(!z.hasPath(e,a))return!1;var l=at.get(e,a);return Ct.isText(l)&&l.text.startsWith(n.text)}function Pg(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return r.reduce((o,a)=>o.slice(0,a.start)+a.text+o.slice(a.end),e)}function Ow(e,t){for(var r=Math.min(e.length,t.length),n=0;n<r;n++)if(e.charAt(n)!==t.charAt(n))return n;return r}function Mw(e,t,r){for(var n=Math.min(e.length,t.length,r),o=0;o<n;o++)if(e.charAt(e.length-o-1)!==t.charAt(t.length-o-1))return o;return n}function zg(e,t){var{start:r,end:n,text:o}=t,a=e.slice(r,n),l=Ow(a,o),u=Math.min(a.length-l,o.length-l),f=Mw(a,o,u),d={start:r+l,end:n-f,text:o.slice(l,o.length-f)};return d.start===d.end&&d.text.length===0?null:d}function Iw(e,t,r){var n=Math.min(t.start,r.start),o=Math.max(0,Math.min(t.start+t.text.length,r.end)-r.start),a=Pg(e,t,r),l=Math.max(r.start+r.text.length,t.start+t.text.length+(t.start+t.text.length>r.start?r.text.length:0)-o),u=a.slice(n,l),f=Math.max(t.end,r.end-t.text.length+(t.end-t.start));return zg(e,{start:n,end:f,text:u})}function Rw(e){var{path:t,diff:r}=e;return{anchor:{path:t,offset:r.start},focus:{path:t,offset:r.end}}}function z0(e,t){var{path:r,offset:n}=t;if(!z.hasPath(e,r))return null;var o=at.get(e,r);if(!Ct.isText(o))return null;var a=z.above(e,{match:u=>kt.isElement(u)&&z.isBlock(e,u),at:r});if(!a)return null;for(;n>o.text.length;){var l=z.next(e,{at:r,match:Ct.isText});if(!l||!de.isDescendant(l[1],a[1]))return null;n-=o.text.length,o=l[0],r=l[1]}return{path:r,offset:n}}function Op(e,t){var r=z0(e,t.anchor);if(!r)return null;if(Oe.isCollapsed(t))return{anchor:r,focus:r};var n=z0(e,t.focus);return n?{anchor:r,focus:n}:null}function _0(e,t,r){var n=Cn.get(e),o=n==null?void 0:n.find(m=>{var{path:g}=m;return de.equals(g,t.path)});if(!o||t.offset<=o.diff.start)return er.transform(t,r,{affinity:"backward"});var{diff:a}=o;if(t.offset<=a.start+a.text.length){var l={path:t.path,offset:a.start},u=er.transform(l,r,{affinity:"backward"});return u?{path:u.path,offset:u.offset+t.offset-a.start}:null}var f={path:t.path,offset:t.offset-a.text.length+a.end-a.start},d=er.transform(f,r,{affinity:"backward"});return d?r.type==="split_node"&&de.equals(r.path,t.path)&&f.offset<r.position&&a.start<r.position?d:{path:d.path,offset:d.offset+a.text.length-a.end+a.start}:null}function Mp(e,t,r){var n=_0(e,t.anchor,r);if(!n)return null;if(Oe.isCollapsed(t))return{anchor:n,focus:n};var o=_0(e,t.focus,r);return o?{anchor:n,focus:o}:null}function Pw(e,t){var{path:r,diff:n,id:o}=e;switch(t.type){case"insert_text":return!de.equals(t.path,r)||t.offset>=n.end?e:t.offset<=n.start?{diff:{start:t.text.length+n.start,end:t.text.length+n.end,text:n.text},id:o,path:r}:{diff:{start:n.start,end:n.end+t.text.length,text:n.text},id:o,path:r};case"remove_text":return!de.equals(t.path,r)||t.offset>=n.end?e:t.offset+t.text.length<=n.start?{diff:{start:n.start-t.text.length,end:n.end-t.text.length,text:n.text},id:o,path:r}:{diff:{start:n.start,end:n.end-t.text.length,text:n.text},id:o,path:r};case"split_node":return!de.equals(t.path,r)||t.position>=n.end?{diff:n,id:o,path:de.transform(r,t,{affinity:"backward"})}:t.position>n.start?{diff:{start:n.start,end:Math.min(t.position,n.end),text:n.text},id:o,path:r}:{diff:{start:n.start-t.position,end:n.end-t.position,text:n.text},id:o,path:de.transform(r,t,{affinity:"forward"})};case"merge_node":return de.equals(t.path,r)?{diff:{start:n.start+t.position,end:n.end+t.position,text:n.text},id:o,path:de.transform(r,t)}:{diff:n,id:o,path:de.transform(r,t)}}var a=de.transform(r,t);return a?{diff:n,path:a,id:o}:null}function Ip(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function os(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ip(Object(r),!0).forEach(function(n){Pn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ip(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var zw=25,_w=200,jw=function(){},Lw=e=>(e==null?void 0:e.constructor.name)==="DataTransfer";function Hw(e){var{editor:t,scheduleOnDOMSelectionChange:r,onDOMSelectionChange:n}=e,o=!1,a=null,l=null,u=null,f=0,d=!1,m=()=>{var X=No.get(t);if(No.delete(t),X){var{selection:G}=t,_=Op(t,X);_&&(!G||!Oe.equals(_,G))&&Ge.select(t,_)}},g=()=>{var X=$o.get(t);if($o.delete(t),!!X){if(X.at){var G=er.isPoint(X.at)?z0(t,X.at):Op(t,X.at);if(!G)return;var _=z.range(t,G);(!t.selection||!Oe.equals(t.selection,_))&&Ge.select(t,G)}X.run()}},v=()=>{if(l&&(clearTimeout(l),l=null),u&&(clearTimeout(u),u=null),!$()&&!k()){m();return}o||(o=!0,setTimeout(()=>o=!1)),k()&&(o="action");var X=t.selection&&z.rangeRef(t,t.selection,{affinity:"forward"});mo.set(t,t.marks),jw("flush",$o.get(t),Cn.get(t));for(var G=$(),_;_=(j=Cn.get(t))===null||j===void 0?void 0:j[0];){var j,W,U=Vn.get(t);U!==void 0&&(Vn.delete(t),t.marks=U),U&&d===!1&&(d=null);var ee=Rw(_);(!t.selection||!Oe.equals(t.selection,ee))&&Ge.select(t,ee),_.diff.text?z.insertText(t,_.diff.text):z.deleteFragment(t),Cn.set(t,(W=Cn.get(t))===null||W===void 0?void 0:W.filter(fe=>{var{id:be}=fe;return be!==_.id})),Nw(t,_)||(G=!1,$o.delete(t),mo.delete(t),o="action",No.delete(t),r.cancel(),n.cancel(),X==null||X.unref())}var V=X==null?void 0:X.unref();if(V&&!No.get(t)&&(!t.selection||!Oe.equals(V,t.selection))&&Ge.select(t,V),k()){g();return}G&&r(),r.flush(),n.flush(),m();var Y=mo.get(t);mo.delete(t),Y!==void 0&&(t.marks=Y,t.onChange())},y=X=>{a&&clearTimeout(a),a=setTimeout(()=>{Vo.set(t,!1),v()},zw)},b=X=>{Vo.set(t,!0),a&&(clearTimeout(a),a=null)},C=function(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,G=M0.get(t);if(G){if($()||X){G.style.display="none";return}G.style.removeProperty("display")}},p=(X,G)=>{var _,j=(_=Cn.get(t))!==null&&_!==void 0?_:[];Cn.set(t,j);var W=at.leaf(t,X),U=j.findIndex(Y=>de.equals(Y.path,X));if(U<0){var ee=zg(W.text,G);ee&&j.push({path:X,diff:G,id:f++}),C();return}var V=Iw(W.text,j[U].diff,G);if(!V){j.splice(U,1),C();return}j[U]=os(os({},j[U]),{},{diff:V})},S=function(X){var{at:G}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};d=!1,No.delete(t),r.cancel(),n.cancel(),k()&&v(),$o.set(t,{at:G,run:X}),u=setTimeout(v)},B=X=>{var G;if(l&&(clearTimeout(l),l=null),!wa.get(t)){var{inputType:_}=X,j=null,W=X.dataTransfer||X.data||void 0;d!==!1&&_!=="insertText"&&_!=="insertCompositionText"&&(d=!1);var[U]=X.getTargetRanges();U&&(j=Le.toSlateRange(t,U,{exactMatch:!1,suppressThrow:!0}));var ee=Le.getWindow(t),V=ee.getSelection();if(!j&&V&&(U=V,j=Le.toSlateRange(t,V,{exactMatch:!1,suppressThrow:!0})),j=(G=j)!==null&&G!==void 0?G:t.selection,!!j){var Y=!0;if(_.startsWith("delete")){if(Oe.isExpanded(j)){var[fe,be]=Oe.edges(j),he=at.leaf(t,fe.path);if(he.text.length===fe.offset&&be.offset===0){var De=z.next(t,{at:fe.path,match:Ct.isText});De&&de.equals(De[1],be.path)&&(j={anchor:be,focus:be})}}var $e=_.endsWith("Backward")?"backward":"forward",[Z,ie]=Oe.edges(j),[le,ue]=z.leaf(t,Z.path),Se={text:"",start:Z.offset,end:ie.offset},Be=Cn.get(t),ge=Be==null?void 0:Be.find($t=>de.equals($t.path,ue)),Ee=ge?[ge.diff,Se]:[Se],Ae=Pg(le.text,...Ee);if(Ae.length===0&&(Y=!1),Oe.isExpanded(j)){if(Y&&de.equals(j.anchor.path,j.focus.path)){var Fe={path:j.anchor.path,offset:Z.offset},xe=z.range(t,Fe,Fe);return F(xe),p(j.anchor.path,{text:"",end:ie.offset,start:Z.offset})}return S(()=>z.deleteFragment(t,{direction:$e}),{at:j})}}switch(_){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":return S(()=>z.deleteFragment(t),{at:j});case"deleteContent":case"deleteContentForward":{var{anchor:Ce}=j;if(Y&&Oe.isCollapsed(j)){var _e=at.leaf(t,Ce.path);if(Ce.offset<_e.text.length)return p(Ce.path,{text:"",start:Ce.offset,end:Ce.offset+1})}return S(()=>z.deleteForward(t),{at:j})}case"deleteContentBackward":{var ht,{anchor:ot}=j,Ie=P0(U)?U.isCollapsed:!!((ht=U)!==null&&ht!==void 0&&ht.collapsed);return Y&&Ie&&Oe.isCollapsed(j)&&ot.offset>0?p(ot.path,{text:"",start:ot.offset-1,end:ot.offset}):S(()=>z.deleteBackward(t),{at:j})}case"deleteEntireSoftLine":return S(()=>{z.deleteBackward(t,{unit:"line"}),z.deleteForward(t,{unit:"line"})},{at:j});case"deleteHardLineBackward":return S(()=>z.deleteBackward(t,{unit:"block"}),{at:j});case"deleteSoftLineBackward":return S(()=>z.deleteBackward(t,{unit:"line"}),{at:j});case"deleteHardLineForward":return S(()=>z.deleteForward(t,{unit:"block"}),{at:j});case"deleteSoftLineForward":return S(()=>z.deleteForward(t,{unit:"line"}),{at:j});case"deleteWordBackward":return S(()=>z.deleteBackward(t,{unit:"word"}),{at:j});case"deleteWordForward":return S(()=>z.deleteForward(t,{unit:"word"}),{at:j});case"insertLineBreak":return S(()=>z.insertSoftBreak(t),{at:j});case"insertParagraph":return S(()=>z.insertBreak(t),{at:j});case"insertCompositionText":case"deleteCompositionText":case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{if(Lw(W))return S(()=>Le.insertData(t,W),{at:j});var Ke=W??"";if(Vn.get(t)&&(Ke=Ke.replace("\uFEFF","")),_==="insertText"&&/.*\n.*\n$/.test(Ke)&&(Ke=Ke.slice(0,-1)),Ke.includes(`
108
+ `))return S(()=>{var $t=Ke.split(`
109
+ `);$t.forEach((Bt,Mt)=>{Bt&&z.insertText(t,Bt),Mt!==$t.length-1&&z.insertSoftBreak(t)})},{at:j});if(de.equals(j.anchor.path,j.focus.path)){var[Ue,vt]=Oe.edges(j),tt={start:Ue.offset,end:vt.offset,text:Ke};if(Ke&&d&&_==="insertCompositionText"){var nt=d.start+d.text.search(/\S|$/),It=tt.start+tt.text.search(/\S|$/);It===nt+1&&tt.end===d.start+d.text.length?(tt.start-=1,d=null,q()):d=!1}else _==="insertText"?d===null?d=tt:d&&Oe.isCollapsed(j)&&d.end+d.text.length===Ue.offset?d=os(os({},d),{},{text:d.text+Ke}):d=!1:d=!1;if(Y){p(Ue.path,tt);return}}return S(()=>z.insertText(t,Ke),{at:j})}}}}},k=()=>!!$o.get(t),$=()=>{var X;return!!((X=Cn.get(t))!==null&&X!==void 0&&X.length)},T=()=>k()||$(),O=()=>o,F=X=>{No.set(t,X),l&&(clearTimeout(l),l=null);var{selection:G}=t;if(X){var _=!G||!de.equals(G.anchor.path,X.anchor.path),j=!G||!de.equals(G.anchor.path.slice(0,-1),X.anchor.path.slice(0,-1));(_&&d||j)&&(d=!1),(_||$())&&(l=setTimeout(v,_w))}},P=()=>{(k()||!$())&&v()},N=X=>{$()||(C(!0),setTimeout(C))},q=()=>{k()||(u=setTimeout(v))},R=X=>{if(!($()||k())&&X.some(_=>Wc(t,_,X))){var G;(G=$g.get(t))===null||G===void 0||G()}};return{flush:v,scheduleFlush:q,hasPendingDiffs:$,hasPendingAction:k,hasPendingChanges:T,isFlushing:O,handleUserSelect:F,handleCompositionEnd:y,handleCompositionStart:b,handleDOMBeforeInput:B,handleKeyDown:N,handleDomMutations:R,handleInput:P}}function Kw(){var e=Vt(!1);return sr(()=>(e.current=!0,()=>{e.current=!1}),[]),e.current}var ki=gs?z4:sr;function qw(e,t,r){var[n]=Ht(()=>new MutationObserver(t));ki(()=>{n.takeRecords()}),sr(()=>{if(!e.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");return n.observe(e.current,r),()=>n.disconnect()},[n,e,r])}var Vw=["node"];function Rp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ww(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rp(Object(r),!0).forEach(function(n){Pn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Uw={subtree:!0,childList:!0,characterData:!0},Xw=mn?e=>{var{node:t}=e,r=ka(e,Vw);if(!mn)return null;var n=Lo(),o=Kw(),[a]=Ht(()=>Hw(Ww({editor:n},r)));return qw(t,a.handleDomMutations,Uw),qc.set(n,a.scheduleFlush),o&&a.flush(),a}:()=>null,Gw=["anchor","focus"],Yw=["anchor","focus"],Zw=(e,t)=>Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(r=>t.hasOwnProperty(r)&&e[r]===t[r]),_g=(e,t)=>{var r=ka(e,Gw),n=ka(t,Yw);return e[Ea]===t[Ea]&&Zw(r,n)},Jw=(e,t)=>{if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++){var n=e[r],o=t[r];if(!Oe.equals(n,o)||!_g(n,o))return!1}return!0},Qw=(e,t)=>{if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++){var n=e[r],o=t[r];if(n.anchor.offset!==o.anchor.offset||n.focus.offset!==o.focus.offset||!_g(n,o))return!1}return!0};function Pp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function eC(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pp(Object(r),!0).forEach(function(n){Pn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var tC=e=>{var{isLast:t,leaf:r,parent:n,text:o}=e,a=Lo(),l=Le.findPath(a,o),u=de.parent(l),f=!!r[Ng];return a.isVoid(n)?We.createElement(Mu,{length:at.string(n).length}):r.text===""&&n.children[n.children.length-1]===o&&!a.isInline(n)&&z.string(a,u)===""?We.createElement(Mu,{isLineBreak:!0,isMarkPlaceholder:f}):r.text===""?We.createElement(Mu,{isMarkPlaceholder:f}):t&&r.text.slice(-1)===`
110
+ `?We.createElement(zp,{isTrailing:!0,text:r.text}):We.createElement(zp,{text:r.text})},zp=e=>{var{text:t,isTrailing:r=!1}=e,n=Vt(null),o=()=>"".concat(t??"").concat(r?`
111
+ `:""),[a]=Ht(o);return ki(()=>{var l=o();n.current&&n.current.textContent!==l&&(n.current.textContent=l)}),We.createElement(rC,{ref:n},a)},rC=L4(_o((e,t)=>We.createElement("span",{"data-slate-string":!0,ref:t},e.children))),Mu=e=>{var{length:t=0,isLineBreak:r=!1,isMarkPlaceholder:n=!1}=e,o={"data-slate-zero-width":r?"n":"z","data-slate-length":t};return n&&(o["data-slate-mark-placeholder"]=!0),We.createElement("span",eC({},o),!(mn||Bg)||!r?"\uFEFF":null,r?We.createElement("br",null):null)};function _p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function jg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_p(Object(r),!0).forEach(function(n){Pn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_p(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var nC=mn?300:0;function oC(e,t){e.current&&(e.current.disconnect(),t&&(e.current=null))}function jp(e){e.current&&(clearTimeout(e.current),e.current=null)}var aC=e=>{var{leaf:t,isLast:r,text:n,parent:o,renderPlaceholder:a,renderLeaf:l=B=>We.createElement(sC,jg({},B))}=e,u=Lo(),f=Vt(null),d=Vt(null),[m,g]=Ht(!1),v=Vt(null),y=zt(B=>{if(oC(f,B==null),B==null){var k;M0.delete(u),(k=t.onPlaceholderResize)===null||k===void 0||k.call(t,null)}else{if(M0.set(u,B),!f.current){var $=window.ResizeObserver||uw;f.current=new $(()=>{var T;(T=t.onPlaceholderResize)===null||T===void 0||T.call(t,B)})}f.current.observe(B),d.current=B}},[d,t,u]),b=We.createElement(tC,{isLast:r,leaf:t,parent:o,text:n}),C=!!t[Ea];if(sr(()=>(C?v.current||(v.current=setTimeout(()=>{g(!0),v.current=null},nC)):(jp(v),g(!1)),()=>jp(v)),[C,g]),C&&m){var p={children:t.placeholder,attributes:{"data-slate-placeholder":!0,style:{position:"absolute",top:0,pointerEvents:"none",width:"100%",maxWidth:"100%",display:"block",opacity:"0.333",userSelect:"none",textDecoration:"none",WebkitUserModify:qo?"inherit":void 0},contentEditable:!1,ref:y}};b=We.createElement(We.Fragment,null,a(p),b)}var S={"data-slate-leaf":!0};return l({attributes:S,children:b,leaf:t,text:n})},iC=We.memo(aC,(e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&Ct.equals(t.leaf,e.leaf)&&t.leaf[Ea]===e.leaf[Ea]),sC=e=>{var{attributes:t,children:r}=e;return We.createElement("span",jg({},t),r)},lC=e=>{for(var{decorations:t,isLast:r,parent:n,renderPlaceholder:o,renderLeaf:a,text:l}=e,u=Lo(),f=Vt(null),d=Ct.decorations(l,t),m=Le.findKey(u,l),g=[],v=0;v<d.length;v++){var y=d[v];g.push(We.createElement(iC,{isLast:r&&v===d.length-1,key:"".concat(m.id,"-").concat(v),renderPlaceholder:o,leaf:y,text:l,parent:n,renderLeaf:a}))}var b=zt(C=>{var p=ml.get(u);C?(p==null||p.set(m,C),Go.set(l,C),Di.set(C,l)):(p==null||p.delete(m),Go.delete(l),f.current&&Di.delete(f.current)),f.current=C},[f,u,m,l]);return We.createElement("span",{"data-slate-node":"text",ref:b},g)},Lg=We.memo(lC,(e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&Qw(t.decorations,e.decorations));function Lp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function j0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lp(Object(r),!0).forEach(function(n){Pn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var uC=e=>{var{decorations:t,element:r,renderElement:n=B=>We.createElement(dC,j0({},B)),renderPlaceholder:o,renderLeaf:a,selection:l}=e,u=Lo(),f=pC(),d=u.isInline(r),m=Le.findKey(u,r),g=zt(B=>{var k=ml.get(u);B?(k==null||k.set(m,B),Go.set(r,B),Di.set(B,r)):(k==null||k.delete(m),Go.delete(r))},[u,m,r]),v=Kg({decorations:t,node:r,renderElement:n,renderPlaceholder:o,renderLeaf:a,selection:l}),y={"data-slate-node":"element",ref:g};if(d&&(y["data-slate-inline"]=!0),!d&&z.hasInlines(u,r)){var b=at.string(r),C=vg(b);C==="rtl"&&(y.dir=C)}if(z.isVoid(u,r)){y["data-slate-void"]=!0,!f&&d&&(y.contentEditable=!1);var p=d?"span":"div",[[S]]=at.texts(r);v=We.createElement(p,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},We.createElement(Lg,{renderPlaceholder:o,decorations:[],isLast:!1,parent:r,text:S})),Hc.set(S,0),Kc.set(S,r)}return n({attributes:y,children:v,element:r})},cC=We.memo(uC,(e,t)=>e.element===t.element&&e.renderElement===t.renderElement&&e.renderLeaf===t.renderLeaf&&e.renderPlaceholder===t.renderPlaceholder&&Jw(e.decorations,t.decorations)&&(e.selection===t.selection||!!e.selection&&!!t.selection&&Oe.equals(e.selection,t.selection))),dC=e=>{var{attributes:t,children:r,element:n}=e,o=Lo(),a=o.isInline(n)?"span":"div";return We.createElement(a,j0(j0({},t),{},{style:{position:"relative"}}),r)},Hg=xo(()=>[]),fC=()=>jo(Hg),hC=xo(!1),Kg=e=>{var{decorations:t,node:r,renderElement:n,renderPlaceholder:o,renderLeaf:a,selection:l}=e,u=fC(),f=Lo();wa.set(f,!1);for(var d=Le.findPath(f,r),m=[],g=kt.isElement(r)&&!f.isInline(r)&&z.hasInlines(f,r),v=0;v<r.children.length;v++){var y=d.concat(v),b=r.children[v],C=Le.findKey(f,b),p=z.range(f,y),S=l&&Oe.intersection(p,l),B=u([b,y]);for(var k of t){var $=Oe.intersection(k,p);$&&B.push($)}kt.isElement(b)?m.push(We.createElement(hC.Provider,{key:"provider-".concat(C.id),value:!!S},We.createElement(cC,{decorations:B,element:b,key:C.id,renderElement:n,renderPlaceholder:o,renderLeaf:a,selection:S}))):m.push(We.createElement(Lg,{decorations:B,key:C.id,isLast:g&&v===r.children.length-1,parent:r,renderPlaceholder:o,renderLeaf:a,text:b})),Hc.set(b,v),Kc.set(b,r)}return m},qg=xo(!1),pC=()=>jo(qg),Vg=xo(null),Wg=()=>{var e=jo(Vg);if(!e)throw new Error("The `useSlate` hook must be used inside the <Slate> component's context.");var{editor:t}=e;return t};function mC(){var e=Lo(),t=Vt(!1),r=Vt(0),n=zt(()=>{if(!t.current){t.current=!0;var o=Le.getWindow(e);o.cancelAnimationFrame(r.current),r.current=o.requestAnimationFrame(()=>{t.current=!1})}},[e]);return sr(()=>()=>cancelAnimationFrame(r.current),[]),{receivedUserInput:t,onUserInput:n}}var gC=3,vC={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",insertSoftBreak:"shift+enter",splitBlock:"enter",undo:"mod+z"},bC={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},yC={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Pr=e=>{var t=vC[e],r=bC[e],n=yC[e],o=t&&$u.isHotkey(t),a=r&&$u.isHotkey(r),l=n&&$u.isHotkey(n);return u=>!!(o&&o(u)||$p&&a&&a(u)||!$p&&l&&l(u))},jr={isBold:Pr("bold"),isCompose:Pr("compose"),isMoveBackward:Pr("moveBackward"),isMoveForward:Pr("moveForward"),isDeleteBackward:Pr("deleteBackward"),isDeleteForward:Pr("deleteForward"),isDeleteLineBackward:Pr("deleteLineBackward"),isDeleteLineForward:Pr("deleteLineForward"),isDeleteWordBackward:Pr("deleteWordBackward"),isDeleteWordForward:Pr("deleteWordForward"),isExtendBackward:Pr("extendBackward"),isExtendForward:Pr("extendForward"),isExtendLineBackward:Pr("extendLineBackward"),isExtendLineForward:Pr("extendLineForward"),isItalic:Pr("italic"),isMoveLineBackward:Pr("moveLineBackward"),isMoveLineForward:Pr("moveLineForward"),isMoveWordBackward:Pr("moveWordBackward"),isMoveWordForward:Pr("moveWordForward"),isRedo:Pr("redo"),isSoftBreak:Pr("insertSoftBreak"),isSplitBlock:Pr("splitBlock"),isTransposeCharacter:Pr("transposeCharacter"),isUndo:Pr("undo")},xC=(e,t)=>{var r=[],n=()=>{r=[]},o=l=>{if(t.current){var u=l.filter(f=>Wc(e,f,l));r.push(...u)}};function a(){r.length>0&&(r.reverse().forEach(l=>{l.type!=="characterData"&&(l.removedNodes.forEach(u=>{l.target.insertBefore(u,l.nextSibling)}),l.addedNodes.forEach(u=>{l.target.removeChild(u)}))}),n())}return{registerMutations:o,restoreDOM:a,clear:n}},wC={subtree:!0,childList:!0,characterData:!0,characterDataOldValue:!0};class Ug extends j4{constructor(){super(...arguments),Pn(this,"context",null),Pn(this,"manager",null),Pn(this,"mutationObserver",null)}observe(){var t,{node:r}=this.props;if(!r.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");(t=this.mutationObserver)===null||t===void 0||t.observe(r.current,wC)}componentDidMount(){var{receivedUserInput:t}=this.props,r=this.context;this.manager=xC(r,t),this.mutationObserver=new MutationObserver(this.manager.registerMutations),this.observe()}getSnapshotBeforeUpdate(){var t,r,n,o=(t=this.mutationObserver)===null||t===void 0?void 0:t.takeRecords();if(o!=null&&o.length){var a;(a=this.manager)===null||a===void 0||a.registerMutations(o)}return(r=this.mutationObserver)===null||r===void 0||r.disconnect(),(n=this.manager)===null||n===void 0||n.restoreDOM(),null}componentDidUpdate(){var t;(t=this.manager)===null||t===void 0||t.clear(),this.observe()}componentWillUnmount(){var t;(t=this.mutationObserver)===null||t===void 0||t.disconnect()}render(){return this.props.children}}Pn(Ug,"contextType",Lc);var CC=mn?Ug:e=>{var{children:t}=e;return We.createElement(We.Fragment,null,t)},DC=xo(!1),kC=["autoFocus","decorate","onDOMBeforeInput","placeholder","readOnly","renderElement","renderLeaf","renderPlaceholder","scrollSelectionIntoView","style","as","disableDefaultStyles"],EC=["text"];function Hp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ro(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Hp(Object(r),!0).forEach(function(n){Pn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var SC=e=>We.createElement(We.Fragment,null,Kg(e)),Iu=_o((e,t)=>{var r=zt(Z=>We.createElement(AC,ro({},Z)),[]),{autoFocus:n,decorate:o=BC,onDOMBeforeInput:a,placeholder:l,readOnly:u=!1,renderElement:f,renderLeaf:d,renderPlaceholder:m=r,scrollSelectionIntoView:g=FC,style:v={},as:y="div",disableDefaultStyles:b=!1}=e,C=ka(e,kC),p=Wg(),[S,B]=Ht(!1),k=Vt(null),$=Vt([]),[T,O]=Ht(),F=Vt(!1),{onUserInput:P,receivedUserInput:N}=mC(),[,q]=_4(Z=>Z+1,0);$g.set(p,q),I0.set(p,u);var R=At(()=>({isDraggingInternally:!1,isUpdatingSelection:!1,latestElement:null,hasMarkPlaceholder:!1}),[]);sr(()=>{k.current&&n&&k.current.focus()},[n]);var X=Vt(),G=At(()=>_x(()=>{if(wa.get(p)){G();return}var Z=Le.toDOMNode(p,p),ie=Z.getRootNode();if(!F.current&&qo&&ie instanceof ShadowRoot){F.current=!0;var le=Bw();le?document.execCommand("indent"):Ge.deselect(p),F.current=!1;return}var ue=X.current;if((mn||!Le.isComposing(p))&&(!R.isUpdatingSelection||ue!=null&&ue.isFlushing())&&!R.isDraggingInternally){var Se=Le.findDocumentOrShadowRoot(p),{activeElement:Be}=Se,ge=Le.toDOMNode(p,p),Ee=di(Se);if(Be===ge?(R.latestElement=Be,Mo.set(p,!0)):Mo.delete(p),!Ee)return Ge.deselect(p);var{anchorNode:Ae,focusNode:Fe}=Ee,xe=Le.hasEditableTarget(p,Ae)||Le.isTargetInsideNonReadonlyVoid(p,Ae),Ce=Le.hasTarget(p,Fe);if(xe&&Ce){var _e=Le.toSlateRange(p,Ee,{exactMatch:!1,suppressThrow:!0});_e&&(!Le.isComposing(p)&&!(ue!=null&&ue.hasPendingChanges())&&!(ue!=null&&ue.isFlushing())?Ge.select(p,_e):ue==null||ue.handleUserSelect(_e))}u&&(!xe||!Ce)&&Ge.deselect(p)}},100),[p,u,R]),_=At(()=>Rx(G,0),[G]);X.current=Xw({node:k,onDOMSelectionChange:G,scheduleOnDOMSelectionChange:_}),ki(()=>{var Z,ie,le;k.current&&(le=Vc(k.current))?(Tg.set(p,le),vs.set(p,k.current),Go.set(p,k.current),Di.set(k.current,p)):Go.delete(p);var{selection:ue}=p,Se=Le.findDocumentOrShadowRoot(p),Be=di(Se);if(!(!Be||!Le.isFocused(p)||(Z=X.current)!==null&&Z!==void 0&&Z.hasPendingAction())){var ge=xe=>{var Ce=Be.type!=="None";if(!(!ue&&!Ce)){var _e=Be.focusNode,ht;if(ga&&Be.rangeCount>1){var ot=Be.getRangeAt(0),Ie=Be.getRangeAt(Be.rangeCount-1);ot.startContainer===_e?ht=Ie.endContainer:ht=ot.startContainer}else ht=Be.anchorNode;var Ke=vs.get(p),Ue=!1;if(Ke.contains(ht)&&Ke.contains(_e)&&(Ue=!0),Ce&&Ue&&ue&&!xe){var vt=Le.toSlateRange(p,Be,{exactMatch:!0,suppressThrow:!0});if(vt&&Oe.equals(vt,ue)){var tt;if(!R.hasMarkPlaceholder||(tt=ht)!==null&&tt!==void 0&&(tt=tt.parentElement)!==null&&tt!==void 0&&tt.hasAttribute("data-slate-mark-placeholder"))return}}if(ue&&!Le.hasRange(p,ue)){p.selection=Le.toSlateRange(p,Be,{exactMatch:!1,suppressThrow:!0});return}R.isUpdatingSelection=!0;var nt=ue&&Le.toDOMRange(p,ue);return nt?(Le.isComposing(p)&&!mn?Be.collapseToEnd():Oe.isBackward(ue)?Be.setBaseAndExtent(nt.endContainer,nt.endOffset,nt.startContainer,nt.startOffset):Be.setBaseAndExtent(nt.startContainer,nt.startOffset,nt.endContainer,nt.endOffset),g(p,nt)):Be.removeAllRanges(),nt}};Be.rangeCount<=1&&ge();var Ee=((ie=X.current)===null||ie===void 0?void 0:ie.isFlushing())==="action";if(!mn||!Ee){setTimeout(()=>{R.isUpdatingSelection=!1});return}var Ae=null,Fe=requestAnimationFrame(()=>{if(Ee){var xe=Ce=>{try{var _e=Le.toDOMNode(p,p);_e.focus(),ge(Ce)}catch{}};xe(),Ae=setTimeout(()=>{xe(!0),R.isUpdatingSelection=!1})}});return()=>{cancelAnimationFrame(Fe),Ae&&clearTimeout(Ae)}}});var j=zt(Z=>{var ie=Le.toDOMNode(p,p),le=ie.getRootNode();if(F!=null&&F.current&&qo&&le instanceof ShadowRoot){var ue=Z.getTargetRanges(),Se=ue[0],Be=new window.Range;Be.setStart(Se.startContainer,Se.startOffset),Be.setEnd(Se.endContainer,Se.endOffset);var ge=Le.toSlateRange(p,Be,{exactMatch:!1,suppressThrow:!1});Ge.select(p,ge),Z.preventDefault(),Z.stopImmediatePropagation();return}if(P(),!u&&Le.hasEditableTarget(p,Z.target)&&!TC(Z,a)){var Ee;if(X.current)return X.current.handleDOMBeforeInput(Z);_.flush(),G.flush();var{selection:Ae}=p,{inputType:Fe}=Z,xe=Z.dataTransfer||Z.data||void 0,Ce=Fe==="insertCompositionText"||Fe==="deleteCompositionText";if(Ce&&Le.isComposing(p))return;var _e=!1;if(Fe==="insertText"&&Ae&&Oe.isCollapsed(Ae)&&Z.data&&Z.data.length===1&&/[a-z ]/i.test(Z.data)&&Ae.anchor.offset!==0&&(_e=!0,p.marks&&(_e=!1),!wa.get(p))){var ht,ot,{anchor:Ie}=Ae,[Ke,Ue]=Le.toDOMPoint(p,Ie),vt=(ht=Ke.parentElement)===null||ht===void 0?void 0:ht.closest("a"),tt=Le.getWindow(p);if(_e&&vt&&Le.hasDOMNode(p,vt)){var nt,It=tt==null?void 0:tt.document.createTreeWalker(vt,NodeFilter.SHOW_TEXT).lastChild();It===Ke&&((nt=It.textContent)===null||nt===void 0?void 0:nt.length)===Ue&&(_e=!1)}if(_e&&Ke.parentElement&&(tt==null||(ot=tt.getComputedStyle(Ke.parentElement))===null||ot===void 0?void 0:ot.whiteSpace)==="pre"){var $t=z.above(p,{at:Ie.path,match:Nt=>kt.isElement(Nt)&&z.isBlock(p,Nt)});$t&&at.string($t[0]).includes(" ")&&(_e=!1)}}if((!Fe.startsWith("delete")||Fe.startsWith("deleteBy"))&&!wa.get(p)){var[Bt]=Z.getTargetRanges();if(Bt){var Mt=Le.toSlateRange(p,Bt,{exactMatch:!1,suppressThrow:!1});if(!Ae||!Oe.equals(Ae,Mt)){_e=!1;var je=!Ce&&p.selection&&z.rangeRef(p,p.selection);Ge.select(p,Mt),je&&ci.set(p,je)}}}if(Ce)return;if(_e||Z.preventDefault(),Ae&&Oe.isExpanded(Ae)&&Fe.startsWith("delete")){var pe=Fe.endsWith("Backward")?"backward":"forward";z.deleteFragment(p,{direction:pe});return}switch(Fe){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":{z.deleteFragment(p);break}case"deleteContent":case"deleteContentForward":{z.deleteForward(p);break}case"deleteContentBackward":{z.deleteBackward(p);break}case"deleteEntireSoftLine":{z.deleteBackward(p,{unit:"line"}),z.deleteForward(p,{unit:"line"});break}case"deleteHardLineBackward":{z.deleteBackward(p,{unit:"block"});break}case"deleteSoftLineBackward":{z.deleteBackward(p,{unit:"line"});break}case"deleteHardLineForward":{z.deleteForward(p,{unit:"block"});break}case"deleteSoftLineForward":{z.deleteForward(p,{unit:"line"});break}case"deleteWordBackward":{z.deleteBackward(p,{unit:"word"});break}case"deleteWordForward":{z.deleteForward(p,{unit:"word"});break}case"insertLineBreak":z.insertSoftBreak(p);break;case"insertParagraph":{z.insertBreak(p);break}case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{Fe==="insertFromComposition"&&Le.isComposing(p)&&(B(!1),Vo.set(p,!1)),(xe==null?void 0:xe.constructor.name)==="DataTransfer"?Le.insertData(p,xe):typeof xe=="string"&&(_e?$.current.push(()=>z.insertText(p,xe)):z.insertText(p,xe));break}}var it=(Ee=ci.get(p))===null||Ee===void 0?void 0:Ee.unref();ci.delete(p),it&&(!p.selection||!Oe.equals(p.selection,it))&&Ge.select(p,it)}},[p,G,P,a,u,_]),W=zt(Z=>{Z==null?(G.cancel(),_.cancel(),vs.delete(p),Go.delete(p),k.current&&Ao&&k.current.removeEventListener("beforeinput",j)):Ao&&Z.addEventListener("beforeinput",j),k.current=Z,typeof t=="function"?t(Z):t&&(t.current=Z)},[G,_,p,j,t]);ki(()=>{var Z=Le.getWindow(p);Z.document.addEventListener("selectionchange",_);var ie=()=>{R.isDraggingInternally=!1};return Z.document.addEventListener("dragend",ie),Z.document.addEventListener("drop",ie),()=>{Z.document.removeEventListener("selectionchange",_),Z.document.removeEventListener("dragend",ie),Z.document.removeEventListener("drop",ie)}},[_,R]);var U=o([p,[]]),ee=l&&p.children.length===1&&Array.from(at.texts(p)).length===1&&at.string(p)===""&&!S,V=zt(Z=>{if(Z&&ee){var ie;O((ie=Z.getBoundingClientRect())===null||ie===void 0?void 0:ie.height)}else O(void 0)},[ee]);if(ee){var Y=z.start(p,[]);U.push({[Ea]:!0,placeholder:l,onPlaceholderResize:V,anchor:Y,focus:Y})}var{marks:fe}=p;if(R.hasMarkPlaceholder=!1,p.selection&&Oe.isCollapsed(p.selection)&&fe){var{anchor:be}=p.selection,he=at.leaf(p,be.path),De=ka(he,EC);if(!Ct.equals(he,fe,{loose:!0})){R.hasMarkPlaceholder=!0;var $e=Object.fromEntries(Object.keys(De).map(Z=>[Z,null]));U.push(ro(ro(ro({[Ng]:!0},$e),fe),{},{anchor:be,focus:be}))}}return sr(()=>{setTimeout(()=>{var{selection:Z}=p;if(Z){var{anchor:ie}=Z,le=at.leaf(p,ie.path);if(fe&&!Ct.equals(le,fe,{loose:!0})){Vn.set(p,fe);return}}Vn.delete(p)})}),We.createElement(qg.Provider,{value:u},We.createElement(DC.Provider,{value:S},We.createElement(Hg.Provider,{value:o},We.createElement(CC,{node:k,receivedUserInput:N},We.createElement(y,ro(ro({role:u?void 0:"textbox","aria-multiline":u?void 0:!0},C),{},{spellCheck:Ao||!gs?C.spellCheck:!1,autoCorrect:Ao||!gs?C.autoCorrect:"false",autoCapitalize:Ao||!gs?C.autoCapitalize:"false","data-slate-editor":!0,"data-slate-node":"value",contentEditable:!u,zindex:-1,suppressContentEditableWarning:!0,ref:W,style:ro(ro({},b?{}:ro({position:"relative",whiteSpace:"pre-wrap",wordWrap:"break-word"},T?{minHeight:T}:{})),v),onBeforeInput:zt(Z=>{if(!Ao&&!u&&!hn(Z,C.onBeforeInput)&&Le.hasSelectableTarget(p,Z.target)&&(Z.preventDefault(),!Le.isComposing(p))){var ie=Z.data;z.insertText(p,ie)}},[C.onBeforeInput,p,u]),onInput:zt(Z=>{if(!hn(Z,C.onInput)){if(X.current){X.current.handleInput();return}for(var ie of $.current)ie();if($.current=[],!Le.isFocused(p)){var le=Z.nativeEvent,ue=p;if(le.inputType==="historyUndo"&&typeof ue.undo=="function"){ue.undo();return}if(le.inputType==="historyRedo"&&typeof ue.redo=="function"){ue.redo();return}}}},[C.onInput,p]),onBlur:zt(Z=>{if(!(u||R.isUpdatingSelection||!Le.hasSelectableTarget(p,Z.target)||hn(Z,C.onBlur))){var ie=Le.findDocumentOrShadowRoot(p);if(R.latestElement!==ie.activeElement){var{relatedTarget:le}=Z,ue=Le.toDOMNode(p,p);if(le!==ue&&!(In(le)&&le.hasAttribute("data-slate-spacer"))){if(le!=null&&zo(le)&&Le.hasDOMNode(p,le)){var Se=Le.toSlateNode(p,le);if(kt.isElement(Se)&&!p.isVoid(Se))return}if(qo){var Be=di(ie);Be==null||Be.removeAllRanges()}Mo.delete(p)}}}},[u,R.isUpdatingSelection,R.latestElement,p,C.onBlur]),onClick:zt(Z=>{if(Le.hasTarget(p,Z.target)&&!hn(Z,C.onClick)&&zo(Z.target)){var ie=Le.toSlateNode(p,Z.target),le=Le.findPath(p,ie);if(!z.hasPath(p,le)||at.get(p,le)!==ie)return;if(Z.detail===gC&&le.length>=1){var ue=le;if(!(kt.isElement(ie)&&z.isBlock(p,ie))){var Se,Be=z.above(p,{match:_e=>kt.isElement(_e)&&z.isBlock(p,_e),at:le});ue=(Se=Be==null?void 0:Be[1])!==null&&Se!==void 0?Se:le.slice(0,1)}var ge=z.range(p,ue);Ge.select(p,ge);return}if(u)return;var Ee=z.start(p,le),Ae=z.end(p,le),Fe=z.void(p,{at:Ee}),xe=z.void(p,{at:Ae});if(Fe&&xe&&de.equals(Fe[1],xe[1])){var Ce=z.range(p,Ee);Ge.select(p,Ce)}}},[p,C.onClick,u]),onCompositionEnd:zt(Z=>{if(Le.hasSelectableTarget(p,Z.target)){var ie;if(Le.isComposing(p)&&Promise.resolve().then(()=>{B(!1),Vo.set(p,!1)}),(ie=X.current)===null||ie===void 0||ie.handleCompositionEnd(Z),hn(Z,C.onCompositionEnd)||mn)return;if(!qo&&!vw&&!Bg&&!yw&&!bw&&Z.data){var le=Vn.get(p);Vn.delete(p),le!==void 0&&(mo.set(p,p.marks),p.marks=le),z.insertText(p,Z.data);var ue=mo.get(p);mo.delete(p),ue!==void 0&&(p.marks=ue)}}},[C.onCompositionEnd,p]),onCompositionUpdate:zt(Z=>{Le.hasSelectableTarget(p,Z.target)&&!hn(Z,C.onCompositionUpdate)&&(Le.isComposing(p)||(B(!0),Vo.set(p,!0)))},[C.onCompositionUpdate,p]),onCompositionStart:zt(Z=>{if(Le.hasSelectableTarget(p,Z.target)){var ie;if((ie=X.current)===null||ie===void 0||ie.handleCompositionStart(Z),hn(Z,C.onCompositionStart)||mn)return;B(!0);var{selection:le}=p;if(le&&Oe.isExpanded(le)){z.deleteFragment(p);return}}},[C.onCompositionStart,p]),onCopy:zt(Z=>{Le.hasSelectableTarget(p,Z.target)&&!hn(Z,C.onCopy)&&!Kp(Z)&&(Z.preventDefault(),Le.setFragmentData(p,Z.clipboardData,"copy"))},[C.onCopy,p]),onCut:zt(Z=>{if(!u&&Le.hasSelectableTarget(p,Z.target)&&!hn(Z,C.onCut)&&!Kp(Z)){Z.preventDefault(),Le.setFragmentData(p,Z.clipboardData,"cut");var{selection:ie}=p;if(ie)if(Oe.isExpanded(ie))z.deleteFragment(p);else{var le=at.parent(p,ie.anchor.path);z.isVoid(p,le)&&Ge.delete(p)}}},[u,p,C.onCut]),onDragOver:zt(Z=>{if(Le.hasTarget(p,Z.target)&&!hn(Z,C.onDragOver)){var ie=Le.toSlateNode(p,Z.target);kt.isElement(ie)&&z.isVoid(p,ie)&&Z.preventDefault()}},[C.onDragOver,p]),onDragStart:zt(Z=>{if(!u&&Le.hasTarget(p,Z.target)&&!hn(Z,C.onDragStart)){var ie=Le.toSlateNode(p,Z.target),le=Le.findPath(p,ie),ue=kt.isElement(ie)&&z.isVoid(p,ie)||z.void(p,{at:le,voids:!0});if(ue){var Se=z.range(p,le);Ge.select(p,Se)}R.isDraggingInternally=!0,Le.setFragmentData(p,Z.dataTransfer,"drag")}},[u,p,C.onDragStart,R]),onDrop:zt(Z=>{if(!u&&Le.hasTarget(p,Z.target)&&!hn(Z,C.onDrop)){Z.preventDefault();var ie=p.selection,le=Le.findEventRange(p,Z),ue=Z.dataTransfer;Ge.select(p,le),R.isDraggingInternally&&ie&&!Oe.equals(ie,le)&&!z.void(p,{at:le,voids:!0})&&Ge.delete(p,{at:ie}),Le.insertData(p,ue),Le.isFocused(p)||Le.focus(p)}},[u,p,C.onDrop,R]),onDragEnd:zt(Z=>{!u&&R.isDraggingInternally&&C.onDragEnd&&Le.hasTarget(p,Z.target)&&C.onDragEnd(Z)},[u,R,C,p]),onFocus:zt(Z=>{if(!u&&!R.isUpdatingSelection&&Le.hasEditableTarget(p,Z.target)&&!hn(Z,C.onFocus)){var ie=Le.toDOMNode(p,p),le=Le.findDocumentOrShadowRoot(p);if(R.latestElement=le.activeElement,ga&&Z.target!==ie){ie.focus();return}Mo.set(p,!0)}},[u,R,p,C.onFocus]),onKeyDown:zt(Z=>{if(!u&&Le.hasEditableTarget(p,Z.target)){var ie;(ie=X.current)===null||ie===void 0||ie.handleKeyDown(Z);var{nativeEvent:le}=Z;if(Le.isComposing(p)&&le.isComposing===!1&&(Vo.set(p,!1),B(!1)),hn(Z,C.onKeyDown)||Le.isComposing(p))return;var{selection:ue}=p,Se=p.children[ue!==null?ue.focus.path[0]:0],Be=vg(at.string(Se))==="rtl";if(jr.isRedo(le)){Z.preventDefault();var ge=p;typeof ge.redo=="function"&&ge.redo();return}if(jr.isUndo(le)){Z.preventDefault();var Ee=p;typeof Ee.undo=="function"&&Ee.undo();return}if(jr.isMoveLineBackward(le)){Z.preventDefault(),Ge.move(p,{unit:"line",reverse:!0});return}if(jr.isMoveLineForward(le)){Z.preventDefault(),Ge.move(p,{unit:"line"});return}if(jr.isExtendLineBackward(le)){Z.preventDefault(),Ge.move(p,{unit:"line",edge:"focus",reverse:!0});return}if(jr.isExtendLineForward(le)){Z.preventDefault(),Ge.move(p,{unit:"line",edge:"focus"});return}if(jr.isMoveBackward(le)){Z.preventDefault(),ue&&Oe.isCollapsed(ue)?Ge.move(p,{reverse:!Be}):Ge.collapse(p,{edge:Be?"end":"start"});return}if(jr.isMoveForward(le)){Z.preventDefault(),ue&&Oe.isCollapsed(ue)?Ge.move(p,{reverse:Be}):Ge.collapse(p,{edge:Be?"start":"end"});return}if(jr.isMoveWordBackward(le)){Z.preventDefault(),ue&&Oe.isExpanded(ue)&&Ge.collapse(p,{edge:"focus"}),Ge.move(p,{unit:"word",reverse:!Be});return}if(jr.isMoveWordForward(le)){Z.preventDefault(),ue&&Oe.isExpanded(ue)&&Ge.collapse(p,{edge:"focus"}),Ge.move(p,{unit:"word",reverse:Be});return}if(Ao){if((Fg||qo)&&ue&&(jr.isDeleteBackward(le)||jr.isDeleteForward(le))&&Oe.isCollapsed(ue)){var Ae=at.parent(p,ue.anchor.path);if(kt.isElement(Ae)&&z.isVoid(p,Ae)&&(z.isInline(p,Ae)||z.isBlock(p,Ae))){Z.preventDefault(),z.deleteBackward(p,{unit:"block"});return}}}else{if(jr.isBold(le)||jr.isItalic(le)||jr.isTransposeCharacter(le)){Z.preventDefault();return}if(jr.isSoftBreak(le)){Z.preventDefault(),z.insertSoftBreak(p);return}if(jr.isSplitBlock(le)){Z.preventDefault(),z.insertBreak(p);return}if(jr.isDeleteBackward(le)){Z.preventDefault(),ue&&Oe.isExpanded(ue)?z.deleteFragment(p,{direction:"backward"}):z.deleteBackward(p);return}if(jr.isDeleteForward(le)){Z.preventDefault(),ue&&Oe.isExpanded(ue)?z.deleteFragment(p,{direction:"forward"}):z.deleteForward(p);return}if(jr.isDeleteLineBackward(le)){Z.preventDefault(),ue&&Oe.isExpanded(ue)?z.deleteFragment(p,{direction:"backward"}):z.deleteBackward(p,{unit:"line"});return}if(jr.isDeleteLineForward(le)){Z.preventDefault(),ue&&Oe.isExpanded(ue)?z.deleteFragment(p,{direction:"forward"}):z.deleteForward(p,{unit:"line"});return}if(jr.isDeleteWordBackward(le)){Z.preventDefault(),ue&&Oe.isExpanded(ue)?z.deleteFragment(p,{direction:"backward"}):z.deleteBackward(p,{unit:"word"});return}if(jr.isDeleteWordForward(le)){Z.preventDefault(),ue&&Oe.isExpanded(ue)?z.deleteFragment(p,{direction:"forward"}):z.deleteForward(p,{unit:"word"});return}}}},[u,p,C.onKeyDown]),onPaste:zt(Z=>{!u&&Le.hasEditableTarget(p,Z.target)&&!hn(Z,C.onPaste)&&(!Ao||Cw(Z.nativeEvent)||qo)&&(Z.preventDefault(),Le.insertData(p,Z.clipboardData))},[u,p,C.onPaste])}),We.createElement(SC,{decorations:U,node:p,renderElement:f,renderPlaceholder:m,renderLeaf:d,selection:p.selection}))))))}),AC=e=>{var{attributes:t,children:r}=e;return We.createElement("span",ro({},t),r,mn&&We.createElement("br",null))},BC=()=>[],FC=(e,t)=>{if(t.getBoundingClientRect&&(!e.selection||e.selection&&Oe.isCollapsed(e.selection))){var r=t.startContainer.parentElement;r.getBoundingClientRect=t.getBoundingClientRect.bind(t),Hx(r,{scrollMode:"if-needed"}),delete r.getBoundingClientRect}},hn=(e,t)=>{if(!t)return!1;var r=t(e);return r??(e.isDefaultPrevented()||e.isPropagationStopped())},Kp=e=>zo(e.target)&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement),TC=(e,t)=>{if(!t)return!1;var r=t(e);return r??e.defaultPrevented},$C=xo(!1),NC=xo({});function OC(e){var t=Vt([]).current,r=Vt({editor:e}).current,n=zt(a=>{r.editor=a,t.forEach(l=>l(a))},[t,r]),o=At(()=>({getSlate:()=>r.editor,addEventListener:a=>(t.push(a),()=>{t.splice(t.indexOf(a),1)})}),[t,r]);return{selectorContext:o,onChange:n}}var MC=["editor","children","onChange","onSelectionChange","onValueChange","initialValue"],Ru=e=>{var{editor:t,children:r,onChange:n,onSelectionChange:o,onValueChange:a,initialValue:l}=e,u=ka(e,MC),[f,d]=We.useState(()=>{if(!at.isNodeList(l))throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(en.stringify(l)));if(!z.isEditor(t))throw new Error("[Slate] editor is invalid! You passed: ".concat(en.stringify(t)));return t.children=l,Object.assign(t,u),{v:0,editor:t}}),{selectorContext:m,onChange:g}=OC(t),v=zt(C=>{var p;switch(n&&n(t.children),C==null||(p=C.operation)===null||p===void 0?void 0:p.type){case"set_selection":o==null||o(t.selection);break;default:a==null||a(t.children)}d(S=>({v:S.v+1,editor:t})),g(t)},[t,g,n,o,a]);sr(()=>(R0.set(t,v),()=>{R0.set(t,()=>{})}),[t,v]);var[y,b]=Ht(Le.isFocused(t));return sr(()=>{b(Le.isFocused(t))},[t]),ki(()=>{var C=()=>b(Le.isFocused(t));return Ag>=17?(document.addEventListener("focusin",C),document.addEventListener("focusout",C),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",C)}):(document.addEventListener("focus",C,!0),document.addEventListener("blur",C,!0),()=>{document.removeEventListener("focus",C,!0),document.removeEventListener("blur",C,!0)})},[]),We.createElement(NC.Provider,{value:m},We.createElement(Vg.Provider,{value:f},We.createElement(Lc.Provider,{value:f.editor},We.createElement($C.Provider,{value:y},r))))},qp=(e,t)=>{var r=(t.top+t.bottom)/2;return e.top<=r&&e.bottom>=r},Vp=(e,t,r)=>{var n=Le.toDOMRange(e,t).getBoundingClientRect(),o=Le.toDOMRange(e,r).getBoundingClientRect();return qp(n,o)&&qp(o,n)},IC=(e,t)=>{var r=z.range(e,Oe.end(t)),n=Array.from(z.positions(e,{at:t})),o=0,a=n.length,l=Math.floor(a/2);if(Vp(e,z.range(e,n[o]),r))return z.range(e,n[o],r);if(n.length<2)return z.range(e,n[n.length-1],r);for(;l!==n.length&&l!==o;)Vp(e,z.range(e,n[l]),r)?a=l:o=l,l=Math.floor((o+a)/2);return z.range(e,n[a],r)};function Wp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Up(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wp(Object(r),!0).forEach(function(n){Pn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var RC=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"x-slate-fragment",r=e,{apply:n,onChange:o,deleteBackward:a,addMark:l,removeMark:u}=r;return ml.set(r,new WeakMap),r.addMark=(f,d)=>{var m,g;(m=qc.get(r))===null||m===void 0||m(),!Vn.get(r)&&(g=Cn.get(r))!==null&&g!==void 0&&g.length&&Vn.set(r,null),mo.delete(r),l(f,d)},r.removeMark=f=>{var d;!Vn.get(r)&&(d=Cn.get(r))!==null&&d!==void 0&&d.length&&Vn.set(r,null),mo.delete(r),u(f)},r.deleteBackward=f=>{if(f!=="line")return a(f);if(r.selection&&Oe.isCollapsed(r.selection)){var d=z.above(r,{match:y=>kt.isElement(y)&&z.isBlock(r,y),at:r.selection});if(d){var[,m]=d,g=z.range(r,m,r.selection.anchor),v=IC(r,g);Oe.isCollapsed(v)||Ge.delete(r,{at:v})}}},r.apply=f=>{var d=[],m=[],g=Cn.get(r);if(g!=null&&g.length){var v=g.map(G=>Pw(G,f)).filter(Boolean);Cn.set(r,v)}var y=No.get(r);y&&No.set(r,Mp(r,y,f));var b=$o.get(r);if(b!=null&&b.at){var C=er.isPoint(b==null?void 0:b.at)?_0(r,b.at,f):Mp(r,b.at,f);$o.set(r,C?Up(Up({},b),{},{at:C}):null)}switch(f.type){case"insert_text":case"remove_text":case"set_node":case"split_node":{d.push(...ua(r,f.path));break}case"set_selection":{var p;(p=ci.get(r))===null||p===void 0||p.unref(),ci.delete(r);break}case"insert_node":case"remove_node":{d.push(...ua(r,de.parent(f.path)));break}case"merge_node":{var S=de.previous(f.path);d.push(...ua(r,S));break}case"move_node":{var B=de.common(de.parent(f.path),de.parent(f.newPath));d.push(...ua(r,B));var k;de.isBefore(f.path,f.newPath)?(d.push(...ua(r,de.parent(f.path))),k=f.newPath):(d.push(...ua(r,de.parent(f.newPath))),k=f.path);var $=at.get(e,de.parent(k)),T=Le.findKey(r,$),O=z.pathRef(r,de.parent(k));m.push([O,T]);break}}switch(n(f),f.type){case"insert_node":case"remove_node":case"merge_node":case"move_node":case"split_node":wa.set(r,!0)}for(var[F,P]of d){var[N]=z.node(r,F);Us.set(N,P)}for(var[q,R]of m){if(q.current){var[X]=z.node(r,q.current);Us.set(X,R)}q.unref()}},r.setFragmentData=f=>{var{selection:d}=r;if(d){var[m,g]=Oe.edges(d),v=z.void(r,{at:m.path}),y=z.void(r,{at:g.path});if(!(Oe.isCollapsed(d)&&!v)){var b=Le.toDOMRange(r,d),C=b.cloneContents(),p=C.childNodes[0];if(C.childNodes.forEach(N=>{N.textContent&&N.textContent.trim()!==""&&(p=N)}),y){var[S]=y,B=b.cloneRange(),k=Le.toDOMNode(r,S);B.setEndAfter(k),C=B.cloneContents()}if(v&&(p=C.querySelector("[data-slate-spacer]")),Array.from(C.querySelectorAll("[data-slate-zero-width]")).forEach(N=>{var q=N.getAttribute("data-slate-zero-width")==="n";N.textContent=q?`
112
+ `:""}),Mg(p)){var $=p.ownerDocument.createElement("span");$.style.whiteSpace="pre",$.appendChild(p),C.appendChild($),p=$}var T=r.getFragment(),O=JSON.stringify(T),F=window.btoa(encodeURIComponent(O));p.setAttribute("data-slate-fragment",F),f.setData("application/".concat(t),F);var P=C.ownerDocument.createElement("div");return P.appendChild(C),P.setAttribute("hidden","true"),C.ownerDocument.body.appendChild(P),f.setData("text/html",P.innerHTML),f.setData("text/plain",Rg(P)),C.ownerDocument.body.removeChild(P),f}}},r.insertData=f=>{r.insertFragmentData(f)||r.insertTextData(f)},r.insertFragmentData=f=>{var d=f.getData("application/".concat(t))||Aw(f);if(d){var m=decodeURIComponent(window.atob(d)),g=JSON.parse(m);return r.insertFragment(g),!0}return!1},r.insertTextData=f=>{var d=f.getData("text/plain");if(d){var m=d.split(/\r\n|\r|\n/),g=!1;for(var v of m)g&&Ge.splitNodes(r,{always:!0}),r.insertText(v),g=!0;return!0}return!1},r.onChange=f=>{var d=Ag<18?a0.unstable_batchedUpdates:m=>m();d(()=>{var m=R0.get(r);m&&m(f),o(f)})},r},ua=(e,t)=>{var r=[];for(var[n,o]of z.levels(e,{at:t})){var a=Le.findKey(e,n);r.push([o,a])}return r};function Uc(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var oa=Uc();function Xg(e){oa=e}var fi={exec:()=>null};function wr(e,t=""){let r=typeof e=="string"?e:e.source;const n={replace:(o,a)=>{let l=typeof a=="string"?a:a.source;return l=l.replace(gn.caret,"$1"),r=r.replace(o,l),n},getRegex:()=>new RegExp(r,t)};return n}var gn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},PC=/^(?:[ \t]*(?:\n|$))+/,zC=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,_C=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Pi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,jC=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Xc=/(?:[*+-]|\d{1,9}[.)])/,Gg=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Yg=wr(Gg).replace(/bull/g,Xc).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),LC=wr(Gg).replace(/bull/g,Xc).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Gc=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,HC=/^[^\n]+/,Yc=/(?!\s*\])(?:\\.|[^\[\]\\])+/,KC=wr(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Yc).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),qC=wr(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Xc).getRegex(),gl="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Zc=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,VC=wr("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Zc).replace("tag",gl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Zg=wr(Gc).replace("hr",Pi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",gl).getRegex(),WC=wr(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Zg).getRegex(),Jc={blockquote:WC,code:zC,def:KC,fences:_C,heading:jC,hr:Pi,html:VC,lheading:Yg,list:qC,newline:PC,paragraph:Zg,table:fi,text:HC},Xp=wr("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Pi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",gl).getRegex(),UC={...Jc,lheading:LC,table:Xp,paragraph:wr(Gc).replace("hr",Pi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Xp).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",gl).getRegex()},XC={...Jc,html:wr(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Zc).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:fi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:wr(Gc).replace("hr",Pi).replace("heading",` *#{1,6} *[^
113
+ ]`).replace("lheading",Yg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},GC=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,YC=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Jg=/^( {2,}|\\)\n(?!\s*$)/,ZC=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,vl=/[\p{P}\p{S}]/u,Qc=/[\s\p{P}\p{S}]/u,Qg=/[^\s\p{P}\p{S}]/u,JC=wr(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Qc).getRegex(),e2=/(?!~)[\p{P}\p{S}]/u,QC=/(?!~)[\s\p{P}\p{S}]/u,eD=/(?:[^\s\p{P}\p{S}]|~)/u,tD=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,t2=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,rD=wr(t2,"u").replace(/punct/g,vl).getRegex(),nD=wr(t2,"u").replace(/punct/g,e2).getRegex(),r2="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",oD=wr(r2,"gu").replace(/notPunctSpace/g,Qg).replace(/punctSpace/g,Qc).replace(/punct/g,vl).getRegex(),aD=wr(r2,"gu").replace(/notPunctSpace/g,eD).replace(/punctSpace/g,QC).replace(/punct/g,e2).getRegex(),iD=wr("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Qg).replace(/punctSpace/g,Qc).replace(/punct/g,vl).getRegex(),sD=wr(/\\(punct)/,"gu").replace(/punct/g,vl).getRegex(),lD=wr(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),uD=wr(Zc).replace("(?:-->|$)","-->").getRegex(),cD=wr("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",uD).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Xs=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,dD=wr(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Xs).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),n2=wr(/^!?\[(label)\]\[(ref)\]/).replace("label",Xs).replace("ref",Yc).getRegex(),o2=wr(/^!?\[(ref)\](?:\[\])?/).replace("ref",Yc).getRegex(),fD=wr("reflink|nolink(?!\\()","g").replace("reflink",n2).replace("nolink",o2).getRegex(),ed={_backpedal:fi,anyPunctuation:sD,autolink:lD,blockSkip:tD,br:Jg,code:YC,del:fi,emStrongLDelim:rD,emStrongRDelimAst:oD,emStrongRDelimUnd:iD,escape:GC,link:dD,nolink:o2,punctuation:JC,reflink:n2,reflinkSearch:fD,tag:cD,text:ZC,url:fi},hD={...ed,link:wr(/^!?\[(label)\]\((.*?)\)/).replace("label",Xs).getRegex(),reflink:wr(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Xs).getRegex()},L0={...ed,emStrongRDelimAst:aD,emStrongLDelim:nD,url:wr(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},pD={...L0,br:wr(Jg).replace("{2,}","*").getRegex(),text:wr(L0.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},as={normal:Jc,gfm:UC,pedantic:XC},Ua={normal:ed,gfm:L0,breaks:pD,pedantic:hD},mD={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Gp=e=>mD[e];function no(e,t){if(t){if(gn.escapeTest.test(e))return e.replace(gn.escapeReplace,Gp)}else if(gn.escapeTestNoEncode.test(e))return e.replace(gn.escapeReplaceNoEncode,Gp);return e}function Yp(e){try{e=encodeURI(e).replace(gn.percentDecode,"%")}catch{return null}return e}function Zp(e,t){var a;const r=e.replace(gn.findPipe,(l,u,f)=>{let d=!1,m=u;for(;--m>=0&&f[m]==="\\";)d=!d;return d?"|":" |"}),n=r.split(gn.splitPipe);let o=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(gn.slashPipe,"|");return n}function Xa(e,t,r){const n=e.length;if(n===0)return"";let o=0;for(;o<n&&e.charAt(n-o-1)===t;)o++;return e.slice(0,n-o)}function gD(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return r>0?-2:-1}function Jp(e,t,r,n,o){const a=t.href,l=t.title||null,u=e[1].replace(o.other.outputLinkReplace,"$1");n.state.inLink=!0;const f={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:l,text:u,tokens:n.inlineTokens(u)};return n.state.inLink=!1,f}function vD(e,t,r){const n=e.match(r.other.indentCodeCompensation);if(n===null)return t;const o=n[1];return t.split(`
114
+ `).map(a=>{const l=a.match(r.other.beginningSpace);if(l===null)return a;const[u]=l;return u.length>=o.length?a.slice(o.length):a}).join(`
115
+ `)}var Gs=class{constructor(e){Br(this,"options"),Br(this,"rules"),Br(this,"lexer"),this.options=e||oa}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const r=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Xa(r,`
116
+ `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const r=t[0],n=vD(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){const n=Xa(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Xa(t[0],`
117
+ `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let r=Xa(t[0],`
118
+ `).split(`
119
+ `),n="",o="";const a=[];for(;r.length>0;){let l=!1;const u=[];let f;for(f=0;f<r.length;f++)if(this.rules.other.blockquoteStart.test(r[f]))u.push(r[f]),l=!0;else if(!l)u.push(r[f]);else break;r=r.slice(f);const d=u.join(`
120
+ `),m=d.replace(this.rules.other.blockquoteSetextReplace,`
121
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
122
+ ${d}`:d,o=o?`${o}
123
+ ${m}`:m;const g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(m,a,!0),this.lexer.state.top=g,r.length===0)break;const v=a.at(-1);if((v==null?void 0:v.type)==="code")break;if((v==null?void 0:v.type)==="blockquote"){const y=v,b=y.raw+`
124
+ `+r.join(`
125
+ `),C=this.blockquote(b);a[a.length-1]=C,n=n.substring(0,n.length-y.raw.length)+C.raw,o=o.substring(0,o.length-y.text.length)+C.text;break}else if((v==null?void 0:v.type)==="list"){const y=v,b=y.raw+`
126
+ `+r.join(`
127
+ `),C=this.list(b);a[a.length-1]=C,n=n.substring(0,n.length-v.raw.length)+C.raw,o=o.substring(0,o.length-y.raw.length)+C.raw,r=b.substring(a.at(-1).raw.length).split(`
128
+ `);continue}}return{type:"blockquote",raw:n,tokens:a,text:o}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const n=r.length>1,o={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const a=this.rules.other.listItemRegex(r);let l=!1;for(;e;){let f=!1,d="",m="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;d=t[0],e=e.substring(d.length);let g=t[2].split(`
129
+ `,1)[0].replace(this.rules.other.listReplaceTabs,S=>" ".repeat(3*S.length)),v=e.split(`
130
+ `,1)[0],y=!g.trim(),b=0;if(this.options.pedantic?(b=2,m=g.trimStart()):y?b=t[1].length+1:(b=t[2].search(this.rules.other.nonSpaceChar),b=b>4?1:b,m=g.slice(b),b+=t[1].length),y&&this.rules.other.blankLine.test(v)&&(d+=v+`
131
+ `,e=e.substring(v.length+1),f=!0),!f){const S=this.rules.other.nextBulletRegex(b),B=this.rules.other.hrRegex(b),k=this.rules.other.fencesBeginRegex(b),$=this.rules.other.headingBeginRegex(b),T=this.rules.other.htmlBeginRegex(b);for(;e;){const O=e.split(`
132
+ `,1)[0];let F;if(v=O,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),F=v):F=v.replace(this.rules.other.tabCharGlobal," "),k.test(v)||$.test(v)||T.test(v)||S.test(v)||B.test(v))break;if(F.search(this.rules.other.nonSpaceChar)>=b||!v.trim())m+=`
133
+ `+F.slice(b);else{if(y||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(g)||$.test(g)||B.test(g))break;m+=`
134
+ `+v}!y&&!v.trim()&&(y=!0),d+=O+`
135
+ `,e=e.substring(O.length+1),g=F.slice(b)}}o.loose||(l?o.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(l=!0));let C=null,p;this.options.gfm&&(C=this.rules.other.listIsTask.exec(m),C&&(p=C[0]!=="[ ] ",m=m.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:d,task:!!C,checked:p,loose:!1,text:m,tokens:[]}),o.raw+=d}const u=o.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let f=0;f<o.items.length;f++)if(this.lexer.state.top=!1,o.items[f].tokens=this.lexer.blockTokens(o.items[f].text,[]),!o.loose){const d=o.items[f].tokens.filter(g=>g.type==="space"),m=d.length>0&&d.some(g=>this.rules.other.anyLine.test(g.raw));o.loose=m}if(o.loose)for(let f=0;f<o.items.length;f++)o.items[f].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:n,title:o}}}table(e){var l;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const r=Zp(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(l=t[3])!=null&&l.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
136
+ `):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(const u of n)this.rules.other.tableAlignRight.test(u)?a.align.push("right"):this.rules.other.tableAlignCenter.test(u)?a.align.push("center"):this.rules.other.tableAlignLeft.test(u)?a.align.push("left"):a.align.push(null);for(let u=0;u<r.length;u++)a.header.push({text:r[u],tokens:this.lexer.inline(r[u]),header:!0,align:a.align[u]});for(const u of o)a.rows.push(Zp(u,a.header.length).map((f,d)=>({text:f,tokens:this.lexer.inline(f),header:!1,align:a.align[d]})));return a}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const r=t[1].charAt(t[1].length-1)===`
137
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const a=Xa(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{const a=gD(t[2],"()");if(a===-2)return;if(a>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let n=t[2],o="";if(this.options.pedantic){const a=this.rules.other.pedanticHrefTitle.exec(n);a&&(n=a[1],o=a[3])}else o=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),Jp(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){const n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[n.toLowerCase()];if(!o){const a=r[0].charAt(0);return{type:"text",raw:a,text:a}}return Jp(r,o,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!r||this.rules.inline.punctuation.exec(r))){const o=[...n[0]].length-1;let a,l,u=o,f=0;const d=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+o);(n=d.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(l=[...a].length,n[3]||n[4]){u+=l;continue}else if((n[5]||n[6])&&o%3&&!((o+l)%3)){f+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+f);const m=[...n[0]][0].length,g=e.slice(0,o+n.index+m+l);if(Math.min(o,l)%2){const y=g.slice(1,-1);return{type:"em",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}const v=g.slice(2,-2);return{type:"strong",raw:g,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let r,n;return t[2]==="@"?(r=t[1],n="mailto:"+r):(r=t[1],n=r),{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(e){var r;let t;if(t=this.rules.inline.url.exec(e)){let n,o;if(t[2]==="@")n=t[0],o="mailto:"+n;else{let a;do a=t[0],t[0]=((r=this.rules.inline._backpedal.exec(t[0]))==null?void 0:r[0])??"";while(a!==t[0]);n=t[0],t[1]==="www."?o="http://"+t[0]:o=t[0]}return{type:"link",raw:t[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},go=class H0{constructor(t){Br(this,"tokens"),Br(this,"options"),Br(this,"state"),Br(this,"tokenizer"),Br(this,"inlineQueue"),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||oa,this.options.tokenizer=this.options.tokenizer||new Gs,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={other:gn,block:as.normal,inline:Ua.normal};this.options.pedantic?(r.block=as.pedantic,r.inline=Ua.pedantic):this.options.gfm&&(r.block=as.gfm,this.options.breaks?r.inline=Ua.breaks:r.inline=Ua.gfm),this.tokenizer.rules=r}static get rules(){return{block:as,inline:Ua}}static lex(t,r){return new H0(r).lex(t)}static lexInline(t,r){return new H0(r).inlineTokens(t)}lex(t){t=t.replace(gn.carriageReturn,`
138
+ `),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],n=!1){var o,a,l;for(this.options.pedantic&&(t=t.replace(gn.tabCharGlobal," ").replace(gn.spaceLine,""));t;){let u;if((a=(o=this.options.extensions)==null?void 0:o.block)!=null&&a.some(d=>(u=d.call({lexer:this},t,r))?(t=t.substring(u.raw.length),r.push(u),!0):!1))continue;if(u=this.tokenizer.space(t)){t=t.substring(u.raw.length);const d=r.at(-1);u.raw.length===1&&d!==void 0?d.raw+=`
139
+ `:r.push(u);continue}if(u=this.tokenizer.code(t)){t=t.substring(u.raw.length);const d=r.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=`
140
+ `+u.raw,d.text+=`
141
+ `+u.text,this.inlineQueue.at(-1).src=d.text):r.push(u);continue}if(u=this.tokenizer.fences(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.heading(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.hr(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.blockquote(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.list(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.html(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.def(t)){t=t.substring(u.raw.length);const d=r.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=`
142
+ `+u.raw,d.text+=`
143
+ `+u.raw,this.inlineQueue.at(-1).src=d.text):this.tokens.links[u.tag]||(this.tokens.links[u.tag]={href:u.href,title:u.title});continue}if(u=this.tokenizer.table(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.lheading(t)){t=t.substring(u.raw.length),r.push(u);continue}let f=t;if((l=this.options.extensions)!=null&&l.startBlock){let d=1/0;const m=t.slice(1);let g;this.options.extensions.startBlock.forEach(v=>{g=v.call({lexer:this},m),typeof g=="number"&&g>=0&&(d=Math.min(d,g))}),d<1/0&&d>=0&&(f=t.substring(0,d+1))}if(this.state.top&&(u=this.tokenizer.paragraph(f))){const d=r.at(-1);n&&(d==null?void 0:d.type)==="paragraph"?(d.raw+=`
144
+ `+u.raw,d.text+=`
145
+ `+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):r.push(u),n=f.length!==t.length,t=t.substring(u.raw.length);continue}if(u=this.tokenizer.text(t)){t=t.substring(u.raw.length);const d=r.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=`
146
+ `+u.raw,d.text+=`
147
+ `+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):r.push(u);continue}if(t){const d="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){var u,f,d;let n=t,o=null;if(this.tokens.links){const m=Object.keys(this.tokens.links);if(m.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)m.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,o.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(o=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let a=!1,l="";for(;t;){a||(l=""),a=!1;let m;if((f=(u=this.options.extensions)==null?void 0:u.inline)!=null&&f.some(v=>(m=v.call({lexer:this},t,r))?(t=t.substring(m.raw.length),r.push(m),!0):!1))continue;if(m=this.tokenizer.escape(t)){t=t.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.tag(t)){t=t.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.link(t)){t=t.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(m.raw.length);const v=r.at(-1);m.type==="text"&&(v==null?void 0:v.type)==="text"?(v.raw+=m.raw,v.text+=m.text):r.push(m);continue}if(m=this.tokenizer.emStrong(t,n,l)){t=t.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.codespan(t)){t=t.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.br(t)){t=t.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.del(t)){t=t.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.autolink(t)){t=t.substring(m.raw.length),r.push(m);continue}if(!this.state.inLink&&(m=this.tokenizer.url(t))){t=t.substring(m.raw.length),r.push(m);continue}let g=t;if((d=this.options.extensions)!=null&&d.startInline){let v=1/0;const y=t.slice(1);let b;this.options.extensions.startInline.forEach(C=>{b=C.call({lexer:this},y),typeof b=="number"&&b>=0&&(v=Math.min(v,b))}),v<1/0&&v>=0&&(g=t.substring(0,v+1))}if(m=this.tokenizer.inlineText(g)){t=t.substring(m.raw.length),m.raw.slice(-1)!=="_"&&(l=m.raw.slice(-1)),a=!0;const v=r.at(-1);(v==null?void 0:v.type)==="text"?(v.raw+=m.raw,v.text+=m.text):r.push(m);continue}if(t){const v="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(v);break}else throw new Error(v)}}return r}},Ys=class{constructor(e){Br(this,"options"),Br(this,"parser"),this.options=e||oa}space(e){return""}code({text:e,lang:t,escaped:r}){var a;const n=(a=(t||"").match(gn.notSpaceStart))==null?void 0:a[0],o=e.replace(gn.endingNewline,"")+`
148
+ `;return n?'<pre><code class="language-'+no(n)+'">'+(r?o:no(o,!0))+`</code></pre>
149
+ `:"<pre><code>"+(r?o:no(o,!0))+`</code></pre>
150
+ `}blockquote({tokens:e}){return`<blockquote>
151
+ ${this.parser.parse(e)}</blockquote>
152
+ `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
153
+ `}hr(e){return`<hr>
154
+ `}list(e){const t=e.ordered,r=e.start;let n="";for(let l=0;l<e.items.length;l++){const u=e.items[l];n+=this.listitem(u)}const o=t?"ol":"ul",a=t&&r!==1?' start="'+r+'"':"";return"<"+o+a+`>
155
+ `+n+"</"+o+`>
156
+ `}listitem(e){var r;let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?((r=e.tokens[0])==null?void 0:r.type)==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+no(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
157
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
158
+ `}table(e){let t="",r="";for(let o=0;o<e.header.length;o++)r+=this.tablecell(e.header[o]);t+=this.tablerow({text:r});let n="";for(let o=0;o<e.rows.length;o++){const a=e.rows[o];r="";for(let l=0;l<a.length;l++)r+=this.tablecell(a[l]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
159
+ <thead>
160
+ `+t+`</thead>
161
+ `+n+`</table>
162
+ `}tablerow({text:e}){return`<tr>
163
+ ${e}</tr>
164
+ `}tablecell(e){const t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
165
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${no(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){const n=this.parser.parseInline(r),o=Yp(e);if(o===null)return n;e=o;let a='<a href="'+e+'"';return t&&(a+=' title="'+no(t)+'"'),a+=">"+n+"</a>",a}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));const o=Yp(e);if(o===null)return no(r);e=o;let a=`<img src="${e}" alt="${r}"`;return t&&(a+=` title="${no(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:no(e.text)}},td=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},vo=class K0{constructor(t){Br(this,"options"),Br(this,"renderer"),Br(this,"textRenderer"),this.options=t||oa,this.options.renderer=this.options.renderer||new Ys,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new td}static parse(t,r){return new K0(r).parse(t)}static parseInline(t,r){return new K0(r).parseInline(t)}parse(t,r=!0){var o,a;let n="";for(let l=0;l<t.length;l++){const u=t[l];if((a=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&a[u.type]){const d=u,m=this.options.extensions.renderers[d.type].call({parser:this},d);if(m!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(d.type)){n+=m||"";continue}}const f=u;switch(f.type){case"space":{n+=this.renderer.space(f);continue}case"hr":{n+=this.renderer.hr(f);continue}case"heading":{n+=this.renderer.heading(f);continue}case"code":{n+=this.renderer.code(f);continue}case"table":{n+=this.renderer.table(f);continue}case"blockquote":{n+=this.renderer.blockquote(f);continue}case"list":{n+=this.renderer.list(f);continue}case"html":{n+=this.renderer.html(f);continue}case"paragraph":{n+=this.renderer.paragraph(f);continue}case"text":{let d=f,m=this.renderer.text(d);for(;l+1<t.length&&t[l+1].type==="text";)d=t[++l],m+=`
166
+ `+this.renderer.text(d);r?n+=this.renderer.paragraph({type:"paragraph",raw:m,text:m,tokens:[{type:"text",raw:m,text:m,escaped:!0}]}):n+=m;continue}default:{const d='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(t,r=this.renderer){var o,a;let n="";for(let l=0;l<t.length;l++){const u=t[l];if((a=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&a[u.type]){const d=this.options.extensions.renderers[u.type].call({parser:this},u);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){n+=d||"";continue}}const f=u;switch(f.type){case"escape":{n+=r.text(f);break}case"html":{n+=r.html(f);break}case"link":{n+=r.link(f);break}case"image":{n+=r.image(f);break}case"strong":{n+=r.strong(f);break}case"em":{n+=r.em(f);break}case"codespan":{n+=r.codespan(f);break}case"br":{n+=r.br(f);break}case"del":{n+=r.del(f);break}case"text":{n+=r.text(f);break}default:{const d='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}},Pu,bs=(Pu=class{constructor(e){Br(this,"options"),Br(this,"block"),this.options=e||oa}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?go.lex:go.lexInline}provideParser(){return this.block?vo.parse:vo.parseInline}},Br(Pu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Pu),bD=class{constructor(...e){Br(this,"defaults",Uc()),Br(this,"options",this.setOptions),Br(this,"parse",this.parseMarkdown(!0)),Br(this,"parseInline",this.parseMarkdown(!1)),Br(this,"Parser",vo),Br(this,"Renderer",Ys),Br(this,"TextRenderer",td),Br(this,"Lexer",go),Br(this,"Tokenizer",Gs),Br(this,"Hooks",bs),this.use(...e)}walkTokens(e,t){var n,o;let r=[];for(const a of e)switch(r=r.concat(t.call(this,a)),a.type){case"table":{const l=a;for(const u of l.header)r=r.concat(this.walkTokens(u.tokens,t));for(const u of l.rows)for(const f of u)r=r.concat(this.walkTokens(f.tokens,t));break}case"list":{const l=a;r=r.concat(this.walkTokens(l.items,t));break}default:{const l=a;(o=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&o[l.type]?this.defaults.extensions.childTokens[l.type].forEach(u=>{const f=l[u].flat(1/0);r=r.concat(this.walkTokens(f,t))}):l.tokens&&(r=r.concat(this.walkTokens(l.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{const n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const a=t.renderers[o.name];a?t.renderers[o.name]=function(...l){let u=o.renderer.apply(this,l);return u===!1&&(u=a.apply(this,l)),u}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const a=t[o.level];a?a.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),n.extensions=t),r.renderer){const o=this.defaults.renderer||new Ys(this.defaults);for(const a in r.renderer){if(!(a in o))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;const l=a,u=r.renderer[l],f=o[l];o[l]=(...d)=>{let m=u.apply(o,d);return m===!1&&(m=f.apply(o,d)),m||""}}n.renderer=o}if(r.tokenizer){const o=this.defaults.tokenizer||new Gs(this.defaults);for(const a in r.tokenizer){if(!(a in o))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;const l=a,u=r.tokenizer[l],f=o[l];o[l]=(...d)=>{let m=u.apply(o,d);return m===!1&&(m=f.apply(o,d)),m}}n.tokenizer=o}if(r.hooks){const o=this.defaults.hooks||new bs;for(const a in r.hooks){if(!(a in o))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;const l=a,u=r.hooks[l],f=o[l];bs.passThroughHooks.has(a)?o[l]=d=>{if(this.defaults.async)return Promise.resolve(u.call(o,d)).then(g=>f.call(o,g));const m=u.call(o,d);return f.call(o,m)}:o[l]=(...d)=>{let m=u.apply(o,d);return m===!1&&(m=f.apply(o,d)),m}}n.hooks=o}if(r.walkTokens){const o=this.defaults.walkTokens,a=r.walkTokens;n.walkTokens=function(l){let u=[];return u.push(a.call(this,l)),o&&(u=u.concat(o.call(this,l))),u}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return go.lex(e,t??this.defaults)}parser(e,t){return vo.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{const n={...r},o={...this.defaults,...n},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&n.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const l=o.hooks?o.hooks.provideLexer():e?go.lex:go.lexInline,u=o.hooks?o.hooks.provideParser():e?vo.parse:vo.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(t):t).then(f=>l(f,o)).then(f=>o.hooks?o.hooks.processAllTokens(f):f).then(f=>o.walkTokens?Promise.all(this.walkTokens(f,o.walkTokens)).then(()=>f):f).then(f=>u(f,o)).then(f=>o.hooks?o.hooks.postprocess(f):f).catch(a);try{o.hooks&&(t=o.hooks.preprocess(t));let f=l(t,o);o.hooks&&(f=o.hooks.processAllTokens(f)),o.walkTokens&&this.walkTokens(f,o.walkTokens);let d=u(f,o);return o.hooks&&(d=o.hooks.postprocess(d)),d}catch(f){return a(f)}}}onError(e,t){return r=>{if(r.message+=`
167
+ Please report this to https://github.com/markedjs/marked.`,e){const n="<p>An error occurred:</p><pre>"+no(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},na=new bD;function br(e,t){return na.parse(e,t)}br.options=br.setOptions=function(e){return na.setOptions(e),br.defaults=na.defaults,Xg(br.defaults),br};br.getDefaults=Uc;br.defaults=oa;br.use=function(...e){return na.use(...e),br.defaults=na.defaults,Xg(br.defaults),br};br.walkTokens=function(e,t){return na.walkTokens(e,t)};br.parseInline=na.parseInline;br.Parser=vo;br.parser=vo.parse;br.Renderer=Ys;br.TextRenderer=td;br.Lexer=go;br.lexer=go.lex;br.Tokenizer=Gs;br.Hooks=bs;br.parse=br;br.options;br.setOptions;br.use;br.walkTokens;br.parseInline;vo.parse;go.lex;var En=function(){return En=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},En.apply(this,arguments)};function Ei(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}var Or="-ms-",hi="-moz-",xr="-webkit-",a2="comm",bl="rule",rd="decl",yD="@import",i2="@keyframes",xD="@layer",s2=Math.abs,nd=String.fromCharCode,q0=Object.assign;function wD(e,t){return Qr(e,0)^45?(((t<<2^Qr(e,0))<<2^Qr(e,1))<<2^Qr(e,2))<<2^Qr(e,3):0}function l2(e){return e.trim()}function po(e,t){return(e=t.exec(e))?e[0]:e}function Zt(e,t,r){return e.replace(t,r)}function ys(e,t,r){return e.indexOf(t,r)}function Qr(e,t){return e.charCodeAt(t)|0}function Sa(e,t,r){return e.slice(t,r)}function oo(e){return e.length}function u2(e){return e.length}function ri(e,t){return t.push(e),e}function CD(e,t){return e.map(t).join("")}function Qp(e,t){return e.filter(function(r){return!po(r,t)})}var yl=1,Aa=1,c2=0,zn=0,Xr=0,za="";function xl(e,t,r,n,o,a,l,u){return{value:e,root:t,parent:r,type:n,props:o,children:a,line:yl,column:Aa,length:l,return:"",siblings:u}}function Fo(e,t){return q0(xl("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function ca(e){for(;e.root;)e=Fo(e.root,{children:[e]});ri(e,e.siblings)}function DD(){return Xr}function kD(){return Xr=zn>0?Qr(za,--zn):0,Aa--,Xr===10&&(Aa=1,yl--),Xr}function Wn(){return Xr=zn<c2?Qr(za,zn++):0,Aa++,Xr===10&&(Aa=1,yl++),Xr}function Yo(){return Qr(za,zn)}function xs(){return zn}function wl(e,t){return Sa(za,e,t)}function V0(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ED(e){return yl=Aa=1,c2=oo(za=e),zn=0,[]}function SD(e){return za="",e}function zu(e){return l2(wl(zn-1,W0(e===91?e+2:e===40?e+1:e)))}function AD(e){for(;(Xr=Yo())&&Xr<33;)Wn();return V0(e)>2||V0(Xr)>3?"":" "}function BD(e,t){for(;--t&&Wn()&&!(Xr<48||Xr>102||Xr>57&&Xr<65||Xr>70&&Xr<97););return wl(e,xs()+(t<6&&Yo()==32&&Wn()==32))}function W0(e){for(;Wn();)switch(Xr){case e:return zn;case 34:case 39:e!==34&&e!==39&&W0(Xr);break;case 40:e===41&&W0(e);break;case 92:Wn();break}return zn}function FD(e,t){for(;Wn()&&e+Xr!==57&&!(e+Xr===84&&Yo()===47););return"/*"+wl(t,zn-1)+"*"+nd(e===47?e:Wn())}function TD(e){for(;!V0(Yo());)Wn();return wl(e,zn)}function $D(e){return SD(ws("",null,null,null,[""],e=ED(e),0,[0],e))}function ws(e,t,r,n,o,a,l,u,f){for(var d=0,m=0,g=l,v=0,y=0,b=0,C=1,p=1,S=1,B=0,k="",$=o,T=a,O=n,F=k;p;)switch(b=B,B=Wn()){case 40:if(b!=108&&Qr(F,g-1)==58){ys(F+=Zt(zu(B),"&","&\f"),"&\f",s2(d?u[d-1]:0))!=-1&&(S=-1);break}case 34:case 39:case 91:F+=zu(B);break;case 9:case 10:case 13:case 32:F+=AD(b);break;case 92:F+=BD(xs()-1,7);continue;case 47:switch(Yo()){case 42:case 47:ri(ND(FD(Wn(),xs()),t,r,f),f);break;default:F+="/"}break;case 123*C:u[d++]=oo(F)*S;case 125*C:case 59:case 0:switch(B){case 0:case 125:p=0;case 59+m:S==-1&&(F=Zt(F,/\f/g,"")),y>0&&oo(F)-g&&ri(y>32?tm(F+";",n,r,g-1,f):tm(Zt(F," ","")+";",n,r,g-2,f),f);break;case 59:F+=";";default:if(ri(O=em(F,t,r,d,m,o,u,k,$=[],T=[],g,a),a),B===123)if(m===0)ws(F,t,O,O,$,a,g,u,T);else switch(v===99&&Qr(F,3)===110?100:v){case 100:case 108:case 109:case 115:ws(e,O,O,n&&ri(em(e,O,O,0,0,o,u,k,o,$=[],g,T),T),o,T,g,u,n?$:T);break;default:ws(F,O,O,O,[""],T,0,u,T)}}d=m=y=0,C=S=1,k=F="",g=l;break;case 58:g=1+oo(F),y=b;default:if(C<1){if(B==123)--C;else if(B==125&&C++==0&&kD()==125)continue}switch(F+=nd(B),B*C){case 38:S=m>0?1:(F+="\f",-1);break;case 44:u[d++]=(oo(F)-1)*S,S=1;break;case 64:Yo()===45&&(F+=zu(Wn())),v=Yo(),m=g=oo(k=F+=TD(xs())),B++;break;case 45:b===45&&oo(F)==2&&(C=0)}}return a}function em(e,t,r,n,o,a,l,u,f,d,m,g){for(var v=o-1,y=o===0?a:[""],b=u2(y),C=0,p=0,S=0;C<n;++C)for(var B=0,k=Sa(e,v+1,v=s2(p=l[C])),$=e;B<b;++B)($=l2(p>0?y[B]+" "+k:Zt(k,/&\f/g,y[B])))&&(f[S++]=$);return xl(e,t,r,o===0?bl:u,f,d,m,g)}function ND(e,t,r,n){return xl(e,t,r,a2,nd(DD()),Sa(e,2,-2),0,n)}function tm(e,t,r,n,o){return xl(e,t,r,rd,Sa(e,0,n),Sa(e,n+1,-1),n,o)}function d2(e,t,r){switch(wD(e,t)){case 5103:return xr+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return xr+e+e;case 4789:return hi+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return xr+e+hi+e+Or+e+e;case 5936:switch(Qr(e,t+11)){case 114:return xr+e+Or+Zt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return xr+e+Or+Zt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return xr+e+Or+Zt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return xr+e+Or+e+e;case 6165:return xr+e+Or+"flex-"+e+e;case 5187:return xr+e+Zt(e,/(\w+).+(:[^]+)/,xr+"box-$1$2"+Or+"flex-$1$2")+e;case 5443:return xr+e+Or+"flex-item-"+Zt(e,/flex-|-self/g,"")+(po(e,/flex-|baseline/)?"":Or+"grid-row-"+Zt(e,/flex-|-self/g,""))+e;case 4675:return xr+e+Or+"flex-line-pack"+Zt(e,/align-content|flex-|-self/g,"")+e;case 5548:return xr+e+Or+Zt(e,"shrink","negative")+e;case 5292:return xr+e+Or+Zt(e,"basis","preferred-size")+e;case 6060:return xr+"box-"+Zt(e,"-grow","")+xr+e+Or+Zt(e,"grow","positive")+e;case 4554:return xr+Zt(e,/([^-])(transform)/g,"$1"+xr+"$2")+e;case 6187:return Zt(Zt(Zt(e,/(zoom-|grab)/,xr+"$1"),/(image-set)/,xr+"$1"),e,"")+e;case 5495:case 3959:return Zt(e,/(image-set\([^]*)/,xr+"$1$`$1");case 4968:return Zt(Zt(e,/(.+:)(flex-)?(.*)/,xr+"box-pack:$3"+Or+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+xr+e+e;case 4200:if(!po(e,/flex-|baseline/))return Or+"grid-column-align"+Sa(e,t)+e;break;case 2592:case 3360:return Or+Zt(e,"template-","")+e;case 4384:case 3616:return r&&r.some(function(n,o){return t=o,po(n.props,/grid-\w+-end/)})?~ys(e+(r=r[t].value),"span",0)?e:Or+Zt(e,"-start","")+e+Or+"grid-row-span:"+(~ys(r,"span",0)?po(r,/\d+/):+po(r,/\d+/)-+po(e,/\d+/))+";":Or+Zt(e,"-start","")+e;case 4896:case 4128:return r&&r.some(function(n){return po(n.props,/grid-\w+-start/)})?e:Or+Zt(Zt(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Zt(e,/(.+)-inline(.+)/,xr+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(oo(e)-1-t>6)switch(Qr(e,t+1)){case 109:if(Qr(e,t+4)!==45)break;case 102:return Zt(e,/(.+:)(.+)-([^]+)/,"$1"+xr+"$2-$3$1"+hi+(Qr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~ys(e,"stretch",0)?d2(Zt(e,"stretch","fill-available"),t,r)+e:e}break;case 5152:case 5920:return Zt(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(n,o,a,l,u,f,d){return Or+o+":"+a+d+(l?Or+o+"-span:"+(u?f:+f-+a)+d:"")+e});case 4949:if(Qr(e,t+6)===121)return Zt(e,":",":"+xr)+e;break;case 6444:switch(Qr(e,Qr(e,14)===45?18:11)){case 120:return Zt(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+xr+(Qr(e,14)===45?"inline-":"")+"box$3$1"+xr+"$2$3$1"+Or+"$2box$3")+e;case 100:return Zt(e,":",":"+Or)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Zt(e,"scroll-","scroll-snap-")+e}return e}function Zs(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function OD(e,t,r,n){switch(e.type){case xD:if(e.children.length)break;case yD:case rd:return e.return=e.return||e.value;case a2:return"";case i2:return e.return=e.value+"{"+Zs(e.children,n)+"}";case bl:if(!oo(e.value=e.props.join(",")))return""}return oo(r=Zs(e.children,n))?e.return=e.value+"{"+r+"}":""}function MD(e){var t=u2(e);return function(r,n,o,a){for(var l="",u=0;u<t;u++)l+=e[u](r,n,o,a)||"";return l}}function ID(e){return function(t){t.root||(t=t.return)&&e(t)}}function RD(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case rd:e.return=d2(e.value,e.length,r);return;case i2:return Zs([Fo(e,{value:Zt(e.value,"@","@"+xr)})],n);case bl:if(e.length)return CD(r=e.props,function(o){switch(po(o,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":ca(Fo(e,{props:[Zt(o,/:(read-\w+)/,":"+hi+"$1")]})),ca(Fo(e,{props:[o]})),q0(e,{props:Qp(r,n)});break;case"::placeholder":ca(Fo(e,{props:[Zt(o,/:(plac\w+)/,":"+xr+"input-$1")]})),ca(Fo(e,{props:[Zt(o,/:(plac\w+)/,":"+hi+"$1")]})),ca(Fo(e,{props:[Zt(o,/:(plac\w+)/,Or+"input-$1")]})),ca(Fo(e,{props:[o]})),q0(e,{props:Qp(r,n)});break}return""})}}var PD={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Ba=typeof process<"u"&&Fn!==void 0&&(Fn.REACT_APP_SC_ATTR||Fn.SC_ATTR)||"data-styled",f2="active",h2="data-styled-version",Cl="6.1.19",od=`/*!sc*/
168
+ `,Js=typeof window<"u"&&typeof document<"u",zD=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Fn!==void 0&&Fn.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Fn.REACT_APP_SC_DISABLE_SPEEDY!==""?Fn.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Fn.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&Fn!==void 0&&Fn.SC_DISABLE_SPEEDY!==void 0&&Fn.SC_DISABLE_SPEEDY!==""&&Fn.SC_DISABLE_SPEEDY!=="false"&&Fn.SC_DISABLE_SPEEDY),Dl=Object.freeze([]),Fa=Object.freeze({});function _D(e,t,r){return r===void 0&&(r=Fa),e.theme!==r.theme&&e.theme||t||r.theme}var p2=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),jD=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,LD=/(^-|-$)/g;function rm(e){return e.replace(jD,"-").replace(LD,"")}var HD=/(a)(d)/gi,is=52,nm=function(e){return String.fromCharCode(e+(e>25?39:97))};function U0(e){var t,r="";for(t=Math.abs(e);t>is;t=t/is|0)r=nm(t%is)+r;return(nm(t%is)+r).replace(HD,"$1-$2")}var _u,m2=5381,va=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},g2=function(e){return va(m2,e)};function v2(e){return U0(g2(e)>>>0)}function KD(e){return e.displayName||e.name||"Component"}function ju(e){return typeof e=="string"&&!0}var b2=typeof Symbol=="function"&&Symbol.for,y2=b2?Symbol.for("react.memo"):60115,qD=b2?Symbol.for("react.forward_ref"):60112,VD={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},WD={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},x2={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},UD=((_u={})[qD]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},_u[y2]=x2,_u);function om(e){return("type"in(t=e)&&t.type.$$typeof)===y2?x2:"$$typeof"in e?UD[e.$$typeof]:VD;var t}var XD=Object.defineProperty,GD=Object.getOwnPropertyNames,am=Object.getOwnPropertySymbols,YD=Object.getOwnPropertyDescriptor,ZD=Object.getPrototypeOf,im=Object.prototype;function w2(e,t,r){if(typeof t!="string"){if(im){var n=ZD(t);n&&n!==im&&w2(e,n,r)}var o=GD(t);am&&(o=o.concat(am(t)));for(var a=om(e),l=om(t),u=0;u<o.length;++u){var f=o[u];if(!(f in WD||r&&r[f]||l&&f in l||a&&f in a)){var d=YD(t,f);try{XD(e,f,d)}catch{}}}}return e}function Ta(e){return typeof e=="function"}function ad(e){return typeof e=="object"&&"styledComponentId"in e}function Wo(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function X0(e,t){if(e.length===0)return"";for(var r=e[0],n=1;n<e.length;n++)r+=e[n];return r}function Si(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function G0(e,t,r){if(r===void 0&&(r=!1),!r&&!Si(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var n=0;n<t.length;n++)e[n]=G0(e[n],t[n]);else if(Si(t))for(var n in t)e[n]=G0(e[n],t[n]);return e}function id(e,t){Object.defineProperty(e,"toString",{value:t})}function zi(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var JD=(function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var r=0,n=0;n<t;n++)r+=this.groupSizes[n];return r},e.prototype.insertRules=function(t,r){if(t>=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,a=o;t>=a;)if((a<<=1)<0)throw zi(16,"".concat(t));this.groupSizes=new Uint32Array(a),this.groupSizes.set(n),this.length=a;for(var l=o;l<a;l++)this.groupSizes[l]=0}for(var u=this.indexOfGroup(t+1),f=(l=0,r.length);l<f;l++)this.tag.insertRule(u,r[l])&&(this.groupSizes[t]++,u++)},e.prototype.clearGroup=function(t){if(t<this.length){var r=this.groupSizes[t],n=this.indexOfGroup(t),o=n+r;this.groupSizes[t]=0;for(var a=n;a<o;a++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(t){var r="";if(t>=this.length||this.groupSizes[t]===0)return r;for(var n=this.groupSizes[t],o=this.indexOfGroup(t),a=o+n,l=o;l<a;l++)r+="".concat(this.tag.getRule(l)).concat(od);return r},e})(),Cs=new Map,Qs=new Map,Ds=1,ss=function(e){if(Cs.has(e))return Cs.get(e);for(;Qs.has(Ds);)Ds++;var t=Ds++;return Cs.set(e,t),Qs.set(t,e),t},QD=function(e,t){Ds=t+1,Cs.set(e,t),Qs.set(t,e)},e9="style[".concat(Ba,"][").concat(h2,'="').concat(Cl,'"]'),t9=new RegExp("^".concat(Ba,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),r9=function(e,t,r){for(var n,o=r.split(","),a=0,l=o.length;a<l;a++)(n=o[a])&&e.registerName(t,n)},n9=function(e,t){for(var r,n=((r=t.textContent)!==null&&r!==void 0?r:"").split(od),o=[],a=0,l=n.length;a<l;a++){var u=n[a].trim();if(u){var f=u.match(t9);if(f){var d=0|parseInt(f[1],10),m=f[2];d!==0&&(QD(m,d),r9(e,m,f[3]),e.getTag().insertRules(d,o)),o.length=0}else o.push(u)}}},sm=function(e){for(var t=document.querySelectorAll(e9),r=0,n=t.length;r<n;r++){var o=t[r];o&&o.getAttribute(Ba)!==f2&&(n9(e,o),o.parentNode&&o.parentNode.removeChild(o))}};function o9(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var C2=function(e){var t=document.head,r=e||t,n=document.createElement("style"),o=(function(u){var f=Array.from(u.querySelectorAll("style[".concat(Ba,"]")));return f[f.length-1]})(r),a=o!==void 0?o.nextSibling:null;n.setAttribute(Ba,f2),n.setAttribute(h2,Cl);var l=o9();return l&&n.setAttribute("nonce",l),r.insertBefore(n,a),n},a9=(function(){function e(t){this.element=C2(t),this.element.appendChild(document.createTextNode("")),this.sheet=(function(r){if(r.sheet)return r.sheet;for(var n=document.styleSheets,o=0,a=n.length;o<a;o++){var l=n[o];if(l.ownerNode===r)return l}throw zi(17)})(this.element),this.length=0}return e.prototype.insertRule=function(t,r){try{return this.sheet.insertRule(r,t),this.length++,!0}catch{return!1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},e.prototype.getRule=function(t){var r=this.sheet.cssRules[t];return r&&r.cssText?r.cssText:""},e})(),i9=(function(){function e(t){this.element=C2(t),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(t,r){if(t<=this.length&&t>=0){var n=document.createTextNode(r);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},e})(),s9=(function(){function e(t){this.rules=[],this.length=0}return e.prototype.insertRule=function(t,r){return t<=this.length&&(this.rules.splice(t,0,r),this.length++,!0)},e.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},e.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},e})(),lm=Js,l9={isServer:!Js,useCSSOMInjection:!zD},D2=(function(){function e(t,r,n){t===void 0&&(t=Fa),r===void 0&&(r={});var o=this;this.options=En(En({},l9),t),this.gs=r,this.names=new Map(n),this.server=!!t.isServer,!this.server&&Js&&lm&&(lm=!1,sm(this)),id(this,function(){return(function(a){for(var l=a.getTag(),u=l.length,f="",d=function(g){var v=(function(S){return Qs.get(S)})(g);if(v===void 0)return"continue";var y=a.names.get(v),b=l.getGroup(g);if(y===void 0||!y.size||b.length===0)return"continue";var C="".concat(Ba,".g").concat(g,'[id="').concat(v,'"]'),p="";y!==void 0&&y.forEach(function(S){S.length>0&&(p+="".concat(S,","))}),f+="".concat(b).concat(C,'{content:"').concat(p,'"}').concat(od)},m=0;m<u;m++)d(m);return f})(o)})}return e.registerId=function(t){return ss(t)},e.prototype.rehydrate=function(){!this.server&&Js&&sm(this)},e.prototype.reconstructWithOptions=function(t,r){return r===void 0&&(r=!0),new e(En(En({},this.options),t),this.gs,r&&this.names||void 0)},e.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(t=(function(r){var n=r.useCSSOMInjection,o=r.target;return r.isServer?new s9(o):n?new a9(o):new i9(o)})(this.options),new JD(t)));var t},e.prototype.hasNameForId=function(t,r){return this.names.has(t)&&this.names.get(t).has(r)},e.prototype.registerName=function(t,r){if(ss(t),this.names.has(t))this.names.get(t).add(r);else{var n=new Set;n.add(r),this.names.set(t,n)}},e.prototype.insertRules=function(t,r,n){this.registerName(t,r),this.getTag().insertRules(ss(t),n)},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.prototype.clearRules=function(t){this.getTag().clearGroup(ss(t)),this.clearNames(t)},e.prototype.clearTag=function(){this.tag=void 0},e})(),u9=/&/g,c9=/^\s*\/\/.*$/gm;function k2(e,t){return e.map(function(r){return r.type==="rule"&&(r.value="".concat(t," ").concat(r.value),r.value=r.value.replaceAll(",",",".concat(t," ")),r.props=r.props.map(function(n){return"".concat(t," ").concat(n)})),Array.isArray(r.children)&&r.type!=="@keyframes"&&(r.children=k2(r.children,t)),r})}function d9(e){var t,r,n,o=Fa,a=o.options,l=a===void 0?Fa:a,u=o.plugins,f=u===void 0?Dl:u,d=function(v,y,b){return b.startsWith(r)&&b.endsWith(r)&&b.replaceAll(r,"").length>0?".".concat(t):v},m=f.slice();m.push(function(v){v.type===bl&&v.value.includes("&")&&(v.props[0]=v.props[0].replace(u9,r).replace(n,d))}),l.prefix&&m.push(RD),m.push(OD);var g=function(v,y,b,C){y===void 0&&(y=""),b===void 0&&(b=""),C===void 0&&(C="&"),t=C,r=y,n=new RegExp("\\".concat(r,"\\b"),"g");var p=v.replace(c9,""),S=$D(b||y?"".concat(b," ").concat(y," { ").concat(p," }"):p);l.namespace&&(S=k2(S,l.namespace));var B=[];return Zs(S,MD(m.concat(ID(function(k){return B.push(k)})))),B};return g.hash=f.length?f.reduce(function(v,y){return y.name||zi(15),va(v,y.name)},m2).toString():"",g}var f9=new D2,Y0=d9(),E2=We.createContext({shouldForwardProp:void 0,styleSheet:f9,stylis:Y0});E2.Consumer;We.createContext(void 0);function um(){return jo(E2)}var S2=(function(){function e(t,r){var n=this;this.inject=function(o,a){a===void 0&&(a=Y0);var l=n.name+a.hash;o.hasNameForId(n.id,l)||o.insertRules(n.id,l,a(n.rules,l,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=r,id(this,function(){throw zi(12,String(n.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=Y0),this.name+t.hash},e})(),h9=function(e){return e>="A"&&e<="Z"};function cm(e){for(var t="",r=0;r<e.length;r++){var n=e[r];if(r===1&&n==="-"&&e[0]==="-")return e;h9(n)?t+="-"+n.toLowerCase():t+=n}return t.startsWith("ms-")?"-"+t:t}var A2=function(e){return e==null||e===!1||e===""},B2=function(e){var t,r,n=[];for(var o in e){var a=e[o];e.hasOwnProperty(o)&&!A2(a)&&(Array.isArray(a)&&a.isCss||Ta(a)?n.push("".concat(cm(o),":"),a,";"):Si(a)?n.push.apply(n,Ei(Ei(["".concat(o," {")],B2(a),!1),["}"],!1)):n.push("".concat(cm(o),": ").concat((t=o,(r=a)==null||typeof r=="boolean"||r===""?"":typeof r!="number"||r===0||t in PD||t.startsWith("--")?String(r).trim():"".concat(r,"px")),";")))}return n};function Zo(e,t,r,n){if(A2(e))return[];if(ad(e))return[".".concat(e.styledComponentId)];if(Ta(e)){if(!Ta(a=e)||a.prototype&&a.prototype.isReactComponent||!t)return[e];var o=e(t);return Zo(o,t,r,n)}var a;return e instanceof S2?r?(e.inject(r,n),[e.getName(n)]):[e]:Si(e)?B2(e):Array.isArray(e)?Array.prototype.concat.apply(Dl,e.map(function(l){return Zo(l,t,r,n)})):[e.toString()]}function p9(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(Ta(r)&&!ad(r))return!1}return!0}var m9=g2(Cl),g9=(function(){function e(t,r,n){this.rules=t,this.staticRulesId="",this.isStatic=(n===void 0||n.isStatic)&&p9(t),this.componentId=r,this.baseHash=va(m9,r),this.baseStyle=n,D2.registerId(r)}return e.prototype.generateAndInjectStyles=function(t,r,n){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,r,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&r.hasNameForId(this.componentId,this.staticRulesId))o=Wo(o,this.staticRulesId);else{var a=X0(Zo(this.rules,t,r,n)),l=U0(va(this.baseHash,a)>>>0);if(!r.hasNameForId(this.componentId,l)){var u=n(a,".".concat(l),void 0,this.componentId);r.insertRules(this.componentId,l,u)}o=Wo(o,l),this.staticRulesId=l}else{for(var f=va(this.baseHash,n.hash),d="",m=0;m<this.rules.length;m++){var g=this.rules[m];if(typeof g=="string")d+=g;else if(g){var v=X0(Zo(g,t,r,n));f=va(f,v+m),d+=v}}if(d){var y=U0(f>>>0);r.hasNameForId(this.componentId,y)||r.insertRules(this.componentId,y,n(d,".".concat(y),void 0,this.componentId)),o=Wo(o,y)}}return o},e})(),F2=We.createContext(void 0);F2.Consumer;var Lu={};function v9(e,t,r){var n=ad(e),o=e,a=!ju(e),l=t.attrs,u=l===void 0?Dl:l,f=t.componentId,d=f===void 0?(function($,T){var O=typeof $!="string"?"sc":rm($);Lu[O]=(Lu[O]||0)+1;var F="".concat(O,"-").concat(v2(Cl+O+Lu[O]));return T?"".concat(T,"-").concat(F):F})(t.displayName,t.parentComponentId):f,m=t.displayName,g=m===void 0?(function($){return ju($)?"styled.".concat($):"Styled(".concat(KD($),")")})(e):m,v=t.displayName&&t.componentId?"".concat(rm(t.displayName),"-").concat(t.componentId):t.componentId||d,y=n&&o.attrs?o.attrs.concat(u).filter(Boolean):u,b=t.shouldForwardProp;if(n&&o.shouldForwardProp){var C=o.shouldForwardProp;if(t.shouldForwardProp){var p=t.shouldForwardProp;b=function($,T){return C($,T)&&p($,T)}}else b=C}var S=new g9(r,v,n?o.componentStyle:void 0);function B($,T){return(function(O,F,P){var N=O.attrs,q=O.componentStyle,R=O.defaultProps,X=O.foldedComponentIds,G=O.styledComponentId,_=O.target,j=We.useContext(F2),W=um(),U=O.shouldForwardProp||W.shouldForwardProp,ee=_D(F,j,R)||Fa,V=(function($e,Z,ie){for(var le,ue=En(En({},Z),{className:void 0,theme:ie}),Se=0;Se<$e.length;Se+=1){var Be=Ta(le=$e[Se])?le(ue):le;for(var ge in Be)ue[ge]=ge==="className"?Wo(ue[ge],Be[ge]):ge==="style"?En(En({},ue[ge]),Be[ge]):Be[ge]}return Z.className&&(ue.className=Wo(ue.className,Z.className)),ue})(N,F,ee),Y=V.as||_,fe={};for(var be in V)V[be]===void 0||be[0]==="$"||be==="as"||be==="theme"&&V.theme===ee||(be==="forwardedAs"?fe.as=V.forwardedAs:U&&!U(be,Y)||(fe[be]=V[be]));var he=(function($e,Z){var ie=um(),le=$e.generateAndInjectStyles(Z,ie.styleSheet,ie.stylis);return le})(q,V),De=Wo(X,G);return he&&(De+=" "+he),V.className&&(De+=" "+V.className),fe[ju(Y)&&!p2.has(Y)?"class":"className"]=De,P&&(fe.ref=P),As(Y,fe)})(k,$,T)}B.displayName=g;var k=We.forwardRef(B);return k.attrs=y,k.componentStyle=S,k.displayName=g,k.shouldForwardProp=b,k.foldedComponentIds=n?Wo(o.foldedComponentIds,o.styledComponentId):"",k.styledComponentId=v,k.target=n?o.target:e,Object.defineProperty(k,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function($){this._foldedDefaultProps=n?(function(T){for(var O=[],F=1;F<arguments.length;F++)O[F-1]=arguments[F];for(var P=0,N=O;P<N.length;P++)G0(T,N[P],!0);return T})({},o.defaultProps,$):$}}),id(k,function(){return".".concat(k.styledComponentId)}),a&&w2(k,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),k}function dm(e,t){for(var r=[e[0]],n=0,o=t.length;n<o;n+=1)r.push(t[n],e[n+1]);return r}var fm=function(e){return Object.assign(e,{isCss:!0})};function kl(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(Ta(e)||Si(e))return fm(Zo(dm(Dl,Ei([e],t,!0))));var n=e;return t.length===0&&n.length===1&&typeof n[0]=="string"?Zo(n):fm(Zo(dm(n,t)))}function Z0(e,t,r){if(r===void 0&&(r=Fa),!t)throw zi(1,t);var n=function(o){for(var a=[],l=1;l<arguments.length;l++)a[l-1]=arguments[l];return e(t,r,kl.apply(void 0,Ei([o],a,!1)))};return n.attrs=function(o){return Z0(e,t,En(En({},r),{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},n.withConfig=function(o){return Z0(e,t,En(En({},r),o))},n}var T2=function(e){return Z0(v9,e)},Xe=T2;p2.forEach(function(e){Xe[e]=T2(e)});function $2(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=X0(kl.apply(void 0,Ei([e],t,!1))),o=v2(n);return new S2(o,n)}var hm={exports:{}},pm;function b9(){return pm||(pm=1,(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
169
+ * Prism: Lightweight, robust, elegant syntax highlighting
170
+ *
171
+ * @license MIT <https://opensource.org/licenses/MIT>
172
+ * @author Lea Verou <https://lea.verou.me>
173
+ * @namespace
174
+ * @public
175
+ */var r=(function(n){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,a=0,l={},u={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:function B(k){return k instanceof f?new f(k.type,B(k.content),k.alias):Array.isArray(k)?k.map(B):k.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(B){return Object.prototype.toString.call(B).slice(8,-1)},objId:function(B){return B.__id||Object.defineProperty(B,"__id",{value:++a}),B.__id},clone:function B(k,$){$=$||{};var T,O;switch(u.util.type(k)){case"Object":if(O=u.util.objId(k),$[O])return $[O];T={},$[O]=T;for(var F in k)k.hasOwnProperty(F)&&(T[F]=B(k[F],$));return T;case"Array":return O=u.util.objId(k),$[O]?$[O]:(T=[],$[O]=T,k.forEach(function(P,N){T[N]=B(P,$)}),T);default:return k}},getLanguage:function(B){for(;B;){var k=o.exec(B.className);if(k)return k[1].toLowerCase();B=B.parentElement}return"none"},setLanguage:function(B,k){B.className=B.className.replace(RegExp(o,"gi"),""),B.classList.add("language-"+k)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(T){var B=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(T.stack)||[])[1];if(B){var k=document.getElementsByTagName("script");for(var $ in k)if(k[$].src==B)return k[$]}return null}},isActive:function(B,k,$){for(var T="no-"+k;B;){var O=B.classList;if(O.contains(k))return!0;if(O.contains(T))return!1;B=B.parentElement}return!!$}},languages:{plain:l,plaintext:l,text:l,txt:l,extend:function(B,k){var $=u.util.clone(u.languages[B]);for(var T in k)$[T]=k[T];return $},insertBefore:function(B,k,$,T){T=T||u.languages;var O=T[B],F={};for(var P in O)if(O.hasOwnProperty(P)){if(P==k)for(var N in $)$.hasOwnProperty(N)&&(F[N]=$[N]);$.hasOwnProperty(P)||(F[P]=O[P])}var q=T[B];return T[B]=F,u.languages.DFS(u.languages,function(R,X){X===q&&R!=B&&(this[R]=F)}),F},DFS:function B(k,$,T,O){O=O||{};var F=u.util.objId;for(var P in k)if(k.hasOwnProperty(P)){$.call(k,P,k[P],T||P);var N=k[P],q=u.util.type(N);q==="Object"&&!O[F(N)]?(O[F(N)]=!0,B(N,$,null,O)):q==="Array"&&!O[F(N)]&&(O[F(N)]=!0,B(N,$,P,O))}}},plugins:{},highlightAll:function(B,k){u.highlightAllUnder(document,B,k)},highlightAllUnder:function(B,k,$){var T={callback:$,container:B,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};u.hooks.run("before-highlightall",T),T.elements=Array.prototype.slice.apply(T.container.querySelectorAll(T.selector)),u.hooks.run("before-all-elements-highlight",T);for(var O=0,F;F=T.elements[O++];)u.highlightElement(F,k===!0,T.callback)},highlightElement:function(B,k,$){var T=u.util.getLanguage(B),O=u.languages[T];u.util.setLanguage(B,T);var F=B.parentElement;F&&F.nodeName.toLowerCase()==="pre"&&u.util.setLanguage(F,T);var P=B.textContent,N={element:B,language:T,grammar:O,code:P};function q(X){N.highlightedCode=X,u.hooks.run("before-insert",N),N.element.innerHTML=N.highlightedCode,u.hooks.run("after-highlight",N),u.hooks.run("complete",N),$&&$.call(N.element)}if(u.hooks.run("before-sanity-check",N),F=N.element.parentElement,F&&F.nodeName.toLowerCase()==="pre"&&!F.hasAttribute("tabindex")&&F.setAttribute("tabindex","0"),!N.code){u.hooks.run("complete",N),$&&$.call(N.element);return}if(u.hooks.run("before-highlight",N),!N.grammar){q(u.util.encode(N.code));return}if(k&&n.Worker){var R=new Worker(u.filename);R.onmessage=function(X){q(X.data)},R.postMessage(JSON.stringify({language:N.language,code:N.code,immediateClose:!0}))}else q(u.highlight(N.code,N.grammar,N.language))},highlight:function(B,k,$){var T={code:B,grammar:k,language:$};if(u.hooks.run("before-tokenize",T),!T.grammar)throw new Error('The language "'+T.language+'" has no grammar.');return T.tokens=u.tokenize(T.code,T.grammar),u.hooks.run("after-tokenize",T),f.stringify(u.util.encode(T.tokens),T.language)},tokenize:function(B,k){var $=k.rest;if($){for(var T in $)k[T]=$[T];delete k.rest}var O=new g;return v(O,O.head,B),m(B,O,k,O.head,0),b(O)},hooks:{all:{},add:function(B,k){var $=u.hooks.all;$[B]=$[B]||[],$[B].push(k)},run:function(B,k){var $=u.hooks.all[B];if(!(!$||!$.length))for(var T=0,O;O=$[T++];)O(k)}},Token:f};n.Prism=u;function f(B,k,$,T){this.type=B,this.content=k,this.alias=$,this.length=(T||"").length|0}f.stringify=function B(k,$){if(typeof k=="string")return k;if(Array.isArray(k)){var T="";return k.forEach(function(q){T+=B(q,$)}),T}var O={type:k.type,content:B(k.content,$),tag:"span",classes:["token",k.type],attributes:{},language:$},F=k.alias;F&&(Array.isArray(F)?Array.prototype.push.apply(O.classes,F):O.classes.push(F)),u.hooks.run("wrap",O);var P="";for(var N in O.attributes)P+=" "+N+'="'+(O.attributes[N]||"").replace(/"/g,"&quot;")+'"';return"<"+O.tag+' class="'+O.classes.join(" ")+'"'+P+">"+O.content+"</"+O.tag+">"};function d(B,k,$,T){B.lastIndex=k;var O=B.exec($);if(O&&T&&O[1]){var F=O[1].length;O.index+=F,O[0]=O[0].slice(F)}return O}function m(B,k,$,T,O,F){for(var P in $)if(!(!$.hasOwnProperty(P)||!$[P])){var N=$[P];N=Array.isArray(N)?N:[N];for(var q=0;q<N.length;++q){if(F&&F.cause==P+","+q)return;var R=N[q],X=R.inside,G=!!R.lookbehind,_=!!R.greedy,j=R.alias;if(_&&!R.pattern.global){var W=R.pattern.toString().match(/[imsuy]*$/)[0];R.pattern=RegExp(R.pattern.source,W+"g")}for(var U=R.pattern||R,ee=T.next,V=O;ee!==k.tail&&!(F&&V>=F.reach);V+=ee.value.length,ee=ee.next){var Y=ee.value;if(k.length>B.length)return;if(!(Y instanceof f)){var fe=1,be;if(_){if(be=d(U,V,B,G),!be||be.index>=B.length)break;var Z=be.index,he=be.index+be[0].length,De=V;for(De+=ee.value.length;Z>=De;)ee=ee.next,De+=ee.value.length;if(De-=ee.value.length,V=De,ee.value instanceof f)continue;for(var $e=ee;$e!==k.tail&&(De<he||typeof $e.value=="string");$e=$e.next)fe++,De+=$e.value.length;fe--,Y=B.slice(V,De),be.index-=V}else if(be=d(U,0,Y,G),!be)continue;var Z=be.index,ie=be[0],le=Y.slice(0,Z),ue=Y.slice(Z+ie.length),Se=V+Y.length;F&&Se>F.reach&&(F.reach=Se);var Be=ee.prev;le&&(Be=v(k,Be,le),V+=le.length),y(k,Be,fe);var ge=new f(P,X?u.tokenize(ie,X):ie,j,ie);if(ee=v(k,Be,ge),ue&&v(k,ee,ue),fe>1){var Ee={cause:P+","+q,reach:Se};m(B,k,$,ee.prev,V,Ee),F&&Ee.reach>F.reach&&(F.reach=Ee.reach)}}}}}}function g(){var B={value:null,prev:null,next:null},k={value:null,prev:B,next:null};B.next=k,this.head=B,this.tail=k,this.length=0}function v(B,k,$){var T=k.next,O={value:$,prev:k,next:T};return k.next=O,T.prev=O,B.length++,O}function y(B,k,$){for(var T=k.next,O=0;O<$&&T!==B.tail;O++)T=T.next;k.next=T,T.prev=k,B.length-=O}function b(B){for(var k=[],$=B.head.next;$!==B.tail;)k.push($.value),$=$.next;return k}if(!n.document)return n.addEventListener&&(u.disableWorkerMessageHandler||n.addEventListener("message",function(B){var k=JSON.parse(B.data),$=k.language,T=k.code,O=k.immediateClose;n.postMessage(u.highlight(T,u.languages[$],$)),O&&n.close()},!1)),u;var C=u.util.currentScript();C&&(u.filename=C.src,C.hasAttribute("data-manual")&&(u.manual=!0));function p(){u.manual||u.highlightAll()}if(!u.manual){var S=document.readyState;S==="loading"||S==="interactive"&&C&&C.defer?document.addEventListener("DOMContentLoaded",p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return u})(t);e.exports&&(e.exports=r),typeof pa<"u"&&(pa.Prism=r),r.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},r.languages.markup.tag.inside["attr-value"].inside.entity=r.languages.markup.entity,r.languages.markup.doctype.inside["internal-subset"].inside=r.languages.markup,r.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&amp;/,"&"))}),Object.defineProperty(r.languages.markup.tag,"addInlined",{value:function(n,o){var a={};a["language-"+o]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:r.languages[o]},a.cdata=/^<!\[CDATA\[|\]\]>$/i;var l={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:a}};l["language-"+o]={pattern:/[\s\S]+/,inside:r.languages[o]};var u={};u[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:l},r.languages.insertBefore("markup","cdata",u)}}),Object.defineProperty(r.languages.markup.tag,"addAttribute",{value:function(n,o){r.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[o,"language-"+o],inside:r.languages[o]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),r.languages.html=r.languages.markup,r.languages.mathml=r.languages.markup,r.languages.svg=r.languages.markup,r.languages.xml=r.languages.extend("markup",{}),r.languages.ssml=r.languages.xml,r.languages.atom=r.languages.xml,r.languages.rss=r.languages.xml,(function(n){var o=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+o.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+o.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+o.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+o.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:o,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var a=n.languages.markup;a&&(a.tag.addInlined("style","css"),a.tag.addAttribute("style","css"))})(r),r.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},r.languages.javascript=r.languages.extend("clike",{"class-name":[r.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),r.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,r.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:r.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:r.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:r.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:r.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:r.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),r.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:r.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),r.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),r.languages.markup&&(r.languages.markup.tag.addInlined("script","javascript"),r.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),r.languages.js=r.languages.javascript,(function(){if(typeof r>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var n="Loading\u2026",o=function(C,p){return"\u2716 Error "+C+" while fetching file: "+p},a="\u2716 Error: File does not exist or is empty",l={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},u="data-src-status",f="loading",d="loaded",m="failed",g="pre[data-src]:not(["+u+'="'+d+'"]):not(['+u+'="'+f+'"])';function v(C,p,S){var B=new XMLHttpRequest;B.open("GET",C,!0),B.onreadystatechange=function(){B.readyState==4&&(B.status<400&&B.responseText?p(B.responseText):B.status>=400?S(o(B.status,B.statusText)):S(a))},B.send(null)}function y(C){var p=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(C||"");if(p){var S=Number(p[1]),B=p[2],k=p[3];return B?k?[S,Number(k)]:[S,void 0]:[S,S]}}r.hooks.add("before-highlightall",function(C){C.selector+=", "+g}),r.hooks.add("before-sanity-check",function(C){var p=C.element;if(p.matches(g)){C.code="",p.setAttribute(u,f);var S=p.appendChild(document.createElement("CODE"));S.textContent=n;var B=p.getAttribute("data-src"),k=C.language;if(k==="none"){var $=(/\.(\w+)$/.exec(B)||[,"none"])[1];k=l[$]||$}r.util.setLanguage(S,k),r.util.setLanguage(p,k);var T=r.plugins.autoloader;T&&T.loadLanguages(k),v(B,function(O){p.setAttribute(u,d);var F=y(p.getAttribute("data-range"));if(F){var P=O.split(/\r\n?|\n/g),N=F[0],q=F[1]==null?P.length:F[1];N<0&&(N+=P.length),N=Math.max(0,Math.min(N-1,P.length)),q<0&&(q+=P.length),q=Math.max(0,Math.min(q,P.length)),O=P.slice(N,q).join(`
176
+ `),p.hasAttribute("data-start")||p.setAttribute("data-start",String(N+1))}S.textContent=O,r.highlightElement(S)},function(O){p.setAttribute(u,m),S.textContent=O})}}),r.plugins.fileHighlight={highlight:function(C){for(var p=(C||document).querySelectorAll(g),S=0,B;B=p[S++];)r.highlightElement(B)}};var b=!1;r.fileHighlight=function(){b||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),b=!0),r.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(hm)),hm.exports}var y9=b9();const Hu=Ii(y9),x9=Xe.span.attrs({className:"unified-rich-text-template-container"})`
177
+ display: inline-block;
178
+ min-width: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.minWidth)||"80px"}};
179
+ padding: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.padding)||"2px 6px"}};
180
+ margin: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.margin)||"0 2px"}};
181
+ border-radius: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.borderRadius)||"4px"}};
182
+ border: none !important;
183
+ cursor: pointer;
184
+ transition: all 0.2s;
185
+ font-weight: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.fontWeight)||"500"}};
186
+ user-select: none;
187
+ font-size: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.fontSize)||"14px"}};
188
+ line-height: 2;
189
+ width: auto; /* 让宽度根据内容自动调整 */
190
+ min-width: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.minWidth)||"80px"}};
191
+ min-height: ${e=>{var l,u,f,d;const t=((u=(l=e.$styles)==null?void 0:l.templateField)==null?void 0:u.padding)||"2px 6px",r=((d=(f=e.$styles)==null?void 0:f.templateField)==null?void 0:d.fontSize)||"14px",n=t.split(" ").map(m=>parseInt(m)),o=(n.length,n[0]),a=parseInt(r);return o*2+a*1.4+"px"}};
192
+
193
+ /* 高度自适应 */
194
+ height: auto; /* 允许高度根据内容自动调整 */
195
+ white-space: normal; /* 允许换行 */
196
+ box-sizing: border-box; /* 确保padding和border包含在宽度内 */
197
+ overflow: visible; /* 确保内容不被隐藏 */
198
+ word-wrap: break-word; /* 允许长单词换行 */
199
+ max-width: 100%; /* 限制在容器宽度内 */
200
+
201
+ /* 使用传入的样式配置 */
202
+ background-color: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.backgroundColor)||"#E5EEFF"}};
203
+ color: #055AFF;
204
+ border: 1px solid ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.borderColor)||"#84ADFF"}};
205
+
206
+ ${e=>{var t,r;return e.$isEditing&&`
207
+ background-color: white !important;
208
+ color: #055AFF !important;
209
+ border: 2px solid ${((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.borderColor)||"#84ADFF"} !important;
210
+ outline: none;
211
+ min-width: 30px;
212
+ `}}
213
+
214
+ &:hover {
215
+ opacity: 0.8;
216
+ }
217
+ `,w9=Xe.input.attrs({className:"unified-rich-text-template-input"})`
218
+ background: white;
219
+ border: 2px solid ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.borderColor)||"#84ADFF"}};
220
+ border-radius: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.borderRadius)||"4px"}};
221
+ padding: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.padding)||"2px 6px"}};
222
+ margin: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.margin)||"0 2px"}};
223
+ min-width: ${"30px"};
224
+ width: ${e=>{var d,m,g,v;const t=e.$value.length;if(t===0)return((m=(d=e.$styles)==null?void 0:d.templateField)==null?void 0:m.minWidth)||"120px";const r=((v=(g=e.$styles)==null?void 0:g.templateField)==null?void 0:v.padding)||"2px 6.2px",n=r.split(" ").map(y=>parseInt(y)),o=n.length===2?n[1]:n[0],a=12.5,l=20,u=t*a+o*2+l,f=Math.min(Math.max(u,120),e.$maxWidth);return console.log("TemplateInput \u5BBD\u5EA6\u8BA1\u7B97\u8C03\u8BD5:",{contentLength:t,padding:r,paddingValues:n,leftRightPadding:o,charWidth:a,bufferSpace:l,calculatedWidth:u,maxWidth:e.$maxWidth,finalWidth:f,inputValue:e.$value}),f+"px"}} !important; /* 使用!important确保宽度不被覆盖 */
225
+ height: ${e=>{var l,u,f,d;const t=((u=(l=e.$styles)==null?void 0:l.templateField)==null?void 0:u.padding)||"2px 6px",r=((d=(f=e.$styles)==null?void 0:f.templateField)==null?void 0:d.fontSize)||"14px",n=t.split(" ").map(m=>parseInt(m)),o=(n.length,n[0]),a=parseInt(r);return o*2+a*1.4+"px"}};
226
+ font-size: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.fontSize)||"14px"}};
227
+ font-family: inherit;
228
+ outline: none;
229
+ color: #055AFF;
230
+ line-height: 2;
231
+ box-sizing: border-box;
232
+ white-space: nowrap; /* 防止内部换行 */
233
+ overflow: hidden; /* 隐藏超出部分 */
234
+ text-overflow: ellipsis; /* 超出部分显示省略号 */
235
+
236
+ &:focus {
237
+ border-color: ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.borderColor)||"#84ADFF"}};
238
+ box-shadow: 0 0 0 3px ${e=>{var t,r;return((r=(t=e.$styles)==null?void 0:t.templateField)==null?void 0:r.borderColor)||"#84ADFF"}}20;
239
+ }
240
+ `,N2=_o(({element:e,attributes:t,children:r,styles:n,onTemplateChange:o},a)=>{var O,F,P,N,q,R,X,G,_,j,W,U;const l=Wg(),[u,f]=Ht(!1),[d,m]=Ht(e.value||""),[g,v]=Ht(e.value&&e.value!==""?e.value:e.placeholder||"\u6A21\u7248\u5B57\u7B26\u5185\u5BB9"),[y,b]=Ht(600),C=Vt(null),p=zt(()=>{try{const ee=document.querySelector('[data-slate-editor="true"]');if(ee){const V=ee.closest('.sc-jwTyAe, .bdQKlw, [role="textbox"]')||ee.parentElement;if(V){const Y=V.clientWidth,fe=Y-40;return console.log("TemplateField: \u7F16\u8F91\u5668\u5BB9\u5668\u5BBD\u5EA6:",Y,"\u53EF\u7528\u5BBD\u5EA6:",fe),Math.max(fe,200)}}return 600}catch(ee){return console.warn("TemplateField: \u65E0\u6CD5\u83B7\u53D6\u7F16\u8F91\u5668\u5BBD\u5EA6\uFF0C\u4F7F\u7528\u9ED8\u8BA4\u503C:",ee),600}},[]);sr(()=>{v(e.value&&e.value!==""?e.value:e.placeholder||"\u6A21\u7248\u5B57\u7B26\u5185\u5BB9");const ee=p();b(ee)},[e.value,e.placeholder,p]);const S=zt(()=>{f(!0),m(e.value||""),setTimeout(()=>{C.current&&(C.current.focus(),C.current.select())},0)},[e.value]),B=zt(ee=>{const V=ee.target.value;m(V)},[]),k=zt(()=>{const ee=Le.findPath(l,e);console.log("TemplateField: \u627E\u5230\u5143\u7D20\u8DEF\u5F84:",ee),console.log("TemplateField: \u5F53\u524D\u5143\u7D20:",e),console.log("TemplateField: \u8981\u8BBE\u7F6E\u7684\u503C:",d),Ge.setNodes(l,{value:d},{at:ee});const V=d.trim()!==""?d:e.placeholder||"\u6A21\u7248\u5B57\u7B26\u5185\u5BB9";v(V);const Y=l.children[ee[0]];if(Y&&"children"in Y){const fe=Y.children[ee[1]];console.log("TemplateField: \u66F4\u65B0\u540E\u7684\u5143\u7D20:",fe)}f(!1)},[l,e,d]),$=zt(()=>{k()},[k]),T=zt(ee=>{ee.key==="Enter"?(ee.preventDefault(),k()):ee.key==="Escape"&&(ee.preventDefault(),m(e.value||""),f(!1))},[k,e.value]);return u?K.jsxs("span",{...t,children:[K.jsx("span",{contentEditable:!1,children:K.jsx(w9,{ref:C,value:d,onChange:B,onBlur:$,onKeyDown:T,placeholder:"",$styles:n,$value:d,$maxWidth:y,style:{backgroundColor:"white",color:((O=n==null?void 0:n.templateField)==null?void 0:O.textColor)||"#055AFF",border:`2px solid ${((F=n==null?void 0:n.templateField)==null?void 0:F.borderColor)||"#84ADFF"}`,minWidth:((P=n==null?void 0:n.templateField)==null?void 0:P.minWidth)||"120px"}})}),r]}):K.jsxs("span",{...t,children:[K.jsx("span",{contentEditable:!1,children:K.jsxs(x9,{ref:a,$style:e.style||"blue",$isEditing:!1,$styles:n,$contentLength:g.length,onClick:S,style:{letterSpacing:n==null?void 0:n.letterSpacing,lineHeight:n==null?void 0:n.lineHeight,backgroundColor:(N=n==null?void 0:n.templateField)==null?void 0:N.backgroundColor,borderColor:(q=n==null?void 0:n.templateField)==null?void 0:q.borderColor,borderRadius:(R=n==null?void 0:n.templateField)==null?void 0:R.borderRadius,padding:(X=n==null?void 0:n.templateField)==null?void 0:X.padding,margin:(G=n==null?void 0:n.templateField)==null?void 0:G.margin,fontSize:(_=n==null?void 0:n.templateField)==null?void 0:_.fontSize,fontWeight:(j=n==null?void 0:n.templateField)==null?void 0:j.fontWeight,minWidth:(W=n==null?void 0:n.templateField)==null?void 0:W.minWidth,color:(U=n==null?void 0:n.templateField)==null?void 0:U.textColor,width:"auto",maxWidth:"100%"},children:[(console.log("TemplateField \u6E32\u67D3\u8C03\u8BD5:",{elementValue:e.value,elementPlaceholder:e.placeholder,displayValue:g,displayValueLength:g.length,contentLength:g.length}),null),g]})}),r]})});N2.displayName="TemplateField";const C9=({children:e,attributes:t,styles:r,extraProps:n})=>{var a;const o=!!(n!=null&&n.isCollapsed);return K.jsxs("div",{...t,className:"think-container",children:[K.jsx("div",{className:"think-indicator"}),K.jsx("div",{className:"think-content py-2",children:K.jsx("div",{className:"think-text text-[#86909C] pl-5 my-3 border border-[#ECECEE] border-solid border-l-3 border-t-0 border-b-0 border-r-0",style:{color:`${(a=r==null?void 0:r.text)==null?void 0:a.color} !important`,display:o?"none":"block"},children:e})})]})},O2=We.forwardRef(({attributes:e,element:t,eventsEmit:r,dataSource:n,tagIndex:o},a)=>{var $;const[l,u]=Ht(null),[f,d]=Ht(!0),[m,g]=Ht(1),[v,y]=Ht(10);sr(()=>{if(!l){if(!n){d(!0);try{const T=new CustomEvent("retrieve-sql-data:request-data",{detail:{id:t.id}});window.dispatchEvent(T)}catch{console.warn("Failed to dispatch retrieve-sql-data:request-data")}return}try{const T=(n==null?void 0:n.queryReplyPairList)||[];console.log("RetrieveSqlDataElement pairList:",T);let O=null,F=null,P;for(const R of T){const X=R==null?void 0:R.reply;if(!(X!=null&&X.databaseReference))continue;const G=X.databaseReference;console.log(G,"123123123jk123lk12j3l12jl3"),G!=null&&G.retrieveSqlData&&(console.log("Found source in raw12eku1h2lkjeh12ljkhelk12hejk:",G.retrieveSqlData.filePath),P=G.retrieveSqlData.filePath);let _=G;if(typeof G=="string")try{_=JSON.parse(G)}catch{}if(!_)continue;const j=Array.isArray(_)?_:[_],W=j.findIndex(V=>(V==null?void 0:V.id)===t.id),U=W>=0?j[W]:null;if(console.log("~~~~~~~~~~~~~~~",U),U){O=U,F=U.retrieveSqlData||U.retrieve_table_data||U.retrieveTableData;break}const ee=j.find(V=>{var Y,fe;return(((fe=(Y=V==null?void 0:V.retrieveSqlData)==null?void 0:Y.preData)==null?void 0:fe.length)||0)>0});!O&&ee&&(O=ee,F=ee.retrieveSqlData||ee.retrieve_table_data||ee.retrieveTableData)}if(!O||!F){console.warn("No databaseReference with preData found for id:",t.id),d(!1);return}const N=Array.isArray(F==null?void 0:F.preData)?F.preData[0]:null;if(!N){console.warn("Matched item has no preData"),d(!1);return}const q={columns:(N.columns||[]).map(R=>({key:R.key,title:R.title})),rows:N.data||N.rows||[],total:(F==null?void 0:F.total)||0,fetchUrl:(F==null?void 0:F.fetchUrl)||"/index/knowledgeBase/file/stream",source:P||(F==null?void 0:F.source)||(O==null?void 0:O.source)};u(q),d(!1)}catch(T){console.error("Init preData parsing failed:",T),d(!1)}}},[t.id,l,n]),sr(()=>{const T=O=>{try{const F=(O==null?void 0:O.detail)||{},P=F==null?void 0:F.id;if(!P||String(P)!==String(t.id))return;const N=F.databaseReference;if(!N)return;let q=N;if(typeof N=="string")try{q=JSON.parse(N)}catch{}if(!q)return;const R=Array.isArray(q)?q:[q],X=R.findIndex(U=>String(U==null?void 0:U.id)===String(t.id)),G=X>=0?R[X]:null;if(!G)return;const _=(G==null?void 0:G.retrieveSqlData)||(G==null?void 0:G.retrieve_table_data)||(G==null?void 0:G.retrieveTableData),j=Array.isArray(_==null?void 0:_.preData)?_.preData[0]:null;if(!j)return;const W={columns:(j.columns||[]).map(U=>({key:U.key,title:U.title})),rows:j.data||j.rows||[],total:(_==null?void 0:_.total)||0,fetchUrl:(_==null?void 0:_.fetchUrl)||"/index/knowledgeBase/file/stream",source:(G==null?void 0:G.source)||(_==null?void 0:_.source)};u(W),d(!1)}catch{console.warn("Failed to handle retrieve-sql-data:data-response")}};return window.addEventListener("retrieve-sql-data:data-response",T),()=>{window.removeEventListener("retrieve-sql-data:data-response",T)}},[t.id]);const b=T=>{if(!T||T.length===0)return[];const O=T.find(F=>F&&typeof F=="object")||{};return Object.keys(O).map(F=>({key:F,title:F}))},C=(T,O)=>{g(T),O&&y(O);const F=P=>{let N=null;if(P&&Array.isArray(P.columns)&&Array.isArray(P.rows))N={columns:P.columns,rows:P.rows,total:Number(P.total)||0,fetchUrl:P.fetchUrl||(l==null?void 0:l.fetchUrl)||"",source:P.source||(l==null?void 0:l.source)};else if(P&&Array.isArray(P.data)){const q=P.data;N={columns:l!=null&&l.columns&&l.columns.length>0?l.columns:b(q),rows:q,total:Number(P.totalCount??P.total??(l==null?void 0:l.total)??q.length)||0,fetchUrl:(l==null?void 0:l.fetchUrl)||"",source:l==null?void 0:l.source},typeof P.currentPage=="number"&&g(P.currentPage),typeof P.pageSize=="number"&&y(P.pageSize)}else if(Array.isArray(P)){const q=P;N={columns:l!=null&&l.columns&&l.columns.length>0?l.columns:b(q),rows:q,total:Number((l==null?void 0:l.total)??q.length)||0,fetchUrl:(l==null?void 0:l.fetchUrl)||"",source:l==null?void 0:l.source}}if(!N){console.warn("replacePredataFunction received unsupported data format:",P);return}console.log("Replacing table data with:",N),u(N)};r==null||r("retrieve-sql-data:pagingation_click",{id:t.id,page:T,pageSize:O||v,fetchUrl:l==null?void 0:l.fetchUrl,total:l==null?void 0:l.total,source:l==null?void 0:l.source,replacePredataFunction:F})},p=T=>l!=null&&l.rows?Math.max(...l.rows.map(O=>{const F=O[T];return F?String(F).length:0})):0,S=((($=l==null?void 0:l.columns)==null?void 0:$.length)||0)===1,B=(l==null?void 0:l.columns.map((T,O)=>({title:T.title||T.key,dataIndex:T.key,key:T.key,render:F=>{const P=F==null||F===""?"-":F;return S?K.jsx("div",{style:{whiteSpace:"normal",wordBreak:"break-word",overflowWrap:"anywhere",lineHeight:1.5},children:String(P)}):P},...S?{width:void 0}:{}})))||[],k=(l==null?void 0:l.rows.map((T,O)=>({key:O,...T})))||[];return K.jsx("div",{...e,ref:a,className:"retrieve-sql-data-container my-4",children:f?K.jsxs("div",{className:"flex items-center justify-center py-8",children:[K.jsx(r1,{size:"large"}),K.jsx("span",{className:"ml-2 text-gray-500",children:"\u52A0\u8F7D\u6570\u636E\u4E2D..."})]}):l?K.jsxs("div",{className:"retrieve-sql-data-content",children:[o!==null&&(()=>{const T=String(o).length;let O="12px",F="24px",P="24px";return T===2?(O="9px",F="22px",P="24px"):T===3?(O="8px",F="24px",P="24px"):T>=4&&(O="8px",F="24px",P="30px"),K.jsxs("div",{className:"mb-2 flex items-center",children:[K.jsx("span",{className:"bg-orange-100 text-orange-600 rounded font-medium flex items-center justify-center",style:{width:F,height:F,minWidth:P,fontSize:O,lineHeight:1},children:o}),K.jsx("span",{children:" \u6570\u636E\u8868\u67E5\u8BE2\u7ED3\u679C\uFF1A"})]})})(),K.jsx("div",{className:"table-container max-w-full overflow-x-auto",style:{border:"1px solid #d9d9d9",borderRadius:"6px",position:"relative",WebkitOverflowScrolling:"touch"},children:K.jsx(Do,{columns:B.map((T,O)=>({...T,...S?{width:void 0,minWidth:void 0,maxWidth:void 0,fixed:void 0,ellipsis:!1}:{width:O===0?160:void 0,minWidth:120,maxWidth:O===0?180:300,fixed:O===0?"left":void 0,ellipsis:{showTitle:!0}},render:F=>{if(F==null)return"-";const P=String(F);if(S)return K.jsx("div",{style:{whiteSpace:"normal",wordBreak:"break-word",overflowWrap:"anywhere",lineHeight:1.5,cursor:"default"},title:P,children:P});const N=p(T.key);let q="200px";return O===0?q="80px":N<=8?q="100px":N<=15?q="150px":N<=25?q="200px":N<=40?q="250px":q="300px",K.jsx("div",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:q,display:"inline-block",cursor:"default"},title:P,children:P})}})),dataSource:k,pagination:!1,size:"small",bordered:!1,className:"database-table",style:{minWidth:S?"100%":"1000px"},scroll:{x:S?void 0:"max-content",y:400}})}),l.total>v&&K.jsx("div",{className:"flex justify-center mt-3",children:K.jsx(n1,{current:m,pageSize:v,total:l.total,onChange:C,onShowSizeChange:C,showSizeChanger:!1,showQuickJumper:!1,size:"small"})})]}):K.jsx("div",{className:"text-center py-4 text-gray-500",children:"\u6682\u65E0\u6570\u636E"})})});O2.displayName="RetrieveSqlDataElement";var ks={exports:{}},Ku={exports:{}},qu,mm;function D9(){if(mm)return qu;mm=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return qu=e,qu}var Vu,gm;function k9(){if(gm)return Vu;gm=1;var e=D9();function t(){}function r(){}return r.resetWarningCache=t,Vu=function(){function n(l,u,f,d,m,g){if(g!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}n.isRequired=n;function o(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:t};return a.PropTypes=a,a},Vu}var vm;function E9(){return vm||(vm=1,Ku.exports=k9()()),Ku.exports}var J0={exports:{}},S9=J0.exports,bm;function A9(){return bm||(bm=1,(function(e,t){(function(r,n){e.exports=n()})(typeof self<"u"?self:S9,function(){return(function(){var r={};(function(){r.d=function(s,i){for(var c in i)r.o(i,c)&&!r.o(s,c)&&Object.defineProperty(s,c,{enumerable:!0,get:i[c]})}})(),(function(){r.o=function(s,i){return Object.prototype.hasOwnProperty.call(s,i)}})();var n={};r.d(n,{default:function(){return I4}});class o{constructor(i,c){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;let h="KaTeX parse error: "+i,x,A;const M=c&&c.loc;if(M&&M.start<=M.end){const J=M.lexer.input;x=M.start,A=M.end,x===J.length?h+=" at end of input: ":h+=" at position "+(x+1)+": ";const se=J.slice(x,A).replace(/[^]/g,"$&\u0332");let ye;x>15?ye="\u2026"+J.slice(x-15,x):ye=J.slice(0,x);let ke;A+15<J.length?ke=J.slice(A,A+15)+"\u2026":ke=J.slice(A),h+=ye+se+ke}const L=new Error(h);return L.name="ParseError",L.__proto__=o.prototype,L.position=x,x!=null&&A!=null&&(L.length=A-x),L.rawMessage=i,L}}o.prototype.__proto__=Error.prototype;var a=o;const l=function(s,i){return s===void 0?i:s},u=/([A-Z])/g,f=function(s){return s.replace(u,"-$1").toLowerCase()},d={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},m=/[&><"']/g;function g(s){return String(s).replace(m,i=>d[i])}const v=function(s){return s.type==="ordgroup"||s.type==="color"?s.body.length===1?v(s.body[0]):s:s.type==="font"?v(s.body):s},y=function(s){const i=v(s);return i.type==="mathord"||i.type==="textord"||i.type==="atom"},b=function(s){if(!s)throw new Error("Expected non-null, but got "+String(s));return s};var C={deflt:l,escape:g,hyphenate:f,getBaseElem:v,isCharacterBox:y,protocolFromUrl:function(s){const i=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(s);return i?i[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(i[1])?null:i[1].toLowerCase():"_relative"}};const p={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:s=>"#"+s},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(s,i)=>(i.push(s),i)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:s=>Math.max(0,s),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:s=>Math.max(0,s),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:s=>Math.max(0,s),cli:"-e, --max-expand <n>",cliProcessor:s=>s==="Infinity"?1/0:parseInt(s)},globalGroup:{type:"boolean",cli:!1}};function S(s){if(s.default)return s.default;const i=s.type,c=Array.isArray(i)?i[0]:i;if(typeof c!="string")return c.enum[0];switch(c){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class B{constructor(i){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,i=i||{};for(const c in p)if(p.hasOwnProperty(c)){const h=p[c];this[c]=i[c]!==void 0?h.processor?h.processor(i[c]):i[c]:S(h)}}reportNonstrict(i,c,h){let x=this.strict;if(typeof x=="function"&&(x=x(i,c,h)),!(!x||x==="ignore")){if(x===!0||x==="error")throw new a("LaTeX-incompatible input and strict mode is set to 'error': "+(c+" ["+i+"]"),h);x==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(c+" ["+i+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+x+"': "+c+" ["+i+"]"))}}useStrictBehavior(i,c,h){let x=this.strict;if(typeof x=="function")try{x=x(i,c,h)}catch{x="error"}return!x||x==="ignore"?!1:x===!0||x==="error"?!0:x==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(c+" ["+i+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+x+"': "+c+" ["+i+"]")),!1)}isTrusted(i){if(i.url&&!i.protocol){const c=C.protocolFromUrl(i.url);if(c==null)return!1;i.protocol=c}return!!(typeof this.trust=="function"?this.trust(i):this.trust)}}class k{constructor(i,c,h){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=i,this.size=c,this.cramped=h}sup(){return X[G[this.id]]}sub(){return X[_[this.id]]}fracNum(){return X[j[this.id]]}fracDen(){return X[W[this.id]]}cramp(){return X[U[this.id]]}text(){return X[ee[this.id]]}isTight(){return this.size>=2}}const $=0,T=1,O=2,F=3,P=4,N=5,q=6,R=7,X=[new k($,0,!1),new k(T,0,!0),new k(O,1,!1),new k(F,1,!0),new k(P,2,!1),new k(N,2,!0),new k(q,3,!1),new k(R,3,!0)],G=[P,N,P,N,q,R,q,R],_=[N,N,N,N,R,R,R,R],j=[O,F,P,N,q,R,q,R],W=[F,F,N,N,R,R,R,R],U=[T,T,F,F,N,N,R,R],ee=[$,T,O,F,O,F,O,F];var V={DISPLAY:X[$],TEXT:X[O],SCRIPT:X[P],SCRIPTSCRIPT:X[q]};const Y=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function fe(s){for(let i=0;i<Y.length;i++){const c=Y[i];for(let h=0;h<c.blocks.length;h++){const x=c.blocks[h];if(s>=x[0]&&s<=x[1])return c.name}}return null}const be=[];Y.forEach(s=>s.blocks.forEach(i=>be.push(...i)));function he(s){for(let i=0;i<be.length;i+=2)if(s>=be[i]&&s<=be[i+1])return!0;return!1}const De=80,$e=function(s,i){return"M95,"+(622+s+i)+`
241
+ c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
242
+ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
243
+ c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
244
+ s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
245
+ c69,-144,104.5,-217.7,106.5,-221
246
+ l`+s/2.075+" -"+s+`
247
+ c5.3,-9.3,12,-14,20,-14
248
+ H400000v`+(40+s)+`H845.2724
249
+ s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
250
+ c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
251
+ M`+(834+s)+" "+i+"h400000v"+(40+s)+"h-400000z"},Z=function(s,i){return"M263,"+(601+s+i)+`c0.7,0,18,39.7,52,119
252
+ c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
253
+ c340,-704.7,510.7,-1060.3,512,-1067
254
+ l`+s/2.084+" -"+s+`
255
+ c4.7,-7.3,11,-11,19,-11
256
+ H40000v`+(40+s)+`H1012.3
257
+ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
258
+ c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
259
+ s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
260
+ c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
261
+ M`+(1001+s)+" "+i+"h400000v"+(40+s)+"h-400000z"},ie=function(s,i){return"M983 "+(10+s+i)+`
262
+ l`+s/3.13+" -"+s+`
263
+ c4,-6.7,10,-10,18,-10 H400000v`+(40+s)+`
264
+ H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
265
+ s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
266
+ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
267
+ c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
268
+ c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
269
+ c53.7,-170.3,84.5,-266.8,92.5,-289.5z
270
+ M`+(1001+s)+" "+i+"h400000v"+(40+s)+"h-400000z"},le=function(s,i){return"M424,"+(2398+s+i)+`
271
+ c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
272
+ c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
273
+ s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
274
+ s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
275
+ l`+s/4.223+" -"+s+`c4,-6.7,10,-10,18,-10 H400000
276
+ v`+(40+s)+`H1014.6
277
+ s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
278
+ c-2,6,-10,9,-24,9
279
+ c-8,0,-12,-0.7,-12,-2z M`+(1001+s)+" "+i+`
280
+ h400000v`+(40+s)+"h-400000z"},ue=function(s,i){return"M473,"+(2713+s+i)+`
281
+ c339.3,-1799.3,509.3,-2700,510,-2702 l`+s/5.298+" -"+s+`
282
+ c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+s)+`H1017.7
283
+ s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
284
+ c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
285
+ c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
286
+ s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
287
+ 606zM`+(1001+s)+" "+i+"h400000v"+(40+s)+"H1017.7z"},Se=function(s){const i=s/2;return"M400000 "+s+" H0 L"+i+" 0 l65 45 L145 "+(s-80)+" H400000z"},Be=function(s,i,c){const h=c-54-i-s;return"M702 "+(s+i)+"H400000"+(40+s)+`
288
+ H742v`+h+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
289
+ h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
290
+ c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
291
+ 219 661 l218 661zM702 `+i+"H400000v"+(40+s)+"H742z"},ge=function(s,i,c){i=1e3*i;let h="";switch(s){case"sqrtMain":h=$e(i,De);break;case"sqrtSize1":h=Z(i,De);break;case"sqrtSize2":h=ie(i,De);break;case"sqrtSize3":h=le(i,De);break;case"sqrtSize4":h=ue(i,De);break;case"sqrtTall":h=Be(i,De,c)}return h},Ee=function(s,i){switch(s){case"\u239C":return"M291 0 H417 V"+i+" H291z M291 0 H417 V"+i+" H291z";case"\u2223":return"M145 0 H188 V"+i+" H145z M145 0 H188 V"+i+" H145z";case"\u2225":return"M145 0 H188 V"+i+" H145z M145 0 H188 V"+i+" H145z"+("M367 0 H410 V"+i+" H367z M367 0 H410 V"+i+" H367z");case"\u239F":return"M457 0 H583 V"+i+" H457z M457 0 H583 V"+i+" H457z";case"\u23A2":return"M319 0 H403 V"+i+" H319z M319 0 H403 V"+i+" H319z";case"\u23A5":return"M263 0 H347 V"+i+" H263z M263 0 H347 V"+i+" H263z";case"\u23AA":return"M384 0 H504 V"+i+" H384z M384 0 H504 V"+i+" H384z";case"\u23D0":return"M312 0 H355 V"+i+" H312z M312 0 H355 V"+i+" H312z";case"\u2016":return"M257 0 H300 V"+i+" H257z M257 0 H300 V"+i+" H257z"+("M478 0 H521 V"+i+" H478z M478 0 H521 V"+i+" H478z");default:return""}},Ae={doubleleftarrow:`M262 157
292
+ l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
293
+ 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
294
+ 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
295
+ c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
296
+ 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
297
+ -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
298
+ -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
299
+ m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
300
+ -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
301
+ 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
302
+ -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
303
+ -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
304
+ -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
305
+ c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
306
+ -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
307
+ 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
308
+ -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
309
+ c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
310
+ 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
311
+ 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
312
+ l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
313
+ -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
314
+ 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
315
+ 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
316
+ 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
317
+ -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
318
+ H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
319
+ 435 0h399565z`,leftgroupunder:`M400000 262
320
+ H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
321
+ 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
322
+ -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
323
+ -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
324
+ -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
325
+ 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
326
+ -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
327
+ -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
328
+ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
329
+ 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
330
+ 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
331
+ -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
332
+ 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
333
+ -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
334
+ v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
335
+ -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
336
+ -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
337
+ 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
338
+ M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
339
+ M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
340
+ -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
341
+ c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
342
+ 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
343
+ M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
344
+ c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
345
+ -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
346
+ 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
347
+ 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
348
+ c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
349
+ 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
350
+ 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
351
+ -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
352
+ -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
353
+ m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
354
+ 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
355
+ -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
356
+ m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
357
+ c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
358
+ -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
359
+ m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
360
+ 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
361
+ -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
362
+ m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
363
+ c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
364
+ -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
365
+ 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
366
+ 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
367
+ -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
368
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
369
+ 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
370
+ -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
371
+ s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
372
+ c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
373
+ 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
374
+ -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
375
+ 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
376
+ 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
377
+ -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
378
+ -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
379
+ 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
380
+ -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
381
+ 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
382
+ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
383
+ 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
384
+ -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
385
+ -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
386
+ 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
387
+ 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
388
+ -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
389
+ m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
390
+ 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
391
+ -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
392
+ 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
393
+ M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
394
+ 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
395
+ -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
396
+ -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
397
+ 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
398
+ -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
399
+ -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
400
+ -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
401
+ 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
402
+ c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
403
+ 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
404
+ 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
405
+ -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
406
+ 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
407
+ -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
408
+ 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
409
+ 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
410
+ -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
411
+ -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
412
+ 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
413
+ c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
414
+ 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
415
+ -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
416
+ 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
417
+ 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
418
+ -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
419
+ -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
420
+ 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
421
+ 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
422
+ -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
423
+ 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
424
+ 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
425
+ -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
426
+ -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
427
+ H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
428
+ c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
429
+ c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
430
+ -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
431
+ -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
432
+ -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
433
+ -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
434
+ -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
435
+ -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
436
+ -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
437
+ c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
438
+ c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
439
+ s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
440
+ 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
441
+ s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
442
+ c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
443
+ M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
444
+ -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
445
+ 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
446
+ -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
447
+ -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
448
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
449
+ 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
450
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
451
+ c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
452
+ c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
453
+ c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
454
+ M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
455
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
456
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
457
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
458
+ M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
459
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
460
+ 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
461
+ -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
462
+ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
463
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
464
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
465
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
466
+ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},Fe=function(s,i){switch(s){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+i+` v1759 h347 v-84
467
+ H403z M403 1759 V0 H319 V1759 v`+i+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+i+` v1759 H0 v84 H347z
468
+ M347 1759 V0 H263 V1759 v`+i+" v1759 h84z";case"vert":return"M145 15 v585 v"+i+` v585 c2.667,10,9.667,15,21,15
469
+ c10,0,16.667,-5,20,-15 v-585 v`+-i+` v-585 c-2.667,-10,-9.667,-15,-21,-15
470
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+i+" v585 h43z";case"doublevert":return"M145 15 v585 v"+i+` v585 c2.667,10,9.667,15,21,15
471
+ c10,0,16.667,-5,20,-15 v-585 v`+-i+` v-585 c-2.667,-10,-9.667,-15,-21,-15
472
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+i+` v585 h43z
473
+ M367 15 v585 v`+i+` v585 c2.667,10,9.667,15,21,15
474
+ c10,0,16.667,-5,20,-15 v-585 v`+-i+` v-585 c-2.667,-10,-9.667,-15,-21,-15
475
+ c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+i+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+i+` v1715 h263 v84 H319z
476
+ MM319 602 V0 H403 V602 v`+i+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+i+` v1799 H0 v-84 H319z
477
+ MM319 602 V0 H403 V602 v`+i+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+i+` v602 h84z
478
+ M403 1759 V0 H319 V1759 v`+i+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+i+` v602 h84z
479
+ M347 1759 V0 h-84 V1759 v`+i+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
480
+ c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
481
+ -36,557 l0,`+(i+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
482
+ 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
483
+ c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
484
+ -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
485
+ l0,-`+(i+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
486
+ -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
487
+ 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
488
+ c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(i+9)+`
489
+ c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
490
+ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
491
+ c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
492
+ c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
493
+ l0,-`+(i+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
494
+ -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};var xe={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}};const Ce={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},_e={\u00C5:"A",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function ht(s,i){xe[s]=i}function ot(s,i,c){if(!xe[i])throw new Error("Font metrics not found for font: "+i+".");let h=s.charCodeAt(0),x=xe[i][h];if(!x&&s[0]in _e&&(h=_e[s[0]].charCodeAt(0),x=xe[i][h]),!x&&c==="text"&&he(h)&&(x=xe[i][77]),x)return{depth:x[0],height:x[1],italic:x[2],skew:x[3],width:x[4]}}const Ie={};function Ke(s){let i;if(s>=5?i=0:s>=3?i=1:i=2,!Ie[i]){const c=Ie[i]={cssEmPerMu:Ce.quad[i]/18};for(const h in Ce)Ce.hasOwnProperty(h)&&(c[h]=Ce[h][i])}return Ie[i]}const Ue=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],vt=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],tt=function(s,i){return i.size<2?s:Ue[s-1][i.size-1]};class nt{constructor(i){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=i.style,this.color=i.color,this.size=i.size||nt.BASESIZE,this.textSize=i.textSize||this.size,this.phantom=!!i.phantom,this.font=i.font||"",this.fontFamily=i.fontFamily||"",this.fontWeight=i.fontWeight||"",this.fontShape=i.fontShape||"",this.sizeMultiplier=vt[this.size-1],this.maxSize=i.maxSize,this.minRuleThickness=i.minRuleThickness,this._fontMetrics=void 0}extend(i){const c={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(const h in i)i.hasOwnProperty(h)&&(c[h]=i[h]);return new nt(c)}havingStyle(i){return this.style===i?this:this.extend({style:i,size:tt(this.textSize,i)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(i){return this.size===i&&this.textSize===i?this:this.extend({style:this.style.text(),size:i,textSize:i,sizeMultiplier:vt[i-1]})}havingBaseStyle(i){i=i||this.style.text();const c=tt(nt.BASESIZE,i);return this.size===c&&this.textSize===nt.BASESIZE&&this.style===i?this:this.extend({style:i,size:c})}havingBaseSizing(){let i;switch(this.style.id){case 4:case 5:i=3;break;case 6:case 7:i=1;break;default:i=6}return this.extend({style:this.style.text(),size:i})}withColor(i){return this.extend({color:i})}withPhantom(){return this.extend({phantom:!0})}withFont(i){return this.extend({font:i})}withTextFontFamily(i){return this.extend({fontFamily:i,font:""})}withTextFontWeight(i){return this.extend({fontWeight:i,font:""})}withTextFontShape(i){return this.extend({fontShape:i,font:""})}sizingClasses(i){return i.size!==this.size?["sizing","reset-size"+i.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==nt.BASESIZE?["sizing","reset-size"+this.size,"size"+nt.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=Ke(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}nt.BASESIZE=6;var It=nt;const $t={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},Bt={ex:!0,em:!0,mu:!0},Mt=function(s){return typeof s!="string"&&(s=s.unit),s in $t||s in Bt||s==="ex"},je=function(s,i){let c;if(s.unit in $t)c=$t[s.unit]/i.fontMetrics().ptPerEm/i.sizeMultiplier;else if(s.unit==="mu")c=i.fontMetrics().cssEmPerMu;else{let h;if(i.style.isTight()?h=i.havingStyle(i.style.text()):h=i,s.unit==="ex")c=h.fontMetrics().xHeight;else if(s.unit==="em")c=h.fontMetrics().quad;else throw new a("Invalid unit: '"+s.unit+"'");h!==i&&(c*=h.sizeMultiplier/i.sizeMultiplier)}return Math.min(s.number*c,i.maxSize)},pe=function(s){return+s.toFixed(4)+"em"},it=function(s){return s.filter(i=>i).join(" ")},Nt=function(s,i,c){if(this.classes=s||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=c||{},i){i.style.isTight()&&this.classes.push("mtight");const h=i.getColor();h&&(this.style.color=h)}},Ft=function(s){const i=document.createElement(s);i.className=it(this.classes);for(const c in this.style)this.style.hasOwnProperty(c)&&(i.style[c]=this.style[c]);for(const c in this.attributes)this.attributes.hasOwnProperty(c)&&i.setAttribute(c,this.attributes[c]);for(let c=0;c<this.children.length;c++)i.appendChild(this.children[c].toNode());return i},yt=/[\s"'>/=\x00-\x1f]/,Rt=function(s){let i="<"+s;this.classes.length&&(i+=' class="'+C.escape(it(this.classes))+'"');let c="";for(const h in this.style)this.style.hasOwnProperty(h)&&(c+=C.hyphenate(h)+":"+this.style[h]+";");c&&(i+=' style="'+C.escape(c)+'"');for(const h in this.attributes)if(this.attributes.hasOwnProperty(h)){if(yt.test(h))throw new a("Invalid attribute name '"+h+"'");i+=" "+h+'="'+C.escape(this.attributes[h])+'"'}i+=">";for(let h=0;h<this.children.length;h++)i+=this.children[h].toMarkup();return i+="</"+s+">",i};class St{constructor(i,c,h,x){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Nt.call(this,i,h,x),this.children=c||[]}setAttribute(i,c){this.attributes[i]=c}hasClass(i){return this.classes.includes(i)}toNode(){return Ft.call(this,"span")}toMarkup(){return Rt.call(this,"span")}}class Kt{constructor(i,c,h,x){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Nt.call(this,c,x),this.children=h||[],this.setAttribute("href",i)}setAttribute(i,c){this.attributes[i]=c}hasClass(i){return this.classes.includes(i)}toNode(){return Ft.call(this,"a")}toMarkup(){return Rt.call(this,"a")}}class tr{constructor(i,c,h){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=c,this.src=i,this.classes=["mord"],this.style=h}hasClass(i){return this.classes.includes(i)}toNode(){const i=document.createElement("img");i.src=this.src,i.alt=this.alt,i.className="mord";for(const c in this.style)this.style.hasOwnProperty(c)&&(i.style[c]=this.style[c]);return i}toMarkup(){let i='<img src="'+C.escape(this.src)+'"'+(' alt="'+C.escape(this.alt)+'"'),c="";for(const h in this.style)this.style.hasOwnProperty(h)&&(c+=C.hyphenate(h)+":"+this.style[h]+";");return c&&(i+=' style="'+C.escape(c)+'"'),i+="'/>",i}}const lr={\u00EE:"\u0131\u0302",\u00EF:"\u0131\u0308",\u00ED:"\u0131\u0301",\u00EC:"\u0131\u0300"};class _t{constructor(i,c,h,x,A,M,L,J){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=i,this.height=c||0,this.depth=h||0,this.italic=x||0,this.skew=A||0,this.width=M||0,this.classes=L||[],this.style=J||{},this.maxFontSize=0;const se=fe(this.text.charCodeAt(0));se&&this.classes.push(se+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=lr[this.text])}hasClass(i){return this.classes.includes(i)}toNode(){const i=document.createTextNode(this.text);let c=null;this.italic>0&&(c=document.createElement("span"),c.style.marginRight=pe(this.italic)),this.classes.length>0&&(c=c||document.createElement("span"),c.className=it(this.classes));for(const h in this.style)this.style.hasOwnProperty(h)&&(c=c||document.createElement("span"),c.style[h]=this.style[h]);return c?(c.appendChild(i),c):i}toMarkup(){let i=!1,c="<span";this.classes.length&&(i=!0,c+=' class="',c+=C.escape(it(this.classes)),c+='"');let h="";this.italic>0&&(h+="margin-right:"+this.italic+"em;");for(const A in this.style)this.style.hasOwnProperty(A)&&(h+=C.hyphenate(A)+":"+this.style[A]+";");h&&(i=!0,c+=' style="'+C.escape(h)+'"');const x=C.escape(this.text);return i?(c+=">",c+=x,c+="</span>",c):x}}class Er{constructor(i,c){this.children=void 0,this.attributes=void 0,this.children=i||[],this.attributes=c||{}}toNode(){const i=document.createElementNS("http://www.w3.org/2000/svg","svg");for(const c in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,c)&&i.setAttribute(c,this.attributes[c]);for(let c=0;c<this.children.length;c++)i.appendChild(this.children[c].toNode());return i}toMarkup(){let i='<svg xmlns="http://www.w3.org/2000/svg"';for(const c in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,c)&&(i+=" "+c+'="'+C.escape(this.attributes[c])+'"');i+=">";for(let c=0;c<this.children.length;c++)i+=this.children[c].toMarkup();return i+="</svg>",i}}class Cr{constructor(i,c){this.pathName=void 0,this.alternate=void 0,this.pathName=i,this.alternate=c}toNode(){const i=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?i.setAttribute("d",this.alternate):i.setAttribute("d",Ae[this.pathName]),i}toMarkup(){return this.alternate?'<path d="'+C.escape(this.alternate)+'"/>':'<path d="'+C.escape(Ae[this.pathName])+'"/>'}}class Zr{constructor(i){this.attributes=void 0,this.attributes=i||{}}toNode(){const i=document.createElementNS("http://www.w3.org/2000/svg","line");for(const c in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,c)&&i.setAttribute(c,this.attributes[c]);return i}toMarkup(){let i="<line";for(const c in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,c)&&(i+=" "+c+'="'+C.escape(this.attributes[c])+'"');return i+="/>",i}}function Ut(s){if(s instanceof _t)return s;throw new Error("Expected symbolNode but got "+String(s)+".")}function Sr(s){if(s instanceof St)return s;throw new Error("Expected span<HtmlDomNode> but got "+String(s)+".")}const zr={bin:1,close:1,inner:1,open:1,punct:1,rel:1},cr={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},ir={math:{},text:{}};var Ot=ir;function w(s,i,c,h,x,A){ir[s][x]={font:i,group:c,replace:h},A&&h&&(ir[s][h]=ir[s][x])}const E="math",ze="text",I="main",re="ams",rr="accent-token",pt="bin",wt="close",xt="inner",st="mathord",jt="op-token",Jt="open",yr="punct",te="rel",ne="spacing",Q="textord";w(E,I,te,"\u2261","\\equiv",!0),w(E,I,te,"\u227A","\\prec",!0),w(E,I,te,"\u227B","\\succ",!0),w(E,I,te,"\u223C","\\sim",!0),w(E,I,te,"\u22A5","\\perp"),w(E,I,te,"\u2AAF","\\preceq",!0),w(E,I,te,"\u2AB0","\\succeq",!0),w(E,I,te,"\u2243","\\simeq",!0),w(E,I,te,"\u2223","\\mid",!0),w(E,I,te,"\u226A","\\ll",!0),w(E,I,te,"\u226B","\\gg",!0),w(E,I,te,"\u224D","\\asymp",!0),w(E,I,te,"\u2225","\\parallel"),w(E,I,te,"\u22C8","\\bowtie",!0),w(E,I,te,"\u2323","\\smile",!0),w(E,I,te,"\u2291","\\sqsubseteq",!0),w(E,I,te,"\u2292","\\sqsupseteq",!0),w(E,I,te,"\u2250","\\doteq",!0),w(E,I,te,"\u2322","\\frown",!0),w(E,I,te,"\u220B","\\ni",!0),w(E,I,te,"\u221D","\\propto",!0),w(E,I,te,"\u22A2","\\vdash",!0),w(E,I,te,"\u22A3","\\dashv",!0),w(E,I,te,"\u220B","\\owns"),w(E,I,yr,".","\\ldotp"),w(E,I,yr,"\u22C5","\\cdotp"),w(E,I,Q,"#","\\#"),w(ze,I,Q,"#","\\#"),w(E,I,Q,"&","\\&"),w(ze,I,Q,"&","\\&"),w(E,I,Q,"\u2135","\\aleph",!0),w(E,I,Q,"\u2200","\\forall",!0),w(E,I,Q,"\u210F","\\hbar",!0),w(E,I,Q,"\u2203","\\exists",!0),w(E,I,Q,"\u2207","\\nabla",!0),w(E,I,Q,"\u266D","\\flat",!0),w(E,I,Q,"\u2113","\\ell",!0),w(E,I,Q,"\u266E","\\natural",!0),w(E,I,Q,"\u2663","\\clubsuit",!0),w(E,I,Q,"\u2118","\\wp",!0),w(E,I,Q,"\u266F","\\sharp",!0),w(E,I,Q,"\u2662","\\diamondsuit",!0),w(E,I,Q,"\u211C","\\Re",!0),w(E,I,Q,"\u2661","\\heartsuit",!0),w(E,I,Q,"\u2111","\\Im",!0),w(E,I,Q,"\u2660","\\spadesuit",!0),w(E,I,Q,"\xA7","\\S",!0),w(ze,I,Q,"\xA7","\\S"),w(E,I,Q,"\xB6","\\P",!0),w(ze,I,Q,"\xB6","\\P"),w(E,I,Q,"\u2020","\\dag"),w(ze,I,Q,"\u2020","\\dag"),w(ze,I,Q,"\u2020","\\textdagger"),w(E,I,Q,"\u2021","\\ddag"),w(ze,I,Q,"\u2021","\\ddag"),w(ze,I,Q,"\u2021","\\textdaggerdbl"),w(E,I,wt,"\u23B1","\\rmoustache",!0),w(E,I,Jt,"\u23B0","\\lmoustache",!0),w(E,I,wt,"\u27EF","\\rgroup",!0),w(E,I,Jt,"\u27EE","\\lgroup",!0),w(E,I,pt,"\u2213","\\mp",!0),w(E,I,pt,"\u2296","\\ominus",!0),w(E,I,pt,"\u228E","\\uplus",!0),w(E,I,pt,"\u2293","\\sqcap",!0),w(E,I,pt,"\u2217","\\ast"),w(E,I,pt,"\u2294","\\sqcup",!0),w(E,I,pt,"\u25EF","\\bigcirc",!0),w(E,I,pt,"\u2219","\\bullet",!0),w(E,I,pt,"\u2021","\\ddagger"),w(E,I,pt,"\u2240","\\wr",!0),w(E,I,pt,"\u2A3F","\\amalg"),w(E,I,pt,"&","\\And"),w(E,I,te,"\u27F5","\\longleftarrow",!0),w(E,I,te,"\u21D0","\\Leftarrow",!0),w(E,I,te,"\u27F8","\\Longleftarrow",!0),w(E,I,te,"\u27F6","\\longrightarrow",!0),w(E,I,te,"\u21D2","\\Rightarrow",!0),w(E,I,te,"\u27F9","\\Longrightarrow",!0),w(E,I,te,"\u2194","\\leftrightarrow",!0),w(E,I,te,"\u27F7","\\longleftrightarrow",!0),w(E,I,te,"\u21D4","\\Leftrightarrow",!0),w(E,I,te,"\u27FA","\\Longleftrightarrow",!0),w(E,I,te,"\u21A6","\\mapsto",!0),w(E,I,te,"\u27FC","\\longmapsto",!0),w(E,I,te,"\u2197","\\nearrow",!0),w(E,I,te,"\u21A9","\\hookleftarrow",!0),w(E,I,te,"\u21AA","\\hookrightarrow",!0),w(E,I,te,"\u2198","\\searrow",!0),w(E,I,te,"\u21BC","\\leftharpoonup",!0),w(E,I,te,"\u21C0","\\rightharpoonup",!0),w(E,I,te,"\u2199","\\swarrow",!0),w(E,I,te,"\u21BD","\\leftharpoondown",!0),w(E,I,te,"\u21C1","\\rightharpoondown",!0),w(E,I,te,"\u2196","\\nwarrow",!0),w(E,I,te,"\u21CC","\\rightleftharpoons",!0),w(E,re,te,"\u226E","\\nless",!0),w(E,re,te,"\uE010","\\@nleqslant"),w(E,re,te,"\uE011","\\@nleqq"),w(E,re,te,"\u2A87","\\lneq",!0),w(E,re,te,"\u2268","\\lneqq",!0),w(E,re,te,"\uE00C","\\@lvertneqq"),w(E,re,te,"\u22E6","\\lnsim",!0),w(E,re,te,"\u2A89","\\lnapprox",!0),w(E,re,te,"\u2280","\\nprec",!0),w(E,re,te,"\u22E0","\\npreceq",!0),w(E,re,te,"\u22E8","\\precnsim",!0),w(E,re,te,"\u2AB9","\\precnapprox",!0),w(E,re,te,"\u2241","\\nsim",!0),w(E,re,te,"\uE006","\\@nshortmid"),w(E,re,te,"\u2224","\\nmid",!0),w(E,re,te,"\u22AC","\\nvdash",!0),w(E,re,te,"\u22AD","\\nvDash",!0),w(E,re,te,"\u22EA","\\ntriangleleft"),w(E,re,te,"\u22EC","\\ntrianglelefteq",!0),w(E,re,te,"\u228A","\\subsetneq",!0),w(E,re,te,"\uE01A","\\@varsubsetneq"),w(E,re,te,"\u2ACB","\\subsetneqq",!0),w(E,re,te,"\uE017","\\@varsubsetneqq"),w(E,re,te,"\u226F","\\ngtr",!0),w(E,re,te,"\uE00F","\\@ngeqslant"),w(E,re,te,"\uE00E","\\@ngeqq"),w(E,re,te,"\u2A88","\\gneq",!0),w(E,re,te,"\u2269","\\gneqq",!0),w(E,re,te,"\uE00D","\\@gvertneqq"),w(E,re,te,"\u22E7","\\gnsim",!0),w(E,re,te,"\u2A8A","\\gnapprox",!0),w(E,re,te,"\u2281","\\nsucc",!0),w(E,re,te,"\u22E1","\\nsucceq",!0),w(E,re,te,"\u22E9","\\succnsim",!0),w(E,re,te,"\u2ABA","\\succnapprox",!0),w(E,re,te,"\u2246","\\ncong",!0),w(E,re,te,"\uE007","\\@nshortparallel"),w(E,re,te,"\u2226","\\nparallel",!0),w(E,re,te,"\u22AF","\\nVDash",!0),w(E,re,te,"\u22EB","\\ntriangleright"),w(E,re,te,"\u22ED","\\ntrianglerighteq",!0),w(E,re,te,"\uE018","\\@nsupseteqq"),w(E,re,te,"\u228B","\\supsetneq",!0),w(E,re,te,"\uE01B","\\@varsupsetneq"),w(E,re,te,"\u2ACC","\\supsetneqq",!0),w(E,re,te,"\uE019","\\@varsupsetneqq"),w(E,re,te,"\u22AE","\\nVdash",!0),w(E,re,te,"\u2AB5","\\precneqq",!0),w(E,re,te,"\u2AB6","\\succneqq",!0),w(E,re,te,"\uE016","\\@nsubseteqq"),w(E,re,pt,"\u22B4","\\unlhd"),w(E,re,pt,"\u22B5","\\unrhd"),w(E,re,te,"\u219A","\\nleftarrow",!0),w(E,re,te,"\u219B","\\nrightarrow",!0),w(E,re,te,"\u21CD","\\nLeftarrow",!0),w(E,re,te,"\u21CF","\\nRightarrow",!0),w(E,re,te,"\u21AE","\\nleftrightarrow",!0),w(E,re,te,"\u21CE","\\nLeftrightarrow",!0),w(E,re,te,"\u25B3","\\vartriangle"),w(E,re,Q,"\u210F","\\hslash"),w(E,re,Q,"\u25BD","\\triangledown"),w(E,re,Q,"\u25CA","\\lozenge"),w(E,re,Q,"\u24C8","\\circledS"),w(E,re,Q,"\xAE","\\circledR"),w(ze,re,Q,"\xAE","\\circledR"),w(E,re,Q,"\u2221","\\measuredangle",!0),w(E,re,Q,"\u2204","\\nexists"),w(E,re,Q,"\u2127","\\mho"),w(E,re,Q,"\u2132","\\Finv",!0),w(E,re,Q,"\u2141","\\Game",!0),w(E,re,Q,"\u2035","\\backprime"),w(E,re,Q,"\u25B2","\\blacktriangle"),w(E,re,Q,"\u25BC","\\blacktriangledown"),w(E,re,Q,"\u25A0","\\blacksquare"),w(E,re,Q,"\u29EB","\\blacklozenge"),w(E,re,Q,"\u2605","\\bigstar"),w(E,re,Q,"\u2222","\\sphericalangle",!0),w(E,re,Q,"\u2201","\\complement",!0),w(E,re,Q,"\xF0","\\eth",!0),w(ze,I,Q,"\xF0","\xF0"),w(E,re,Q,"\u2571","\\diagup"),w(E,re,Q,"\u2572","\\diagdown"),w(E,re,Q,"\u25A1","\\square"),w(E,re,Q,"\u25A1","\\Box"),w(E,re,Q,"\u25CA","\\Diamond"),w(E,re,Q,"\xA5","\\yen",!0),w(ze,re,Q,"\xA5","\\yen",!0),w(E,re,Q,"\u2713","\\checkmark",!0),w(ze,re,Q,"\u2713","\\checkmark"),w(E,re,Q,"\u2136","\\beth",!0),w(E,re,Q,"\u2138","\\daleth",!0),w(E,re,Q,"\u2137","\\gimel",!0),w(E,re,Q,"\u03DD","\\digamma",!0),w(E,re,Q,"\u03F0","\\varkappa"),w(E,re,Jt,"\u250C","\\@ulcorner",!0),w(E,re,wt,"\u2510","\\@urcorner",!0),w(E,re,Jt,"\u2514","\\@llcorner",!0),w(E,re,wt,"\u2518","\\@lrcorner",!0),w(E,re,te,"\u2266","\\leqq",!0),w(E,re,te,"\u2A7D","\\leqslant",!0),w(E,re,te,"\u2A95","\\eqslantless",!0),w(E,re,te,"\u2272","\\lesssim",!0),w(E,re,te,"\u2A85","\\lessapprox",!0),w(E,re,te,"\u224A","\\approxeq",!0),w(E,re,pt,"\u22D6","\\lessdot"),w(E,re,te,"\u22D8","\\lll",!0),w(E,re,te,"\u2276","\\lessgtr",!0),w(E,re,te,"\u22DA","\\lesseqgtr",!0),w(E,re,te,"\u2A8B","\\lesseqqgtr",!0),w(E,re,te,"\u2251","\\doteqdot"),w(E,re,te,"\u2253","\\risingdotseq",!0),w(E,re,te,"\u2252","\\fallingdotseq",!0),w(E,re,te,"\u223D","\\backsim",!0),w(E,re,te,"\u22CD","\\backsimeq",!0),w(E,re,te,"\u2AC5","\\subseteqq",!0),w(E,re,te,"\u22D0","\\Subset",!0),w(E,re,te,"\u228F","\\sqsubset",!0),w(E,re,te,"\u227C","\\preccurlyeq",!0),w(E,re,te,"\u22DE","\\curlyeqprec",!0),w(E,re,te,"\u227E","\\precsim",!0),w(E,re,te,"\u2AB7","\\precapprox",!0),w(E,re,te,"\u22B2","\\vartriangleleft"),w(E,re,te,"\u22B4","\\trianglelefteq"),w(E,re,te,"\u22A8","\\vDash",!0),w(E,re,te,"\u22AA","\\Vvdash",!0),w(E,re,te,"\u2323","\\smallsmile"),w(E,re,te,"\u2322","\\smallfrown"),w(E,re,te,"\u224F","\\bumpeq",!0),w(E,re,te,"\u224E","\\Bumpeq",!0),w(E,re,te,"\u2267","\\geqq",!0),w(E,re,te,"\u2A7E","\\geqslant",!0),w(E,re,te,"\u2A96","\\eqslantgtr",!0),w(E,re,te,"\u2273","\\gtrsim",!0),w(E,re,te,"\u2A86","\\gtrapprox",!0),w(E,re,pt,"\u22D7","\\gtrdot"),w(E,re,te,"\u22D9","\\ggg",!0),w(E,re,te,"\u2277","\\gtrless",!0),w(E,re,te,"\u22DB","\\gtreqless",!0),w(E,re,te,"\u2A8C","\\gtreqqless",!0),w(E,re,te,"\u2256","\\eqcirc",!0),w(E,re,te,"\u2257","\\circeq",!0),w(E,re,te,"\u225C","\\triangleq",!0),w(E,re,te,"\u223C","\\thicksim"),w(E,re,te,"\u2248","\\thickapprox"),w(E,re,te,"\u2AC6","\\supseteqq",!0),w(E,re,te,"\u22D1","\\Supset",!0),w(E,re,te,"\u2290","\\sqsupset",!0),w(E,re,te,"\u227D","\\succcurlyeq",!0),w(E,re,te,"\u22DF","\\curlyeqsucc",!0),w(E,re,te,"\u227F","\\succsim",!0),w(E,re,te,"\u2AB8","\\succapprox",!0),w(E,re,te,"\u22B3","\\vartriangleright"),w(E,re,te,"\u22B5","\\trianglerighteq"),w(E,re,te,"\u22A9","\\Vdash",!0),w(E,re,te,"\u2223","\\shortmid"),w(E,re,te,"\u2225","\\shortparallel"),w(E,re,te,"\u226C","\\between",!0),w(E,re,te,"\u22D4","\\pitchfork",!0),w(E,re,te,"\u221D","\\varpropto"),w(E,re,te,"\u25C0","\\blacktriangleleft"),w(E,re,te,"\u2234","\\therefore",!0),w(E,re,te,"\u220D","\\backepsilon"),w(E,re,te,"\u25B6","\\blacktriangleright"),w(E,re,te,"\u2235","\\because",!0),w(E,re,te,"\u22D8","\\llless"),w(E,re,te,"\u22D9","\\gggtr"),w(E,re,pt,"\u22B2","\\lhd"),w(E,re,pt,"\u22B3","\\rhd"),w(E,re,te,"\u2242","\\eqsim",!0),w(E,I,te,"\u22C8","\\Join"),w(E,re,te,"\u2251","\\Doteq",!0),w(E,re,pt,"\u2214","\\dotplus",!0),w(E,re,pt,"\u2216","\\smallsetminus"),w(E,re,pt,"\u22D2","\\Cap",!0),w(E,re,pt,"\u22D3","\\Cup",!0),w(E,re,pt,"\u2A5E","\\doublebarwedge",!0),w(E,re,pt,"\u229F","\\boxminus",!0),w(E,re,pt,"\u229E","\\boxplus",!0),w(E,re,pt,"\u22C7","\\divideontimes",!0),w(E,re,pt,"\u22C9","\\ltimes",!0),w(E,re,pt,"\u22CA","\\rtimes",!0),w(E,re,pt,"\u22CB","\\leftthreetimes",!0),w(E,re,pt,"\u22CC","\\rightthreetimes",!0),w(E,re,pt,"\u22CF","\\curlywedge",!0),w(E,re,pt,"\u22CE","\\curlyvee",!0),w(E,re,pt,"\u229D","\\circleddash",!0),w(E,re,pt,"\u229B","\\circledast",!0),w(E,re,pt,"\u22C5","\\centerdot"),w(E,re,pt,"\u22BA","\\intercal",!0),w(E,re,pt,"\u22D2","\\doublecap"),w(E,re,pt,"\u22D3","\\doublecup"),w(E,re,pt,"\u22A0","\\boxtimes",!0),w(E,re,te,"\u21E2","\\dashrightarrow",!0),w(E,re,te,"\u21E0","\\dashleftarrow",!0),w(E,re,te,"\u21C7","\\leftleftarrows",!0),w(E,re,te,"\u21C6","\\leftrightarrows",!0),w(E,re,te,"\u21DA","\\Lleftarrow",!0),w(E,re,te,"\u219E","\\twoheadleftarrow",!0),w(E,re,te,"\u21A2","\\leftarrowtail",!0),w(E,re,te,"\u21AB","\\looparrowleft",!0),w(E,re,te,"\u21CB","\\leftrightharpoons",!0),w(E,re,te,"\u21B6","\\curvearrowleft",!0),w(E,re,te,"\u21BA","\\circlearrowleft",!0),w(E,re,te,"\u21B0","\\Lsh",!0),w(E,re,te,"\u21C8","\\upuparrows",!0),w(E,re,te,"\u21BF","\\upharpoonleft",!0),w(E,re,te,"\u21C3","\\downharpoonleft",!0),w(E,I,te,"\u22B6","\\origof",!0),w(E,I,te,"\u22B7","\\imageof",!0),w(E,re,te,"\u22B8","\\multimap",!0),w(E,re,te,"\u21AD","\\leftrightsquigarrow",!0),w(E,re,te,"\u21C9","\\rightrightarrows",!0),w(E,re,te,"\u21C4","\\rightleftarrows",!0),w(E,re,te,"\u21A0","\\twoheadrightarrow",!0),w(E,re,te,"\u21A3","\\rightarrowtail",!0),w(E,re,te,"\u21AC","\\looparrowright",!0),w(E,re,te,"\u21B7","\\curvearrowright",!0),w(E,re,te,"\u21BB","\\circlearrowright",!0),w(E,re,te,"\u21B1","\\Rsh",!0),w(E,re,te,"\u21CA","\\downdownarrows",!0),w(E,re,te,"\u21BE","\\upharpoonright",!0),w(E,re,te,"\u21C2","\\downharpoonright",!0),w(E,re,te,"\u21DD","\\rightsquigarrow",!0),w(E,re,te,"\u21DD","\\leadsto"),w(E,re,te,"\u21DB","\\Rrightarrow",!0),w(E,re,te,"\u21BE","\\restriction"),w(E,I,Q,"\u2018","`"),w(E,I,Q,"$","\\$"),w(ze,I,Q,"$","\\$"),w(ze,I,Q,"$","\\textdollar"),w(E,I,Q,"%","\\%"),w(ze,I,Q,"%","\\%"),w(E,I,Q,"_","\\_"),w(ze,I,Q,"_","\\_"),w(ze,I,Q,"_","\\textunderscore"),w(E,I,Q,"\u2220","\\angle",!0),w(E,I,Q,"\u221E","\\infty",!0),w(E,I,Q,"\u2032","\\prime"),w(E,I,Q,"\u25B3","\\triangle"),w(E,I,Q,"\u0393","\\Gamma",!0),w(E,I,Q,"\u0394","\\Delta",!0),w(E,I,Q,"\u0398","\\Theta",!0),w(E,I,Q,"\u039B","\\Lambda",!0),w(E,I,Q,"\u039E","\\Xi",!0),w(E,I,Q,"\u03A0","\\Pi",!0),w(E,I,Q,"\u03A3","\\Sigma",!0),w(E,I,Q,"\u03A5","\\Upsilon",!0),w(E,I,Q,"\u03A6","\\Phi",!0),w(E,I,Q,"\u03A8","\\Psi",!0),w(E,I,Q,"\u03A9","\\Omega",!0),w(E,I,Q,"A","\u0391"),w(E,I,Q,"B","\u0392"),w(E,I,Q,"E","\u0395"),w(E,I,Q,"Z","\u0396"),w(E,I,Q,"H","\u0397"),w(E,I,Q,"I","\u0399"),w(E,I,Q,"K","\u039A"),w(E,I,Q,"M","\u039C"),w(E,I,Q,"N","\u039D"),w(E,I,Q,"O","\u039F"),w(E,I,Q,"P","\u03A1"),w(E,I,Q,"T","\u03A4"),w(E,I,Q,"X","\u03A7"),w(E,I,Q,"\xAC","\\neg",!0),w(E,I,Q,"\xAC","\\lnot"),w(E,I,Q,"\u22A4","\\top"),w(E,I,Q,"\u22A5","\\bot"),w(E,I,Q,"\u2205","\\emptyset"),w(E,re,Q,"\u2205","\\varnothing"),w(E,I,st,"\u03B1","\\alpha",!0),w(E,I,st,"\u03B2","\\beta",!0),w(E,I,st,"\u03B3","\\gamma",!0),w(E,I,st,"\u03B4","\\delta",!0),w(E,I,st,"\u03F5","\\epsilon",!0),w(E,I,st,"\u03B6","\\zeta",!0),w(E,I,st,"\u03B7","\\eta",!0),w(E,I,st,"\u03B8","\\theta",!0),w(E,I,st,"\u03B9","\\iota",!0),w(E,I,st,"\u03BA","\\kappa",!0),w(E,I,st,"\u03BB","\\lambda",!0),w(E,I,st,"\u03BC","\\mu",!0),w(E,I,st,"\u03BD","\\nu",!0),w(E,I,st,"\u03BE","\\xi",!0),w(E,I,st,"\u03BF","\\omicron",!0),w(E,I,st,"\u03C0","\\pi",!0),w(E,I,st,"\u03C1","\\rho",!0),w(E,I,st,"\u03C3","\\sigma",!0),w(E,I,st,"\u03C4","\\tau",!0),w(E,I,st,"\u03C5","\\upsilon",!0),w(E,I,st,"\u03D5","\\phi",!0),w(E,I,st,"\u03C7","\\chi",!0),w(E,I,st,"\u03C8","\\psi",!0),w(E,I,st,"\u03C9","\\omega",!0),w(E,I,st,"\u03B5","\\varepsilon",!0),w(E,I,st,"\u03D1","\\vartheta",!0),w(E,I,st,"\u03D6","\\varpi",!0),w(E,I,st,"\u03F1","\\varrho",!0),w(E,I,st,"\u03C2","\\varsigma",!0),w(E,I,st,"\u03C6","\\varphi",!0),w(E,I,pt,"\u2217","*",!0),w(E,I,pt,"+","+"),w(E,I,pt,"\u2212","-",!0),w(E,I,pt,"\u22C5","\\cdot",!0),w(E,I,pt,"\u2218","\\circ",!0),w(E,I,pt,"\xF7","\\div",!0),w(E,I,pt,"\xB1","\\pm",!0),w(E,I,pt,"\xD7","\\times",!0),w(E,I,pt,"\u2229","\\cap",!0),w(E,I,pt,"\u222A","\\cup",!0),w(E,I,pt,"\u2216","\\setminus",!0),w(E,I,pt,"\u2227","\\land"),w(E,I,pt,"\u2228","\\lor"),w(E,I,pt,"\u2227","\\wedge",!0),w(E,I,pt,"\u2228","\\vee",!0),w(E,I,Q,"\u221A","\\surd"),w(E,I,Jt,"\u27E8","\\langle",!0),w(E,I,Jt,"\u2223","\\lvert"),w(E,I,Jt,"\u2225","\\lVert"),w(E,I,wt,"?","?"),w(E,I,wt,"!","!"),w(E,I,wt,"\u27E9","\\rangle",!0),w(E,I,wt,"\u2223","\\rvert"),w(E,I,wt,"\u2225","\\rVert"),w(E,I,te,"=","="),w(E,I,te,":",":"),w(E,I,te,"\u2248","\\approx",!0),w(E,I,te,"\u2245","\\cong",!0),w(E,I,te,"\u2265","\\ge"),w(E,I,te,"\u2265","\\geq",!0),w(E,I,te,"\u2190","\\gets"),w(E,I,te,">","\\gt",!0),w(E,I,te,"\u2208","\\in",!0),w(E,I,te,"\uE020","\\@not"),w(E,I,te,"\u2282","\\subset",!0),w(E,I,te,"\u2283","\\supset",!0),w(E,I,te,"\u2286","\\subseteq",!0),w(E,I,te,"\u2287","\\supseteq",!0),w(E,re,te,"\u2288","\\nsubseteq",!0),w(E,re,te,"\u2289","\\nsupseteq",!0),w(E,I,te,"\u22A8","\\models"),w(E,I,te,"\u2190","\\leftarrow",!0),w(E,I,te,"\u2264","\\le"),w(E,I,te,"\u2264","\\leq",!0),w(E,I,te,"<","\\lt",!0),w(E,I,te,"\u2192","\\rightarrow",!0),w(E,I,te,"\u2192","\\to"),w(E,re,te,"\u2271","\\ngeq",!0),w(E,re,te,"\u2270","\\nleq",!0),w(E,I,ne,"\xA0","\\ "),w(E,I,ne,"\xA0","\\space"),w(E,I,ne,"\xA0","\\nobreakspace"),w(ze,I,ne,"\xA0","\\ "),w(ze,I,ne,"\xA0"," "),w(ze,I,ne,"\xA0","\\space"),w(ze,I,ne,"\xA0","\\nobreakspace"),w(E,I,ne,null,"\\nobreak"),w(E,I,ne,null,"\\allowbreak"),w(E,I,yr,",",","),w(E,I,yr,";",";"),w(E,re,pt,"\u22BC","\\barwedge",!0),w(E,re,pt,"\u22BB","\\veebar",!0),w(E,I,pt,"\u2299","\\odot",!0),w(E,I,pt,"\u2295","\\oplus",!0),w(E,I,pt,"\u2297","\\otimes",!0),w(E,I,Q,"\u2202","\\partial",!0),w(E,I,pt,"\u2298","\\oslash",!0),w(E,re,pt,"\u229A","\\circledcirc",!0),w(E,re,pt,"\u22A1","\\boxdot",!0),w(E,I,pt,"\u25B3","\\bigtriangleup"),w(E,I,pt,"\u25BD","\\bigtriangledown"),w(E,I,pt,"\u2020","\\dagger"),w(E,I,pt,"\u22C4","\\diamond"),w(E,I,pt,"\u22C6","\\star"),w(E,I,pt,"\u25C3","\\triangleleft"),w(E,I,pt,"\u25B9","\\triangleright"),w(E,I,Jt,"{","\\{"),w(ze,I,Q,"{","\\{"),w(ze,I,Q,"{","\\textbraceleft"),w(E,I,wt,"}","\\}"),w(ze,I,Q,"}","\\}"),w(ze,I,Q,"}","\\textbraceright"),w(E,I,Jt,"{","\\lbrace"),w(E,I,wt,"}","\\rbrace"),w(E,I,Jt,"[","\\lbrack",!0),w(ze,I,Q,"[","\\lbrack",!0),w(E,I,wt,"]","\\rbrack",!0),w(ze,I,Q,"]","\\rbrack",!0),w(E,I,Jt,"(","\\lparen",!0),w(E,I,wt,")","\\rparen",!0),w(ze,I,Q,"<","\\textless",!0),w(ze,I,Q,">","\\textgreater",!0),w(E,I,Jt,"\u230A","\\lfloor",!0),w(E,I,wt,"\u230B","\\rfloor",!0),w(E,I,Jt,"\u2308","\\lceil",!0),w(E,I,wt,"\u2309","\\rceil",!0),w(E,I,Q,"\\","\\backslash"),w(E,I,Q,"\u2223","|"),w(E,I,Q,"\u2223","\\vert"),w(ze,I,Q,"|","\\textbar",!0),w(E,I,Q,"\u2225","\\|"),w(E,I,Q,"\u2225","\\Vert"),w(ze,I,Q,"\u2225","\\textbardbl"),w(ze,I,Q,"~","\\textasciitilde"),w(ze,I,Q,"\\","\\textbackslash"),w(ze,I,Q,"^","\\textasciicircum"),w(E,I,te,"\u2191","\\uparrow",!0),w(E,I,te,"\u21D1","\\Uparrow",!0),w(E,I,te,"\u2193","\\downarrow",!0),w(E,I,te,"\u21D3","\\Downarrow",!0),w(E,I,te,"\u2195","\\updownarrow",!0),w(E,I,te,"\u21D5","\\Updownarrow",!0),w(E,I,jt,"\u2210","\\coprod"),w(E,I,jt,"\u22C1","\\bigvee"),w(E,I,jt,"\u22C0","\\bigwedge"),w(E,I,jt,"\u2A04","\\biguplus"),w(E,I,jt,"\u22C2","\\bigcap"),w(E,I,jt,"\u22C3","\\bigcup"),w(E,I,jt,"\u222B","\\int"),w(E,I,jt,"\u222B","\\intop"),w(E,I,jt,"\u222C","\\iint"),w(E,I,jt,"\u222D","\\iiint"),w(E,I,jt,"\u220F","\\prod"),w(E,I,jt,"\u2211","\\sum"),w(E,I,jt,"\u2A02","\\bigotimes"),w(E,I,jt,"\u2A01","\\bigoplus"),w(E,I,jt,"\u2A00","\\bigodot"),w(E,I,jt,"\u222E","\\oint"),w(E,I,jt,"\u222F","\\oiint"),w(E,I,jt,"\u2230","\\oiiint"),w(E,I,jt,"\u2A06","\\bigsqcup"),w(E,I,jt,"\u222B","\\smallint"),w(ze,I,xt,"\u2026","\\textellipsis"),w(E,I,xt,"\u2026","\\mathellipsis"),w(ze,I,xt,"\u2026","\\ldots",!0),w(E,I,xt,"\u2026","\\ldots",!0),w(E,I,xt,"\u22EF","\\@cdots",!0),w(E,I,xt,"\u22F1","\\ddots",!0),w(E,I,Q,"\u22EE","\\varvdots"),w(ze,I,Q,"\u22EE","\\varvdots"),w(E,I,rr,"\u02CA","\\acute"),w(E,I,rr,"\u02CB","\\grave"),w(E,I,rr,"\xA8","\\ddot"),w(E,I,rr,"~","\\tilde"),w(E,I,rr,"\u02C9","\\bar"),w(E,I,rr,"\u02D8","\\breve"),w(E,I,rr,"\u02C7","\\check"),w(E,I,rr,"^","\\hat"),w(E,I,rr,"\u20D7","\\vec"),w(E,I,rr,"\u02D9","\\dot"),w(E,I,rr,"\u02DA","\\mathring"),w(E,I,st,"\uE131","\\@imath"),w(E,I,st,"\uE237","\\@jmath"),w(E,I,Q,"\u0131","\u0131"),w(E,I,Q,"\u0237","\u0237"),w(ze,I,Q,"\u0131","\\i",!0),w(ze,I,Q,"\u0237","\\j",!0),w(ze,I,Q,"\xDF","\\ss",!0),w(ze,I,Q,"\xE6","\\ae",!0),w(ze,I,Q,"\u0153","\\oe",!0),w(ze,I,Q,"\xF8","\\o",!0),w(ze,I,Q,"\xC6","\\AE",!0),w(ze,I,Q,"\u0152","\\OE",!0),w(ze,I,Q,"\xD8","\\O",!0),w(ze,I,rr,"\u02CA","\\'"),w(ze,I,rr,"\u02CB","\\`"),w(ze,I,rr,"\u02C6","\\^"),w(ze,I,rr,"\u02DC","\\~"),w(ze,I,rr,"\u02C9","\\="),w(ze,I,rr,"\u02D8","\\u"),w(ze,I,rr,"\u02D9","\\."),w(ze,I,rr,"\xB8","\\c"),w(ze,I,rr,"\u02DA","\\r"),w(ze,I,rr,"\u02C7","\\v"),w(ze,I,rr,"\xA8",'\\"'),w(ze,I,rr,"\u02DD","\\H"),w(ze,I,rr,"\u25EF","\\textcircled");const Je={"--":!0,"---":!0,"``":!0,"''":!0};w(ze,I,Q,"\u2013","--",!0),w(ze,I,Q,"\u2013","\\textendash"),w(ze,I,Q,"\u2014","---",!0),w(ze,I,Q,"\u2014","\\textemdash"),w(ze,I,Q,"\u2018","`",!0),w(ze,I,Q,"\u2018","\\textquoteleft"),w(ze,I,Q,"\u2019","'",!0),w(ze,I,Q,"\u2019","\\textquoteright"),w(ze,I,Q,"\u201C","``",!0),w(ze,I,Q,"\u201C","\\textquotedblleft"),w(ze,I,Q,"\u201D","''",!0),w(ze,I,Q,"\u201D","\\textquotedblright"),w(E,I,Q,"\xB0","\\degree",!0),w(ze,I,Q,"\xB0","\\degree"),w(ze,I,Q,"\xB0","\\textdegree",!0),w(E,I,Q,"\xA3","\\pounds"),w(E,I,Q,"\xA3","\\mathsterling",!0),w(ze,I,Q,"\xA3","\\pounds"),w(ze,I,Q,"\xA3","\\textsterling",!0),w(E,re,Q,"\u2720","\\maltese"),w(ze,re,Q,"\u2720","\\maltese");const lt='0123456789/@."';for(let s=0;s<lt.length;s++){const i=lt.charAt(s);w(E,I,Q,i,i)}const mr='0123456789!@*()-=+";:?/.,';for(let s=0;s<mr.length;s++){const i=mr.charAt(s);w(ze,I,Q,i,i)}const Lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let s=0;s<Lt.length;s++){const i=Lt.charAt(s);w(E,I,st,i,i),w(ze,I,Q,i,i)}w(E,re,Q,"C","\u2102"),w(ze,re,Q,"C","\u2102"),w(E,re,Q,"H","\u210D"),w(ze,re,Q,"H","\u210D"),w(E,re,Q,"N","\u2115"),w(ze,re,Q,"N","\u2115"),w(E,re,Q,"P","\u2119"),w(ze,re,Q,"P","\u2119"),w(E,re,Q,"Q","\u211A"),w(ze,re,Q,"Q","\u211A"),w(E,re,Q,"R","\u211D"),w(ze,re,Q,"R","\u211D"),w(E,re,Q,"Z","\u2124"),w(ze,re,Q,"Z","\u2124"),w(E,I,st,"h","\u210E"),w(ze,I,st,"h","\u210E");let bt="";for(let s=0;s<Lt.length;s++){const i=Lt.charAt(s);bt=String.fromCharCode(55349,56320+s),w(E,I,st,i,bt),w(ze,I,Q,i,bt),bt=String.fromCharCode(55349,56372+s),w(E,I,st,i,bt),w(ze,I,Q,i,bt),bt=String.fromCharCode(55349,56424+s),w(E,I,st,i,bt),w(ze,I,Q,i,bt),bt=String.fromCharCode(55349,56580+s),w(E,I,st,i,bt),w(ze,I,Q,i,bt),bt=String.fromCharCode(55349,56684+s),w(E,I,st,i,bt),w(ze,I,Q,i,bt),bt=String.fromCharCode(55349,56736+s),w(E,I,st,i,bt),w(ze,I,Q,i,bt),bt=String.fromCharCode(55349,56788+s),w(E,I,st,i,bt),w(ze,I,Q,i,bt),bt=String.fromCharCode(55349,56840+s),w(E,I,st,i,bt),w(ze,I,Q,i,bt),bt=String.fromCharCode(55349,56944+s),w(E,I,st,i,bt),w(ze,I,Q,i,bt),s<26&&(bt=String.fromCharCode(55349,56632+s),w(E,I,st,i,bt),w(ze,I,Q,i,bt),bt=String.fromCharCode(55349,56476+s),w(E,I,st,i,bt),w(ze,I,Q,i,bt))}bt="\u{1D55C}",w(E,I,st,"k",bt),w(ze,I,Q,"k",bt);for(let s=0;s<10;s++){const i=s.toString();bt=String.fromCharCode(55349,57294+s),w(E,I,st,i,bt),w(ze,I,Q,i,bt),bt=String.fromCharCode(55349,57314+s),w(E,I,st,i,bt),w(ze,I,Q,i,bt),bt=String.fromCharCode(55349,57324+s),w(E,I,st,i,bt),w(ze,I,Q,i,bt),bt=String.fromCharCode(55349,57334+s),w(E,I,st,i,bt),w(ze,I,Q,i,bt)}const Mr="\xD0\xDE\xFE";for(let s=0;s<Mr.length;s++){const i=Mr.charAt(s);w(E,I,st,i,i),w(ze,I,Q,i,i)}const Lr=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Sn=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Fr=function(s,i){const c=s.charCodeAt(0),h=s.charCodeAt(1),x=(c-55296)*1024+(h-56320)+65536,A=i==="math"?0:1;if(119808<=x&&x<120484){const M=Math.floor((x-119808)/26);return[Lr[M][2],Lr[M][A]]}else if(120782<=x&&x<=120831){const M=Math.floor((x-120782)/10);return[Sn[M][2],Sn[M][A]]}else{if(x===120485||x===120486)return[Lr[0][2],Lr[0][A]];if(120486<x&&x<120782)return["",""];throw new a("Unsupported character: "+s)}};class nn{constructor(i){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=i,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(i){return this.classes.includes(i)}toNode(){const i=document.createDocumentFragment();for(let c=0;c<this.children.length;c++)i.appendChild(this.children[c].toNode());return i}toMarkup(){let i="";for(let c=0;c<this.children.length;c++)i+=this.children[c].toMarkup();return i}toText(){const i=c=>c.toText();return this.children.map(i).join("")}}const oe=function(s,i,c){return Ot[c][s]&&Ot[c][s].replace&&(s=Ot[c][s].replace),{value:s,metrics:ot(s,i,c)}},Te=function(s,i,c,h,x){const A=oe(s,i,c),M=A.metrics;s=A.value;let L;if(M){let J=M.italic;(c==="text"||h&&h.font==="mathit")&&(J=0),L=new _t(s,M.height,M.depth,J,M.skew,M.width,x)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+s+"' in style '"+i+"' and mode '"+c+"'")),L=new _t(s,0,0,0,0,0,x);if(h){L.maxFontSize=h.sizeMultiplier,h.style.isTight()&&L.classes.push("mtight");const J=h.getColor();J&&(L.style.color=J)}return L},ct=function(s,i,c,h){return h===void 0&&(h=[]),c.font==="boldsymbol"&&oe(s,"Main-Bold",i).metrics?Te(s,"Main-Bold",i,c,h.concat(["mathbf"])):s==="\\"||Ot[i][s].font==="main"?Te(s,"Main-Regular",i,c,h):Te(s,"AMS-Regular",i,c,h.concat(["amsrm"]))},Ye=function(s,i,c,h,x){return x!=="textord"&&oe(s,"Math-BoldItalic",i).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},ae=function(s,i,c){const h=s.mode,x=s.text,A=["mord"],M=h==="math"||h==="text"&&i.font,L=M?i.font:i.fontFamily;let J="",se="";if(x.charCodeAt(0)===55349&&([J,se]=Fr(x,h)),J.length>0)return Te(x,J,h,i,A.concat(se));if(L){let ye,ke;if(L==="boldsymbol"){const Ne=Ye(x,h,i,A,c);ye=Ne.fontName,ke=[Ne.fontClass]}else M?(ye=Vr[L].fontName,ke=[L]):(ye=dr(L,i.fontWeight,i.fontShape),ke=[L,i.fontWeight,i.fontShape]);if(oe(x,ye,h).metrics)return Te(x,ye,h,i,A.concat(ke));if(Je.hasOwnProperty(x)&&ye.slice(0,10)==="Typewriter"){const Ne=[];for(let et=0;et<x.length;et++)Ne.push(Te(x[et],ye,h,i,A.concat(ke)));return Qe(Ne)}}if(c==="mathord")return Te(x,"Math-Italic",h,i,A.concat(["mathnormal"]));if(c==="textord"){const ye=Ot[h][x]&&Ot[h][x].font;if(ye==="ams"){const ke=dr("amsrm",i.fontWeight,i.fontShape);return Te(x,ke,h,i,A.concat("amsrm",i.fontWeight,i.fontShape))}else if(ye==="main"||!ye){const ke=dr("textrm",i.fontWeight,i.fontShape);return Te(x,ke,h,i,A.concat(i.fontWeight,i.fontShape))}else{const ke=dr(ye,i.fontWeight,i.fontShape);return Te(x,ke,h,i,A.concat(ke,i.fontWeight,i.fontShape))}}else throw new Error("unexpected type: "+c+" in makeOrd")},Re=(s,i)=>{if(it(s.classes)!==it(i.classes)||s.skew!==i.skew||s.maxFontSize!==i.maxFontSize)return!1;if(s.classes.length===1){const c=s.classes[0];if(c==="mbin"||c==="mord")return!1}for(const c in s.style)if(s.style.hasOwnProperty(c)&&s.style[c]!==i.style[c])return!1;for(const c in i.style)if(i.style.hasOwnProperty(c)&&s.style[c]!==i.style[c])return!1;return!0},Pe=s=>{for(let i=0;i<s.length-1;i++){const c=s[i],h=s[i+1];c instanceof _t&&h instanceof _t&&Re(c,h)&&(c.text+=h.text,c.height=Math.max(c.height,h.height),c.depth=Math.max(c.depth,h.depth),c.italic=h.italic,s.splice(i+1,1),i--)}return s},ut=function(s){let i=0,c=0,h=0;for(let x=0;x<s.children.length;x++){const A=s.children[x];A.height>i&&(i=A.height),A.depth>c&&(c=A.depth),A.maxFontSize>h&&(h=A.maxFontSize)}s.height=i,s.depth=c,s.maxFontSize=h},ve=function(s,i,c,h){const x=new St(s,i,c,h);return ut(x),x},me=(s,i,c,h)=>new St(s,i,c,h),ce=function(s,i,c){const h=ve([s],[],i);return h.height=Math.max(c||i.fontMetrics().defaultRuleThickness,i.minRuleThickness),h.style.borderBottomWidth=pe(h.height),h.maxFontSize=1,h},He=function(s,i,c,h){const x=new Kt(s,i,c,h);return ut(x),x},Qe=function(s){const i=new nn(s);return ut(i),i},Tt=function(s,i){return s instanceof nn?ve([],[s],i):s},dt=function(s){if(s.positionType==="individualShift"){const c=s.children,h=[c[0]],x=-c[0].shift-c[0].elem.depth;let A=x;for(let M=1;M<c.length;M++){const L=-c[M].shift-A-c[M].elem.depth,J=L-(c[M-1].elem.height+c[M-1].elem.depth);A=A+L,h.push({type:"kern",size:J}),h.push(c[M])}return{children:h,depth:x}}let i;if(s.positionType==="top"){let c=s.positionData;for(let h=0;h<s.children.length;h++){const x=s.children[h];c-=x.type==="kern"?x.size:x.elem.height+x.elem.depth}i=c}else if(s.positionType==="bottom")i=-s.positionData;else{const c=s.children[0];if(c.type!=="elem")throw new Error('First child must have type "elem".');if(s.positionType==="shift")i=-c.elem.depth-s.positionData;else if(s.positionType==="firstBaseline")i=-c.elem.depth;else throw new Error("Invalid positionType "+s.positionType+".")}return{children:s.children,depth:i}},qe=function(s,i){const{children:c,depth:h}=dt(s);let x=0;for(let et=0;et<c.length;et++){const gt=c[et];if(gt.type==="elem"){const Xt=gt.elem;x=Math.max(x,Xt.maxFontSize,Xt.height)}}x+=2;const A=ve(["pstrut"],[]);A.style.height=pe(x);const M=[];let L=h,J=h,se=h;for(let et=0;et<c.length;et++){const gt=c[et];if(gt.type==="kern")se+=gt.size;else{const Xt=gt.elem,ur=gt.wrapperClasses||[],nr=gt.wrapperStyle||{},gr=ve(ur,[A,Xt],void 0,nr);gr.style.top=pe(-x-se-Xt.depth),gt.marginLeft&&(gr.style.marginLeft=gt.marginLeft),gt.marginRight&&(gr.style.marginRight=gt.marginRight),M.push(gr),se+=Xt.height+Xt.depth}L=Math.min(L,se),J=Math.max(J,se)}const ye=ve(["vlist"],M);ye.style.height=pe(J);let ke;if(L<0){const et=ve([],[]),gt=ve(["vlist"],[et]);gt.style.height=pe(-L);const Xt=ve(["vlist-s"],[new _t("\u200B")]);ke=[ve(["vlist-r"],[ye,Xt]),ve(["vlist-r"],[gt])]}else ke=[ve(["vlist-r"],[ye])];const Ne=ve(["vlist-t"],ke);return ke.length===2&&Ne.classes.push("vlist-t2"),Ne.height=J,Ne.depth=-L,Ne},Pt=(s,i)=>{const c=ve(["mspace"],[],i),h=je(s,i);return c.style.marginRight=pe(h),c},dr=function(s,i,c){let h="";switch(s){case"amsrm":h="AMS";break;case"textrm":h="Main";break;case"textsf":h="SansSerif";break;case"texttt":h="Typewriter";break;default:h=s}let x;return i==="textbf"&&c==="textit"?x="BoldItalic":i==="textbf"?x="Bold":i==="textit"?x="Italic":x="Regular",h+"-"+x},Vr={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},un={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]};var we={fontMap:Vr,makeSymbol:Te,mathsym:ct,makeSpan:ve,makeSvgSpan:me,makeLineSpan:ce,makeAnchor:He,makeFragment:Qe,wrapFragment:Tt,makeVList:qe,makeOrd:ae,makeGlue:Pt,staticSvg:function(s,i){const[c,h,x]=un[s],A=new Cr(c),M=new Er([A],{width:pe(h),height:pe(x),style:"width:"+pe(h),viewBox:"0 0 "+1e3*h+" "+1e3*x,preserveAspectRatio:"xMinYMin"}),L=me(["overlay"],[M],i);return L.height=x,L.style.height=pe(x),L.style.width=pe(h),L},svgData:un,tryCombineChars:Pe};const fr={number:3,unit:"mu"},jn={number:4,unit:"mu"},qt={number:5,unit:"mu"},Qt={mord:{mop:fr,mbin:jn,mrel:qt,minner:fr},mop:{mord:fr,mop:fr,mrel:qt,minner:fr},mbin:{mord:jn,mop:jn,mopen:jn,minner:jn},mrel:{mord:qt,mop:qt,mopen:qt,minner:qt},mopen:{},mclose:{mop:fr,mbin:jn,mrel:qt,minner:fr},mpunct:{mord:fr,mop:fr,mrel:qt,mopen:fr,mclose:fr,mpunct:fr,minner:fr},minner:{mord:fr,mop:fr,mbin:jn,mrel:qt,mopen:fr,mpunct:fr,minner:fr}},Gr={mord:{mop:fr},mop:{mord:fr,mop:fr},mbin:{},mrel:{},mopen:{},mclose:{mop:fr},mpunct:{},minner:{mop:fr}},cn={},Hr={},Ln={};function mt(s){let{type:i,names:c,props:h,handler:x,htmlBuilder:A,mathmlBuilder:M}=s;const L={type:i,numArgs:h.numArgs,argTypes:h.argTypes,allowedInArgument:!!h.allowedInArgument,allowedInText:!!h.allowedInText,allowedInMath:h.allowedInMath===void 0?!0:h.allowedInMath,numOptionalArgs:h.numOptionalArgs||0,infix:!!h.infix,primitive:!!h.primitive,handler:x};for(let J=0;J<c.length;++J)cn[c[J]]=L;i&&(A&&(Hr[i]=A),M&&(Ln[i]=M))}function dn(s){let{type:i,htmlBuilder:c,mathmlBuilder:h}=s;mt({type:i,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:c,mathmlBuilder:h})}const Gn=function(s){return s.type==="ordgroup"&&s.body.length===1?s.body[0]:s},Tr=function(s){return s.type==="ordgroup"?s.body:[s]},so=we.makeSpan,K2=["leftmost","mbin","mopen","mrel","mop","mpunct"],q2=["rightmost","mrel","mclose","mpunct"],V2={display:V.DISPLAY,text:V.TEXT,script:V.SCRIPT,scriptscript:V.SCRIPTSCRIPT},W2={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Yr=function(s,i,c,h){h===void 0&&(h=[null,null]);const x=[];for(let se=0;se<s.length;se++){const ye=hr(s[se],i);if(ye instanceof nn){const ke=ye.children;x.push(...ke)}else x.push(ye)}if(we.tryCombineChars(x),!c)return x;let A=i;if(s.length===1){const se=s[0];se.type==="sizing"?A=i.havingSize(se.size):se.type==="styling"&&(A=i.havingStyle(V2[se.style]))}const M=so([h[0]||"leftmost"],[],i),L=so([h[1]||"rightmost"],[],i),J=c==="root";return Sl(x,(se,ye)=>{const ke=ye.classes[0],Ne=se.classes[0];ke==="mbin"&&q2.includes(Ne)?ye.classes[0]="mord":Ne==="mbin"&&K2.includes(ke)&&(se.classes[0]="mord")},{node:M},L,J),Sl(x,(se,ye)=>{const ke=Bl(ye),Ne=Bl(se),et=ke&&Ne?se.hasClass("mtight")?Gr[ke][Ne]:Qt[ke][Ne]:null;if(et)return we.makeGlue(et,A)},{node:M},L,J),x},Sl=function(s,i,c,h,x){h&&s.push(h);let A=0;for(;A<s.length;A++){const M=s[A],L=sd(M);if(L){Sl(L.children,i,c,null,x);continue}const J=!M.hasClass("mspace");if(J){const se=i(M,c.node);se&&(c.insertAfter?c.insertAfter(se):(s.unshift(se),A++))}J?c.node=M:x&&M.hasClass("newline")&&(c.node=so(["leftmost"])),c.insertAfter=(se=>ye=>{s.splice(se+1,0,ye),A++})(A)}h&&s.pop()},sd=function(s){return s instanceof nn||s instanceof Kt||s instanceof St&&s.hasClass("enclosing")?s:null},Al=function(s,i){const c=sd(s);if(c){const h=c.children;if(h.length){if(i==="right")return Al(h[h.length-1],"right");if(i==="left")return Al(h[0],"left")}}return s},Bl=function(s,i){return s?(i&&(s=Al(s,i)),W2[s.classes[0]]||null):null},_a=function(s,i){const c=["nulldelimiter"].concat(s.baseSizingClasses());return so(i.concat(c))},hr=function(s,i,c){if(!s)return so();if(Hr[s.type]){let h=Hr[s.type](s,i);if(c&&i.size!==c.size){h=so(i.sizingClasses(c),[h],i);const x=i.sizeMultiplier/c.sizeMultiplier;h.height*=x,h.depth*=x}return h}else throw new a("Got group of unknown type: '"+s.type+"'")};function _i(s,i){const c=so(["base"],s,i),h=so(["strut"]);return h.style.height=pe(c.height+c.depth),c.depth&&(h.style.verticalAlign=pe(-c.depth)),c.children.unshift(h),c}function Fl(s,i){let c=null;s.length===1&&s[0].type==="tag"&&(c=s[0].tag,s=s[0].body);const h=Yr(s,i,"root");let x;h.length===2&&h[1].hasClass("tag")&&(x=h.pop());const A=[];let M=[];for(let se=0;se<h.length;se++)if(M.push(h[se]),h[se].hasClass("mbin")||h[se].hasClass("mrel")||h[se].hasClass("allowbreak")){let ye=!1;for(;se<h.length-1&&h[se+1].hasClass("mspace")&&!h[se+1].hasClass("newline");)se++,M.push(h[se]),h[se].hasClass("nobreak")&&(ye=!0);ye||(A.push(_i(M,i)),M=[])}else h[se].hasClass("newline")&&(M.pop(),M.length>0&&(A.push(_i(M,i)),M=[]),A.push(h[se]));M.length>0&&A.push(_i(M,i));let L;c?(L=_i(Yr(c,i,!0)),L.classes=["tag"],A.push(L)):x&&A.push(x);const J=so(["katex-html"],A);if(J.setAttribute("aria-hidden","true"),L){const se=L.children[0];se.style.height=pe(J.height+J.depth),J.depth&&(se.style.verticalAlign=pe(-J.depth))}return J}function ld(s){return new nn(s)}class An{constructor(i,c,h){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=i,this.attributes={},this.children=c||[],this.classes=h||[]}setAttribute(i,c){this.attributes[i]=c}getAttribute(i){return this.attributes[i]}toNode(){const i=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(const c in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,c)&&i.setAttribute(c,this.attributes[c]);this.classes.length>0&&(i.className=it(this.classes));for(let c=0;c<this.children.length;c++)if(this.children[c]instanceof Yn&&this.children[c+1]instanceof Yn){let h=this.children[c].toText()+this.children[++c].toText();for(;this.children[c+1]instanceof Yn;)h+=this.children[++c].toText();i.appendChild(new Yn(h).toNode())}else i.appendChild(this.children[c].toNode());return i}toMarkup(){let i="<"+this.type;for(const c in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,c)&&(i+=" "+c+'="',i+=C.escape(this.attributes[c]),i+='"');this.classes.length>0&&(i+=' class ="'+C.escape(it(this.classes))+'"'),i+=">";for(let c=0;c<this.children.length;c++)i+=this.children[c].toMarkup();return i+="</"+this.type+">",i}toText(){return this.children.map(i=>i.toText()).join("")}}class Yn{constructor(i){this.text=void 0,this.text=i}toNode(){return document.createTextNode(this.text)}toMarkup(){return C.escape(this.toText())}toText(){return this.text}}class U2{constructor(i){this.width=void 0,this.character=void 0,this.width=i,i>=.05555&&i<=.05556?this.character="\u200A":i>=.1666&&i<=.1667?this.character="\u2009":i>=.2222&&i<=.2223?this.character="\u2005":i>=.2777&&i<=.2778?this.character="\u2005\u200A":i>=-.05556&&i<=-.05555?this.character="\u200A\u2063":i>=-.1667&&i<=-.1666?this.character="\u2009\u2063":i>=-.2223&&i<=-.2222?this.character="\u205F\u2063":i>=-.2778&&i<=-.2777?this.character="\u2005\u2063":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);{const i=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return i.setAttribute("width",pe(this.width)),i}}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+pe(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var Ze={MathNode:An,TextNode:Yn,SpaceNode:U2,newDocumentFragment:ld};const Nn=function(s,i,c){return Ot[i][s]&&Ot[i][s].replace&&s.charCodeAt(0)!==55349&&!(Je.hasOwnProperty(s)&&c&&(c.fontFamily&&c.fontFamily.slice(4,6)==="tt"||c.font&&c.font.slice(4,6)==="tt"))&&(s=Ot[i][s].replace),new Ze.TextNode(s)},Tl=function(s){return s.length===1?s[0]:new Ze.MathNode("mrow",s)},$l=function(s,i){if(i.fontFamily==="texttt")return"monospace";if(i.fontFamily==="textsf")return i.fontShape==="textit"&&i.fontWeight==="textbf"?"sans-serif-bold-italic":i.fontShape==="textit"?"sans-serif-italic":i.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(i.fontShape==="textit"&&i.fontWeight==="textbf")return"bold-italic";if(i.fontShape==="textit")return"italic";if(i.fontWeight==="textbf")return"bold";const c=i.font;if(!c||c==="mathnormal")return null;const h=s.mode;if(c==="mathit")return"italic";if(c==="boldsymbol")return s.type==="textord"?"bold":"bold-italic";if(c==="mathbf")return"bold";if(c==="mathbb")return"double-struck";if(c==="mathsfit")return"sans-serif-italic";if(c==="mathfrak")return"fraktur";if(c==="mathscr"||c==="mathcal")return"script";if(c==="mathsf")return"sans-serif";if(c==="mathtt")return"monospace";let x=s.text;if(["\\imath","\\jmath"].includes(x))return null;Ot[h][x]&&Ot[h][x].replace&&(x=Ot[h][x].replace);const A=we.fontMap[c].fontName;return ot(x,A,h)?we.fontMap[c].variant:null};function Nl(s){if(!s)return!1;if(s.type==="mi"&&s.children.length===1){const i=s.children[0];return i instanceof Yn&&i.text==="."}else if(s.type==="mo"&&s.children.length===1&&s.getAttribute("separator")==="true"&&s.getAttribute("lspace")==="0em"&&s.getAttribute("rspace")==="0em"){const i=s.children[0];return i instanceof Yn&&i.text===","}else return!1}const xn=function(s,i,c){if(s.length===1){const A=Ar(s[0],i);return c&&A instanceof An&&A.type==="mo"&&(A.setAttribute("lspace","0em"),A.setAttribute("rspace","0em")),[A]}const h=[];let x;for(let A=0;A<s.length;A++){const M=Ar(s[A],i);if(M instanceof An&&x instanceof An){if(M.type==="mtext"&&x.type==="mtext"&&M.getAttribute("mathvariant")===x.getAttribute("mathvariant")){x.children.push(...M.children);continue}else if(M.type==="mn"&&x.type==="mn"){x.children.push(...M.children);continue}else if(Nl(M)&&x.type==="mn"){x.children.push(...M.children);continue}else if(M.type==="mn"&&Nl(x))M.children=[...x.children,...M.children],h.pop();else if((M.type==="msup"||M.type==="msub")&&M.children.length>=1&&(x.type==="mn"||Nl(x))){const L=M.children[0];L instanceof An&&L.type==="mn"&&(L.children=[...x.children,...L.children],h.pop())}else if(x.type==="mi"&&x.children.length===1){const L=x.children[0];if(L instanceof Yn&&L.text==="\u0338"&&(M.type==="mo"||M.type==="mi"||M.type==="mn")){const J=M.children[0];J instanceof Yn&&J.text.length>0&&(J.text=J.text.slice(0,1)+"\u0338"+J.text.slice(1),h.pop())}}}h.push(M),x=M}return h},ko=function(s,i,c){return Tl(xn(s,i,c))},Ar=function(s,i){if(!s)return new Ze.MathNode("mrow");if(Ln[s.type])return Ln[s.type](s,i);throw new a("Got group of unknown type: '"+s.type+"'")};function ud(s,i,c,h,x){const A=xn(s,c);let M;A.length===1&&A[0]instanceof An&&["mrow","mtable"].includes(A[0].type)?M=A[0]:M=new Ze.MathNode("mrow",A);const L=new Ze.MathNode("annotation",[new Ze.TextNode(i)]);L.setAttribute("encoding","application/x-tex");const J=new Ze.MathNode("semantics",[M,L]),se=new Ze.MathNode("math",[J]);se.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),h&&se.setAttribute("display","block");const ye=x?"katex":"katex-mathml";return we.makeSpan([ye],[se])}const cd=function(s){return new It({style:s.displayMode?V.DISPLAY:V.TEXT,maxSize:s.maxSize,minRuleThickness:s.minRuleThickness})},dd=function(s,i){if(i.displayMode){const c=["katex-display"];i.leqno&&c.push("leqno"),i.fleqn&&c.push("fleqn"),s=we.makeSpan(c,[s])}return s},X2=function(s,i,c){const h=cd(c);let x;if(c.output==="mathml")return ud(s,i,h,c.displayMode,!0);if(c.output==="html"){const A=Fl(s,h);x=we.makeSpan(["katex"],[A])}else{const A=ud(s,i,h,c.displayMode,!1),M=Fl(s,h);x=we.makeSpan(["katex"],[A,M])}return dd(x,c)},G2=function(s,i,c){const h=cd(c),x=Fl(s,h),A=we.makeSpan(["katex"],[x]);return dd(A,c)},Y2={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xrightleftarrows:"\u21C4",xrightequilibrium:"\u21CC",xleftequilibrium:"\u21CB","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"="},Z2=function(s){const i=new Ze.MathNode("mo",[new Ze.TextNode(Y2[s.replace(/^\\/,"")])]);return i.setAttribute("stretchy","true"),i},J2={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Q2=function(s){return s.type==="ordgroup"?s.body.length:1};var lo={encloseSpan:function(s,i,c,h,x){let A;const M=s.height+s.depth+c+h;if(/fbox|color|angl/.test(i)){if(A=we.makeSpan(["stretchy",i],[],x),i==="fbox"){const L=x.color&&x.getColor();L&&(A.style.borderColor=L)}}else{const L=[];/^[bx]cancel$/.test(i)&&L.push(new Zr({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(i)&&L.push(new Zr({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));const J=new Er(L,{width:"100%",height:pe(M)});A=we.makeSvgSpan([],[J],x)}return A.height=M,A.style.height=pe(M),A},mathMLnode:Z2,svgSpan:function(s,i){function c(){let M=4e5;const L=s.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(L)){const J=Q2(s.base);let se,ye,ke;if(J>5)L==="widehat"||L==="widecheck"?(se=420,M=2364,ke=.42,ye=L+"4"):(se=312,M=2340,ke=.34,ye="tilde4");else{const gt=[1,1,2,2,3,3][J];L==="widehat"||L==="widecheck"?(M=[0,1062,2364,2364,2364][gt],se=[0,239,300,360,420][gt],ke=[0,.24,.3,.3,.36,.42][gt],ye=L+gt):(M=[0,600,1033,2339,2340][gt],se=[0,260,286,306,312][gt],ke=[0,.26,.286,.3,.306,.34][gt],ye="tilde"+gt)}const Ne=new Cr(ye),et=new Er([Ne],{width:"100%",height:pe(ke),viewBox:"0 0 "+M+" "+se,preserveAspectRatio:"none"});return{span:we.makeSvgSpan([],[et],i),minWidth:0,height:ke}}else{const J=[],se=J2[L],[ye,ke,Ne]=se,et=Ne/1e3,gt=ye.length;let Xt,ur;if(gt===1){const nr=se[3];Xt=["hide-tail"],ur=[nr]}else if(gt===2)Xt=["halfarrow-left","halfarrow-right"],ur=["xMinYMin","xMaxYMin"];else if(gt===3)Xt=["brace-left","brace-center","brace-right"],ur=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
495
+ `+gt+" children.");for(let nr=0;nr<gt;nr++){const gr=new Cr(ye[nr]),pr=new Er([gr],{width:"400em",height:pe(et),viewBox:"0 0 "+M+" "+Ne,preserveAspectRatio:ur[nr]+" slice"}),$r=we.makeSvgSpan([Xt[nr]],[pr],i);if(gt===1)return{span:$r,minWidth:ke,height:et};$r.style.height=pe(et),J.push($r)}return{span:we.makeSpan(["stretchy"],J,i),minWidth:ke,height:et}}}const{span:h,minWidth:x,height:A}=c();return h.height=A,h.style.height=pe(A),x>0&&(h.style.minWidth=pe(x)),h}};function Yt(s,i){if(!s||s.type!==i)throw new Error("Expected node of type "+i+", but got "+(s?"node of type "+s.type:String(s)));return s}function Ol(s){const i=ji(s);if(!i)throw new Error("Expected node of symbol group type, but got "+(s?"node of type "+s.type:String(s)));return i}function ji(s){return s&&(s.type==="atom"||cr.hasOwnProperty(s.type))?s:null}const Ml=(s,i)=>{let c,h,x;s&&s.type==="supsub"?(h=Yt(s.base,"accent"),c=h.base,s.base=c,x=Sr(hr(s,i)),s.base=h):(h=Yt(s,"accent"),c=h.base);const A=hr(c,i.havingCrampedStyle()),M=h.isShifty&&C.isCharacterBox(c);let L=0;if(M){const Ne=C.getBaseElem(c),et=hr(Ne,i.havingCrampedStyle());L=Ut(et).skew}const J=h.label==="\\c";let se=J?A.height+A.depth:Math.min(A.height,i.fontMetrics().xHeight),ye;if(h.isStretchy)ye=lo.svgSpan(h,i),ye=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:A},{type:"elem",elem:ye,wrapperClasses:["svg-align"],wrapperStyle:L>0?{width:"calc(100% - "+pe(2*L)+")",marginLeft:pe(2*L)}:void 0}]},i);else{let Ne,et;h.label==="\\vec"?(Ne=we.staticSvg("vec",i),et=we.svgData.vec[1]):(Ne=we.makeOrd({mode:h.mode,text:h.label},i,"textord"),Ne=Ut(Ne),Ne.italic=0,et=Ne.width,J&&(se+=Ne.depth)),ye=we.makeSpan(["accent-body"],[Ne]);const gt=h.label==="\\textcircled";gt&&(ye.classes.push("accent-full"),se=A.height);let Xt=L;gt||(Xt-=et/2),ye.style.left=pe(Xt),h.label==="\\textcircled"&&(ye.style.top=".2em"),ye=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:A},{type:"kern",size:-se},{type:"elem",elem:ye}]},i)}const ke=we.makeSpan(["mord","accent"],[ye],i);return x?(x.children[0]=ke,x.height=Math.max(ke.height,x.height),x.classes[0]="mord",x):ke},fd=(s,i)=>{const c=s.isStretchy?lo.mathMLnode(s.label):new Ze.MathNode("mo",[Nn(s.label,s.mode)]),h=new Ze.MathNode("mover",[Ar(s.base,i),c]);return h.setAttribute("accent","true"),h},e4=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(s=>"\\"+s).join("|"));mt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(s,i)=>{const c=Gn(i[0]),h=!e4.test(s.funcName),x=!h||s.funcName==="\\widehat"||s.funcName==="\\widetilde"||s.funcName==="\\widecheck";return{type:"accent",mode:s.parser.mode,label:s.funcName,isStretchy:h,isShifty:x,base:c}},htmlBuilder:Ml,mathmlBuilder:fd}),mt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(s,i)=>{const c=i[0];let h=s.parser.mode;return h==="math"&&(s.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+s.funcName+" works only in text mode"),h="text"),{type:"accent",mode:h,label:s.funcName,isStretchy:!1,isShifty:!0,base:c}},htmlBuilder:Ml,mathmlBuilder:fd}),mt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(s,i)=>{let{parser:c,funcName:h}=s;const x=i[0];return{type:"accentUnder",mode:c.mode,label:h,base:x}},htmlBuilder:(s,i)=>{const c=hr(s.base,i),h=lo.svgSpan(s,i),x=s.label==="\\utilde"?.12:0,A=we.makeVList({positionType:"top",positionData:c.height,children:[{type:"elem",elem:h,wrapperClasses:["svg-align"]},{type:"kern",size:x},{type:"elem",elem:c}]},i);return we.makeSpan(["mord","accentunder"],[A],i)},mathmlBuilder:(s,i)=>{const c=lo.mathMLnode(s.label),h=new Ze.MathNode("munder",[Ar(s.base,i),c]);return h.setAttribute("accentunder","true"),h}});const Li=s=>{const i=new Ze.MathNode("mpadded",s?[s]:[]);return i.setAttribute("width","+0.6em"),i.setAttribute("lspace","0.3em"),i};mt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(s,i,c){let{parser:h,funcName:x}=s;return{type:"xArrow",mode:h.mode,label:x,body:i[0],below:c[0]}},htmlBuilder(s,i){const c=i.style;let h=i.havingStyle(c.sup());const x=we.wrapFragment(hr(s.body,h,i),i),A=s.label.slice(0,2)==="\\x"?"x":"cd";x.classes.push(A+"-arrow-pad");let M;s.below&&(h=i.havingStyle(c.sub()),M=we.wrapFragment(hr(s.below,h,i),i),M.classes.push(A+"-arrow-pad"));const L=lo.svgSpan(s,i),J=-i.fontMetrics().axisHeight+.5*L.height;let se=-i.fontMetrics().axisHeight-.5*L.height-.111;(x.depth>.25||s.label==="\\xleftequilibrium")&&(se-=x.depth);let ye;if(M){const ke=-i.fontMetrics().axisHeight+M.height+.5*L.height+.111;ye=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:x,shift:se},{type:"elem",elem:L,shift:J},{type:"elem",elem:M,shift:ke}]},i)}else ye=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:x,shift:se},{type:"elem",elem:L,shift:J}]},i);return ye.children[0].children[0].children[1].classes.push("svg-align"),we.makeSpan(["mrel","x-arrow"],[ye],i)},mathmlBuilder(s,i){const c=lo.mathMLnode(s.label);c.setAttribute("minsize",s.label.charAt(0)==="x"?"1.75em":"3.0em");let h;if(s.body){const x=Li(Ar(s.body,i));if(s.below){const A=Li(Ar(s.below,i));h=new Ze.MathNode("munderover",[c,A,x])}else h=new Ze.MathNode("mover",[c,x])}else if(s.below){const x=Li(Ar(s.below,i));h=new Ze.MathNode("munder",[c,x])}else h=Li(),h=new Ze.MathNode("mover",[c,h]);return h}});const t4=we.makeSpan;function hd(s,i){const c=Yr(s.body,i,!0);return t4([s.mclass],c,i)}function pd(s,i){let c;const h=xn(s.body,i);return s.mclass==="minner"?c=new Ze.MathNode("mpadded",h):s.mclass==="mord"?s.isCharacterBox?(c=h[0],c.type="mi"):c=new Ze.MathNode("mi",h):(s.isCharacterBox?(c=h[0],c.type="mo"):c=new Ze.MathNode("mo",h),s.mclass==="mbin"?(c.attributes.lspace="0.22em",c.attributes.rspace="0.22em"):s.mclass==="mpunct"?(c.attributes.lspace="0em",c.attributes.rspace="0.17em"):s.mclass==="mopen"||s.mclass==="mclose"?(c.attributes.lspace="0em",c.attributes.rspace="0em"):s.mclass==="minner"&&(c.attributes.lspace="0.0556em",c.attributes.width="+0.1111em")),c}mt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(s,i){let{parser:c,funcName:h}=s;const x=i[0];return{type:"mclass",mode:c.mode,mclass:"m"+h.slice(5),body:Tr(x),isCharacterBox:C.isCharacterBox(x)}},htmlBuilder:hd,mathmlBuilder:pd});const Hi=s=>{const i=s.type==="ordgroup"&&s.body.length?s.body[0]:s;return i.type==="atom"&&(i.family==="bin"||i.family==="rel")?"m"+i.family:"mord"};mt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(s,i){let{parser:c}=s;return{type:"mclass",mode:c.mode,mclass:Hi(i[0]),body:Tr(i[1]),isCharacterBox:C.isCharacterBox(i[1])}}}),mt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(s,i){let{parser:c,funcName:h}=s;const x=i[1],A=i[0];let M;h!=="\\stackrel"?M=Hi(x):M="mrel";const L={type:"op",mode:x.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:h!=="\\stackrel",body:Tr(x)},J={type:"supsub",mode:A.mode,base:L,sup:h==="\\underset"?null:A,sub:h==="\\underset"?A:null};return{type:"mclass",mode:c.mode,mclass:M,body:[J],isCharacterBox:C.isCharacterBox(J)}},htmlBuilder:hd,mathmlBuilder:pd}),mt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(s,i){let{parser:c}=s;return{type:"pmb",mode:c.mode,mclass:Hi(i[0]),body:Tr(i[0])}},htmlBuilder(s,i){const c=Yr(s.body,i,!0),h=we.makeSpan([s.mclass],c,i);return h.style.textShadow="0.02em 0.01em 0.04px",h},mathmlBuilder(s,i){const c=xn(s.body,i),h=new Ze.MathNode("mstyle",c);return h.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),h}});const r4={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},md=()=>({type:"styling",body:[],mode:"math",style:"display"}),gd=s=>s.type==="textord"&&s.text==="@",n4=(s,i)=>(s.type==="mathord"||s.type==="atom")&&s.text===i;function o4(s,i,c){const h=r4[s];switch(h){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return c.callFunction(h,[i[0]],[i[1]]);case"\\uparrow":case"\\downarrow":{const x=c.callFunction("\\\\cdleft",[i[0]],[]),A={type:"atom",text:h,mode:"math",family:"rel"},M=c.callFunction("\\Big",[A],[]),L=c.callFunction("\\\\cdright",[i[1]],[]),J={type:"ordgroup",mode:"math",body:[x,M,L]};return c.callFunction("\\\\cdparent",[J],[])}case"\\\\cdlongequal":return c.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{const x={type:"textord",text:"\\Vert",mode:"math"};return c.callFunction("\\Big",[x],[])}default:return{type:"textord",text:" ",mode:"math"}}}function a4(s){const i=[];for(s.gullet.beginGroup(),s.gullet.macros.set("\\cr","\\\\\\relax"),s.gullet.beginGroup();;){i.push(s.parseExpression(!1,"\\\\")),s.gullet.endGroup(),s.gullet.beginGroup();const A=s.fetch().text;if(A==="&"||A==="\\\\")s.consume();else if(A==="\\end"){i[i.length-1].length===0&&i.pop();break}else throw new a("Expected \\\\ or \\cr or \\end",s.nextToken)}let c=[];const h=[c];for(let A=0;A<i.length;A++){const M=i[A];let L=md();for(let J=0;J<M.length;J++)if(!gd(M[J]))L.body.push(M[J]);else{c.push(L),J+=1;const se=Ol(M[J]).text,ye=new Array(2);if(ye[0]={type:"ordgroup",mode:"math",body:[]},ye[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(se)>-1))if("<>AV".indexOf(se)>-1)for(let Ne=0;Ne<2;Ne++){let et=!0;for(let gt=J+1;gt<M.length;gt++){if(n4(M[gt],se)){et=!1,J=gt;break}if(gd(M[gt]))throw new a("Missing a "+se+" character to complete a CD arrow.",M[gt]);ye[Ne].body.push(M[gt])}if(et)throw new a("Missing a "+se+" character to complete a CD arrow.",M[J])}else throw new a('Expected one of "<>AV=|." after @',M[J]);const ke={type:"styling",body:[o4(se,ye,s)],mode:"math",style:"display"};c.push(ke),L=md()}A%2===0?c.push(L):c.shift(),c=[],h.push(c)}s.gullet.endGroup(),s.gullet.endGroup();const x=new Array(h[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:h,arraystretch:1,addJot:!0,rowGaps:[null],cols:x,colSeparationType:"CD",hLinesBeforeRow:new Array(h.length+1).fill([])}}mt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(s,i){let{parser:c,funcName:h}=s;return{type:"cdlabel",mode:c.mode,side:h.slice(4),label:i[0]}},htmlBuilder(s,i){const c=i.havingStyle(i.style.sup()),h=we.wrapFragment(hr(s.label,c,i),i);return h.classes.push("cd-label-"+s.side),h.style.bottom=pe(.8-h.depth),h.height=0,h.depth=0,h},mathmlBuilder(s,i){let c=new Ze.MathNode("mrow",[Ar(s.label,i)]);return c=new Ze.MathNode("mpadded",[c]),c.setAttribute("width","0"),s.side==="left"&&c.setAttribute("lspace","-1width"),c.setAttribute("voffset","0.7em"),c=new Ze.MathNode("mstyle",[c]),c.setAttribute("displaystyle","false"),c.setAttribute("scriptlevel","1"),c}}),mt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(s,i){let{parser:c}=s;return{type:"cdlabelparent",mode:c.mode,fragment:i[0]}},htmlBuilder(s,i){const c=we.wrapFragment(hr(s.fragment,i),i);return c.classes.push("cd-vert-arrow"),c},mathmlBuilder(s,i){return new Ze.MathNode("mrow",[Ar(s.fragment,i)])}}),mt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(s,i){let{parser:c}=s;const h=Yt(i[0],"ordgroup").body;let x="";for(let L=0;L<h.length;L++){const J=Yt(h[L],"textord");x+=J.text}let A=parseInt(x),M;if(isNaN(A))throw new a("\\@char has non-numeric argument "+x);if(A<0||A>=1114111)throw new a("\\@char with invalid code point "+x);return A<=65535?M=String.fromCharCode(A):(A-=65536,M=String.fromCharCode((A>>10)+55296,(A&1023)+56320)),{type:"textord",mode:c.mode,text:M}}});const vd=(s,i)=>{const c=Yr(s.body,i.withColor(s.color),!1);return we.makeFragment(c)},bd=(s,i)=>{const c=xn(s.body,i.withColor(s.color)),h=new Ze.MathNode("mstyle",c);return h.setAttribute("mathcolor",s.color),h};mt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(s,i){let{parser:c}=s;const h=Yt(i[0],"color-token").color,x=i[1];return{type:"color",mode:c.mode,color:h,body:Tr(x)}},htmlBuilder:vd,mathmlBuilder:bd}),mt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(s,i){let{parser:c,breakOnTokenText:h}=s;const x=Yt(i[0],"color-token").color;c.gullet.macros.set("\\current@color",x);const A=c.parseExpression(!0,h);return{type:"color",mode:c.mode,color:x,body:A}},htmlBuilder:vd,mathmlBuilder:bd}),mt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(s,i,c){let{parser:h}=s;const x=h.gullet.future().text==="["?h.parseSizeGroup(!0):null,A=!h.settings.displayMode||!h.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:h.mode,newLine:A,size:x&&Yt(x,"size").value}},htmlBuilder(s,i){const c=we.makeSpan(["mspace"],[],i);return s.newLine&&(c.classes.push("newline"),s.size&&(c.style.marginTop=pe(je(s.size,i)))),c},mathmlBuilder(s,i){const c=new Ze.MathNode("mspace");return s.newLine&&(c.setAttribute("linebreak","newline"),s.size&&c.setAttribute("height",pe(je(s.size,i)))),c}});const Il={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},yd=s=>{const i=s.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new a("Expected a control sequence",s);return i},i4=s=>{let i=s.gullet.popToken();return i.text==="="&&(i=s.gullet.popToken(),i.text===" "&&(i=s.gullet.popToken())),i},xd=(s,i,c,h)=>{let x=s.gullet.macros.get(c.text);x==null&&(c.noexpand=!0,x={tokens:[c],numArgs:0,unexpandable:!s.gullet.isExpandable(c.text)}),s.gullet.macros.set(i,x,h)};mt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(s){let{parser:i,funcName:c}=s;i.consumeSpaces();const h=i.fetch();if(Il[h.text])return(c==="\\global"||c==="\\\\globallong")&&(h.text=Il[h.text]),Yt(i.parseFunction(),"internal");throw new a("Invalid token after macro prefix",h)}}),mt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(s){let{parser:i,funcName:c}=s,h=i.gullet.popToken();const x=h.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(x))throw new a("Expected a control sequence",h);let A=0,M;const L=[[]];for(;i.gullet.future().text!=="{";)if(h=i.gullet.popToken(),h.text==="#"){if(i.gullet.future().text==="{"){M=i.gullet.future(),L[A].push("{");break}if(h=i.gullet.popToken(),!/^[1-9]$/.test(h.text))throw new a('Invalid argument number "'+h.text+'"');if(parseInt(h.text)!==A+1)throw new a('Argument number "'+h.text+'" out of order');A++,L.push([])}else{if(h.text==="EOF")throw new a("Expected a macro definition");L[A].push(h.text)}let{tokens:J}=i.gullet.consumeArg();return M&&J.unshift(M),(c==="\\edef"||c==="\\xdef")&&(J=i.gullet.expandTokens(J),J.reverse()),i.gullet.macros.set(x,{tokens:J,numArgs:A,delimiters:L},c===Il[c]),{type:"internal",mode:i.mode}}}),mt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(s){let{parser:i,funcName:c}=s;const h=yd(i.gullet.popToken());i.gullet.consumeSpaces();const x=i4(i);return xd(i,h,x,c==="\\\\globallet"),{type:"internal",mode:i.mode}}}),mt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(s){let{parser:i,funcName:c}=s;const h=yd(i.gullet.popToken()),x=i.gullet.popToken(),A=i.gullet.popToken();return xd(i,h,A,c==="\\\\globalfuture"),i.gullet.pushToken(A),i.gullet.pushToken(x),{type:"internal",mode:i.mode}}});const ja=function(s,i,c){const h=Ot.math[s]&&Ot.math[s].replace,x=ot(h||s,i,c);if(!x)throw new Error("Unsupported symbol "+s+" and font size "+i+".");return x},Rl=function(s,i,c,h){const x=c.havingBaseStyle(i),A=we.makeSpan(h.concat(x.sizingClasses(c)),[s],c),M=x.sizeMultiplier/c.sizeMultiplier;return A.height*=M,A.depth*=M,A.maxFontSize=x.sizeMultiplier,A},wd=function(s,i,c){const h=i.havingBaseStyle(c),x=(1-i.sizeMultiplier/h.sizeMultiplier)*i.fontMetrics().axisHeight;s.classes.push("delimcenter"),s.style.top=pe(x),s.height-=x,s.depth+=x},s4=function(s,i,c,h,x,A){const M=we.makeSymbol(s,"Main-Regular",x,h),L=Rl(M,i,h,A);return c&&wd(L,h,i),L},l4=function(s,i,c,h){return we.makeSymbol(s,"Size"+i+"-Regular",c,h)},Cd=function(s,i,c,h,x,A){const M=l4(s,i,x,h),L=Rl(we.makeSpan(["delimsizing","size"+i],[M],h),V.TEXT,h,A);return c&&wd(L,h,V.TEXT),L},Pl=function(s,i,c){let h;return i==="Size1-Regular"?h="delim-size1":h="delim-size4",{type:"elem",elem:we.makeSpan(["delimsizinginner",h],[we.makeSpan([],[we.makeSymbol(s,i,c)])])}},zl=function(s,i,c){const h=xe["Size4-Regular"][s.charCodeAt(0)]?xe["Size4-Regular"][s.charCodeAt(0)][4]:xe["Size1-Regular"][s.charCodeAt(0)][4],x=new Cr("inner",Ee(s,Math.round(1e3*i))),A=new Er([x],{width:pe(h),height:pe(i),style:"width:"+pe(h),viewBox:"0 0 "+1e3*h+" "+Math.round(1e3*i),preserveAspectRatio:"xMinYMin"}),M=we.makeSvgSpan([],[A],c);return M.height=i,M.style.height=pe(i),M.style.width=pe(h),{type:"elem",elem:M}},_l=.008,Ki={type:"kern",size:-1*_l},u4=["|","\\lvert","\\rvert","\\vert"],c4=["\\|","\\lVert","\\rVert","\\Vert"],Dd=function(s,i,c,h,x,A){let M,L,J,se,ye="",ke=0;M=J=se=s,L=null;let Ne="Size1-Regular";s==="\\uparrow"?J=se="\u23D0":s==="\\Uparrow"?J=se="\u2016":s==="\\downarrow"?M=J="\u23D0":s==="\\Downarrow"?M=J="\u2016":s==="\\updownarrow"?(M="\\uparrow",J="\u23D0",se="\\downarrow"):s==="\\Updownarrow"?(M="\\Uparrow",J="\u2016",se="\\Downarrow"):u4.includes(s)?(J="\u2223",ye="vert",ke=333):c4.includes(s)?(J="\u2225",ye="doublevert",ke=556):s==="["||s==="\\lbrack"?(M="\u23A1",J="\u23A2",se="\u23A3",Ne="Size4-Regular",ye="lbrack",ke=667):s==="]"||s==="\\rbrack"?(M="\u23A4",J="\u23A5",se="\u23A6",Ne="Size4-Regular",ye="rbrack",ke=667):s==="\\lfloor"||s==="\u230A"?(J=M="\u23A2",se="\u23A3",Ne="Size4-Regular",ye="lfloor",ke=667):s==="\\lceil"||s==="\u2308"?(M="\u23A1",J=se="\u23A2",Ne="Size4-Regular",ye="lceil",ke=667):s==="\\rfloor"||s==="\u230B"?(J=M="\u23A5",se="\u23A6",Ne="Size4-Regular",ye="rfloor",ke=667):s==="\\rceil"||s==="\u2309"?(M="\u23A4",J=se="\u23A5",Ne="Size4-Regular",ye="rceil",ke=667):s==="("||s==="\\lparen"?(M="\u239B",J="\u239C",se="\u239D",Ne="Size4-Regular",ye="lparen",ke=875):s===")"||s==="\\rparen"?(M="\u239E",J="\u239F",se="\u23A0",Ne="Size4-Regular",ye="rparen",ke=875):s==="\\{"||s==="\\lbrace"?(M="\u23A7",L="\u23A8",se="\u23A9",J="\u23AA",Ne="Size4-Regular"):s==="\\}"||s==="\\rbrace"?(M="\u23AB",L="\u23AC",se="\u23AD",J="\u23AA",Ne="Size4-Regular"):s==="\\lgroup"||s==="\u27EE"?(M="\u23A7",se="\u23A9",J="\u23AA",Ne="Size4-Regular"):s==="\\rgroup"||s==="\u27EF"?(M="\u23AB",se="\u23AD",J="\u23AA",Ne="Size4-Regular"):s==="\\lmoustache"||s==="\u23B0"?(M="\u23A7",se="\u23AD",J="\u23AA",Ne="Size4-Regular"):(s==="\\rmoustache"||s==="\u23B1")&&(M="\u23AB",se="\u23A9",J="\u23AA",Ne="Size4-Regular");const et=ja(M,Ne,x),gt=et.height+et.depth,Xt=ja(J,Ne,x),ur=Xt.height+Xt.depth,nr=ja(se,Ne,x),gr=nr.height+nr.depth;let pr=0,$r=1;if(L!==null){const Kr=ja(L,Ne,x);pr=Kr.height+Kr.depth,$r=2}const rn=gt+gr+pr,fn=Math.max(0,Math.ceil((i-rn)/($r*ur))),On=rn+fn*$r*ur;let ia=h.fontMetrics().axisHeight;c&&(ia*=h.sizeMultiplier);const vr=On/2-ia,Dr=[];if(ye.length>0){const Kr=On-gt-gr,_r=Math.round(On*1e3),Mn=Fe(ye,Math.round(Kr*1e3)),R4=new Cr(ye,Mn),pf=(ke/1e3).toFixed(3)+"em",mf=(_r/1e3).toFixed(3)+"em",P4=new Er([R4],{width:pf,height:mf,viewBox:"0 0 "+ke+" "+_r}),Xi=we.makeSvgSpan([],[P4],h);Xi.height=_r/1e3,Xi.style.width=pf,Xi.style.height=mf,Dr.push({type:"elem",elem:Xi})}else{if(Dr.push(Pl(se,Ne,x)),Dr.push(Ki),L===null){const Kr=On-gt-gr+2*_l;Dr.push(zl(J,Kr,h))}else{const Kr=(On-gt-gr-pr)/2+2*_l;Dr.push(zl(J,Kr,h)),Dr.push(Ki),Dr.push(Pl(L,Ne,x)),Dr.push(Ki),Dr.push(zl(J,Kr,h))}Dr.push(Ki),Dr.push(Pl(M,Ne,x))}const Nr=h.havingBaseStyle(V.TEXT),Ir=we.makeVList({positionType:"bottom",positionData:vr,children:Dr},Nr);return Rl(we.makeSpan(["delimsizing","mult"],[Ir],Nr),V.TEXT,h,A)},jl=80,Ll=.08,Hl=function(s,i,c,h,x){const A=ge(s,h,c),M=new Cr(s,A),L=new Er([M],{width:"400em",height:pe(i),viewBox:"0 0 400000 "+c,preserveAspectRatio:"xMinYMin slice"});return we.makeSvgSpan(["hide-tail"],[L],x)},d4=function(s,i){const c=i.havingBaseSizing(),h=Ad("\\surd",s*c.sizeMultiplier,Sd,c);let x=c.sizeMultiplier;const A=Math.max(0,i.minRuleThickness-i.fontMetrics().sqrtRuleThickness);let M,L=0,J=0,se=0,ye;return h.type==="small"?(se=1e3+1e3*A+jl,s<1?x=1:s<1.4&&(x=.7),L=(1+A+Ll)/x,J=(1+A)/x,M=Hl("sqrtMain",L,se,A,i),M.style.minWidth="0.853em",ye=.833/x):h.type==="large"?(se=(1e3+jl)*La[h.size],J=(La[h.size]+A)/x,L=(La[h.size]+A+Ll)/x,M=Hl("sqrtSize"+h.size,L,se,A,i),M.style.minWidth="1.02em",ye=1/x):(L=s+A+Ll,J=s+A,se=Math.floor(1e3*s+A)+jl,M=Hl("sqrtTall",L,se,A,i),M.style.minWidth="0.742em",ye=1.056),M.height=J,M.style.height=pe(L),{span:M,advanceWidth:ye,ruleWidth:(i.fontMetrics().sqrtRuleThickness+A)*x}},kd=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],f4=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"],Ed=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],La=[0,1.2,1.8,2.4,3],h4=function(s,i,c,h,x){if(s==="<"||s==="\\lt"||s==="\u27E8"?s="\\langle":(s===">"||s==="\\gt"||s==="\u27E9")&&(s="\\rangle"),kd.includes(s)||Ed.includes(s))return Cd(s,i,!1,c,h,x);if(f4.includes(s))return Dd(s,La[i],!1,c,h,x);throw new a("Illegal delimiter: '"+s+"'")},p4=[{type:"small",style:V.SCRIPTSCRIPT},{type:"small",style:V.SCRIPT},{type:"small",style:V.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],m4=[{type:"small",style:V.SCRIPTSCRIPT},{type:"small",style:V.SCRIPT},{type:"small",style:V.TEXT},{type:"stack"}],Sd=[{type:"small",style:V.SCRIPTSCRIPT},{type:"small",style:V.SCRIPT},{type:"small",style:V.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],g4=function(s){if(s.type==="small")return"Main-Regular";if(s.type==="large")return"Size"+s.size+"-Regular";if(s.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+s.type+"' here.")},Ad=function(s,i,c,h){const x=Math.min(2,3-h.style.size);for(let A=x;A<c.length&&c[A].type!=="stack";A++){const M=ja(s,g4(c[A]),"math");let L=M.height+M.depth;if(c[A].type==="small"){const J=h.havingBaseStyle(c[A].style);L*=J.sizeMultiplier}if(L>i)return c[A]}return c[c.length-1]},Bd=function(s,i,c,h,x,A){s==="<"||s==="\\lt"||s==="\u27E8"?s="\\langle":(s===">"||s==="\\gt"||s==="\u27E9")&&(s="\\rangle");let M;Ed.includes(s)?M=p4:kd.includes(s)?M=Sd:M=m4;const L=Ad(s,i,M,h);return L.type==="small"?s4(s,L.style,c,h,x,A):L.type==="large"?Cd(s,L.size,c,h,x,A):Dd(s,i,c,h,x,A)};var uo={sqrtImage:d4,sizedDelim:h4,sizeToMaxHeight:La,customSizedDelim:Bd,leftRightDelim:function(s,i,c,h,x,A){const M=h.fontMetrics().axisHeight*h.sizeMultiplier,L=901,J=5/h.fontMetrics().ptPerEm,se=Math.max(i-M,c+M),ye=Math.max(se/500*L,2*se-J);return Bd(s,ye,!0,h,x,A)}};const Fd={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},v4=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27E8","\\rangle","\u27E9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function qi(s,i){const c=ji(s);if(c&&v4.includes(c.text))return c;throw c?new a("Invalid delimiter '"+c.text+"' after '"+i.funcName+"'",s):new a("Invalid delimiter type '"+s.type+"'",s)}mt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(s,i)=>{const c=qi(i[0],s);return{type:"delimsizing",mode:s.parser.mode,size:Fd[s.funcName].size,mclass:Fd[s.funcName].mclass,delim:c.text}},htmlBuilder:(s,i)=>s.delim==="."?we.makeSpan([s.mclass]):uo.sizedDelim(s.delim,s.size,i,s.mode,[s.mclass]),mathmlBuilder:s=>{const i=[];s.delim!=="."&&i.push(Nn(s.delim,s.mode));const c=new Ze.MathNode("mo",i);s.mclass==="mopen"||s.mclass==="mclose"?c.setAttribute("fence","true"):c.setAttribute("fence","false"),c.setAttribute("stretchy","true");const h=pe(uo.sizeToMaxHeight[s.size]);return c.setAttribute("minsize",h),c.setAttribute("maxsize",h),c}});function Td(s){if(!s.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}mt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(s,i)=>{const c=s.parser.gullet.macros.get("\\current@color");if(c&&typeof c!="string")throw new a("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:s.parser.mode,delim:qi(i[0],s).text,color:c}}}),mt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(s,i)=>{const c=qi(i[0],s),h=s.parser;++h.leftrightDepth;const x=h.parseExpression(!1);--h.leftrightDepth,h.expect("\\right",!1);const A=Yt(h.parseFunction(),"leftright-right");return{type:"leftright",mode:h.mode,body:x,left:c.text,right:A.delim,rightColor:A.color}},htmlBuilder:(s,i)=>{Td(s);const c=Yr(s.body,i,!0,["mopen","mclose"]);let h=0,x=0,A=!1;for(let J=0;J<c.length;J++)c[J].isMiddle?A=!0:(h=Math.max(c[J].height,h),x=Math.max(c[J].depth,x));h*=i.sizeMultiplier,x*=i.sizeMultiplier;let M;if(s.left==="."?M=_a(i,["mopen"]):M=uo.leftRightDelim(s.left,h,x,i,s.mode,["mopen"]),c.unshift(M),A)for(let J=1;J<c.length;J++){const se=c[J].isMiddle;se&&(c[J]=uo.leftRightDelim(se.delim,h,x,se.options,s.mode,[]))}let L;if(s.right===".")L=_a(i,["mclose"]);else{const J=s.rightColor?i.withColor(s.rightColor):i;L=uo.leftRightDelim(s.right,h,x,J,s.mode,["mclose"])}return c.push(L),we.makeSpan(["minner"],c,i)},mathmlBuilder:(s,i)=>{Td(s);const c=xn(s.body,i);if(s.left!=="."){const h=new Ze.MathNode("mo",[Nn(s.left,s.mode)]);h.setAttribute("fence","true"),c.unshift(h)}if(s.right!=="."){const h=new Ze.MathNode("mo",[Nn(s.right,s.mode)]);h.setAttribute("fence","true"),s.rightColor&&h.setAttribute("mathcolor",s.rightColor),c.push(h)}return Tl(c)}}),mt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(s,i)=>{const c=qi(i[0],s);if(!s.parser.leftrightDepth)throw new a("\\middle without preceding \\left",c);return{type:"middle",mode:s.parser.mode,delim:c.text}},htmlBuilder:(s,i)=>{let c;if(s.delim===".")c=_a(i,[]);else{c=uo.sizedDelim(s.delim,1,i,s.mode,[]);const h={delim:s.delim,options:i};c.isMiddle=h}return c},mathmlBuilder:(s,i)=>{const c=s.delim==="\\vert"||s.delim==="|"?Nn("|","text"):Nn(s.delim,s.mode),h=new Ze.MathNode("mo",[c]);return h.setAttribute("fence","true"),h.setAttribute("lspace","0.05em"),h.setAttribute("rspace","0.05em"),h}});const Kl=(s,i)=>{const c=we.wrapFragment(hr(s.body,i),i),h=s.label.slice(1);let x=i.sizeMultiplier,A,M=0;const L=C.isCharacterBox(s.body);if(h==="sout")A=we.makeSpan(["stretchy","sout"]),A.height=i.fontMetrics().defaultRuleThickness/x,M=-.5*i.fontMetrics().xHeight;else if(h==="phase"){const se=je({number:.6,unit:"pt"},i),ye=je({number:.35,unit:"ex"},i),ke=i.havingBaseSizing();x=x/ke.sizeMultiplier;const Ne=c.height+c.depth+se+ye;c.style.paddingLeft=pe(Ne/2+se);const et=Math.floor(1e3*Ne*x),gt=Se(et),Xt=new Er([new Cr("phase",gt)],{width:"400em",height:pe(et/1e3),viewBox:"0 0 400000 "+et,preserveAspectRatio:"xMinYMin slice"});A=we.makeSvgSpan(["hide-tail"],[Xt],i),A.style.height=pe(Ne),M=c.depth+se+ye}else{/cancel/.test(h)?L||c.classes.push("cancel-pad"):h==="angl"?c.classes.push("anglpad"):c.classes.push("boxpad");let se=0,ye=0,ke=0;/box/.test(h)?(ke=Math.max(i.fontMetrics().fboxrule,i.minRuleThickness),se=i.fontMetrics().fboxsep+(h==="colorbox"?0:ke),ye=se):h==="angl"?(ke=Math.max(i.fontMetrics().defaultRuleThickness,i.minRuleThickness),se=4*ke,ye=Math.max(0,.25-c.depth)):(se=L?.2:0,ye=se),A=lo.encloseSpan(c,h,se,ye,i),/fbox|boxed|fcolorbox/.test(h)?(A.style.borderStyle="solid",A.style.borderWidth=pe(ke)):h==="angl"&&ke!==.049&&(A.style.borderTopWidth=pe(ke),A.style.borderRightWidth=pe(ke)),M=c.depth+ye,s.backgroundColor&&(A.style.backgroundColor=s.backgroundColor,s.borderColor&&(A.style.borderColor=s.borderColor))}let J;if(s.backgroundColor)J=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:A,shift:M},{type:"elem",elem:c,shift:0}]},i);else{const se=/cancel|phase/.test(h)?["svg-align"]:[];J=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:A,shift:M,wrapperClasses:se}]},i)}return/cancel/.test(h)&&(J.height=c.height,J.depth=c.depth),/cancel/.test(h)&&!L?we.makeSpan(["mord","cancel-lap"],[J],i):we.makeSpan(["mord"],[J],i)},ql=(s,i)=>{let c=0;const h=new Ze.MathNode(s.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Ar(s.body,i)]);switch(s.label){case"\\cancel":h.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":h.setAttribute("notation","downdiagonalstrike");break;case"\\phase":h.setAttribute("notation","phasorangle");break;case"\\sout":h.setAttribute("notation","horizontalstrike");break;case"\\fbox":h.setAttribute("notation","box");break;case"\\angl":h.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(c=i.fontMetrics().fboxsep*i.fontMetrics().ptPerEm,h.setAttribute("width","+"+2*c+"pt"),h.setAttribute("height","+"+2*c+"pt"),h.setAttribute("lspace",c+"pt"),h.setAttribute("voffset",c+"pt"),s.label==="\\fcolorbox"){const x=Math.max(i.fontMetrics().fboxrule,i.minRuleThickness);h.setAttribute("style","border: "+x+"em solid "+String(s.borderColor))}break;case"\\xcancel":h.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return s.backgroundColor&&h.setAttribute("mathbackground",s.backgroundColor),h};mt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(s,i,c){let{parser:h,funcName:x}=s;const A=Yt(i[0],"color-token").color,M=i[1];return{type:"enclose",mode:h.mode,label:x,backgroundColor:A,body:M}},htmlBuilder:Kl,mathmlBuilder:ql}),mt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(s,i,c){let{parser:h,funcName:x}=s;const A=Yt(i[0],"color-token").color,M=Yt(i[1],"color-token").color,L=i[2];return{type:"enclose",mode:h.mode,label:x,backgroundColor:M,borderColor:A,body:L}},htmlBuilder:Kl,mathmlBuilder:ql}),mt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(s,i){let{parser:c}=s;return{type:"enclose",mode:c.mode,label:"\\fbox",body:i[0]}}}),mt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(s,i){let{parser:c,funcName:h}=s;const x=i[0];return{type:"enclose",mode:c.mode,label:h,body:x}},htmlBuilder:Kl,mathmlBuilder:ql}),mt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(s,i){let{parser:c}=s;return{type:"enclose",mode:c.mode,label:"\\angl",body:i[0]}}});const $d={};function Zn(s){let{type:i,names:c,props:h,handler:x,htmlBuilder:A,mathmlBuilder:M}=s;const L={type:i,numArgs:h.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:x};for(let J=0;J<c.length;++J)$d[c[J]]=L;A&&(Hr[i]=A),M&&(Ln[i]=M)}const Nd={};function H(s,i){Nd[s]=i}class wn{constructor(i,c,h){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=i,this.start=c,this.end=h}static range(i,c){return c?!i||!i.loc||!c.loc||i.loc.lexer!==c.loc.lexer?null:new wn(i.loc.lexer,i.loc.start,c.loc.end):i&&i.loc}}class Bn{constructor(i,c){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=i,this.loc=c}range(i,c){return new Bn(c,wn.range(this,i))}}function Od(s){const i=[];s.consumeSpaces();let c=s.fetch().text;for(c==="\\relax"&&(s.consume(),s.consumeSpaces(),c=s.fetch().text);c==="\\hline"||c==="\\hdashline";)s.consume(),i.push(c==="\\hdashline"),s.consumeSpaces(),c=s.fetch().text;return i}const Vi=s=>{if(!s.parser.settings.displayMode)throw new a("{"+s.envName+"} can be used only in display mode.")};function Vl(s){if(s.indexOf("ed")===-1)return s.indexOf("*")===-1}function Eo(s,i,c){let{hskipBeforeAndAfter:h,addJot:x,cols:A,arraystretch:M,colSeparationType:L,autoTag:J,singleRow:se,emptySingleRow:ye,maxNumCols:ke,leqno:Ne}=i;if(s.gullet.beginGroup(),se||s.gullet.macros.set("\\cr","\\\\\\relax"),!M){const $r=s.gullet.expandMacroAsText("\\arraystretch");if($r==null)M=1;else if(M=parseFloat($r),!M||M<0)throw new a("Invalid \\arraystretch: "+$r)}s.gullet.beginGroup();let et=[];const gt=[et],Xt=[],ur=[],nr=J!=null?[]:void 0;function gr(){J&&s.gullet.macros.set("\\@eqnsw","1",!0)}function pr(){nr&&(s.gullet.macros.get("\\df@tag")?(nr.push(s.subparse([new Bn("\\df@tag")])),s.gullet.macros.set("\\df@tag",void 0,!0)):nr.push(!!J&&s.gullet.macros.get("\\@eqnsw")==="1"))}for(gr(),ur.push(Od(s));;){let $r=s.parseExpression(!1,se?"\\end":"\\\\");s.gullet.endGroup(),s.gullet.beginGroup(),$r={type:"ordgroup",mode:s.mode,body:$r},c&&($r={type:"styling",mode:s.mode,style:c,body:[$r]}),et.push($r);const rn=s.fetch().text;if(rn==="&"){if(ke&&et.length===ke){if(se||L)throw new a("Too many tab characters: &",s.nextToken);s.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}s.consume()}else if(rn==="\\end"){pr(),et.length===1&&$r.type==="styling"&&$r.body[0].body.length===0&&(gt.length>1||!ye)&&gt.pop(),ur.length<gt.length+1&&ur.push([]);break}else if(rn==="\\\\"){s.consume();let fn;s.gullet.future().text!==" "&&(fn=s.parseSizeGroup(!0)),Xt.push(fn?fn.value:null),pr(),ur.push(Od(s)),et=[],gt.push(et),gr()}else throw new a("Expected & or \\\\ or \\cr or \\end",s.nextToken)}return s.gullet.endGroup(),s.gullet.endGroup(),{type:"array",mode:s.mode,addJot:x,arraystretch:M,body:gt,cols:A,rowGaps:Xt,hskipBeforeAndAfter:h,hLinesBeforeRow:ur,colSeparationType:L,tags:nr,leqno:Ne}}function Wl(s){return s.slice(0,1)==="d"?"display":"text"}const Jn=function(s,i){let c,h;const x=s.body.length,A=s.hLinesBeforeRow;let M=0,L=new Array(x);const J=[],se=Math.max(i.fontMetrics().arrayRuleWidth,i.minRuleThickness),ye=1/i.fontMetrics().ptPerEm;let ke=5*ye;s.colSeparationType&&s.colSeparationType==="small"&&(ke=.2778*(i.havingStyle(V.SCRIPT).sizeMultiplier/i.sizeMultiplier));const Ne=s.colSeparationType==="CD"?je({number:3,unit:"ex"},i):12*ye,et=3*ye,gt=s.arraystretch*Ne,Xt=.7*gt,ur=.3*gt;let nr=0;function gr(vr){for(let Dr=0;Dr<vr.length;++Dr)Dr>0&&(nr+=.25),J.push({pos:nr,isDashed:vr[Dr]})}for(gr(A[0]),c=0;c<s.body.length;++c){const vr=s.body[c];let Dr=Xt,Nr=ur;M<vr.length&&(M=vr.length);const Ir=new Array(vr.length);for(h=0;h<vr.length;++h){const Mn=hr(vr[h],i);Nr<Mn.depth&&(Nr=Mn.depth),Dr<Mn.height&&(Dr=Mn.height),Ir[h]=Mn}const Kr=s.rowGaps[c];let _r=0;Kr&&(_r=je(Kr,i),_r>0&&(_r+=ur,Nr<_r&&(Nr=_r),_r=0)),s.addJot&&(Nr+=et),Ir.height=Dr,Ir.depth=Nr,nr+=Dr,Ir.pos=nr,nr+=Nr+_r,L[c]=Ir,gr(A[c+1])}const pr=nr/2+i.fontMetrics().axisHeight,$r=s.cols||[],rn=[];let fn,On;const ia=[];if(s.tags&&s.tags.some(vr=>vr))for(c=0;c<x;++c){const vr=L[c],Dr=vr.pos-pr,Nr=s.tags[c];let Ir;Nr===!0?Ir=we.makeSpan(["eqn-num"],[],i):Nr===!1?Ir=we.makeSpan([],[],i):Ir=we.makeSpan([],Yr(Nr,i,!0),i),Ir.depth=vr.depth,Ir.height=vr.height,ia.push({type:"elem",elem:Ir,shift:Dr})}for(h=0,On=0;h<M||On<$r.length;++h,++On){let vr=$r[On]||{},Dr=!0;for(;vr.type==="separator";){if(Dr||(fn=we.makeSpan(["arraycolsep"],[]),fn.style.width=pe(i.fontMetrics().doubleRuleSep),rn.push(fn)),vr.separator==="|"||vr.separator===":"){const Kr=vr.separator==="|"?"solid":"dashed",_r=we.makeSpan(["vertical-separator"],[],i);_r.style.height=pe(nr),_r.style.borderRightWidth=pe(se),_r.style.borderRightStyle=Kr,_r.style.margin="0 "+pe(-se/2);const Mn=nr-pr;Mn&&(_r.style.verticalAlign=pe(-Mn)),rn.push(_r)}else throw new a("Invalid separator type: "+vr.separator);On++,vr=$r[On]||{},Dr=!1}if(h>=M)continue;let Nr;(h>0||s.hskipBeforeAndAfter)&&(Nr=C.deflt(vr.pregap,ke),Nr!==0&&(fn=we.makeSpan(["arraycolsep"],[]),fn.style.width=pe(Nr),rn.push(fn)));let Ir=[];for(c=0;c<x;++c){const Kr=L[c],_r=Kr[h];if(!_r)continue;const Mn=Kr.pos-pr;_r.depth=Kr.depth,_r.height=Kr.height,Ir.push({type:"elem",elem:_r,shift:Mn})}Ir=we.makeVList({positionType:"individualShift",children:Ir},i),Ir=we.makeSpan(["col-align-"+(vr.align||"c")],[Ir]),rn.push(Ir),(h<M-1||s.hskipBeforeAndAfter)&&(Nr=C.deflt(vr.postgap,ke),Nr!==0&&(fn=we.makeSpan(["arraycolsep"],[]),fn.style.width=pe(Nr),rn.push(fn)))}if(L=we.makeSpan(["mtable"],rn),J.length>0){const vr=we.makeLineSpan("hline",i,se),Dr=we.makeLineSpan("hdashline",i,se),Nr=[{type:"elem",elem:L,shift:0}];for(;J.length>0;){const Ir=J.pop(),Kr=Ir.pos-pr;Ir.isDashed?Nr.push({type:"elem",elem:Dr,shift:Kr}):Nr.push({type:"elem",elem:vr,shift:Kr})}L=we.makeVList({positionType:"individualShift",children:Nr},i)}if(ia.length===0)return we.makeSpan(["mord"],[L],i);{let vr=we.makeVList({positionType:"individualShift",children:ia},i);return vr=we.makeSpan(["tag"],[vr],i),we.makeFragment([L,vr])}},b4={c:"center ",l:"left ",r:"right "},Qn=function(s,i){const c=[],h=new Ze.MathNode("mtd",[],["mtr-glue"]),x=new Ze.MathNode("mtd",[],["mml-eqn-num"]);for(let ke=0;ke<s.body.length;ke++){const Ne=s.body[ke],et=[];for(let gt=0;gt<Ne.length;gt++)et.push(new Ze.MathNode("mtd",[Ar(Ne[gt],i)]));s.tags&&s.tags[ke]&&(et.unshift(h),et.push(h),s.leqno?et.unshift(x):et.push(x)),c.push(new Ze.MathNode("mtr",et))}let A=new Ze.MathNode("mtable",c);const M=s.arraystretch===.5?.1:.16+s.arraystretch-1+(s.addJot?.09:0);A.setAttribute("rowspacing",pe(M));let L="",J="";if(s.cols&&s.cols.length>0){const ke=s.cols;let Ne="",et=!1,gt=0,Xt=ke.length;ke[0].type==="separator"&&(L+="top ",gt=1),ke[ke.length-1].type==="separator"&&(L+="bottom ",Xt-=1);for(let ur=gt;ur<Xt;ur++)ke[ur].type==="align"?(J+=b4[ke[ur].align],et&&(Ne+="none "),et=!0):ke[ur].type==="separator"&&et&&(Ne+=ke[ur].separator==="|"?"solid ":"dashed ",et=!1);A.setAttribute("columnalign",J.trim()),/[sd]/.test(Ne)&&A.setAttribute("columnlines",Ne.trim())}if(s.colSeparationType==="align"){const ke=s.cols||[];let Ne="";for(let et=1;et<ke.length;et++)Ne+=et%2?"0em ":"1em ";A.setAttribute("columnspacing",Ne.trim())}else s.colSeparationType==="alignat"||s.colSeparationType==="gather"?A.setAttribute("columnspacing","0em"):s.colSeparationType==="small"?A.setAttribute("columnspacing","0.2778em"):s.colSeparationType==="CD"?A.setAttribute("columnspacing","0.5em"):A.setAttribute("columnspacing","1em");let se="";const ye=s.hLinesBeforeRow;L+=ye[0].length>0?"left ":"",L+=ye[ye.length-1].length>0?"right ":"";for(let ke=1;ke<ye.length-1;ke++)se+=ye[ke].length===0?"none ":ye[ke][0]?"dashed ":"solid ";return/[sd]/.test(se)&&A.setAttribute("rowlines",se.trim()),L!==""&&(A=new Ze.MathNode("menclose",[A]),A.setAttribute("notation",L.trim())),s.arraystretch&&s.arraystretch<1&&(A=new Ze.MathNode("mstyle",[A]),A.setAttribute("scriptlevel","1")),A},Md=function(s,i){s.envName.indexOf("ed")===-1&&Vi(s);const c=[],h=s.envName.indexOf("at")>-1?"alignat":"align",x=s.envName==="split",A=Eo(s.parser,{cols:c,addJot:!0,autoTag:x?void 0:Vl(s.envName),emptySingleRow:!0,colSeparationType:h,maxNumCols:x?2:void 0,leqno:s.parser.settings.leqno},"display");let M,L=0;const J={type:"ordgroup",mode:s.mode,body:[]};if(i[0]&&i[0].type==="ordgroup"){let ye="";for(let ke=0;ke<i[0].body.length;ke++){const Ne=Yt(i[0].body[ke],"textord");ye+=Ne.text}M=Number(ye),L=M*2}const se=!L;A.body.forEach(function(ye){for(let ke=1;ke<ye.length;ke+=2){const Ne=Yt(ye[ke],"styling");Yt(Ne.body[0],"ordgroup").body.unshift(J)}if(se)L<ye.length&&(L=ye.length);else{const ke=ye.length/2;if(M<ke)throw new a("Too many math in a row: "+("expected "+M+", but got "+ke),ye[0])}});for(let ye=0;ye<L;++ye){let ke="r",Ne=0;ye%2===1?ke="l":ye>0&&se&&(Ne=1),c[ye]={type:"align",align:ke,pregap:Ne,postgap:0}}return A.colSeparationType=se?"align":"alignat",A};Zn({type:"array",names:["array","darray"],props:{numArgs:1},handler(s,i){const c=(ji(i[0])?[i[0]]:Yt(i[0],"ordgroup").body).map(function(x){const A=Ol(x).text;if("lcr".indexOf(A)!==-1)return{type:"align",align:A};if(A==="|")return{type:"separator",separator:"|"};if(A===":")return{type:"separator",separator:":"};throw new a("Unknown column alignment: "+A,x)}),h={cols:c,hskipBeforeAndAfter:!0,maxNumCols:c.length};return Eo(s.parser,h,Wl(s.envName))},htmlBuilder:Jn,mathmlBuilder:Qn}),Zn({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(s){const i={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[s.envName.replace("*","")];let c="c";const h={hskipBeforeAndAfter:!1,cols:[{type:"align",align:c}]};if(s.envName.charAt(s.envName.length-1)==="*"){const M=s.parser;if(M.consumeSpaces(),M.fetch().text==="["){if(M.consume(),M.consumeSpaces(),c=M.fetch().text,"lcr".indexOf(c)===-1)throw new a("Expected l or c or r",M.nextToken);M.consume(),M.consumeSpaces(),M.expect("]"),M.consume(),h.cols=[{type:"align",align:c}]}}const x=Eo(s.parser,h,Wl(s.envName)),A=Math.max(0,...x.body.map(M=>M.length));return x.cols=new Array(A).fill({type:"align",align:c}),i?{type:"leftright",mode:s.mode,body:[x],left:i[0],right:i[1],rightColor:void 0}:x},htmlBuilder:Jn,mathmlBuilder:Qn}),Zn({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(s){const i={arraystretch:.5},c=Eo(s.parser,i,"script");return c.colSeparationType="small",c},htmlBuilder:Jn,mathmlBuilder:Qn}),Zn({type:"array",names:["subarray"],props:{numArgs:1},handler(s,i){const c=(ji(i[0])?[i[0]]:Yt(i[0],"ordgroup").body).map(function(x){const A=Ol(x).text;if("lc".indexOf(A)!==-1)return{type:"align",align:A};throw new a("Unknown column alignment: "+A,x)});if(c.length>1)throw new a("{subarray} can contain only one column");let h={cols:c,hskipBeforeAndAfter:!1,arraystretch:.5};if(h=Eo(s.parser,h,"script"),h.body.length>0&&h.body[0].length>1)throw new a("{subarray} can contain only one column");return h},htmlBuilder:Jn,mathmlBuilder:Qn}),Zn({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(s){const i={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},c=Eo(s.parser,i,Wl(s.envName));return{type:"leftright",mode:s.mode,body:[c],left:s.envName.indexOf("r")>-1?".":"\\{",right:s.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Jn,mathmlBuilder:Qn}),Zn({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Md,htmlBuilder:Jn,mathmlBuilder:Qn}),Zn({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(s){["gather","gather*"].includes(s.envName)&&Vi(s);const i={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Vl(s.envName),emptySingleRow:!0,leqno:s.parser.settings.leqno};return Eo(s.parser,i,"display")},htmlBuilder:Jn,mathmlBuilder:Qn}),Zn({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Md,htmlBuilder:Jn,mathmlBuilder:Qn}),Zn({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(s){Vi(s);const i={autoTag:Vl(s.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:s.parser.settings.leqno};return Eo(s.parser,i,"display")},htmlBuilder:Jn,mathmlBuilder:Qn}),Zn({type:"array",names:["CD"],props:{numArgs:0},handler(s){return Vi(s),a4(s.parser)},htmlBuilder:Jn,mathmlBuilder:Qn}),H("\\nonumber","\\gdef\\@eqnsw{0}"),H("\\notag","\\nonumber"),mt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(s,i){throw new a(s.funcName+" valid only within array environment")}});var Id=$d;mt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(s,i){let{parser:c,funcName:h}=s;const x=i[0];if(x.type!=="ordgroup")throw new a("Invalid environment name",x);let A="";for(let M=0;M<x.body.length;++M)A+=Yt(x.body[M],"textord").text;if(h==="\\begin"){if(!Id.hasOwnProperty(A))throw new a("No such environment: "+A,x);const M=Id[A],{args:L,optArgs:J}=c.parseArguments("\\begin{"+A+"}",M),se={mode:c.mode,envName:A,parser:c},ye=M.handler(se,L,J);c.expect("\\end",!1);const ke=c.nextToken,Ne=Yt(c.parseFunction(),"environment");if(Ne.name!==A)throw new a("Mismatch: \\begin{"+A+"} matched by \\end{"+Ne.name+"}",ke);return ye}return{type:"environment",mode:c.mode,name:A,nameGroup:x}}});const Rd=(s,i)=>{const c=s.font,h=i.withFont(c);return hr(s.body,h)},Pd=(s,i)=>{const c=s.font,h=i.withFont(c);return Ar(s.body,h)},zd={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};mt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(s,i)=>{let{parser:c,funcName:h}=s;const x=Gn(i[0]);let A=h;return A in zd&&(A=zd[A]),{type:"font",mode:c.mode,font:A.slice(1),body:x}},htmlBuilder:Rd,mathmlBuilder:Pd}),mt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(s,i)=>{let{parser:c}=s;const h=i[0],x=C.isCharacterBox(h);return{type:"mclass",mode:c.mode,mclass:Hi(h),body:[{type:"font",mode:c.mode,font:"boldsymbol",body:h}],isCharacterBox:x}}}),mt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(s,i)=>{let{parser:c,funcName:h,breakOnTokenText:x}=s;const{mode:A}=c,M=c.parseExpression(!0,x),L="math"+h.slice(1);return{type:"font",mode:A,font:L,body:{type:"ordgroup",mode:c.mode,body:M}}},htmlBuilder:Rd,mathmlBuilder:Pd});const _d=(s,i)=>{let c=i;return s==="display"?c=c.id>=V.SCRIPT.id?c.text():V.DISPLAY:s==="text"&&c.size===V.DISPLAY.size?c=V.TEXT:s==="script"?c=V.SCRIPT:s==="scriptscript"&&(c=V.SCRIPTSCRIPT),c},Ul=(s,i)=>{const c=_d(s.size,i.style),h=c.fracNum(),x=c.fracDen();let A;A=i.havingStyle(h);const M=hr(s.numer,A,i);if(s.continued){const gr=8.5/i.fontMetrics().ptPerEm,pr=3.5/i.fontMetrics().ptPerEm;M.height=M.height<gr?gr:M.height,M.depth=M.depth<pr?pr:M.depth}A=i.havingStyle(x);const L=hr(s.denom,A,i);let J,se,ye;s.hasBarLine?(s.barSize?(se=je(s.barSize,i),J=we.makeLineSpan("frac-line",i,se)):J=we.makeLineSpan("frac-line",i),se=J.height,ye=J.height):(J=null,se=0,ye=i.fontMetrics().defaultRuleThickness);let ke,Ne,et;c.size===V.DISPLAY.size||s.size==="display"?(ke=i.fontMetrics().num1,se>0?Ne=3*ye:Ne=7*ye,et=i.fontMetrics().denom1):(se>0?(ke=i.fontMetrics().num2,Ne=ye):(ke=i.fontMetrics().num3,Ne=3*ye),et=i.fontMetrics().denom2);let gt;if(J){const gr=i.fontMetrics().axisHeight;ke-M.depth-(gr+.5*se)<Ne&&(ke+=Ne-(ke-M.depth-(gr+.5*se))),gr-.5*se-(L.height-et)<Ne&&(et+=Ne-(gr-.5*se-(L.height-et)));const pr=-(gr-.5*se);gt=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:L,shift:et},{type:"elem",elem:J,shift:pr},{type:"elem",elem:M,shift:-ke}]},i)}else{const gr=ke-M.depth-(L.height-et);gr<Ne&&(ke+=.5*(Ne-gr),et+=.5*(Ne-gr)),gt=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:L,shift:et},{type:"elem",elem:M,shift:-ke}]},i)}A=i.havingStyle(c),gt.height*=A.sizeMultiplier/i.sizeMultiplier,gt.depth*=A.sizeMultiplier/i.sizeMultiplier;let Xt;c.size===V.DISPLAY.size?Xt=i.fontMetrics().delim1:c.size===V.SCRIPTSCRIPT.size?Xt=i.havingStyle(V.SCRIPT).fontMetrics().delim2:Xt=i.fontMetrics().delim2;let ur,nr;return s.leftDelim==null?ur=_a(i,["mopen"]):ur=uo.customSizedDelim(s.leftDelim,Xt,!0,i.havingStyle(c),s.mode,["mopen"]),s.continued?nr=we.makeSpan([]):s.rightDelim==null?nr=_a(i,["mclose"]):nr=uo.customSizedDelim(s.rightDelim,Xt,!0,i.havingStyle(c),s.mode,["mclose"]),we.makeSpan(["mord"].concat(A.sizingClasses(i)),[ur,we.makeSpan(["mfrac"],[gt]),nr],i)},Xl=(s,i)=>{let c=new Ze.MathNode("mfrac",[Ar(s.numer,i),Ar(s.denom,i)]);if(!s.hasBarLine)c.setAttribute("linethickness","0px");else if(s.barSize){const x=je(s.barSize,i);c.setAttribute("linethickness",pe(x))}const h=_d(s.size,i.style);if(h.size!==i.style.size){c=new Ze.MathNode("mstyle",[c]);const x=h.size===V.DISPLAY.size?"true":"false";c.setAttribute("displaystyle",x),c.setAttribute("scriptlevel","0")}if(s.leftDelim!=null||s.rightDelim!=null){const x=[];if(s.leftDelim!=null){const A=new Ze.MathNode("mo",[new Ze.TextNode(s.leftDelim.replace("\\",""))]);A.setAttribute("fence","true"),x.push(A)}if(x.push(c),s.rightDelim!=null){const A=new Ze.MathNode("mo",[new Ze.TextNode(s.rightDelim.replace("\\",""))]);A.setAttribute("fence","true"),x.push(A)}return Tl(x)}return c};mt({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(s,i)=>{let{parser:c,funcName:h}=s;const x=i[0],A=i[1];let M,L=null,J=null,se="auto";switch(h){case"\\dfrac":case"\\frac":case"\\tfrac":M=!0;break;case"\\\\atopfrac":M=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":M=!1,L="(",J=")";break;case"\\\\bracefrac":M=!1,L="\\{",J="\\}";break;case"\\\\brackfrac":M=!1,L="[",J="]";break;default:throw new Error("Unrecognized genfrac command")}switch(h){case"\\dfrac":case"\\dbinom":se="display";break;case"\\tfrac":case"\\tbinom":se="text";break}return{type:"genfrac",mode:c.mode,continued:!1,numer:x,denom:A,hasBarLine:M,leftDelim:L,rightDelim:J,size:se,barSize:null}},htmlBuilder:Ul,mathmlBuilder:Xl}),mt({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(s,i)=>{let{parser:c,funcName:h}=s;const x=i[0],A=i[1];return{type:"genfrac",mode:c.mode,continued:!0,numer:x,denom:A,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),mt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(s){let{parser:i,funcName:c,token:h}=s,x;switch(c){case"\\over":x="\\frac";break;case"\\choose":x="\\binom";break;case"\\atop":x="\\\\atopfrac";break;case"\\brace":x="\\\\bracefrac";break;case"\\brack":x="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:i.mode,replaceWith:x,token:h}}});const jd=["display","text","script","scriptscript"],Ld=function(s){let i=null;return s.length>0&&(i=s,i=i==="."?null:i),i};mt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(s,i){let{parser:c}=s;const h=i[4],x=i[5],A=Gn(i[0]),M=A.type==="atom"&&A.family==="open"?Ld(A.text):null,L=Gn(i[1]),J=L.type==="atom"&&L.family==="close"?Ld(L.text):null,se=Yt(i[2],"size");let ye,ke=null;se.isBlank?ye=!0:(ke=se.value,ye=ke.number>0);let Ne="auto",et=i[3];if(et.type==="ordgroup"){if(et.body.length>0){const gt=Yt(et.body[0],"textord");Ne=jd[Number(gt.text)]}}else et=Yt(et,"textord"),Ne=jd[Number(et.text)];return{type:"genfrac",mode:c.mode,numer:h,denom:x,continued:!1,hasBarLine:ye,barSize:ke,leftDelim:M,rightDelim:J,size:Ne}},htmlBuilder:Ul,mathmlBuilder:Xl}),mt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(s,i){let{parser:c,funcName:h,token:x}=s;return{type:"infix",mode:c.mode,replaceWith:"\\\\abovefrac",size:Yt(i[0],"size").value,token:x}}}),mt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(s,i)=>{let{parser:c,funcName:h}=s;const x=i[0],A=b(Yt(i[1],"infix").size),M=i[2],L=A.number>0;return{type:"genfrac",mode:c.mode,numer:x,denom:M,continued:!1,hasBarLine:L,barSize:A,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Ul,mathmlBuilder:Xl});const Hd=(s,i)=>{const c=i.style;let h,x;s.type==="supsub"?(h=s.sup?hr(s.sup,i.havingStyle(c.sup()),i):hr(s.sub,i.havingStyle(c.sub()),i),x=Yt(s.base,"horizBrace")):x=Yt(s,"horizBrace");const A=hr(x.base,i.havingBaseStyle(V.DISPLAY)),M=lo.svgSpan(x,i);let L;if(x.isOver?(L=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:A},{type:"kern",size:.1},{type:"elem",elem:M}]},i),L.children[0].children[0].children[1].classes.push("svg-align")):(L=we.makeVList({positionType:"bottom",positionData:A.depth+.1+M.height,children:[{type:"elem",elem:M},{type:"kern",size:.1},{type:"elem",elem:A}]},i),L.children[0].children[0].children[0].classes.push("svg-align")),h){const J=we.makeSpan(["mord",x.isOver?"mover":"munder"],[L],i);x.isOver?L=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:J},{type:"kern",size:.2},{type:"elem",elem:h}]},i):L=we.makeVList({positionType:"bottom",positionData:J.depth+.2+h.height+h.depth,children:[{type:"elem",elem:h},{type:"kern",size:.2},{type:"elem",elem:J}]},i)}return we.makeSpan(["mord",x.isOver?"mover":"munder"],[L],i)};mt({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(s,i){let{parser:c,funcName:h}=s;return{type:"horizBrace",mode:c.mode,label:h,isOver:/^\\over/.test(h),base:i[0]}},htmlBuilder:Hd,mathmlBuilder:(s,i)=>{const c=lo.mathMLnode(s.label);return new Ze.MathNode(s.isOver?"mover":"munder",[Ar(s.base,i),c])}}),mt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(s,i)=>{let{parser:c}=s;const h=i[1],x=Yt(i[0],"url").url;return c.settings.isTrusted({command:"\\href",url:x})?{type:"href",mode:c.mode,href:x,body:Tr(h)}:c.formatUnsupportedCmd("\\href")},htmlBuilder:(s,i)=>{const c=Yr(s.body,i,!1);return we.makeAnchor(s.href,[],c,i)},mathmlBuilder:(s,i)=>{let c=ko(s.body,i);return c instanceof An||(c=new An("mrow",[c])),c.setAttribute("href",s.href),c}}),mt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(s,i)=>{let{parser:c}=s;const h=Yt(i[0],"url").url;if(!c.settings.isTrusted({command:"\\url",url:h}))return c.formatUnsupportedCmd("\\url");const x=[];for(let M=0;M<h.length;M++){let L=h[M];L==="~"&&(L="\\textasciitilde"),x.push({type:"textord",mode:"text",text:L})}const A={type:"text",mode:c.mode,font:"\\texttt",body:x};return{type:"href",mode:c.mode,href:h,body:Tr(A)}}}),mt({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(s,i){let{parser:c}=s;return{type:"hbox",mode:c.mode,body:Tr(i[0])}},htmlBuilder(s,i){const c=Yr(s.body,i,!1);return we.makeFragment(c)},mathmlBuilder(s,i){return new Ze.MathNode("mrow",xn(s.body,i))}}),mt({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(s,i)=>{let{parser:c,funcName:h,token:x}=s;const A=Yt(i[0],"raw").string,M=i[1];c.settings.strict&&c.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");let L;const J={};switch(h){case"\\htmlClass":J.class=A,L={command:"\\htmlClass",class:A};break;case"\\htmlId":J.id=A,L={command:"\\htmlId",id:A};break;case"\\htmlStyle":J.style=A,L={command:"\\htmlStyle",style:A};break;case"\\htmlData":{const se=A.split(",");for(let ye=0;ye<se.length;ye++){const ke=se[ye].split("=");if(ke.length!==2)throw new a("Error parsing key-value for \\htmlData");J["data-"+ke[0].trim()]=ke[1].trim()}L={command:"\\htmlData",attributes:J};break}default:throw new Error("Unrecognized html command")}return c.settings.isTrusted(L)?{type:"html",mode:c.mode,attributes:J,body:Tr(M)}:c.formatUnsupportedCmd(h)},htmlBuilder:(s,i)=>{const c=Yr(s.body,i,!1),h=["enclosing"];s.attributes.class&&h.push(...s.attributes.class.trim().split(/\s+/));const x=we.makeSpan(h,c,i);for(const A in s.attributes)A!=="class"&&s.attributes.hasOwnProperty(A)&&x.setAttribute(A,s.attributes[A]);return x},mathmlBuilder:(s,i)=>ko(s.body,i)}),mt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(s,i)=>{let{parser:c}=s;return{type:"htmlmathml",mode:c.mode,html:Tr(i[0]),mathml:Tr(i[1])}},htmlBuilder:(s,i)=>{const c=Yr(s.html,i,!1);return we.makeFragment(c)},mathmlBuilder:(s,i)=>ko(s.mathml,i)});const Gl=function(s){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(s))return{number:+s,unit:"bp"};{const i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(s);if(!i)throw new a("Invalid size: '"+s+"' in \\includegraphics");const c={number:+(i[1]+i[2]),unit:i[3]};if(!Mt(c))throw new a("Invalid unit: '"+c.unit+"' in \\includegraphics.");return c}};mt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(s,i,c)=>{let{parser:h}=s,x={number:0,unit:"em"},A={number:.9,unit:"em"},M={number:0,unit:"em"},L="";if(c[0]){const se=Yt(c[0],"raw").string.split(",");for(let ye=0;ye<se.length;ye++){const ke=se[ye].split("=");if(ke.length===2){const Ne=ke[1].trim();switch(ke[0].trim()){case"alt":L=Ne;break;case"width":x=Gl(Ne);break;case"height":A=Gl(Ne);break;case"totalheight":M=Gl(Ne);break;default:throw new a("Invalid key: '"+ke[0]+"' in \\includegraphics.")}}}}const J=Yt(i[0],"url").url;return L===""&&(L=J,L=L.replace(/^.*[\\/]/,""),L=L.substring(0,L.lastIndexOf("."))),h.settings.isTrusted({command:"\\includegraphics",url:J})?{type:"includegraphics",mode:h.mode,alt:L,width:x,height:A,totalheight:M,src:J}:h.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(s,i)=>{const c=je(s.height,i);let h=0;s.totalheight.number>0&&(h=je(s.totalheight,i)-c);let x=0;s.width.number>0&&(x=je(s.width,i));const A={height:pe(c+h)};x>0&&(A.width=pe(x)),h>0&&(A.verticalAlign=pe(-h));const M=new tr(s.src,s.alt,A);return M.height=c,M.depth=h,M},mathmlBuilder:(s,i)=>{const c=new Ze.MathNode("mglyph",[]);c.setAttribute("alt",s.alt);const h=je(s.height,i);let x=0;if(s.totalheight.number>0&&(x=je(s.totalheight,i)-h,c.setAttribute("valign",pe(-x))),c.setAttribute("height",pe(h+x)),s.width.number>0){const A=je(s.width,i);c.setAttribute("width",pe(A))}return c.setAttribute("src",s.src),c}}),mt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(s,i){let{parser:c,funcName:h}=s;const x=Yt(i[0],"size");if(c.settings.strict){const A=h[1]==="m",M=x.value.unit==="mu";A?(M||c.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+h+" supports only mu units, "+("not "+x.value.unit+" units")),c.mode!=="math"&&c.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+h+" works only in math mode")):M&&c.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+h+" doesn't support mu units")}return{type:"kern",mode:c.mode,dimension:x.value}},htmlBuilder(s,i){return we.makeGlue(s.dimension,i)},mathmlBuilder(s,i){const c=je(s.dimension,i);return new Ze.SpaceNode(c)}}),mt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(s,i)=>{let{parser:c,funcName:h}=s;const x=i[0];return{type:"lap",mode:c.mode,alignment:h.slice(5),body:x}},htmlBuilder:(s,i)=>{let c;s.alignment==="clap"?(c=we.makeSpan([],[hr(s.body,i)]),c=we.makeSpan(["inner"],[c],i)):c=we.makeSpan(["inner"],[hr(s.body,i)]);const h=we.makeSpan(["fix"],[]);let x=we.makeSpan([s.alignment],[c,h],i);const A=we.makeSpan(["strut"]);return A.style.height=pe(x.height+x.depth),x.depth&&(A.style.verticalAlign=pe(-x.depth)),x.children.unshift(A),x=we.makeSpan(["thinbox"],[x],i),we.makeSpan(["mord","vbox"],[x],i)},mathmlBuilder:(s,i)=>{const c=new Ze.MathNode("mpadded",[Ar(s.body,i)]);if(s.alignment!=="rlap"){const h=s.alignment==="llap"?"-1":"-0.5";c.setAttribute("lspace",h+"width")}return c.setAttribute("width","0px"),c}}),mt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(s,i){let{funcName:c,parser:h}=s;const x=h.mode;h.switchMode("math");const A=c==="\\("?"\\)":"$",M=h.parseExpression(!1,A);return h.expect(A),h.switchMode(x),{type:"styling",mode:h.mode,style:"text",body:M}}}),mt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(s,i){throw new a("Mismatched "+s.funcName)}});const Kd=(s,i)=>{switch(i.style.size){case V.DISPLAY.size:return s.display;case V.TEXT.size:return s.text;case V.SCRIPT.size:return s.script;case V.SCRIPTSCRIPT.size:return s.scriptscript;default:return s.text}};mt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(s,i)=>{let{parser:c}=s;return{type:"mathchoice",mode:c.mode,display:Tr(i[0]),text:Tr(i[1]),script:Tr(i[2]),scriptscript:Tr(i[3])}},htmlBuilder:(s,i)=>{const c=Kd(s,i),h=Yr(c,i,!1);return we.makeFragment(h)},mathmlBuilder:(s,i)=>{const c=Kd(s,i);return ko(c,i)}});const qd=(s,i,c,h,x,A,M)=>{s=we.makeSpan([],[s]);const L=c&&C.isCharacterBox(c);let J,se;if(i){const Ne=hr(i,h.havingStyle(x.sup()),h);se={elem:Ne,kern:Math.max(h.fontMetrics().bigOpSpacing1,h.fontMetrics().bigOpSpacing3-Ne.depth)}}if(c){const Ne=hr(c,h.havingStyle(x.sub()),h);J={elem:Ne,kern:Math.max(h.fontMetrics().bigOpSpacing2,h.fontMetrics().bigOpSpacing4-Ne.height)}}let ye;if(se&&J){const Ne=h.fontMetrics().bigOpSpacing5+J.elem.height+J.elem.depth+J.kern+s.depth+M;ye=we.makeVList({positionType:"bottom",positionData:Ne,children:[{type:"kern",size:h.fontMetrics().bigOpSpacing5},{type:"elem",elem:J.elem,marginLeft:pe(-A)},{type:"kern",size:J.kern},{type:"elem",elem:s},{type:"kern",size:se.kern},{type:"elem",elem:se.elem,marginLeft:pe(A)},{type:"kern",size:h.fontMetrics().bigOpSpacing5}]},h)}else if(J){const Ne=s.height-M;ye=we.makeVList({positionType:"top",positionData:Ne,children:[{type:"kern",size:h.fontMetrics().bigOpSpacing5},{type:"elem",elem:J.elem,marginLeft:pe(-A)},{type:"kern",size:J.kern},{type:"elem",elem:s}]},h)}else if(se){const Ne=s.depth+M;ye=we.makeVList({positionType:"bottom",positionData:Ne,children:[{type:"elem",elem:s},{type:"kern",size:se.kern},{type:"elem",elem:se.elem,marginLeft:pe(A)},{type:"kern",size:h.fontMetrics().bigOpSpacing5}]},h)}else return s;const ke=[ye];if(J&&A!==0&&!L){const Ne=we.makeSpan(["mspace"],[],h);Ne.style.marginRight=pe(A),ke.unshift(Ne)}return we.makeSpan(["mop","op-limits"],ke,h)},Vd=["\\smallint"],aa=(s,i)=>{let c,h,x=!1,A;s.type==="supsub"?(c=s.sup,h=s.sub,A=Yt(s.base,"op"),x=!0):A=Yt(s,"op");const M=i.style;let L=!1;M.size===V.DISPLAY.size&&A.symbol&&!Vd.includes(A.name)&&(L=!0);let J;if(A.symbol){const ke=L?"Size2-Regular":"Size1-Regular";let Ne="";if((A.name==="\\oiint"||A.name==="\\oiiint")&&(Ne=A.name.slice(1),A.name=Ne==="oiint"?"\\iint":"\\iiint"),J=we.makeSymbol(A.name,ke,"math",i,["mop","op-symbol",L?"large-op":"small-op"]),Ne.length>0){const et=J.italic,gt=we.staticSvg(Ne+"Size"+(L?"2":"1"),i);J=we.makeVList({positionType:"individualShift",children:[{type:"elem",elem:J,shift:0},{type:"elem",elem:gt,shift:L?.08:0}]},i),A.name="\\"+Ne,J.classes.unshift("mop"),J.italic=et}}else if(A.body){const ke=Yr(A.body,i,!0);ke.length===1&&ke[0]instanceof _t?(J=ke[0],J.classes[0]="mop"):J=we.makeSpan(["mop"],ke,i)}else{const ke=[];for(let Ne=1;Ne<A.name.length;Ne++)ke.push(we.mathsym(A.name[Ne],A.mode,i));J=we.makeSpan(["mop"],ke,i)}let se=0,ye=0;return(J instanceof _t||A.name==="\\oiint"||A.name==="\\oiiint")&&!A.suppressBaseShift&&(se=(J.height-J.depth)/2-i.fontMetrics().axisHeight,ye=J.italic),x?qd(J,c,h,i,M,ye,se):(se&&(J.style.position="relative",J.style.top=pe(se)),J)},Ha=(s,i)=>{let c;if(s.symbol)c=new An("mo",[Nn(s.name,s.mode)]),Vd.includes(s.name)&&c.setAttribute("largeop","false");else if(s.body)c=new An("mo",xn(s.body,i));else{c=new An("mi",[new Yn(s.name.slice(1))]);const h=new An("mo",[Nn("\u2061","text")]);s.parentIsSupSub?c=new An("mrow",[c,h]):c=ld([c,h])}return c},y4={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};mt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220F","\u2210","\u2211","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"],props:{numArgs:0},handler:(s,i)=>{let{parser:c,funcName:h}=s,x=h;return x.length===1&&(x=y4[x]),{type:"op",mode:c.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:x}},htmlBuilder:aa,mathmlBuilder:Ha}),mt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(s,i)=>{let{parser:c}=s;const h=i[0];return{type:"op",mode:c.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Tr(h)}},htmlBuilder:aa,mathmlBuilder:Ha});const x4={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};mt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(s){let{parser:i,funcName:c}=s;return{type:"op",mode:i.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:c}},htmlBuilder:aa,mathmlBuilder:Ha}),mt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(s){let{parser:i,funcName:c}=s;return{type:"op",mode:i.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:c}},htmlBuilder:aa,mathmlBuilder:Ha}),mt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0},handler(s){let{parser:i,funcName:c}=s,h=c;return h.length===1&&(h=x4[h]),{type:"op",mode:i.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:h}},htmlBuilder:aa,mathmlBuilder:Ha});const Wd=(s,i)=>{let c,h,x=!1,A;s.type==="supsub"?(c=s.sup,h=s.sub,A=Yt(s.base,"operatorname"),x=!0):A=Yt(s,"operatorname");let M;if(A.body.length>0){const L=A.body.map(se=>{const ye=se.text;return typeof ye=="string"?{type:"textord",mode:se.mode,text:ye}:se}),J=Yr(L,i.withFont("mathrm"),!0);for(let se=0;se<J.length;se++){const ye=J[se];ye instanceof _t&&(ye.text=ye.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}M=we.makeSpan(["mop"],J,i)}else M=we.makeSpan(["mop"],[],i);return x?qd(M,c,h,i,i.style,0,0):M};mt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(s,i)=>{let{parser:c,funcName:h}=s;const x=i[0];return{type:"operatorname",mode:c.mode,body:Tr(x),alwaysHandleSupSub:h==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Wd,mathmlBuilder:(s,i)=>{let c=xn(s.body,i.withFont("mathrm")),h=!0;for(let M=0;M<c.length;M++){const L=c[M];if(!(L instanceof Ze.SpaceNode))if(L instanceof Ze.MathNode)switch(L.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{const J=L.children[0];L.children.length===1&&J instanceof Ze.TextNode?J.text=J.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):h=!1;break}default:h=!1}else h=!1}if(h){const M=c.map(L=>L.toText()).join("");c=[new Ze.TextNode(M)]}const x=new Ze.MathNode("mi",c);x.setAttribute("mathvariant","normal");const A=new Ze.MathNode("mo",[Nn("\u2061","text")]);return s.parentIsSupSub?new Ze.MathNode("mrow",[x,A]):Ze.newDocumentFragment([x,A])}}),H("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),dn({type:"ordgroup",htmlBuilder(s,i){return s.semisimple?we.makeFragment(Yr(s.body,i,!1)):we.makeSpan(["mord"],Yr(s.body,i,!0),i)},mathmlBuilder(s,i){return ko(s.body,i,!0)}}),mt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(s,i){let{parser:c}=s;const h=i[0];return{type:"overline",mode:c.mode,body:h}},htmlBuilder(s,i){const c=hr(s.body,i.havingCrampedStyle()),h=we.makeLineSpan("overline-line",i),x=i.fontMetrics().defaultRuleThickness,A=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:3*x},{type:"elem",elem:h},{type:"kern",size:x}]},i);return we.makeSpan(["mord","overline"],[A],i)},mathmlBuilder(s,i){const c=new Ze.MathNode("mo",[new Ze.TextNode("\u203E")]);c.setAttribute("stretchy","true");const h=new Ze.MathNode("mover",[Ar(s.body,i),c]);return h.setAttribute("accent","true"),h}}),mt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(s,i)=>{let{parser:c}=s;const h=i[0];return{type:"phantom",mode:c.mode,body:Tr(h)}},htmlBuilder:(s,i)=>{const c=Yr(s.body,i.withPhantom(),!1);return we.makeFragment(c)},mathmlBuilder:(s,i)=>{const c=xn(s.body,i);return new Ze.MathNode("mphantom",c)}}),mt({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(s,i)=>{let{parser:c}=s;const h=i[0];return{type:"hphantom",mode:c.mode,body:h}},htmlBuilder:(s,i)=>{let c=we.makeSpan([],[hr(s.body,i.withPhantom())]);if(c.height=0,c.depth=0,c.children)for(let h=0;h<c.children.length;h++)c.children[h].height=0,c.children[h].depth=0;return c=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:c}]},i),we.makeSpan(["mord"],[c],i)},mathmlBuilder:(s,i)=>{const c=xn(Tr(s.body),i),h=new Ze.MathNode("mphantom",c),x=new Ze.MathNode("mpadded",[h]);return x.setAttribute("height","0px"),x.setAttribute("depth","0px"),x}}),mt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(s,i)=>{let{parser:c}=s;const h=i[0];return{type:"vphantom",mode:c.mode,body:h}},htmlBuilder:(s,i)=>{const c=we.makeSpan(["inner"],[hr(s.body,i.withPhantom())]),h=we.makeSpan(["fix"],[]);return we.makeSpan(["mord","rlap"],[c,h],i)},mathmlBuilder:(s,i)=>{const c=xn(Tr(s.body),i),h=new Ze.MathNode("mphantom",c),x=new Ze.MathNode("mpadded",[h]);return x.setAttribute("width","0px"),x}}),mt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(s,i){let{parser:c}=s;const h=Yt(i[0],"size").value,x=i[1];return{type:"raisebox",mode:c.mode,dy:h,body:x}},htmlBuilder(s,i){const c=hr(s.body,i),h=je(s.dy,i);return we.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:c}]},i)},mathmlBuilder(s,i){const c=new Ze.MathNode("mpadded",[Ar(s.body,i)]),h=s.dy.number+s.dy.unit;return c.setAttribute("voffset",h),c}}),mt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(s){let{parser:i}=s;return{type:"internal",mode:i.mode}}}),mt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(s,i,c){let{parser:h}=s;const x=c[0],A=Yt(i[0],"size"),M=Yt(i[1],"size");return{type:"rule",mode:h.mode,shift:x&&Yt(x,"size").value,width:A.value,height:M.value}},htmlBuilder(s,i){const c=we.makeSpan(["mord","rule"],[],i),h=je(s.width,i),x=je(s.height,i),A=s.shift?je(s.shift,i):0;return c.style.borderRightWidth=pe(h),c.style.borderTopWidth=pe(x),c.style.bottom=pe(A),c.width=h,c.height=x+A,c.depth=-A,c.maxFontSize=x*1.125*i.sizeMultiplier,c},mathmlBuilder(s,i){const c=je(s.width,i),h=je(s.height,i),x=s.shift?je(s.shift,i):0,A=i.color&&i.getColor()||"black",M=new Ze.MathNode("mspace");M.setAttribute("mathbackground",A),M.setAttribute("width",pe(c)),M.setAttribute("height",pe(h));const L=new Ze.MathNode("mpadded",[M]);return x>=0?L.setAttribute("height",pe(x)):(L.setAttribute("height",pe(x)),L.setAttribute("depth",pe(-x))),L.setAttribute("voffset",pe(x)),L}});function Ud(s,i,c){const h=Yr(s,i,!1),x=i.sizeMultiplier/c.sizeMultiplier;for(let A=0;A<h.length;A++){const M=h[A].classes.indexOf("sizing");M<0?Array.prototype.push.apply(h[A].classes,i.sizingClasses(c)):h[A].classes[M+1]==="reset-size"+i.size&&(h[A].classes[M+1]="reset-size"+c.size),h[A].height*=x,h[A].depth*=x}return we.makeFragment(h)}const Xd=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];mt({type:"sizing",names:Xd,props:{numArgs:0,allowedInText:!0},handler:(s,i)=>{let{breakOnTokenText:c,funcName:h,parser:x}=s;const A=x.parseExpression(!1,c);return{type:"sizing",mode:x.mode,size:Xd.indexOf(h)+1,body:A}},htmlBuilder:(s,i)=>{const c=i.havingSize(s.size);return Ud(s.body,c,i)},mathmlBuilder:(s,i)=>{const c=i.havingSize(s.size),h=xn(s.body,c),x=new Ze.MathNode("mstyle",h);return x.setAttribute("mathsize",pe(c.sizeMultiplier)),x}}),mt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(s,i,c)=>{let{parser:h}=s,x=!1,A=!1;const M=c[0]&&Yt(c[0],"ordgroup");if(M){let J="";for(let se=0;se<M.body.length;++se)if(J=M.body[se].text,J==="t")x=!0;else if(J==="b")A=!0;else{x=!1,A=!1;break}}else x=!0,A=!0;const L=i[0];return{type:"smash",mode:h.mode,body:L,smashHeight:x,smashDepth:A}},htmlBuilder:(s,i)=>{const c=we.makeSpan([],[hr(s.body,i)]);if(!s.smashHeight&&!s.smashDepth)return c;if(s.smashHeight&&(c.height=0,c.children))for(let x=0;x<c.children.length;x++)c.children[x].height=0;if(s.smashDepth&&(c.depth=0,c.children))for(let x=0;x<c.children.length;x++)c.children[x].depth=0;const h=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:c}]},i);return we.makeSpan(["mord"],[h],i)},mathmlBuilder:(s,i)=>{const c=new Ze.MathNode("mpadded",[Ar(s.body,i)]);return s.smashHeight&&c.setAttribute("height","0px"),s.smashDepth&&c.setAttribute("depth","0px"),c}}),mt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(s,i,c){let{parser:h}=s;const x=c[0],A=i[0];return{type:"sqrt",mode:h.mode,body:A,index:x}},htmlBuilder(s,i){let c=hr(s.body,i.havingCrampedStyle());c.height===0&&(c.height=i.fontMetrics().xHeight),c=we.wrapFragment(c,i);const h=i.fontMetrics().defaultRuleThickness;let x=h;i.style.id<V.TEXT.id&&(x=i.fontMetrics().xHeight);let A=h+x/4;const M=c.height+c.depth+A+h,{span:L,ruleWidth:J,advanceWidth:se}=uo.sqrtImage(M,i),ye=L.height-J;ye>c.height+c.depth+A&&(A=(A+ye-c.height-c.depth)/2);const ke=L.height-c.height-A-J;c.style.paddingLeft=pe(se);const Ne=we.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:c,wrapperClasses:["svg-align"]},{type:"kern",size:-(c.height+ke)},{type:"elem",elem:L},{type:"kern",size:J}]},i);if(s.index){const et=i.havingStyle(V.SCRIPTSCRIPT),gt=hr(s.index,et,i),Xt=.6*(Ne.height-Ne.depth),ur=we.makeVList({positionType:"shift",positionData:-Xt,children:[{type:"elem",elem:gt}]},i),nr=we.makeSpan(["root"],[ur]);return we.makeSpan(["mord","sqrt"],[nr,Ne],i)}else return we.makeSpan(["mord","sqrt"],[Ne],i)},mathmlBuilder(s,i){const{body:c,index:h}=s;return h?new Ze.MathNode("mroot",[Ar(c,i),Ar(h,i)]):new Ze.MathNode("msqrt",[Ar(c,i)])}});const Gd={display:V.DISPLAY,text:V.TEXT,script:V.SCRIPT,scriptscript:V.SCRIPTSCRIPT};mt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(s,i){let{breakOnTokenText:c,funcName:h,parser:x}=s;const A=x.parseExpression(!0,c),M=h.slice(1,h.length-5);return{type:"styling",mode:x.mode,style:M,body:A}},htmlBuilder(s,i){const c=Gd[s.style],h=i.havingStyle(c).withFont("");return Ud(s.body,h,i)},mathmlBuilder(s,i){const c=Gd[s.style],h=i.havingStyle(c),x=xn(s.body,h),A=new Ze.MathNode("mstyle",x),M={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[s.style];return A.setAttribute("scriptlevel",M[0]),A.setAttribute("displaystyle",M[1]),A}});const w4=function(s,i){const c=s.base;return c?c.type==="op"?c.limits&&(i.style.size===V.DISPLAY.size||c.alwaysHandleSupSub)?aa:null:c.type==="operatorname"?c.alwaysHandleSupSub&&(i.style.size===V.DISPLAY.size||c.limits)?Wd:null:c.type==="accent"?C.isCharacterBox(c.base)?Ml:null:c.type==="horizBrace"&&!s.sub===c.isOver?Hd:null:null};dn({type:"supsub",htmlBuilder(s,i){const c=w4(s,i);if(c)return c(s,i);const{base:h,sup:x,sub:A}=s,M=hr(h,i);let L,J;const se=i.fontMetrics();let ye=0,ke=0;const Ne=h&&C.isCharacterBox(h);if(x){const pr=i.havingStyle(i.style.sup());L=hr(x,pr,i),Ne||(ye=M.height-pr.fontMetrics().supDrop*pr.sizeMultiplier/i.sizeMultiplier)}if(A){const pr=i.havingStyle(i.style.sub());J=hr(A,pr,i),Ne||(ke=M.depth+pr.fontMetrics().subDrop*pr.sizeMultiplier/i.sizeMultiplier)}let et;i.style===V.DISPLAY?et=se.sup1:i.style.cramped?et=se.sup3:et=se.sup2;const gt=i.sizeMultiplier,Xt=pe(.5/se.ptPerEm/gt);let ur=null;if(J){const pr=s.base&&s.base.type==="op"&&s.base.name&&(s.base.name==="\\oiint"||s.base.name==="\\oiiint");(M instanceof _t||pr)&&(ur=pe(-M.italic))}let nr;if(L&&J){ye=Math.max(ye,et,L.depth+.25*se.xHeight),ke=Math.max(ke,se.sub2);const pr=4*se.defaultRuleThickness;if(ye-L.depth-(J.height-ke)<pr){ke=pr-(ye-L.depth)+J.height;const rn=.8*se.xHeight-(ye-L.depth);rn>0&&(ye+=rn,ke-=rn)}const $r=[{type:"elem",elem:J,shift:ke,marginRight:Xt,marginLeft:ur},{type:"elem",elem:L,shift:-ye,marginRight:Xt}];nr=we.makeVList({positionType:"individualShift",children:$r},i)}else if(J){ke=Math.max(ke,se.sub1,J.height-.8*se.xHeight);const pr=[{type:"elem",elem:J,marginLeft:ur,marginRight:Xt}];nr=we.makeVList({positionType:"shift",positionData:ke,children:pr},i)}else if(L)ye=Math.max(ye,et,L.depth+.25*se.xHeight),nr=we.makeVList({positionType:"shift",positionData:-ye,children:[{type:"elem",elem:L,marginRight:Xt}]},i);else throw new Error("supsub must have either sup or sub.");const gr=Bl(M,"right")||"mord";return we.makeSpan([gr],[M,we.makeSpan(["msupsub"],[nr])],i)},mathmlBuilder(s,i){let c=!1,h,x;s.base&&s.base.type==="horizBrace"&&(x=!!s.sup,x===s.base.isOver&&(c=!0,h=s.base.isOver)),s.base&&(s.base.type==="op"||s.base.type==="operatorname")&&(s.base.parentIsSupSub=!0);const A=[Ar(s.base,i)];s.sub&&A.push(Ar(s.sub,i)),s.sup&&A.push(Ar(s.sup,i));let M;if(c)M=h?"mover":"munder";else if(s.sub)if(s.sup){const L=s.base;L&&L.type==="op"&&L.limits&&i.style===V.DISPLAY||L&&L.type==="operatorname"&&L.alwaysHandleSupSub&&(i.style===V.DISPLAY||L.limits)?M="munderover":M="msubsup"}else{const L=s.base;L&&L.type==="op"&&L.limits&&(i.style===V.DISPLAY||L.alwaysHandleSupSub)||L&&L.type==="operatorname"&&L.alwaysHandleSupSub&&(L.limits||i.style===V.DISPLAY)?M="munder":M="msub"}else{const L=s.base;L&&L.type==="op"&&L.limits&&(i.style===V.DISPLAY||L.alwaysHandleSupSub)||L&&L.type==="operatorname"&&L.alwaysHandleSupSub&&(L.limits||i.style===V.DISPLAY)?M="mover":M="msup"}return new Ze.MathNode(M,A)}}),dn({type:"atom",htmlBuilder(s,i){return we.mathsym(s.text,s.mode,i,["m"+s.family])},mathmlBuilder(s,i){const c=new Ze.MathNode("mo",[Nn(s.text,s.mode)]);if(s.family==="bin"){const h=$l(s,i);h==="bold-italic"&&c.setAttribute("mathvariant",h)}else s.family==="punct"?c.setAttribute("separator","true"):(s.family==="open"||s.family==="close")&&c.setAttribute("stretchy","false");return c}});const Yd={mi:"italic",mn:"normal",mtext:"normal"};dn({type:"mathord",htmlBuilder(s,i){return we.makeOrd(s,i,"mathord")},mathmlBuilder(s,i){const c=new Ze.MathNode("mi",[Nn(s.text,s.mode,i)]),h=$l(s,i)||"italic";return h!==Yd[c.type]&&c.setAttribute("mathvariant",h),c}}),dn({type:"textord",htmlBuilder(s,i){return we.makeOrd(s,i,"textord")},mathmlBuilder(s,i){const c=Nn(s.text,s.mode,i),h=$l(s,i)||"normal";let x;return s.mode==="text"?x=new Ze.MathNode("mtext",[c]):/[0-9]/.test(s.text)?x=new Ze.MathNode("mn",[c]):s.text==="\\prime"?x=new Ze.MathNode("mo",[c]):x=new Ze.MathNode("mi",[c]),h!==Yd[x.type]&&x.setAttribute("mathvariant",h),x}});const Yl={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Zl={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};dn({type:"spacing",htmlBuilder(s,i){if(Zl.hasOwnProperty(s.text)){const c=Zl[s.text].className||"";if(s.mode==="text"){const h=we.makeOrd(s,i,"textord");return h.classes.push(c),h}else return we.makeSpan(["mspace",c],[we.mathsym(s.text,s.mode,i)],i)}else{if(Yl.hasOwnProperty(s.text))return we.makeSpan(["mspace",Yl[s.text]],[],i);throw new a('Unknown type of space "'+s.text+'"')}},mathmlBuilder(s,i){let c;if(Zl.hasOwnProperty(s.text))c=new Ze.MathNode("mtext",[new Ze.TextNode("\xA0")]);else{if(Yl.hasOwnProperty(s.text))return new Ze.MathNode("mspace");throw new a('Unknown type of space "'+s.text+'"')}return c}});const Zd=()=>{const s=new Ze.MathNode("mtd",[]);return s.setAttribute("width","50%"),s};dn({type:"tag",mathmlBuilder(s,i){const c=new Ze.MathNode("mtable",[new Ze.MathNode("mtr",[Zd(),new Ze.MathNode("mtd",[ko(s.body,i)]),Zd(),new Ze.MathNode("mtd",[ko(s.tag,i)])])]);return c.setAttribute("width","100%"),c}});const Jd={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Qd={"\\textbf":"textbf","\\textmd":"textmd"},C4={"\\textit":"textit","\\textup":"textup"},ef=(s,i)=>{const c=s.font;if(c){if(Jd[c])return i.withTextFontFamily(Jd[c]);if(Qd[c])return i.withTextFontWeight(Qd[c]);if(c==="\\emph")return i.fontShape==="textit"?i.withTextFontShape("textup"):i.withTextFontShape("textit")}else return i;return i.withTextFontShape(C4[c])};mt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(s,i){let{parser:c,funcName:h}=s;const x=i[0];return{type:"text",mode:c.mode,body:Tr(x),font:h}},htmlBuilder(s,i){const c=ef(s,i),h=Yr(s.body,c,!0);return we.makeSpan(["mord","text"],h,c)},mathmlBuilder(s,i){const c=ef(s,i);return ko(s.body,c)}}),mt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(s,i){let{parser:c}=s;return{type:"underline",mode:c.mode,body:i[0]}},htmlBuilder(s,i){const c=hr(s.body,i),h=we.makeLineSpan("underline-line",i),x=i.fontMetrics().defaultRuleThickness,A=we.makeVList({positionType:"top",positionData:c.height,children:[{type:"kern",size:x},{type:"elem",elem:h},{type:"kern",size:3*x},{type:"elem",elem:c}]},i);return we.makeSpan(["mord","underline"],[A],i)},mathmlBuilder(s,i){const c=new Ze.MathNode("mo",[new Ze.TextNode("\u203E")]);c.setAttribute("stretchy","true");const h=new Ze.MathNode("munder",[Ar(s.body,i),c]);return h.setAttribute("accentunder","true"),h}}),mt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(s,i){let{parser:c}=s;return{type:"vcenter",mode:c.mode,body:i[0]}},htmlBuilder(s,i){const c=hr(s.body,i),h=i.fontMetrics().axisHeight,x=.5*(c.height-h-(c.depth+h));return we.makeVList({positionType:"shift",positionData:x,children:[{type:"elem",elem:c}]},i)},mathmlBuilder(s,i){return new Ze.MathNode("mpadded",[Ar(s.body,i)],["vcenter"])}}),mt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(s,i,c){throw new a("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(s,i){const c=tf(s),h=[],x=i.havingStyle(i.style.text());for(let A=0;A<c.length;A++){let M=c[A];M==="~"&&(M="\\textasciitilde"),h.push(we.makeSymbol(M,"Typewriter-Regular",s.mode,x,["mord","texttt"]))}return we.makeSpan(["mord","text"].concat(x.sizingClasses(i)),we.tryCombineChars(h),x)},mathmlBuilder(s,i){const c=new Ze.TextNode(tf(s)),h=new Ze.MathNode("mtext",[c]);return h.setAttribute("mathvariant","monospace"),h}});const tf=s=>s.body.replace(/ /g,s.star?"\u2423":"\xA0");var So=cn;const rf=`[ \r
496
+ ]`,D4="\\\\[a-zA-Z@]+",k4="\\\\[^\uD800-\uDFFF]",E4="("+D4+")"+rf+"*",S4=`\\\\(
497
+ |[ \r ]+
498
+ ?)[ \r ]*`,Jl="[\u0300-\u036F]",A4=new RegExp(Jl+"+$"),B4="("+rf+"+)|"+(S4+"|")+"([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(Jl+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Jl+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+E4)+("|"+k4+")");class nf{constructor(i,c){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=i,this.settings=c,this.tokenRegex=new RegExp(B4,"g"),this.catcodes={"%":14,"~":13}}setCatcode(i,c){this.catcodes[i]=c}lex(){const i=this.input,c=this.tokenRegex.lastIndex;if(c===i.length)return new Bn("EOF",new wn(this,c,c));const h=this.tokenRegex.exec(i);if(h===null||h.index!==c)throw new a("Unexpected character: '"+i[c]+"'",new Bn(i[c],new wn(this,c,c+1)));const x=h[6]||h[3]||(h[2]?"\\ ":" ");if(this.catcodes[x]===14){const A=i.indexOf(`
499
+ `,this.tokenRegex.lastIndex);return A===-1?(this.tokenRegex.lastIndex=i.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=A+1,this.lex()}return new Bn(x,new wn(this,c,this.tokenRegex.lastIndex))}}class F4{constructor(i,c){i===void 0&&(i={}),c===void 0&&(c={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=c,this.builtins=i,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new a("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");const i=this.undefStack.pop();for(const c in i)i.hasOwnProperty(c)&&(i[c]==null?delete this.current[c]:this.current[c]=i[c])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(i){return this.current.hasOwnProperty(i)||this.builtins.hasOwnProperty(i)}get(i){return this.current.hasOwnProperty(i)?this.current[i]:this.builtins[i]}set(i,c,h){if(h===void 0&&(h=!1),h){for(let x=0;x<this.undefStack.length;x++)delete this.undefStack[x][i];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][i]=c)}else{const x=this.undefStack[this.undefStack.length-1];x&&!x.hasOwnProperty(i)&&(x[i]=this.current[i])}c==null?delete this.current[i]:this.current[i]=c}}var T4=Nd;H("\\noexpand",function(s){const i=s.popToken();return s.isExpandable(i.text)&&(i.noexpand=!0,i.treatAsRelax=!0),{tokens:[i],numArgs:0}}),H("\\expandafter",function(s){const i=s.popToken();return s.expandOnce(!0),{tokens:[i],numArgs:0}}),H("\\@firstoftwo",function(s){return{tokens:s.consumeArgs(2)[0],numArgs:0}}),H("\\@secondoftwo",function(s){return{tokens:s.consumeArgs(2)[1],numArgs:0}}),H("\\@ifnextchar",function(s){const i=s.consumeArgs(3);s.consumeSpaces();const c=s.future();return i[0].length===1&&i[0][0].text===c.text?{tokens:i[1],numArgs:0}:{tokens:i[2],numArgs:0}}),H("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),H("\\TextOrMath",function(s){const i=s.consumeArgs(2);return s.mode==="text"?{tokens:i[0],numArgs:0}:{tokens:i[1],numArgs:0}});const of={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};H("\\char",function(s){let i=s.popToken(),c,h="";if(i.text==="'")c=8,i=s.popToken();else if(i.text==='"')c=16,i=s.popToken();else if(i.text==="`")if(i=s.popToken(),i.text[0]==="\\")h=i.text.charCodeAt(1);else{if(i.text==="EOF")throw new a("\\char` missing argument");h=i.text.charCodeAt(0)}else c=10;if(c){if(h=of[i.text],h==null||h>=c)throw new a("Invalid base-"+c+" digit "+i.text);let x;for(;(x=of[s.future().text])!=null&&x<c;)h*=c,h+=x,s.popToken()}return"\\@char{"+h+"}"});const Ql=(s,i,c,h)=>{let x=s.consumeArg().tokens;if(x.length!==1)throw new a("\\newcommand's first argument must be a macro name");const A=x[0].text,M=s.isDefined(A);if(M&&!i)throw new a("\\newcommand{"+A+"} attempting to redefine "+(A+"; use \\renewcommand"));if(!M&&!c)throw new a("\\renewcommand{"+A+"} when command "+A+" does not yet exist; use \\newcommand");let L=0;if(x=s.consumeArg().tokens,x.length===1&&x[0].text==="["){let J="",se=s.expandNextToken();for(;se.text!=="]"&&se.text!=="EOF";)J+=se.text,se=s.expandNextToken();if(!J.match(/^\s*[0-9]+\s*$/))throw new a("Invalid number of arguments: "+J);L=parseInt(J),x=s.consumeArg().tokens}return M&&h||s.macros.set(A,{tokens:x,numArgs:L}),""};H("\\newcommand",s=>Ql(s,!1,!0,!1)),H("\\renewcommand",s=>Ql(s,!0,!1,!1)),H("\\providecommand",s=>Ql(s,!0,!0,!0)),H("\\message",s=>{const i=s.consumeArgs(1)[0];return console.log(i.reverse().map(c=>c.text).join("")),""}),H("\\errmessage",s=>{const i=s.consumeArgs(1)[0];return console.error(i.reverse().map(c=>c.text).join("")),""}),H("\\show",s=>{const i=s.popToken(),c=i.text;return console.log(i,s.macros.get(c),So[c],Ot.math[c],Ot.text[c]),""}),H("\\bgroup","{"),H("\\egroup","}"),H("~","\\nobreakspace"),H("\\lq","`"),H("\\rq","'"),H("\\aa","\\r a"),H("\\AA","\\r A"),H("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}"),H("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),H("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}"),H("\u212C","\\mathscr{B}"),H("\u2130","\\mathscr{E}"),H("\u2131","\\mathscr{F}"),H("\u210B","\\mathscr{H}"),H("\u2110","\\mathscr{I}"),H("\u2112","\\mathscr{L}"),H("\u2133","\\mathscr{M}"),H("\u211B","\\mathscr{R}"),H("\u212D","\\mathfrak{C}"),H("\u210C","\\mathfrak{H}"),H("\u2128","\\mathfrak{Z}"),H("\\Bbbk","\\Bbb{k}"),H("\xB7","\\cdotp"),H("\\llap","\\mathllap{\\textrm{#1}}"),H("\\rlap","\\mathrlap{\\textrm{#1}}"),H("\\clap","\\mathclap{\\textrm{#1}}"),H("\\mathstrut","\\vphantom{(}"),H("\\underbar","\\underline{\\text{#1}}"),H("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),H("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}"),H("\\ne","\\neq"),H("\u2260","\\neq"),H("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}"),H("\u2209","\\notin"),H("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}"),H("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}"),H("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}"),H("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}"),H("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}"),H("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}"),H("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}"),H("\u27C2","\\perp"),H("\u203C","\\mathclose{!\\mkern-0.8mu!}"),H("\u220C","\\notni"),H("\u231C","\\ulcorner"),H("\u231D","\\urcorner"),H("\u231E","\\llcorner"),H("\u231F","\\lrcorner"),H("\xA9","\\copyright"),H("\xAE","\\textregistered"),H("\uFE0F","\\textregistered"),H("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),H("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),H("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),H("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),H("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),H("\u22EE","\\vdots"),H("\\varGamma","\\mathit{\\Gamma}"),H("\\varDelta","\\mathit{\\Delta}"),H("\\varTheta","\\mathit{\\Theta}"),H("\\varLambda","\\mathit{\\Lambda}"),H("\\varXi","\\mathit{\\Xi}"),H("\\varPi","\\mathit{\\Pi}"),H("\\varSigma","\\mathit{\\Sigma}"),H("\\varUpsilon","\\mathit{\\Upsilon}"),H("\\varPhi","\\mathit{\\Phi}"),H("\\varPsi","\\mathit{\\Psi}"),H("\\varOmega","\\mathit{\\Omega}"),H("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),H("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),H("\\boxed","\\fbox{$\\displaystyle{#1}$}"),H("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),H("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),H("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),H("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),H("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");const af={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};H("\\dots",function(s){let i="\\dotso";const c=s.expandAfterFuture().text;return c in af?i=af[c]:(c.slice(0,4)==="\\not"||c in Ot.math&&["bin","rel"].includes(Ot.math[c].group))&&(i="\\dotsb"),i});const eu={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};H("\\dotso",function(s){return s.future().text in eu?"\\ldots\\,":"\\ldots"}),H("\\dotsc",function(s){const i=s.future().text;return i in eu&&i!==","?"\\ldots\\,":"\\ldots"}),H("\\cdots",function(s){return s.future().text in eu?"\\@cdots\\,":"\\@cdots"}),H("\\dotsb","\\cdots"),H("\\dotsm","\\cdots"),H("\\dotsi","\\!\\cdots"),H("\\dotsx","\\ldots\\,"),H("\\DOTSI","\\relax"),H("\\DOTSB","\\relax"),H("\\DOTSX","\\relax"),H("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),H("\\,","\\tmspace+{3mu}{.1667em}"),H("\\thinspace","\\,"),H("\\>","\\mskip{4mu}"),H("\\:","\\tmspace+{4mu}{.2222em}"),H("\\medspace","\\:"),H("\\;","\\tmspace+{5mu}{.2777em}"),H("\\thickspace","\\;"),H("\\!","\\tmspace-{3mu}{.1667em}"),H("\\negthinspace","\\!"),H("\\negmedspace","\\tmspace-{4mu}{.2222em}"),H("\\negthickspace","\\tmspace-{5mu}{.277em}"),H("\\enspace","\\kern.5em "),H("\\enskip","\\hskip.5em\\relax"),H("\\quad","\\hskip1em\\relax"),H("\\qquad","\\hskip2em\\relax"),H("\\tag","\\@ifstar\\tag@literal\\tag@paren"),H("\\tag@paren","\\tag@literal{({#1})}"),H("\\tag@literal",s=>{if(s.macros.get("\\df@tag"))throw new a("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),H("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),H("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),H("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),H("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),H("\\newline","\\\\\\relax"),H("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");const sf=pe(xe["Main-Regular"][84][1]-.7*xe["Main-Regular"][65][1]);H("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+sf+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),H("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+sf+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),H("\\hspace","\\@ifstar\\@hspacer\\@hspace"),H("\\@hspace","\\hskip #1\\relax"),H("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),H("\\ordinarycolon",":"),H("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),H("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),H("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),H("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),H("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),H("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),H("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),H("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),H("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),H("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),H("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),H("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),H("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),H("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),H("\u2237","\\dblcolon"),H("\u2239","\\eqcolon"),H("\u2254","\\coloneqq"),H("\u2255","\\eqqcolon"),H("\u2A74","\\Coloneqq"),H("\\ratio","\\vcentcolon"),H("\\coloncolon","\\dblcolon"),H("\\colonequals","\\coloneqq"),H("\\coloncolonequals","\\Coloneqq"),H("\\equalscolon","\\eqqcolon"),H("\\equalscoloncolon","\\Eqqcolon"),H("\\colonminus","\\coloneq"),H("\\coloncolonminus","\\Coloneq"),H("\\minuscolon","\\eqcolon"),H("\\minuscoloncolon","\\Eqcolon"),H("\\coloncolonapprox","\\Colonapprox"),H("\\coloncolonsim","\\Colonsim"),H("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),H("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),H("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),H("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),H("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}"),H("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),H("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),H("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),H("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),H("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),H("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),H("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),H("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),H("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}"),H("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}"),H("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}"),H("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}"),H("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}"),H("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}"),H("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}"),H("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}"),H("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}"),H("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}"),H("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}"),H("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}"),H("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}"),H("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}"),H("\\imath","\\html@mathml{\\@imath}{\u0131}"),H("\\jmath","\\html@mathml{\\@jmath}{\u0237}"),H("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}"),H("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}"),H("\u27E6","\\llbracket"),H("\u27E7","\\rrbracket"),H("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"),H("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"),H("\u2983","\\lBrace"),H("\u2984","\\rBrace"),H("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29B5}}"),H("\u29B5","\\minuso"),H("\\darr","\\downarrow"),H("\\dArr","\\Downarrow"),H("\\Darr","\\Downarrow"),H("\\lang","\\langle"),H("\\rang","\\rangle"),H("\\uarr","\\uparrow"),H("\\uArr","\\Uparrow"),H("\\Uarr","\\Uparrow"),H("\\N","\\mathbb{N}"),H("\\R","\\mathbb{R}"),H("\\Z","\\mathbb{Z}"),H("\\alef","\\aleph"),H("\\alefsym","\\aleph"),H("\\Alpha","\\mathrm{A}"),H("\\Beta","\\mathrm{B}"),H("\\bull","\\bullet"),H("\\Chi","\\mathrm{X}"),H("\\clubs","\\clubsuit"),H("\\cnums","\\mathbb{C}"),H("\\Complex","\\mathbb{C}"),H("\\Dagger","\\ddagger"),H("\\diamonds","\\diamondsuit"),H("\\empty","\\emptyset"),H("\\Epsilon","\\mathrm{E}"),H("\\Eta","\\mathrm{H}"),H("\\exist","\\exists"),H("\\harr","\\leftrightarrow"),H("\\hArr","\\Leftrightarrow"),H("\\Harr","\\Leftrightarrow"),H("\\hearts","\\heartsuit"),H("\\image","\\Im"),H("\\infin","\\infty"),H("\\Iota","\\mathrm{I}"),H("\\isin","\\in"),H("\\Kappa","\\mathrm{K}"),H("\\larr","\\leftarrow"),H("\\lArr","\\Leftarrow"),H("\\Larr","\\Leftarrow"),H("\\lrarr","\\leftrightarrow"),H("\\lrArr","\\Leftrightarrow"),H("\\Lrarr","\\Leftrightarrow"),H("\\Mu","\\mathrm{M}"),H("\\natnums","\\mathbb{N}"),H("\\Nu","\\mathrm{N}"),H("\\Omicron","\\mathrm{O}"),H("\\plusmn","\\pm"),H("\\rarr","\\rightarrow"),H("\\rArr","\\Rightarrow"),H("\\Rarr","\\Rightarrow"),H("\\real","\\Re"),H("\\reals","\\mathbb{R}"),H("\\Reals","\\mathbb{R}"),H("\\Rho","\\mathrm{P}"),H("\\sdot","\\cdot"),H("\\sect","\\S"),H("\\spades","\\spadesuit"),H("\\sub","\\subset"),H("\\sube","\\subseteq"),H("\\supe","\\supseteq"),H("\\Tau","\\mathrm{T}"),H("\\thetasym","\\vartheta"),H("\\weierp","\\wp"),H("\\Zeta","\\mathrm{Z}"),H("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),H("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),H("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),H("\\bra","\\mathinner{\\langle{#1}|}"),H("\\ket","\\mathinner{|{#1}\\rangle}"),H("\\braket","\\mathinner{\\langle{#1}\\rangle}"),H("\\Bra","\\left\\langle#1\\right|"),H("\\Ket","\\left|#1\\right\\rangle");const lf=s=>i=>{const c=i.consumeArg().tokens,h=i.consumeArg().tokens,x=i.consumeArg().tokens,A=i.consumeArg().tokens,M=i.macros.get("|"),L=i.macros.get("\\|");i.macros.beginGroup();const J=ke=>Ne=>{s&&(Ne.macros.set("|",M),x.length&&Ne.macros.set("\\|",L));let et=ke;return!ke&&x.length&&Ne.future().text==="|"&&(Ne.popToken(),et=!0),{tokens:et?x:h,numArgs:0}};i.macros.set("|",J(!1)),x.length&&i.macros.set("\\|",J(!0));const se=i.consumeArg().tokens,ye=i.expandTokens([...A,...se,...c]);return i.macros.endGroup(),{tokens:ye.reverse(),numArgs:0}};H("\\bra@ket",lf(!1)),H("\\bra@set",lf(!0)),H("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),H("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),H("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),H("\\angln","{\\angl n}"),H("\\blue","\\textcolor{##6495ed}{#1}"),H("\\orange","\\textcolor{##ffa500}{#1}"),H("\\pink","\\textcolor{##ff00af}{#1}"),H("\\red","\\textcolor{##df0030}{#1}"),H("\\green","\\textcolor{##28ae7b}{#1}"),H("\\gray","\\textcolor{gray}{#1}"),H("\\purple","\\textcolor{##9d38bd}{#1}"),H("\\blueA","\\textcolor{##ccfaff}{#1}"),H("\\blueB","\\textcolor{##80f6ff}{#1}"),H("\\blueC","\\textcolor{##63d9ea}{#1}"),H("\\blueD","\\textcolor{##11accd}{#1}"),H("\\blueE","\\textcolor{##0c7f99}{#1}"),H("\\tealA","\\textcolor{##94fff5}{#1}"),H("\\tealB","\\textcolor{##26edd5}{#1}"),H("\\tealC","\\textcolor{##01d1c1}{#1}"),H("\\tealD","\\textcolor{##01a995}{#1}"),H("\\tealE","\\textcolor{##208170}{#1}"),H("\\greenA","\\textcolor{##b6ffb0}{#1}"),H("\\greenB","\\textcolor{##8af281}{#1}"),H("\\greenC","\\textcolor{##74cf70}{#1}"),H("\\greenD","\\textcolor{##1fab54}{#1}"),H("\\greenE","\\textcolor{##0d923f}{#1}"),H("\\goldA","\\textcolor{##ffd0a9}{#1}"),H("\\goldB","\\textcolor{##ffbb71}{#1}"),H("\\goldC","\\textcolor{##ff9c39}{#1}"),H("\\goldD","\\textcolor{##e07d10}{#1}"),H("\\goldE","\\textcolor{##a75a05}{#1}"),H("\\redA","\\textcolor{##fca9a9}{#1}"),H("\\redB","\\textcolor{##ff8482}{#1}"),H("\\redC","\\textcolor{##f9685d}{#1}"),H("\\redD","\\textcolor{##e84d39}{#1}"),H("\\redE","\\textcolor{##bc2612}{#1}"),H("\\maroonA","\\textcolor{##ffbde0}{#1}"),H("\\maroonB","\\textcolor{##ff92c6}{#1}"),H("\\maroonC","\\textcolor{##ed5fa6}{#1}"),H("\\maroonD","\\textcolor{##ca337c}{#1}"),H("\\maroonE","\\textcolor{##9e034e}{#1}"),H("\\purpleA","\\textcolor{##ddd7ff}{#1}"),H("\\purpleB","\\textcolor{##c6b9fc}{#1}"),H("\\purpleC","\\textcolor{##aa87ff}{#1}"),H("\\purpleD","\\textcolor{##7854ab}{#1}"),H("\\purpleE","\\textcolor{##543b78}{#1}"),H("\\mintA","\\textcolor{##f5f9e8}{#1}"),H("\\mintB","\\textcolor{##edf2df}{#1}"),H("\\mintC","\\textcolor{##e0e5cc}{#1}"),H("\\grayA","\\textcolor{##f6f7f7}{#1}"),H("\\grayB","\\textcolor{##f0f1f2}{#1}"),H("\\grayC","\\textcolor{##e3e5e6}{#1}"),H("\\grayD","\\textcolor{##d6d8da}{#1}"),H("\\grayE","\\textcolor{##babec2}{#1}"),H("\\grayF","\\textcolor{##888d93}{#1}"),H("\\grayG","\\textcolor{##626569}{#1}"),H("\\grayH","\\textcolor{##3b3e40}{#1}"),H("\\grayI","\\textcolor{##21242c}{#1}"),H("\\kaBlue","\\textcolor{##314453}{#1}"),H("\\kaGreen","\\textcolor{##71B307}{#1}");const uf={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class $4{constructor(i,c,h){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=c,this.expansionCount=0,this.feed(i),this.macros=new F4(T4,c.macros),this.mode=h,this.stack=[]}feed(i){this.lexer=new nf(i,this.settings)}switchMode(i){this.mode=i}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(i){this.stack.push(i)}pushTokens(i){this.stack.push(...i)}scanArgument(i){let c,h,x;if(i){if(this.consumeSpaces(),this.future().text!=="[")return null;c=this.popToken(),{tokens:x,end:h}=this.consumeArg(["]"])}else({tokens:x,start:c,end:h}=this.consumeArg());return this.pushToken(new Bn("EOF",h.loc)),this.pushTokens(x),new Bn("",wn.range(c,h))}consumeSpaces(){for(;this.future().text===" ";)this.stack.pop()}consumeArg(i){const c=[],h=i&&i.length>0;h||this.consumeSpaces();const x=this.future();let A,M=0,L=0;do{if(A=this.popToken(),c.push(A),A.text==="{")++M;else if(A.text==="}"){if(--M,M===-1)throw new a("Extra }",A)}else if(A.text==="EOF")throw new a("Unexpected end of input in a macro argument, expected '"+(i&&h?i[L]:"}")+"'",A);if(i&&h)if((M===0||M===1&&i[L]==="{")&&A.text===i[L]){if(++L,L===i.length){c.splice(-L,L);break}}else L=0}while(M!==0||h);return x.text==="{"&&c[c.length-1].text==="}"&&(c.pop(),c.shift()),c.reverse(),{tokens:c,start:x,end:A}}consumeArgs(i,c){if(c){if(c.length!==i+1)throw new a("The length of delimiters doesn't match the number of args!");const x=c[0];for(let A=0;A<x.length;A++){const M=this.popToken();if(x[A]!==M.text)throw new a("Use of the macro doesn't match its definition",M)}}const h=[];for(let x=0;x<i;x++)h.push(this.consumeArg(c&&c[x+1]).tokens);return h}countExpansion(i){if(this.expansionCount+=i,this.expansionCount>this.settings.maxExpand)throw new a("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(i){const c=this.popToken(),h=c.text,x=c.noexpand?null:this._getExpansion(h);if(x==null||i&&x.unexpandable){if(i&&x==null&&h[0]==="\\"&&!this.isDefined(h))throw new a("Undefined control sequence: "+h);return this.pushToken(c),!1}this.countExpansion(1);let A=x.tokens;const M=this.consumeArgs(x.numArgs,x.delimiters);if(x.numArgs){A=A.slice();for(let L=A.length-1;L>=0;--L){let J=A[L];if(J.text==="#"){if(L===0)throw new a("Incomplete placeholder at end of macro body",J);if(J=A[--L],J.text==="#")A.splice(L+1,1);else if(/^[1-9]$/.test(J.text))A.splice(L,2,...M[+J.text-1]);else throw new a("Not a valid argument number",J)}}}return this.pushTokens(A),A.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){const i=this.stack.pop();return i.treatAsRelax&&(i.text="\\relax"),i}throw new Error}expandMacro(i){return this.macros.has(i)?this.expandTokens([new Bn(i)]):void 0}expandTokens(i){const c=[],h=this.stack.length;for(this.pushTokens(i);this.stack.length>h;)if(this.expandOnce(!0)===!1){const x=this.stack.pop();x.treatAsRelax&&(x.noexpand=!1,x.treatAsRelax=!1),c.push(x)}return this.countExpansion(c.length),c}expandMacroAsText(i){const c=this.expandMacro(i);return c&&c.map(h=>h.text).join("")}_getExpansion(i){const c=this.macros.get(i);if(c==null)return c;if(i.length===1){const x=this.lexer.catcodes[i];if(x!=null&&x!==13)return}const h=typeof c=="function"?c(this):c;if(typeof h=="string"){let x=0;if(h.indexOf("#")!==-1){const J=h.replace(/##/g,"");for(;J.indexOf("#"+(x+1))!==-1;)++x}const A=new nf(h,this.settings),M=[];let L=A.lex();for(;L.text!=="EOF";)M.push(L),L=A.lex();return M.reverse(),{tokens:M,numArgs:x}}return h}isDefined(i){return this.macros.has(i)||So.hasOwnProperty(i)||Ot.math.hasOwnProperty(i)||Ot.text.hasOwnProperty(i)||uf.hasOwnProperty(i)}isExpandable(i){const c=this.macros.get(i);return c!=null?typeof c=="string"||typeof c=="function"||!c.unexpandable:So.hasOwnProperty(i)&&!So[i].primitive}}const cf=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Wi=Object.freeze({"\u208A":"+","\u208B":"-","\u208C":"=","\u208D":"(","\u208E":")","\u2080":"0","\u2081":"1","\u2082":"2","\u2083":"3","\u2084":"4","\u2085":"5","\u2086":"6","\u2087":"7","\u2088":"8","\u2089":"9","\u2090":"a","\u2091":"e","\u2095":"h","\u1D62":"i","\u2C7C":"j","\u2096":"k","\u2097":"l","\u2098":"m","\u2099":"n","\u2092":"o","\u209A":"p","\u1D63":"r","\u209B":"s","\u209C":"t","\u1D64":"u","\u1D65":"v","\u2093":"x","\u1D66":"\u03B2","\u1D67":"\u03B3","\u1D68":"\u03C1","\u1D69":"\u03D5","\u1D6A":"\u03C7","\u207A":"+","\u207B":"-","\u207C":"=","\u207D":"(","\u207E":")","\u2070":"0","\xB9":"1","\xB2":"2","\xB3":"3","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u1D2C":"A","\u1D2E":"B","\u1D30":"D","\u1D31":"E","\u1D33":"G","\u1D34":"H","\u1D35":"I","\u1D36":"J","\u1D37":"K","\u1D38":"L","\u1D39":"M","\u1D3A":"N","\u1D3C":"O","\u1D3E":"P","\u1D3F":"R","\u1D40":"T","\u1D41":"U","\u2C7D":"V","\u1D42":"W","\u1D43":"a","\u1D47":"b","\u1D9C":"c","\u1D48":"d","\u1D49":"e","\u1DA0":"f","\u1D4D":"g",\u02B0:"h","\u2071":"i",\u02B2:"j","\u1D4F":"k",\u02E1:"l","\u1D50":"m",\u207F:"n","\u1D52":"o","\u1D56":"p",\u02B3:"r",\u02E2:"s","\u1D57":"t","\u1D58":"u","\u1D5B":"v",\u02B7:"w",\u02E3:"x",\u02B8:"y","\u1DBB":"z","\u1D5D":"\u03B2","\u1D5E":"\u03B3","\u1D5F":"\u03B4","\u1D60":"\u03D5","\u1D61":"\u03C7","\u1DBF":"\u03B8"}),tu={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030C":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030A":{text:"\\r",math:"\\mathring"},"\u030B":{text:"\\H"},"\u0327":{text:"\\c"}},df={\u00E1:"a\u0301",\u00E0:"a\u0300",\u00E4:"a\u0308",\u01DF:"a\u0308\u0304",\u00E3:"a\u0303",\u0101:"a\u0304",\u0103:"a\u0306",\u1EAF:"a\u0306\u0301",\u1EB1:"a\u0306\u0300",\u1EB5:"a\u0306\u0303",\u01CE:"a\u030C",\u00E2:"a\u0302",\u1EA5:"a\u0302\u0301",\u1EA7:"a\u0302\u0300",\u1EAB:"a\u0302\u0303",\u0227:"a\u0307",\u01E1:"a\u0307\u0304",\u00E5:"a\u030A",\u01FB:"a\u030A\u0301",\u1E03:"b\u0307",\u0107:"c\u0301",\u1E09:"c\u0327\u0301",\u010D:"c\u030C",\u0109:"c\u0302",\u010B:"c\u0307",\u00E7:"c\u0327",\u010F:"d\u030C",\u1E0B:"d\u0307",\u1E11:"d\u0327",\u00E9:"e\u0301",\u00E8:"e\u0300",\u00EB:"e\u0308",\u1EBD:"e\u0303",\u0113:"e\u0304",\u1E17:"e\u0304\u0301",\u1E15:"e\u0304\u0300",\u0115:"e\u0306",\u1E1D:"e\u0327\u0306",\u011B:"e\u030C",\u00EA:"e\u0302",\u1EBF:"e\u0302\u0301",\u1EC1:"e\u0302\u0300",\u1EC5:"e\u0302\u0303",\u0117:"e\u0307",\u0229:"e\u0327",\u1E1F:"f\u0307",\u01F5:"g\u0301",\u1E21:"g\u0304",\u011F:"g\u0306",\u01E7:"g\u030C",\u011D:"g\u0302",\u0121:"g\u0307",\u0123:"g\u0327",\u1E27:"h\u0308",\u021F:"h\u030C",\u0125:"h\u0302",\u1E23:"h\u0307",\u1E29:"h\u0327",\u00ED:"i\u0301",\u00EC:"i\u0300",\u00EF:"i\u0308",\u1E2F:"i\u0308\u0301",\u0129:"i\u0303",\u012B:"i\u0304",\u012D:"i\u0306",\u01D0:"i\u030C",\u00EE:"i\u0302",\u01F0:"j\u030C",\u0135:"j\u0302",\u1E31:"k\u0301",\u01E9:"k\u030C",\u0137:"k\u0327",\u013A:"l\u0301",\u013E:"l\u030C",\u013C:"l\u0327",\u1E3F:"m\u0301",\u1E41:"m\u0307",\u0144:"n\u0301",\u01F9:"n\u0300",\u00F1:"n\u0303",\u0148:"n\u030C",\u1E45:"n\u0307",\u0146:"n\u0327",\u00F3:"o\u0301",\u00F2:"o\u0300",\u00F6:"o\u0308",\u022B:"o\u0308\u0304",\u00F5:"o\u0303",\u1E4D:"o\u0303\u0301",\u1E4F:"o\u0303\u0308",\u022D:"o\u0303\u0304",\u014D:"o\u0304",\u1E53:"o\u0304\u0301",\u1E51:"o\u0304\u0300",\u014F:"o\u0306",\u01D2:"o\u030C",\u00F4:"o\u0302",\u1ED1:"o\u0302\u0301",\u1ED3:"o\u0302\u0300",\u1ED7:"o\u0302\u0303",\u022F:"o\u0307",\u0231:"o\u0307\u0304",\u0151:"o\u030B",\u1E55:"p\u0301",\u1E57:"p\u0307",\u0155:"r\u0301",\u0159:"r\u030C",\u1E59:"r\u0307",\u0157:"r\u0327",\u015B:"s\u0301",\u1E65:"s\u0301\u0307",\u0161:"s\u030C",\u1E67:"s\u030C\u0307",\u015D:"s\u0302",\u1E61:"s\u0307",\u015F:"s\u0327",\u1E97:"t\u0308",\u0165:"t\u030C",\u1E6B:"t\u0307",\u0163:"t\u0327",\u00FA:"u\u0301",\u00F9:"u\u0300",\u00FC:"u\u0308",\u01D8:"u\u0308\u0301",\u01DC:"u\u0308\u0300",\u01D6:"u\u0308\u0304",\u01DA:"u\u0308\u030C",\u0169:"u\u0303",\u1E79:"u\u0303\u0301",\u016B:"u\u0304",\u1E7B:"u\u0304\u0308",\u016D:"u\u0306",\u01D4:"u\u030C",\u00FB:"u\u0302",\u016F:"u\u030A",\u0171:"u\u030B",\u1E7D:"v\u0303",\u1E83:"w\u0301",\u1E81:"w\u0300",\u1E85:"w\u0308",\u0175:"w\u0302",\u1E87:"w\u0307",\u1E98:"w\u030A",\u1E8D:"x\u0308",\u1E8B:"x\u0307",\u00FD:"y\u0301",\u1EF3:"y\u0300",\u00FF:"y\u0308",\u1EF9:"y\u0303",\u0233:"y\u0304",\u0177:"y\u0302",\u1E8F:"y\u0307",\u1E99:"y\u030A",\u017A:"z\u0301",\u017E:"z\u030C",\u1E91:"z\u0302",\u017C:"z\u0307",\u00C1:"A\u0301",\u00C0:"A\u0300",\u00C4:"A\u0308",\u01DE:"A\u0308\u0304",\u00C3:"A\u0303",\u0100:"A\u0304",\u0102:"A\u0306",\u1EAE:"A\u0306\u0301",\u1EB0:"A\u0306\u0300",\u1EB4:"A\u0306\u0303",\u01CD:"A\u030C",\u00C2:"A\u0302",\u1EA4:"A\u0302\u0301",\u1EA6:"A\u0302\u0300",\u1EAA:"A\u0302\u0303",\u0226:"A\u0307",\u01E0:"A\u0307\u0304",\u00C5:"A\u030A",\u01FA:"A\u030A\u0301",\u1E02:"B\u0307",\u0106:"C\u0301",\u1E08:"C\u0327\u0301",\u010C:"C\u030C",\u0108:"C\u0302",\u010A:"C\u0307",\u00C7:"C\u0327",\u010E:"D\u030C",\u1E0A:"D\u0307",\u1E10:"D\u0327",\u00C9:"E\u0301",\u00C8:"E\u0300",\u00CB:"E\u0308",\u1EBC:"E\u0303",\u0112:"E\u0304",\u1E16:"E\u0304\u0301",\u1E14:"E\u0304\u0300",\u0114:"E\u0306",\u1E1C:"E\u0327\u0306",\u011A:"E\u030C",\u00CA:"E\u0302",\u1EBE:"E\u0302\u0301",\u1EC0:"E\u0302\u0300",\u1EC4:"E\u0302\u0303",\u0116:"E\u0307",\u0228:"E\u0327",\u1E1E:"F\u0307",\u01F4:"G\u0301",\u1E20:"G\u0304",\u011E:"G\u0306",\u01E6:"G\u030C",\u011C:"G\u0302",\u0120:"G\u0307",\u0122:"G\u0327",\u1E26:"H\u0308",\u021E:"H\u030C",\u0124:"H\u0302",\u1E22:"H\u0307",\u1E28:"H\u0327",\u00CD:"I\u0301",\u00CC:"I\u0300",\u00CF:"I\u0308",\u1E2E:"I\u0308\u0301",\u0128:"I\u0303",\u012A:"I\u0304",\u012C:"I\u0306",\u01CF:"I\u030C",\u00CE:"I\u0302",\u0130:"I\u0307",\u0134:"J\u0302",\u1E30:"K\u0301",\u01E8:"K\u030C",\u0136:"K\u0327",\u0139:"L\u0301",\u013D:"L\u030C",\u013B:"L\u0327",\u1E3E:"M\u0301",\u1E40:"M\u0307",\u0143:"N\u0301",\u01F8:"N\u0300",\u00D1:"N\u0303",\u0147:"N\u030C",\u1E44:"N\u0307",\u0145:"N\u0327",\u00D3:"O\u0301",\u00D2:"O\u0300",\u00D6:"O\u0308",\u022A:"O\u0308\u0304",\u00D5:"O\u0303",\u1E4C:"O\u0303\u0301",\u1E4E:"O\u0303\u0308",\u022C:"O\u0303\u0304",\u014C:"O\u0304",\u1E52:"O\u0304\u0301",\u1E50:"O\u0304\u0300",\u014E:"O\u0306",\u01D1:"O\u030C",\u00D4:"O\u0302",\u1ED0:"O\u0302\u0301",\u1ED2:"O\u0302\u0300",\u1ED6:"O\u0302\u0303",\u022E:"O\u0307",\u0230:"O\u0307\u0304",\u0150:"O\u030B",\u1E54:"P\u0301",\u1E56:"P\u0307",\u0154:"R\u0301",\u0158:"R\u030C",\u1E58:"R\u0307",\u0156:"R\u0327",\u015A:"S\u0301",\u1E64:"S\u0301\u0307",\u0160:"S\u030C",\u1E66:"S\u030C\u0307",\u015C:"S\u0302",\u1E60:"S\u0307",\u015E:"S\u0327",\u0164:"T\u030C",\u1E6A:"T\u0307",\u0162:"T\u0327",\u00DA:"U\u0301",\u00D9:"U\u0300",\u00DC:"U\u0308",\u01D7:"U\u0308\u0301",\u01DB:"U\u0308\u0300",\u01D5:"U\u0308\u0304",\u01D9:"U\u0308\u030C",\u0168:"U\u0303",\u1E78:"U\u0303\u0301",\u016A:"U\u0304",\u1E7A:"U\u0304\u0308",\u016C:"U\u0306",\u01D3:"U\u030C",\u00DB:"U\u0302",\u016E:"U\u030A",\u0170:"U\u030B",\u1E7C:"V\u0303",\u1E82:"W\u0301",\u1E80:"W\u0300",\u1E84:"W\u0308",\u0174:"W\u0302",\u1E86:"W\u0307",\u1E8C:"X\u0308",\u1E8A:"X\u0307",\u00DD:"Y\u0301",\u1EF2:"Y\u0300",\u0178:"Y\u0308",\u1EF8:"Y\u0303",\u0232:"Y\u0304",\u0176:"Y\u0302",\u1E8E:"Y\u0307",\u0179:"Z\u0301",\u017D:"Z\u030C",\u1E90:"Z\u0302",\u017B:"Z\u0307",\u03AC:"\u03B1\u0301",\u1F70:"\u03B1\u0300",\u1FB1:"\u03B1\u0304",\u1FB0:"\u03B1\u0306",\u03AD:"\u03B5\u0301",\u1F72:"\u03B5\u0300",\u03AE:"\u03B7\u0301",\u1F74:"\u03B7\u0300",\u03AF:"\u03B9\u0301",\u1F76:"\u03B9\u0300",\u03CA:"\u03B9\u0308",\u0390:"\u03B9\u0308\u0301",\u1FD2:"\u03B9\u0308\u0300",\u1FD1:"\u03B9\u0304",\u1FD0:"\u03B9\u0306",\u03CC:"\u03BF\u0301",\u1F78:"\u03BF\u0300",\u03CD:"\u03C5\u0301",\u1F7A:"\u03C5\u0300",\u03CB:"\u03C5\u0308",\u03B0:"\u03C5\u0308\u0301",\u1FE2:"\u03C5\u0308\u0300",\u1FE1:"\u03C5\u0304",\u1FE0:"\u03C5\u0306",\u03CE:"\u03C9\u0301",\u1F7C:"\u03C9\u0300",\u038E:"\u03A5\u0301",\u1FEA:"\u03A5\u0300",\u03AB:"\u03A5\u0308",\u1FE9:"\u03A5\u0304",\u1FE8:"\u03A5\u0306",\u038F:"\u03A9\u0301",\u1FFA:"\u03A9\u0300"};class Ui{constructor(i,c){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new $4(i,c,this.mode),this.settings=c,this.leftrightDepth=0}expect(i,c){if(c===void 0&&(c=!0),this.fetch().text!==i)throw new a("Expected '"+i+"', got '"+this.fetch().text+"'",this.fetch());c&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(i){this.mode=i,this.gullet.switchMode(i)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{const i=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),i}finally{this.gullet.endGroups()}}subparse(i){const c=this.nextToken;this.consume(),this.gullet.pushToken(new Bn("}")),this.gullet.pushTokens(i);const h=this.parseExpression(!1);return this.expect("}"),this.nextToken=c,h}parseExpression(i,c){const h=[];for(;;){this.mode==="math"&&this.consumeSpaces();const x=this.fetch();if(Ui.endOfExpression.indexOf(x.text)!==-1||c&&x.text===c||i&&So[x.text]&&So[x.text].infix)break;const A=this.parseAtom(c);if(A){if(A.type==="internal")continue}else break;h.push(A)}return this.mode==="text"&&this.formLigatures(h),this.handleInfixNodes(h)}handleInfixNodes(i){let c=-1,h;for(let x=0;x<i.length;x++)if(i[x].type==="infix"){if(c!==-1)throw new a("only one infix operator per group",i[x].token);c=x,h=i[x].replaceWith}if(c!==-1&&h){let x,A;const M=i.slice(0,c),L=i.slice(c+1);M.length===1&&M[0].type==="ordgroup"?x=M[0]:x={type:"ordgroup",mode:this.mode,body:M},L.length===1&&L[0].type==="ordgroup"?A=L[0]:A={type:"ordgroup",mode:this.mode,body:L};let J;return h==="\\\\abovefrac"?J=this.callFunction(h,[x,i[c],A],[]):J=this.callFunction(h,[x,A],[]),[J]}else return i}handleSupSubscript(i){const c=this.fetch(),h=c.text;this.consume(),this.consumeSpaces();let x;do{var A;x=this.parseGroup(i)}while(((A=x)==null?void 0:A.type)==="internal");if(!x)throw new a("Expected group after '"+h+"'",c);return x}formatUnsupportedCmd(i){const c=[];for(let x=0;x<i.length;x++)c.push({type:"textord",mode:"text",text:i[x]});const h={type:"text",mode:this.mode,body:c};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[h]}}parseAtom(i){const c=this.parseGroup("atom",i);if((c==null?void 0:c.type)==="internal"||this.mode==="text")return c;let h,x;for(;;){this.consumeSpaces();const A=this.fetch();if(A.text==="\\limits"||A.text==="\\nolimits"){if(c&&c.type==="op"){const M=A.text==="\\limits";c.limits=M,c.alwaysHandleSupSub=!0}else if(c&&c.type==="operatorname")c.alwaysHandleSupSub&&(c.limits=A.text==="\\limits");else throw new a("Limit controls must follow a math operator",A);this.consume()}else if(A.text==="^"){if(h)throw new a("Double superscript",A);h=this.handleSupSubscript("superscript")}else if(A.text==="_"){if(x)throw new a("Double subscript",A);x=this.handleSupSubscript("subscript")}else if(A.text==="'"){if(h)throw new a("Double superscript",A);const M={type:"textord",mode:this.mode,text:"\\prime"},L=[M];for(this.consume();this.fetch().text==="'";)L.push(M),this.consume();this.fetch().text==="^"&&L.push(this.handleSupSubscript("superscript")),h={type:"ordgroup",mode:this.mode,body:L}}else if(Wi[A.text]){const M=cf.test(A.text),L=[];for(L.push(new Bn(Wi[A.text])),this.consume();;){const se=this.fetch().text;if(!Wi[se]||cf.test(se)!==M)break;L.unshift(new Bn(Wi[se])),this.consume()}const J=this.subparse(L);M?x={type:"ordgroup",mode:"math",body:J}:h={type:"ordgroup",mode:"math",body:J}}else break}return h||x?{type:"supsub",mode:this.mode,base:c,sup:h,sub:x}:c}parseFunction(i,c){const h=this.fetch(),x=h.text,A=So[x];if(!A)return null;if(this.consume(),c&&c!=="atom"&&!A.allowedInArgument)throw new a("Got function '"+x+"' with no arguments"+(c?" as "+c:""),h);if(this.mode==="text"&&!A.allowedInText)throw new a("Can't use function '"+x+"' in text mode",h);if(this.mode==="math"&&A.allowedInMath===!1)throw new a("Can't use function '"+x+"' in math mode",h);const{args:M,optArgs:L}=this.parseArguments(x,A);return this.callFunction(x,M,L,h,i)}callFunction(i,c,h,x,A){const M={funcName:i,parser:this,token:x,breakOnTokenText:A},L=So[i];if(L&&L.handler)return L.handler(M,c,h);throw new a("No function handler for "+i)}parseArguments(i,c){const h=c.numArgs+c.numOptionalArgs;if(h===0)return{args:[],optArgs:[]};const x=[],A=[];for(let M=0;M<h;M++){let L=c.argTypes&&c.argTypes[M];const J=M<c.numOptionalArgs;(c.primitive&&L==null||c.type==="sqrt"&&M===1&&A[0]==null)&&(L="primitive");const se=this.parseGroupOfType("argument to '"+i+"'",L,J);if(J)A.push(se);else if(se!=null)x.push(se);else throw new a("Null argument, please report this as a bug")}return{args:x,optArgs:A}}parseGroupOfType(i,c,h){switch(c){case"color":return this.parseColorGroup(h);case"size":return this.parseSizeGroup(h);case"url":return this.parseUrlGroup(h);case"math":case"text":return this.parseArgumentGroup(h,c);case"hbox":{const x=this.parseArgumentGroup(h,"text");return x!=null?{type:"styling",mode:x.mode,body:[x],style:"text"}:null}case"raw":{const x=this.parseStringGroup("raw",h);return x!=null?{type:"raw",mode:"text",string:x.text}:null}case"primitive":{if(h)throw new a("A primitive argument cannot be optional");const x=this.parseGroup(i);if(x==null)throw new a("Expected group as "+i,this.fetch());return x}case"original":case null:case void 0:return this.parseArgumentGroup(h);default:throw new a("Unknown group type as "+i,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(i,c){const h=this.gullet.scanArgument(c);if(h==null)return null;let x="",A;for(;(A=this.fetch()).text!=="EOF";)x+=A.text,this.consume();return this.consume(),h.text=x,h}parseRegexGroup(i,c){const h=this.fetch();let x=h,A="",M;for(;(M=this.fetch()).text!=="EOF"&&i.test(A+M.text);)x=M,A+=x.text,this.consume();if(A==="")throw new a("Invalid "+c+": '"+h.text+"'",h);return h.range(x,A)}parseColorGroup(i){const c=this.parseStringGroup("color",i);if(c==null)return null;const h=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(c.text);if(!h)throw new a("Invalid color: '"+c.text+"'",c);let x=h[0];return/^[0-9a-f]{6}$/i.test(x)&&(x="#"+x),{type:"color-token",mode:this.mode,color:x}}parseSizeGroup(i){let c,h=!1;if(this.gullet.consumeSpaces(),!i&&this.gullet.future().text!=="{"?c=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):c=this.parseStringGroup("size",i),!c)return null;!i&&c.text.length===0&&(c.text="0pt",h=!0);const x=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(c.text);if(!x)throw new a("Invalid size: '"+c.text+"'",c);const A={number:+(x[1]+x[2]),unit:x[3]};if(!Mt(A))throw new a("Invalid unit: '"+A.unit+"'",c);return{type:"size",mode:this.mode,value:A,isBlank:h}}parseUrlGroup(i){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);const c=this.parseStringGroup("url",i);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),c==null)return null;const h=c.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:h}}parseArgumentGroup(i,c){const h=this.gullet.scanArgument(i);if(h==null)return null;const x=this.mode;c&&this.switchMode(c),this.gullet.beginGroup();const A=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();const M={type:"ordgroup",mode:this.mode,loc:h.loc,body:A};return c&&this.switchMode(x),M}parseGroup(i,c){const h=this.fetch(),x=h.text;let A;if(x==="{"||x==="\\begingroup"){this.consume();const M=x==="{"?"}":"\\endgroup";this.gullet.beginGroup();const L=this.parseExpression(!1,M),J=this.fetch();this.expect(M),this.gullet.endGroup(),A={type:"ordgroup",mode:this.mode,loc:wn.range(h,J),body:L,semisimple:x==="\\begingroup"||void 0}}else if(A=this.parseFunction(c,i)||this.parseSymbol(),A==null&&x[0]==="\\"&&!uf.hasOwnProperty(x)){if(this.settings.throwOnError)throw new a("Undefined control sequence: "+x,h);A=this.formatUnsupportedCmd(x),this.consume()}return A}formLigatures(i){let c=i.length-1;for(let h=0;h<c;++h){const x=i[h],A=x.text;A==="-"&&i[h+1].text==="-"&&(h+1<c&&i[h+2].text==="-"?(i.splice(h,3,{type:"textord",mode:"text",loc:wn.range(x,i[h+2]),text:"---"}),c-=2):(i.splice(h,2,{type:"textord",mode:"text",loc:wn.range(x,i[h+1]),text:"--"}),c-=1)),(A==="'"||A==="`")&&i[h+1].text===A&&(i.splice(h,2,{type:"textord",mode:"text",loc:wn.range(x,i[h+1]),text:A+A}),c-=1)}}parseSymbol(){const i=this.fetch();let c=i.text;if(/^\\verb[^a-zA-Z]/.test(c)){this.consume();let A=c.slice(5);const M=A.charAt(0)==="*";if(M&&(A=A.slice(1)),A.length<2||A.charAt(0)!==A.slice(-1))throw new a(`\\verb assertion failed --
500
+ please report what input caused this bug`);return A=A.slice(1,-1),{type:"verb",mode:"text",body:A,star:M}}df.hasOwnProperty(c[0])&&!Ot[this.mode][c[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+c[0]+'" used in math mode',i),c=df[c[0]]+c.slice(1));const h=A4.exec(c);h&&(c=c.substring(0,h.index),c==="i"?c="\u0131":c==="j"&&(c="\u0237"));let x;if(Ot[this.mode][c]){this.settings.strict&&this.mode==="math"&&Mr.indexOf(c)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+c[0]+'" used in math mode',i);const A=Ot[this.mode][c].group,M=wn.range(i);let L;if(zr.hasOwnProperty(A)){const J=A;L={type:"atom",mode:this.mode,family:J,loc:M,text:c}}else L={type:A,mode:this.mode,loc:M,text:c};x=L}else if(c.charCodeAt(0)>=128)this.settings.strict&&(he(c.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+c[0]+'" used in math mode',i):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+c[0]+'"'+(" ("+c.charCodeAt(0)+")"),i)),x={type:"textord",mode:"text",loc:wn.range(i),text:c};else return null;if(this.consume(),h)for(let A=0;A<h[0].length;A++){const M=h[0][A];if(!tu[M])throw new a("Unknown accent ' "+M+"'",i);const L=tu[M][this.mode]||tu[M].text;if(!L)throw new a("Accent "+M+" unsupported in "+this.mode+" mode",i);x={type:"accent",mode:this.mode,loc:wn.range(i),label:L,isStretchy:!1,isShifty:!0,base:x}}return x}}Ui.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var ru=function(s,i){if(!(typeof s=="string"||s instanceof String))throw new TypeError("KaTeX can only parse string typed expression");const c=new Ui(s,i);delete c.gullet.macros.current["\\df@tag"];let h=c.parse();if(delete c.gullet.macros.current["\\current@color"],delete c.gullet.macros.current["\\color"],c.gullet.macros.get("\\df@tag")){if(!i.displayMode)throw new a("\\tag works only in display equations");h=[{type:"tag",mode:"text",body:h,tag:c.subparse([new Bn("\\df@tag")])}]}return h};let ff=function(s,i,c){i.textContent="";const h=nu(s,c).toNode();i.appendChild(h)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),ff=function(){throw new a("KaTeX doesn't work in quirks mode.")});const N4=function(s,i){return nu(s,i).toMarkup()},O4=function(s,i){const c=new B(i);return ru(s,c)},hf=function(s,i,c){if(c.throwOnError||!(s instanceof a))throw s;const h=we.makeSpan(["katex-error"],[new _t(i)]);return h.setAttribute("title",s.toString()),h.setAttribute("style","color:"+c.errorColor),h},nu=function(s,i){const c=new B(i);try{const h=ru(s,c);return X2(h,s,c)}catch(h){return hf(h,s,c)}};var M4={version:"0.16.25",render:ff,renderToString:N4,ParseError:a,SETTINGS_SCHEMA:p,__parse:O4,__renderToDomTree:nu,__renderToHTMLTree:function(s,i){const c=new B(i);try{const h=ru(s,c);return G2(h,s,c)}catch(h){return hf(h,s,c)}},__setFontMetrics:ht,__defineSymbol:w,__defineFunction:mt,__defineMacro:H,__domTree:{Span:St,Anchor:Kt,SymbolNode:_t,SvgNode:Er,PathNode:Cr,LineNode:Zr}},I4=M4;return n=n.default,n})()})})(J0)),J0.exports}var B9=ks.exports,ym;function F9(){return ym||(ym=1,(function(e,t){(function(r,n){n(t,We,E9(),A9())})(B9,function(r,n,o,a){Object.defineProperty(r,"__esModule",{value:!0});function l(p,S){for(var B in S)Object.defineProperty(p,B,{enumerable:!0,get:S[B]})}l(r,{BlockMath:()=>b,InlineMath:()=>C}),n=d(n),o=u(o),a=u(a);function u(p){return p&&p.__esModule?p:{default:p}}function f(p){if(typeof WeakMap!="function")return null;var S=new WeakMap,B=new WeakMap;return(f=function(k){return k?B:S})(p)}function d(p,S){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var B=f(S);if(B&&B.has(p))return B.get(p);var k={},$=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in p)if(T!=="default"&&Object.prototype.hasOwnProperty.call(p,T)){var O=$?Object.getOwnPropertyDescriptor(p,T):null;O&&(O.get||O.set)?Object.defineProperty(k,T,O):k[T]=p[T]}return k.default=p,B&&B.set(p,k),k}const m=(p,{displayMode:S})=>{const B=({children:k,errorColor:$,math:T,renderError:O})=>{const F=T??k,{html:P,error:N}=(0,n.useMemo)(()=>{try{return{html:a.default.renderToString(F,{displayMode:S,errorColor:$,throwOnError:!!O}),error:void 0}}catch(q){if(q instanceof a.default.ParseError||q instanceof TypeError)return{error:q};throw q}},[F,$,O]);return N?O?O(N):n.default.createElement(p,{html:`${N.message}`}):n.default.createElement(p,{html:P})};return B.propTypes={children:o.default.string,errorColor:o.default.string,math:o.default.string,renderError:o.default.func},B},g={html:o.default.string.isRequired},v=({html:p})=>n.default.createElement("div",{"data-testid":"react-katex",dangerouslySetInnerHTML:{__html:p}});v.propTypes=g;const y=({html:p})=>n.default.createElement("span",{"data-testid":"react-katex",dangerouslySetInnerHTML:{__html:p}});y.propTypes=g;const b=m(v,{displayMode:!0}),C=m(y,{displayMode:!1})})})(ks,ks.exports)),ks.exports}var M2=F9();const T9=Xe.span.attrs({className:"latex-inline-wrapper"})`
501
+ display: inline-flex;
502
+ align-items: baseline;
503
+ column-gap: 4px;
504
+ line-height: 1.2;
505
+ color: ${({$color:e})=>e||"inherit"};
506
+ `,$9=Xe.span.attrs({className:"latex-inline-error"})`
507
+ display: inline-flex;
508
+ align-items: center;
509
+ column-gap: 6px;
510
+ padding: 2px 4px;
511
+ border-radius: 4px;
512
+ background: rgba(215, 58, 73, 0.08);
513
+ color: #d73a49;
514
+ font-size: 0.85em;
515
+ `,N9=Xe.span.attrs({className:"latex-inline-error-message"})`
516
+ font-size: 0.75em;
517
+ color: #d73a49;
518
+ `,O9=({attributes:e,formula:t,styles:r})=>{var a;const n=At(()=>(t||"").trim(),[t]),o=(a=r==null?void 0:r.text)==null?void 0:a.color;return n?K.jsx(T9,{...e,$color:o,children:K.jsx(M2.InlineMath,{math:n,errorColor:"#d73a49",renderError:l=>K.jsxs($9,{children:[K.jsx("span",{children:n}),K.jsx(N9,{children:l==null?void 0:l.message})]})})}):null},M9=Xe.div.attrs({className:"latex-block-wrapper"})`
519
+ width: 100%;
520
+ display: flex;
521
+ justify-content: center;
522
+ align-items: center;
523
+ margin: 1.25rem 0;
524
+ padding: 0.75rem;
525
+ border-radius: 8px;
526
+ background: rgba(2, 132, 199, 0.05);
527
+ color: ${({$textColor:e})=>e||"inherit"};
528
+ `,I9=Xe.div.attrs({className:"latex-block-error"})`
529
+ display: flex;
530
+ flex-direction: column;
531
+ width: 100%;
532
+ gap: 6px;
533
+ padding: 0.75rem;
534
+ background: rgba(215, 58, 73, 0.08);
535
+ border: 1px dashed #d73a49;
536
+ border-radius: 8px;
537
+ font-size: 0.9rem;
538
+ color: #d73a49;
539
+ `,R9=Xe.span.attrs({className:"latex-block-error-title"})`
540
+ font-weight: 600;
541
+ `,P9=Xe.code.attrs({className:"latex-block-error-formula"})`
542
+ font-size: 0.85rem;
543
+ color: #d73a49;
544
+ overflow-x: auto;
545
+ `,z9=({attributes:e,formula:t,styles:r})=>{var a;const n=At(()=>(t||"").trim(),[t]),o=(a=r==null?void 0:r.text)==null?void 0:a.color;return n?K.jsx(M9,{...e,$textColor:o,children:K.jsx(M2.BlockMath,{math:n,errorColor:"#d73a49",renderError:l=>K.jsxs(I9,{children:[K.jsx(R9,{children:"\u516C\u5F0F\u6E32\u67D3\u5931\u8D25"}),K.jsx(P9,{children:n}),K.jsx("span",{children:l==null?void 0:l.message})]})})}):null};/**
546
+ * @license lucide-react v0.456.0 - ISC
547
+ *
548
+ * This source code is licensed under the ISC license.
549
+ * See the LICENSE file in the root directory of this source tree.
550
+ */const _9=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),I2=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
551
+ * @license lucide-react v0.456.0 - ISC
552
+ *
553
+ * This source code is licensed under the ISC license.
554
+ * See the LICENSE file in the root directory of this source tree.
555
+ */var j9={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
556
+ * @license lucide-react v0.456.0 - ISC
557
+ *
558
+ * This source code is licensed under the ISC license.
559
+ * See the LICENSE file in the root directory of this source tree.
560
+ */const L9=_o(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:a,iconNode:l,...u},f)=>As("svg",{ref:f,...j9,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:I2("lucide",o),...u},[...l.map(([d,m])=>As(d,m)),...Array.isArray(a)?a:[a]]));/**
561
+ * @license lucide-react v0.456.0 - ISC
562
+ *
563
+ * This source code is licensed under the ISC license.
564
+ * See the LICENSE file in the root directory of this source tree.
565
+ */const Wr=(e,t)=>{const r=_o(({className:n,...o},a)=>As(L9,{ref:a,iconNode:t,className:I2(`lucide-${_9(e)}`,n),...o}));return r.displayName=`${e}`,r};/**
566
+ * @license lucide-react v0.456.0 - ISC
567
+ *
568
+ * This source code is licensed under the ISC license.
569
+ * See the LICENSE file in the root directory of this source tree.
570
+ */const H9=Wr("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
571
+ * @license lucide-react v0.456.0 - ISC
572
+ *
573
+ * This source code is licensed under the ISC license.
574
+ * See the LICENSE file in the root directory of this source tree.
575
+ */const ni=Wr("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
576
+ * @license lucide-react v0.456.0 - ISC
577
+ *
578
+ * This source code is licensed under the ISC license.
579
+ * See the LICENSE file in the root directory of this source tree.
580
+ */const K9=Wr("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
581
+ * @license lucide-react v0.456.0 - ISC
582
+ *
583
+ * This source code is licensed under the ISC license.
584
+ * See the LICENSE file in the root directory of this source tree.
585
+ */const oi=Wr("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
586
+ * @license lucide-react v0.456.0 - ISC
587
+ *
588
+ * This source code is licensed under the ISC license.
589
+ * See the LICENSE file in the root directory of this source tree.
590
+ */Wr("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
591
+ * @license lucide-react v0.456.0 - ISC
592
+ *
593
+ * This source code is licensed under the ISC license.
594
+ * See the LICENSE file in the root directory of this source tree.
595
+ */const R2=Wr("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
596
+ * @license lucide-react v0.456.0 - ISC
597
+ *
598
+ * This source code is licensed under the ISC license.
599
+ * See the LICENSE file in the root directory of this source tree.
600
+ */const q9=Wr("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
601
+ * @license lucide-react v0.456.0 - ISC
602
+ *
603
+ * This source code is licensed under the ISC license.
604
+ * See the LICENSE file in the root directory of this source tree.
605
+ */const V9=Wr("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
606
+ * @license lucide-react v0.456.0 - ISC
607
+ *
608
+ * This source code is licensed under the ISC license.
609
+ * See the LICENSE file in the root directory of this source tree.
610
+ */const W9=Wr("FileSearch",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]]);/**
611
+ * @license lucide-react v0.456.0 - ISC
612
+ *
613
+ * This source code is licensed under the ISC license.
614
+ * See the LICENSE file in the root directory of this source tree.
615
+ */const U9=Wr("MessageSquareDot",[["path",{d:"M11.7 3H5a2 2 0 0 0-2 2v16l4-4h12a2 2 0 0 0 2-2v-2.7",key:"uodpkb"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}]]);/**
616
+ * @license lucide-react v0.456.0 - ISC
617
+ *
618
+ * This source code is licensed under the ISC license.
619
+ * See the LICENSE file in the root directory of this source tree.
620
+ */Wr("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
621
+ * @license lucide-react v0.456.0 - ISC
622
+ *
623
+ * This source code is licensed under the ISC license.
624
+ * See the LICENSE file in the root directory of this source tree.
625
+ */const X9=Wr("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
626
+ * @license lucide-react v0.456.0 - ISC
627
+ *
628
+ * This source code is licensed under the ISC license.
629
+ * See the LICENSE file in the root directory of this source tree.
630
+ */const G9=Wr("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
631
+ * @license lucide-react v0.456.0 - ISC
632
+ *
633
+ * This source code is licensed under the ISC license.
634
+ * See the LICENSE file in the root directory of this source tree.
635
+ */const Y9=Wr("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
636
+ * @license lucide-react v0.456.0 - ISC
637
+ *
638
+ * This source code is licensed under the ISC license.
639
+ * See the LICENSE file in the root directory of this source tree.
640
+ */Wr("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
641
+ * @license lucide-react v0.456.0 - ISC
642
+ *
643
+ * This source code is licensed under the ISC license.
644
+ * See the LICENSE file in the root directory of this source tree.
645
+ */const Z9=Wr("Share",[["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["polyline",{points:"16 6 12 2 8 6",key:"m901s6"}],["line",{x1:"12",x2:"12",y1:"2",y2:"15",key:"1p0rca"}]]);/**
646
+ * @license lucide-react v0.456.0 - ISC
647
+ *
648
+ * This source code is licensed under the ISC license.
649
+ * See the LICENSE file in the root directory of this source tree.
650
+ */const J9=Wr("ThumbsDown",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
651
+ * @license lucide-react v0.456.0 - ISC
652
+ *
653
+ * This source code is licensed under the ISC license.
654
+ * See the LICENSE file in the root directory of this source tree.
655
+ */const Q9=Wr("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
656
+ * @license lucide-react v0.456.0 - ISC
657
+ *
658
+ * This source code is licensed under the ISC license.
659
+ * See the LICENSE file in the root directory of this source tree.
660
+ */const ek=Wr("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
661
+ * @license lucide-react v0.456.0 - ISC
662
+ *
663
+ * This source code is licensed under the ISC license.
664
+ * See the LICENSE file in the root directory of this source tree.
665
+ */const tk=Wr("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
666
+ * @license lucide-react v0.456.0 - ISC
667
+ *
668
+ * This source code is licensed under the ISC license.
669
+ * See the LICENSE file in the root directory of this source tree.
670
+ */Wr("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);const rk=Xe.div.attrs({className:"rtext-code-block-wrapper"})`
671
+ position: relative;
672
+ margin: 20px 0;
673
+ border-radius: 8px;
674
+ overflow: hidden;
675
+ border: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#e1e4e8"}};
676
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
677
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
678
+ transition: box-shadow 0.2s ease;
679
+
680
+ &:hover {
681
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
682
+ }
683
+ `,nk=Xe.div.attrs({className:"rtext-code-block-language"})`
684
+ display: flex;
685
+ align-items: center;
686
+ justify-content: space-between;
687
+ padding: 10px 16px;
688
+ background: ${e=>{var r;const t=((r=e.theme)==null?void 0:r.disabledBackground)||"#f6f8fa";return t==="#f6f8fa"||t.includes("f6f8fa")?"#f0f2f5":t==="#ffffff"||t.includes("ffffff")?"#f6f8fa":t}};
689
+ border-bottom: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#e1e4e8"}};
690
+ font-size: 11px;
691
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#656d76"}};
692
+ font-weight: 600;
693
+ letter-spacing: 0.5px;
694
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
695
+
696
+ span:first-child {
697
+ opacity: 0.85;
698
+ font-variant: small-caps;
699
+ }
700
+ `,ok=Xe.pre.attrs({className:"rtext-simple-code-block"})`
701
+ margin: 16px 0;
702
+ padding: 12px 16px;
703
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
704
+ border: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#e1e4e8"}};
705
+ border-radius: 6px;
706
+ overflow-x: auto;
707
+ font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Source Code Pro', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
708
+ font-size: 13px;
709
+ line-height: 1.6;
710
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
711
+
712
+ code {
713
+ background: transparent;
714
+ padding: 0;
715
+ color: inherit;
716
+ font-size: inherit;
717
+ font-family: inherit;
718
+ white-space: pre;
719
+ }
720
+ `,ak=Xe.pre.attrs({className:"rtext-code-block-container"})`
721
+ margin: 0 !important;
722
+ border: none !important;
723
+ padding: 16px 20px;
724
+ overflow-x: auto;
725
+ background: ${e=>{var r;const t=((r=e.theme)==null?void 0:r.disabledBackground)||"#f6f8fa";return t==="#f6f8fa"||t.includes("f6f8fa")||t.includes("f0f2f5")||t==="#ffffff"||t.includes("ffffff")?"#ffffff":t}};
726
+ font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Source Code Pro', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
727
+ font-size: 13px;
728
+ line-height: 1.7;
729
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
730
+ tab-size: 2;
731
+ -webkit-font-smoothing: antialiased;
732
+ -moz-osx-font-smoothing: grayscale;
733
+
734
+ /* 美化滚动条 */
735
+ &::-webkit-scrollbar {
736
+ height: 8px;
737
+ }
738
+
739
+ &::-webkit-scrollbar-track {
740
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
741
+ }
742
+
743
+ &::-webkit-scrollbar-thumb {
744
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#c1c7cd"}};
745
+ border-radius: 4px;
746
+
747
+ &:hover {
748
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#8b949e"}};
749
+ }
750
+ }
751
+
752
+ code {
753
+ background: transparent;
754
+ padding: 0;
755
+ color: inherit;
756
+ font-size: inherit;
757
+ font-family: inherit;
758
+ white-space: pre;
759
+ }
760
+
761
+ /* 优化 PrismJS 高亮样式 - 参考 DeepSeek/飞书设计 */
762
+ .token.comment,
763
+ .token.prolog,
764
+ .token.doctype,
765
+ .token.cdata {
766
+ color: #6a737d;
767
+ font-style: italic;
768
+ }
769
+
770
+ .token.punctuation {
771
+ color: #24292f;
772
+ }
773
+
774
+ .token.property,
775
+ .token.tag,
776
+ .token.boolean,
777
+ .token.number,
778
+ .token.constant,
779
+ .token.symbol,
780
+ .token.deleted {
781
+ color: #005cc5;
782
+ }
783
+
784
+ .token.selector,
785
+ .token.attr-name,
786
+ .token.string,
787
+ .token.char,
788
+ .token.builtin,
789
+ .token.inserted {
790
+ color: #032f62;
791
+ }
792
+
793
+ .token.operator,
794
+ .token.entity,
795
+ .token.url,
796
+ .language-css .token.string,
797
+ .style .token.string {
798
+ color: #d73a49;
799
+ }
800
+
801
+ .token.atrule,
802
+ .token.attr-value,
803
+ .token.keyword {
804
+ color: #d73a49;
805
+ }
806
+
807
+ .token.function,
808
+ .token.class-name {
809
+ color: #6f42c1;
810
+ }
811
+
812
+ .token.regex,
813
+ .token.important,
814
+ .token.variable {
815
+ color: #e36209;
816
+ }
817
+ `,ik=Xe.button.attrs({className:"rtext-code-block-copy-btn"})`
818
+ display: inline-flex;
819
+ align-items: center;
820
+ justify-content: center;
821
+ gap: 5px;
822
+ padding: 5px 10px;
823
+ background: ${e=>e.$error?"#d73a49":e.$copied?"#2da44e":"transparent"};
824
+ border: 1px solid ${e=>{var t;return e.$error?"#d73a49":e.$copied?"#2da44e":((t=e.theme)==null?void 0:t.borderColor)||"#d0d7de"}};
825
+ border-radius: 5px;
826
+ color: ${e=>{var t;return e.$error||e.$copied?"#ffffff":((t=e.theme)==null?void 0:t.textColor)||"#57606a"}};
827
+ cursor: pointer;
828
+ font-size: 12px;
829
+ font-weight: 500;
830
+ transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
831
+ min-width: 64px;
832
+ height: 28px;
833
+ user-select: none;
834
+
835
+ &:hover {
836
+ background: ${e=>{var t;return e.$error?"#b6232f":e.$copied?"#28a745":((t=e.theme)==null?void 0:t.hoverBackground)||"rgba(0, 0, 0, 0.05)"}};
837
+ border-color: ${e=>{var t;return e.$error?"#b6232f":e.$copied?"#28a745":((t=e.theme)==null?void 0:t.textColor)||"#8b949e"}};
838
+ transform: translateY(-1px);
839
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
840
+ }
841
+
842
+ &:active {
843
+ transform: translateY(0);
844
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
845
+ }
846
+
847
+ svg {
848
+ width: 14px;
849
+ height: 14px;
850
+ flex-shrink: 0;
851
+ }
852
+
853
+ span {
854
+ white-space: nowrap;
855
+ }
856
+ `,sk=({attributes:e,language:t,children:r,styles:n,codeText:o,enablePrism:a=!1})=>{const l=Vt(null),[u,f]=Ht(!1),[d,m]=Ht(!1),g=At(()=>{if(o)return o;const C=S=>typeof S=="string"?S:typeof S=="number"?String(S):S==null?"":Array.isArray(S)?S.map(C).join(""):typeof S=="object"&&S!==null?"text"in S?String(S.text||""):We.isValidElement(S)?S.props&&S.props.children?C(S.props.children):"":"textContent"in S?String(S.textContent||""):"":"";return C(r)},[r,o]),v=At(()=>{if(!t)return;const C=t.toLowerCase();return C.startsWith("language-")?C.replace("language-",""):C},[t]);sr(()=>{l.current&&g&&(l.current.textContent=g)},[g]);const y=async()=>{if(g)try{await navigator.clipboard.writeText(g),f(!0),m(!1),setTimeout(()=>{f(!1)},2e3)}catch(C){console.error("Failed to copy code:",C),m(!0),f(!1),setTimeout(()=>{m(!1)},2e3)}},b=At(()=>(n==null?void 0:n.theme)||{},[n]);return a?K.jsxs(rk,{...e,theme:b,children:[K.jsxs(nk,{theme:b,children:[K.jsx("span",{children:v?v.toUpperCase():"CODE"}),K.jsx(ik,{theme:b,$copied:u,$error:d,onClick:y,title:u?"\u5DF2\u590D\u5236":d?"\u590D\u5236\u5931\u8D25":"\u590D\u5236\u4EE3\u7801",children:d?K.jsxs(K.Fragment,{children:[K.jsx(tk,{size:14}),K.jsx("span",{children:"\u5931\u8D25"})]}):u?K.jsxs(K.Fragment,{children:[K.jsx(H9,{size:14}),K.jsx("span",{children:"\u5DF2\u590D\u5236"})]}):K.jsxs(K.Fragment,{children:[K.jsx(R2,{size:14}),K.jsx("span",{children:"\u590D\u5236"})]})})]}),K.jsx(ak,{theme:b,children:K.jsx("code",{ref:l,className:v?`language-${v}`:"",children:g})})]}):K.jsx(ok,{...e,theme:b,children:K.jsx("code",{ref:l,children:g})})},lk=e=>{var a,l,u,f,d,m,g,v;const{styles:t}=e,{element:r,children:n,attributes:o}=e;switch(r.type){case"paragraph":return K.jsx("div",{...o,style:{letterSpacing:t==null?void 0:t.letterSpacing,lineHeight:t==null?void 0:t.lineHeight,color:`${(a=t==null?void 0:t.text)==null?void 0:a.color} !important`,margin:"0 0 0.75rem 0"},children:n});case"heading-one":return K.jsx("h1",{...o,style:{letterSpacing:t==null?void 0:t.letterSpacing,lineHeight:t==null?void 0:t.lineHeight,color:`${(l=t==null?void 0:t.text)==null?void 0:l.color} !important`},children:n});case"heading-two":return K.jsx("h2",{...o,style:{letterSpacing:t==null?void 0:t.letterSpacing,lineHeight:t==null?void 0:t.lineHeight,color:`${(u=t==null?void 0:t.text)==null?void 0:u.color} !important`},children:n});case"heading-three":return K.jsx("h3",{...o,style:{letterSpacing:t==null?void 0:t.letterSpacing,lineHeight:t==null?void 0:t.lineHeight,color:`${(f=t==null?void 0:t.text)==null?void 0:f.color} !important`},children:n});case"bulleted-list":return K.jsx("ul",{...o,children:n});case"numbered-list":return K.jsx("ol",{...o,children:n});case"list-item":return K.jsx("li",{...o,children:n});case"table":return K.jsx("div",{className:"table-container",children:K.jsx("table",{...o,children:K.jsx("tbody",{children:n})})});case"table-row":return K.jsx("tr",{...o,children:n});case"table-cell":return r.header?K.jsx("th",{...o,children:n}):K.jsx("td",{...o,children:n});case"block-quote":return K.jsx("blockquote",{...o,style:{letterSpacing:t==null?void 0:t.letterSpacing,lineHeight:t==null?void 0:t.lineHeight,color:`${(d=t==null?void 0:t.text)==null?void 0:d.color} !important`},children:n});case"code-block":const y=((m=r.children)==null?void 0:m.map(k=>k.text||"").join(""))||"",b=e&&typeof e.enablePrism=="boolean"?e.enablePrism:!1;return K.jsx(sk,{attributes:o,language:r.language,styles:t,codeText:y,enablePrism:b,children:n});case"think":const C=e.extraProps||{},p=C.isCollapsed!==void 0?C.isCollapsed:Object.values(C)[1]===!0,S={...C,isCollapsed:p};return K.jsx(C9,{attributes:o,styles:t,extraProps:S,children:n});case"template":return K.jsx(N2,{...o,element:r,children:n,styles:t});case"latex-inline":return K.jsx(O9,{attributes:o,formula:r.formula,styles:t});case"latex-block":return K.jsx(z9,{attributes:o,formula:r.formula,styles:t});case"retrieve-sql-data":const B=(k=>{if(!k)return null;try{const $=typeof k=="string"?JSON.parse(k):k;return{queryReplyPairList:[{reply:{databaseReference:Array.isArray($)?$[0]:$}}]}}catch($){return console.error("Failed to parse databaseReference:",$),null}})(((g=e.extraProps)==null?void 0:g.databaseReference)||e.databaseReference);return K.jsx(O2,{...o,element:r,children:n,styles:t,eventsEmit:e.eventsEmit,dataSource:B||void 0,tagIndex:1});case"image":return console.log("\u6E32\u67D3\u56FE\u7247\u5143\u7D20:",{url:r.url,alt:r.alt}),K.jsx("img",{...o,src:r.url,alt:r.alt||"",style:{maxWidth:"100%",height:"auto",borderRadius:"0.5rem",margin:"1rem 0",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",transition:"transform 0.2s ease-in-out",display:"block"},onError:k=>{const $=k.target;$.style.display="none",console.warn("\u56FE\u7247\u52A0\u8F7D\u5931\u8D25:",r.url)}});case"iframe":return console.log("\u6E32\u67D3iframe\u5143\u7D20:",{src:r.src,width:r.width,height:r.height}),K.jsx("iframe",{...o,src:r.src,width:r.width||"100%",height:r.height||"400",frameBorder:r.frameborder||"0",title:r.title||"",style:{width:r.width||"100%",height:r.height||"400px",border:"none",borderRadius:"0.5rem",margin:"1rem 0",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",display:"block"},onError:k=>{const $=k.target;$.style.display="none",console.warn("iframe\u52A0\u8F7D\u5931\u8D25:",r.src)}});default:return K.jsx("div",{...o,className:"mb-4",style:{letterSpacing:t==null?void 0:t.letterSpacing,lineHeight:t==null?void 0:t.lineHeight,color:`${(v=t==null?void 0:t.text)==null?void 0:v.color} !important`},children:n})}},uk=e=>{var l,u,f,d,m,g;const{attributes:t,children:r,leaf:n,styles:o}=e;(l=o==null?void 0:o.text)!=null&&l.color&&console.log("renderLeaf - \u63A5\u6536\u5230\u7684\u6587\u672C\u989C\u8272:",o.text.color);let a=r;if(n.retrive){const v=n.fromtype==="0",y=n.fromtype==="1",b=n.fromtype==="2",C=n.fromtype==="10",p=n.text||"";let S=p,B="#e6f7ff",k="#1890ff",$="#bae7ff";return v?(S=`${p}`,B="#e6f7ff",k="#1890ff",$="#bae7ff"):y?(S=`${p}`,B="#f6ffed",k="#52c41a",$="#d9f7be"):b?(S=`${p}`,B="#E7F8FB",k="#10BBD9",$="#E7F8FB"):C&&(S=`${p}`,B="#e6f7ff",k="#1890ff",$="#bae7ff"),a=K.jsx("span",{...t,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:B,color:k,minWidth:24,height:24,borderRadius:4,padding:"0 6px",margin:"0 2px",fontWeight:600,fontSize:10,lineHeight:"20px",cursor:"pointer",verticalAlign:"middle",boxSizing:"border-box"},onClick:()=>{e.onRetriveTagClick&&e.onRetriveTagClick(n,t)},onMouseEnter:T=>T.currentTarget.style.background=$,onMouseLeave:T=>T.currentTarget.style.background=B,children:S}),a}if(n.code)a=K.jsx("code",{...t,style:{color:`${(u=o==null?void 0:o.text)==null?void 0:u.color} !important`},children:a});else{const v=[n.bold&&"bold",n.italic&&"italic",n.underline&&"underline",n.strikethrough&&"strikethrough"].filter(Boolean).join(" "),y={color:`${(f=o==null?void 0:o.text)==null?void 0:f.color} !important`,fontSize:(d=o==null?void 0:o.text)==null?void 0:d.fontSize,lineHeight:(m=o==null?void 0:o.text)==null?void 0:m.lineHeight,letterSpacing:o==null?void 0:o.letterSpacing};a=K.jsx("span",{...t,className:v,style:y,children:a})}return n.link&&(a=K.jsx("a",{href:n.link,target:"_blank",rel:"noopener noreferrer",className:"link",style:{color:`${(g=o==null?void 0:o.text)==null?void 0:g.color} !important`},children:a})),a},Wu=Xe.div.attrs({className:"unified-rich-text-container"})`
857
+
858
+
859
+ & > * + * {
860
+ margin-top: ${e=>{var t;return((t=e.theme)==null?void 0:t.margin)||"0.5rem"}};
861
+ }
862
+
863
+ /* 标题样式 */
864
+ & h1 {
865
+ font-size: ${e=>e.$size==="sm"?"20px":"32px"};
866
+ font-weight: 600;
867
+ margin: 24px 0 16px 0;
868
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
869
+ border-bottom: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#d0d7de"}};
870
+ padding-bottom: 8px;
871
+ }
872
+
873
+ & h2 {
874
+ font-size: ${e=>e.$size==="sm"?"18px":"24px"};
875
+ font-weight: 600;
876
+ margin: 24px 0 16px 0;
877
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
878
+ border-bottom: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#d0d7de"}};
879
+ padding-bottom: 6px;
880
+ }
881
+
882
+ & h3 {
883
+ font-size: ${e=>e.$size==="sm"?"16px":"20px"};
884
+ font-weight: 600;
885
+ margin: 24px 0 16px 0;
886
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
887
+ }
888
+
889
+ /* 段落样式 */
890
+ & p {
891
+ font-size: ${e=>e.$size==="sm"?"14px":"16px"};
892
+ margin: 16px 0;
893
+ line-height: 1.6;
894
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
895
+ }
896
+
897
+ /* 列表样式 - GitHub 风格简约设计 */
898
+ & ul, & ol {
899
+ margin: 16px 0;
900
+ padding-left: 24px;
901
+ line-height: 1.6;
902
+ }
903
+
904
+ & ul {
905
+ list-style-type: disc;
906
+ }
907
+
908
+ & ol {
909
+ list-style-type: decimal;
910
+ }
911
+
912
+ & li {
913
+ margin: 4px 0;
914
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
915
+ }
916
+
917
+ /* 嵌套列表 */
918
+ & ul ul, & ol ol, & ul ol, & ol ul {
919
+ margin: 8px 0;
920
+ }
921
+
922
+ /* 引用块样式 */
923
+ & blockquote {
924
+ font-size: ${e=>e.$size==="sm"?"14px":"16px"};
925
+ border-left: 4px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#d0d7de"}};
926
+ padding: 0 16px;
927
+ margin: 16px 0;
928
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textSecondary)||"#656d76"}};
929
+ background-color: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
930
+ }
931
+
932
+ /* 行内代码样式 */
933
+ & code {
934
+ font-size: 0.875em;
935
+ background-color: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
936
+ padding: 0.125em 0.25em;
937
+ border-radius: 6px;
938
+ font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
939
+ color: #d73a49;
940
+ }
941
+
942
+ /* 代码块样式 */
943
+ & pre {
944
+ background-color: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
945
+ padding: 16px;
946
+ border-radius: 6px;
947
+ overflow-x: auto;
948
+ margin: 16px 0;
949
+ border: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#d0d7de"}};
950
+ }
951
+
952
+ & pre code {
953
+ background-color: transparent;
954
+ padding: 0;
955
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
956
+ }
957
+
958
+ /* 表格容器样式 */
959
+ & .table-container {
960
+ overflow: auto;
961
+ border: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#e5e7eb"}};
962
+ border-radius: 6px;
963
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.backgroundColor)||"transparent"}};
964
+ margin: 16px 0;
965
+ }
966
+
967
+ /* 表格样式 */
968
+ & .table-container table,
969
+ & table {
970
+ width: 100%;
971
+ border-collapse: collapse;
972
+ border: none;
973
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.backgroundColor)||"transparent"}};
974
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
975
+ }
976
+
977
+ & .table-container th,
978
+ & .table-container td,
979
+ & th, & td {
980
+ border: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#e5e7eb"}};
981
+ padding: 8px 12px;
982
+ text-align: left;
983
+ }
984
+
985
+ & .table-container th,
986
+ & th {
987
+ background-color: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
988
+ font-weight: 600;
989
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
990
+ }
991
+
992
+ & .table-container tr:nth-child(even) td,
993
+ & tr:nth-child(even) {
994
+ background-color: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
995
+ }
996
+
997
+ & .table-container td,
998
+ & td {
999
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
1000
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.backgroundColor)||"transparent"}};
1001
+ }
1002
+
1003
+ /* 图片样式 */
1004
+ & img {
1005
+ max-width: 100%;
1006
+ height: auto;
1007
+ border-radius: 6px;
1008
+ margin: 16px 0;
1009
+ }
1010
+
1011
+ /* 链接样式 */
1012
+ & a {
1013
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.primaryColor)||"#0969da"}};
1014
+ text-decoration: none;
1015
+
1016
+ &:hover {
1017
+ text-decoration: underline;
1018
+ }
1019
+ }
1020
+
1021
+ /* 文本样式 */
1022
+ & strong {
1023
+ font-weight: 600;
1024
+ }
1025
+
1026
+ & em {
1027
+ font-style: italic;
1028
+ }
1029
+
1030
+ & u {
1031
+ text-decoration: underline;
1032
+ }
1033
+
1034
+ & s {
1035
+ text-decoration: line-through;
1036
+ }
1037
+
1038
+ /* 分割线样式 */
1039
+ & hr {
1040
+ border: none;
1041
+ border-top: 1px solid #d0d7de;
1042
+ margin: 24px 0;
1043
+ }
1044
+
1045
+ /* 思考容器样式 */
1046
+ & .think-container {
1047
+
1048
+
1049
+ }
1050
+
1051
+ & .think-header {
1052
+
1053
+ }
1054
+
1055
+ & .think-icon {
1056
+ display: inline-flex;
1057
+ align-items: center;
1058
+ justify-content: center;
1059
+
1060
+ &.is-spinning {
1061
+ animation: rtext-think-spin 1s linear infinite;
1062
+ }
1063
+ }
1064
+
1065
+ @keyframes rtext-think-spin {
1066
+ from {
1067
+ transform: rotate(0deg);
1068
+ }
1069
+ to {
1070
+ transform: rotate(360deg);
1071
+ }
1072
+ }
1073
+
1074
+ & .think-title {
1075
+ font-weight: 600;
1076
+ color: #24292f;
1077
+ font-size: 14px;
1078
+ }
1079
+
1080
+ & .think-text {
1081
+ color: #86909C;
1082
+ font-size: 14px;
1083
+ line-height: 1.6;
1084
+ }
1085
+
1086
+ /* 召回标签样式 */
1087
+ & .retrive-tag {
1088
+ display: inline-block;
1089
+ background: #e6f7ff;
1090
+ color: #1890ff;
1091
+ border: 1px solid rgba(114, 187, 255, 0.3);
1092
+ border-radius: 6px;
1093
+ padding: 2px 6px;
1094
+ margin: 0 2px;
1095
+ font-weight: 500;
1096
+ font-size: 12px;
1097
+ line-height: 1.4;
1098
+ cursor: pointer;
1099
+ vertical-align: middle;
1100
+ transition: background-color 0.2s ease;
1101
+ }
1102
+
1103
+ & .retrive-tag:hover {
1104
+ background: #bae7ff;
1105
+ }
1106
+ `;/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */const{entries:P2,setPrototypeOf:xm,isFrozen:ck,getPrototypeOf:dk,getOwnPropertyDescriptor:fk}=Object;let{freeze:vn,seal:_n,create:Q0}=Object,{apply:ec,construct:tc}=typeof Reflect<"u"&&Reflect;vn||(vn=function(e){return e});_n||(_n=function(e){return e});ec||(ec=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];return e.apply(t,n)});tc||(tc=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return new e(...r)});const ls=bn(Array.prototype.forEach),hk=bn(Array.prototype.lastIndexOf),wm=bn(Array.prototype.pop),Ga=bn(Array.prototype.push),pk=bn(Array.prototype.splice),Es=bn(String.prototype.toLowerCase),Uu=bn(String.prototype.toString),Xu=bn(String.prototype.match),Ya=bn(String.prototype.replace),mk=bn(String.prototype.indexOf),gk=bn(String.prototype.trim),Kn=bn(Object.prototype.hasOwnProperty),pn=bn(RegExp.prototype.test),Za=vk(TypeError);function bn(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return ec(e,t,n)}}function vk(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return tc(e,r)}}function ar(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Es;xm&&xm(e,null);let n=t.length;for(;n--;){let o=t[n];if(typeof o=="string"){const a=r(o);a!==o&&(ck(t)||(t[n]=a),o=a)}e[o]=!0}return e}function bk(e){for(let t=0;t<e.length;t++)Kn(e,t)||(e[t]=null);return e}function ho(e){const t=Q0(null);for(const[r,n]of P2(e))Kn(e,r)&&(Array.isArray(n)?t[r]=bk(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=ho(n):t[r]=n);return t}function Ja(e,t){for(;e!==null;){const n=fk(e,t);if(n){if(n.get)return bn(n.get);if(typeof n.value=="function")return bn(n.value)}e=dk(e)}function r(){return null}return r}const Cm=vn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Gu=vn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Yu=vn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),yk=vn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Zu=vn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),xk=vn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Dm=vn(["#text"]),km=vn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ju=vn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Em=vn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),us=vn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),wk=_n(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ck=_n(/<%[\w\W]*|[\w\W]*%>/gm),Dk=_n(/\$\{[\w\W]*/gm),kk=_n(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ek=_n(/^aria-[\-\w]+$/),z2=_n(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Sk=_n(/^(?:\w+script|data):/i),Ak=_n(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_2=_n(/^html$/i),Bk=_n(/^[a-z][.\w]*(-[.\w]+)+$/i);var Sm=Object.freeze({__proto__:null,ARIA_ATTR:Ek,ATTR_WHITESPACE:Ak,CUSTOM_ELEMENT:Bk,DATA_ATTR:kk,DOCTYPE_NAME:_2,ERB_EXPR:Ck,IS_ALLOWED_URI:z2,IS_SCRIPT_OR_DATA:Sk,MUSTACHE_EXPR:wk,TMPLIT_EXPR:Dk});const Qa={element:1,text:3,progressingInstruction:7,comment:8,document:9},Fk=function(){return typeof window>"u"?null:window},Tk=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Am=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function j2(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Fk();const t=ne=>j2(ne);if(t.version="3.3.0",t.removed=[],!e||!e.document||e.document.nodeType!==Qa.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const n=r,o=n.currentScript,{DocumentFragment:a,HTMLTemplateElement:l,Node:u,Element:f,NodeFilter:d,NamedNodeMap:m=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:g,DOMParser:v,trustedTypes:y}=e,b=f.prototype,C=Ja(b,"cloneNode"),p=Ja(b,"remove"),S=Ja(b,"nextSibling"),B=Ja(b,"childNodes"),k=Ja(b,"parentNode");if(typeof l=="function"){const ne=r.createElement("template");ne.content&&ne.content.ownerDocument&&(r=ne.content.ownerDocument)}let $,T="";const{implementation:O,createNodeIterator:F,createDocumentFragment:P,getElementsByTagName:N}=r,{importNode:q}=n;let R=Am();t.isSupported=typeof P2=="function"&&typeof k=="function"&&O&&O.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:X,ERB_EXPR:G,TMPLIT_EXPR:_,DATA_ATTR:j,ARIA_ATTR:W,IS_SCRIPT_OR_DATA:U,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:V}=Sm;let{IS_ALLOWED_URI:Y}=Sm,fe=null;const be=ar({},[...Cm,...Gu,...Yu,...Zu,...Dm]);let he=null;const De=ar({},[...km,...Ju,...Em,...us]);let $e=Object.seal(Q0(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Z=null,ie=null;const le=Object.seal(Q0(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ue=!0,Se=!0,Be=!1,ge=!0,Ee=!1,Ae=!0,Fe=!1,xe=!1,Ce=!1,_e=!1,ht=!1,ot=!1,Ie=!0,Ke=!1;const Ue="user-content-";let vt=!0,tt=!1,nt={},It=null;const $t=ar({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Bt=null;const Mt=ar({},["audio","video","img","source","image","track"]);let je=null;const pe=ar({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),it="http://www.w3.org/1998/Math/MathML",Nt="http://www.w3.org/2000/svg",Ft="http://www.w3.org/1999/xhtml";let yt=Ft,Rt=!1,St=null;const Kt=ar({},[it,Nt,Ft],Uu);let tr=ar({},["mi","mo","mn","ms","mtext"]),lr=ar({},["annotation-xml"]);const _t=ar({},["title","style","font","a","script"]);let Er=null;const Cr=["application/xhtml+xml","text/html"],Zr="text/html";let Ut=null,Sr=null;const zr=r.createElement("form"),cr=function(ne){return ne instanceof RegExp||ne instanceof Function},ir=function(){let ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Sr&&Sr===ne)){if((!ne||typeof ne!="object")&&(ne={}),ne=ho(ne),Er=Cr.indexOf(ne.PARSER_MEDIA_TYPE)===-1?Zr:ne.PARSER_MEDIA_TYPE,Ut=Er==="application/xhtml+xml"?Uu:Es,fe=Kn(ne,"ALLOWED_TAGS")?ar({},ne.ALLOWED_TAGS,Ut):be,he=Kn(ne,"ALLOWED_ATTR")?ar({},ne.ALLOWED_ATTR,Ut):De,St=Kn(ne,"ALLOWED_NAMESPACES")?ar({},ne.ALLOWED_NAMESPACES,Uu):Kt,je=Kn(ne,"ADD_URI_SAFE_ATTR")?ar(ho(pe),ne.ADD_URI_SAFE_ATTR,Ut):pe,Bt=Kn(ne,"ADD_DATA_URI_TAGS")?ar(ho(Mt),ne.ADD_DATA_URI_TAGS,Ut):Mt,It=Kn(ne,"FORBID_CONTENTS")?ar({},ne.FORBID_CONTENTS,Ut):$t,Z=Kn(ne,"FORBID_TAGS")?ar({},ne.FORBID_TAGS,Ut):ho({}),ie=Kn(ne,"FORBID_ATTR")?ar({},ne.FORBID_ATTR,Ut):ho({}),nt=Kn(ne,"USE_PROFILES")?ne.USE_PROFILES:!1,ue=ne.ALLOW_ARIA_ATTR!==!1,Se=ne.ALLOW_DATA_ATTR!==!1,Be=ne.ALLOW_UNKNOWN_PROTOCOLS||!1,ge=ne.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ee=ne.SAFE_FOR_TEMPLATES||!1,Ae=ne.SAFE_FOR_XML!==!1,Fe=ne.WHOLE_DOCUMENT||!1,_e=ne.RETURN_DOM||!1,ht=ne.RETURN_DOM_FRAGMENT||!1,ot=ne.RETURN_TRUSTED_TYPE||!1,Ce=ne.FORCE_BODY||!1,Ie=ne.SANITIZE_DOM!==!1,Ke=ne.SANITIZE_NAMED_PROPS||!1,vt=ne.KEEP_CONTENT!==!1,tt=ne.IN_PLACE||!1,Y=ne.ALLOWED_URI_REGEXP||z2,yt=ne.NAMESPACE||Ft,tr=ne.MATHML_TEXT_INTEGRATION_POINTS||tr,lr=ne.HTML_INTEGRATION_POINTS||lr,$e=ne.CUSTOM_ELEMENT_HANDLING||{},ne.CUSTOM_ELEMENT_HANDLING&&cr(ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($e.tagNameCheck=ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ne.CUSTOM_ELEMENT_HANDLING&&cr(ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($e.attributeNameCheck=ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ne.CUSTOM_ELEMENT_HANDLING&&typeof ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&($e.allowCustomizedBuiltInElements=ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ee&&(Se=!1),ht&&(_e=!0),nt&&(fe=ar({},Dm),he=[],nt.html===!0&&(ar(fe,Cm),ar(he,km)),nt.svg===!0&&(ar(fe,Gu),ar(he,Ju),ar(he,us)),nt.svgFilters===!0&&(ar(fe,Yu),ar(he,Ju),ar(he,us)),nt.mathMl===!0&&(ar(fe,Zu),ar(he,Em),ar(he,us))),ne.ADD_TAGS&&(typeof ne.ADD_TAGS=="function"?le.tagCheck=ne.ADD_TAGS:(fe===be&&(fe=ho(fe)),ar(fe,ne.ADD_TAGS,Ut))),ne.ADD_ATTR&&(typeof ne.ADD_ATTR=="function"?le.attributeCheck=ne.ADD_ATTR:(he===De&&(he=ho(he)),ar(he,ne.ADD_ATTR,Ut))),ne.ADD_URI_SAFE_ATTR&&ar(je,ne.ADD_URI_SAFE_ATTR,Ut),ne.FORBID_CONTENTS&&(It===$t&&(It=ho(It)),ar(It,ne.FORBID_CONTENTS,Ut)),vt&&(fe["#text"]=!0),Fe&&ar(fe,["html","head","body"]),fe.table&&(ar(fe,["tbody"]),delete Z.tbody),ne.TRUSTED_TYPES_POLICY){if(typeof ne.TRUSTED_TYPES_POLICY.createHTML!="function")throw Za('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ne.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Za('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');$=ne.TRUSTED_TYPES_POLICY,T=$.createHTML("")}else $===void 0&&($=Tk(y,o)),$!==null&&typeof T=="string"&&(T=$.createHTML(""));vn&&vn(ne),Sr=ne}},Ot=ar({},[...Gu,...Yu,...yk]),w=ar({},[...Zu,...xk]),E=function(ne){let Q=k(ne);(!Q||!Q.tagName)&&(Q={namespaceURI:yt,tagName:"template"});const Je=Es(ne.tagName),lt=Es(Q.tagName);return St[ne.namespaceURI]?ne.namespaceURI===Nt?Q.namespaceURI===Ft?Je==="svg":Q.namespaceURI===it?Je==="svg"&&(lt==="annotation-xml"||tr[lt]):!!Ot[Je]:ne.namespaceURI===it?Q.namespaceURI===Ft?Je==="math":Q.namespaceURI===Nt?Je==="math"&&lr[lt]:!!w[Je]:ne.namespaceURI===Ft?Q.namespaceURI===Nt&&!lr[lt]||Q.namespaceURI===it&&!tr[lt]?!1:!w[Je]&&(_t[Je]||!Ot[Je]):!!(Er==="application/xhtml+xml"&&St[ne.namespaceURI]):!1},ze=function(ne){Ga(t.removed,{element:ne});try{k(ne).removeChild(ne)}catch{p(ne)}},I=function(ne,Q){try{Ga(t.removed,{attribute:Q.getAttributeNode(ne),from:Q})}catch{Ga(t.removed,{attribute:null,from:Q})}if(Q.removeAttribute(ne),ne==="is")if(_e||ht)try{ze(Q)}catch{}else try{Q.setAttribute(ne,"")}catch{}},re=function(ne){let Q=null,Je=null;if(Ce)ne="<remove></remove>"+ne;else{const Lt=Xu(ne,/^[\r\n\t ]+/);Je=Lt&&Lt[0]}Er==="application/xhtml+xml"&&yt===Ft&&(ne='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ne+"</body></html>");const lt=$?$.createHTML(ne):ne;if(yt===Ft)try{Q=new v().parseFromString(lt,Er)}catch{}if(!Q||!Q.documentElement){Q=O.createDocument(yt,"template",null);try{Q.documentElement.innerHTML=Rt?T:lt}catch{}}const mr=Q.body||Q.documentElement;return ne&&Je&&mr.insertBefore(r.createTextNode(Je),mr.childNodes[0]||null),yt===Ft?N.call(Q,Fe?"html":"body")[0]:Fe?Q.documentElement:mr},rr=function(ne){return F.call(ne.ownerDocument||ne,ne,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},pt=function(ne){return ne instanceof g&&(typeof ne.nodeName!="string"||typeof ne.textContent!="string"||typeof ne.removeChild!="function"||!(ne.attributes instanceof m)||typeof ne.removeAttribute!="function"||typeof ne.setAttribute!="function"||typeof ne.namespaceURI!="string"||typeof ne.insertBefore!="function"||typeof ne.hasChildNodes!="function")},wt=function(ne){return typeof u=="function"&&ne instanceof u};function xt(ne,Q,Je){ls(ne,lt=>{lt.call(t,Q,Je,Sr)})}const st=function(ne){let Q=null;if(xt(R.beforeSanitizeElements,ne,null),pt(ne))return ze(ne),!0;const Je=Ut(ne.nodeName);if(xt(R.uponSanitizeElement,ne,{tagName:Je,allowedTags:fe}),Ae&&ne.hasChildNodes()&&!wt(ne.firstElementChild)&&pn(/<[/\w!]/g,ne.innerHTML)&&pn(/<[/\w!]/g,ne.textContent)||ne.nodeType===Qa.progressingInstruction||Ae&&ne.nodeType===Qa.comment&&pn(/<[/\w]/g,ne.data))return ze(ne),!0;if(!(le.tagCheck instanceof Function&&le.tagCheck(Je))&&(!fe[Je]||Z[Je])){if(!Z[Je]&&Jt(Je)&&($e.tagNameCheck instanceof RegExp&&pn($e.tagNameCheck,Je)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(Je)))return!1;if(vt&&!It[Je]){const lt=k(ne)||ne.parentNode,mr=B(ne)||ne.childNodes;if(mr&&lt){const Lt=mr.length;for(let bt=Lt-1;bt>=0;--bt){const Mr=C(mr[bt],!0);Mr.__removalCount=(ne.__removalCount||0)+1,lt.insertBefore(Mr,S(ne))}}}return ze(ne),!0}return ne instanceof f&&!E(ne)||(Je==="noscript"||Je==="noembed"||Je==="noframes")&&pn(/<\/no(script|embed|frames)/i,ne.innerHTML)?(ze(ne),!0):(Ee&&ne.nodeType===Qa.text&&(Q=ne.textContent,ls([X,G,_],lt=>{Q=Ya(Q,lt," ")}),ne.textContent!==Q&&(Ga(t.removed,{element:ne.cloneNode()}),ne.textContent=Q)),xt(R.afterSanitizeElements,ne,null),!1)},jt=function(ne,Q,Je){if(Ie&&(Q==="id"||Q==="name")&&(Je in r||Je in zr))return!1;if(!(Se&&!ie[Q]&&pn(j,Q))&&!(ue&&pn(W,Q))&&!(le.attributeCheck instanceof Function&&le.attributeCheck(Q,ne))){if(!he[Q]||ie[Q]){if(!(Jt(ne)&&($e.tagNameCheck instanceof RegExp&&pn($e.tagNameCheck,ne)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(ne))&&($e.attributeNameCheck instanceof RegExp&&pn($e.attributeNameCheck,Q)||$e.attributeNameCheck instanceof Function&&$e.attributeNameCheck(Q,ne))||Q==="is"&&$e.allowCustomizedBuiltInElements&&($e.tagNameCheck instanceof RegExp&&pn($e.tagNameCheck,Je)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(Je))))return!1}else if(!je[Q]&&!pn(Y,Ya(Je,ee,""))&&!((Q==="src"||Q==="xlink:href"||Q==="href")&&ne!=="script"&&mk(Je,"data:")===0&&Bt[ne])&&!(Be&&!pn(U,Ya(Je,ee,"")))&&Je)return!1}return!0},Jt=function(ne){return ne!=="annotation-xml"&&Xu(ne,V)},yr=function(ne){xt(R.beforeSanitizeAttributes,ne,null);const{attributes:Q}=ne;if(!Q||pt(ne))return;const Je={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:he,forceKeepAttr:void 0};let lt=Q.length;for(;lt--;){const mr=Q[lt],{name:Lt,namespaceURI:bt,value:Mr}=mr,Lr=Ut(Lt),Sn=Mr;let Fr=Lt==="value"?Sn:gk(Sn);if(Je.attrName=Lr,Je.attrValue=Fr,Je.keepAttr=!0,Je.forceKeepAttr=void 0,xt(R.uponSanitizeAttribute,ne,Je),Fr=Je.attrValue,Ke&&(Lr==="id"||Lr==="name")&&(I(Lt,ne),Fr=Ue+Fr),Ae&&pn(/((--!?|])>)|<\/(style|title|textarea)/i,Fr)){I(Lt,ne);continue}if(Lr==="attributename"&&Xu(Fr,"href")){I(Lt,ne);continue}if(Je.forceKeepAttr)continue;if(!Je.keepAttr){I(Lt,ne);continue}if(!ge&&pn(/\/>/i,Fr)){I(Lt,ne);continue}Ee&&ls([X,G,_],oe=>{Fr=Ya(Fr,oe," ")});const nn=Ut(ne.nodeName);if(!jt(nn,Lr,Fr)){I(Lt,ne);continue}if($&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!bt)switch(y.getAttributeType(nn,Lr)){case"TrustedHTML":{Fr=$.createHTML(Fr);break}case"TrustedScriptURL":{Fr=$.createScriptURL(Fr);break}}if(Fr!==Sn)try{bt?ne.setAttributeNS(bt,Lt,Fr):ne.setAttribute(Lt,Fr),pt(ne)?ze(ne):wm(t.removed)}catch{I(Lt,ne)}}xt(R.afterSanitizeAttributes,ne,null)},te=function ne(Q){let Je=null;const lt=rr(Q);for(xt(R.beforeSanitizeShadowDOM,Q,null);Je=lt.nextNode();)xt(R.uponSanitizeShadowNode,Je,null),st(Je),yr(Je),Je.content instanceof a&&ne(Je.content);xt(R.afterSanitizeShadowDOM,Q,null)};return t.sanitize=function(ne){let Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Je=null,lt=null,mr=null,Lt=null;if(Rt=!ne,Rt&&(ne="<!-->"),typeof ne!="string"&&!wt(ne))if(typeof ne.toString=="function"){if(ne=ne.toString(),typeof ne!="string")throw Za("dirty is not a string, aborting")}else throw Za("toString is not a function");if(!t.isSupported)return ne;if(xe||ir(Q),t.removed=[],typeof ne=="string"&&(tt=!1),tt){if(ne.nodeName){const Lr=Ut(ne.nodeName);if(!fe[Lr]||Z[Lr])throw Za("root node is forbidden and cannot be sanitized in-place")}}else if(ne instanceof u)Je=re("<!---->"),lt=Je.ownerDocument.importNode(ne,!0),lt.nodeType===Qa.element&&lt.nodeName==="BODY"||lt.nodeName==="HTML"?Je=lt:Je.appendChild(lt);else{if(!_e&&!Ee&&!Fe&&ne.indexOf("<")===-1)return $&&ot?$.createHTML(ne):ne;if(Je=re(ne),!Je)return _e?null:ot?T:""}Je&&Ce&&ze(Je.firstChild);const bt=rr(tt?ne:Je);for(;mr=bt.nextNode();)st(mr),yr(mr),mr.content instanceof a&&te(mr.content);if(tt)return ne;if(_e){if(ht)for(Lt=P.call(Je.ownerDocument);Je.firstChild;)Lt.appendChild(Je.firstChild);else Lt=Je;return(he.shadowroot||he.shadowrootmode)&&(Lt=q.call(n,Lt,!0)),Lt}let Mr=Fe?Je.outerHTML:Je.innerHTML;return Fe&&fe["!doctype"]&&Je.ownerDocument&&Je.ownerDocument.doctype&&Je.ownerDocument.doctype.name&&pn(_2,Je.ownerDocument.doctype.name)&&(Mr="<!DOCTYPE "+Je.ownerDocument.doctype.name+`>
1107
+ `+Mr),Ee&&ls([X,G,_],Lr=>{Mr=Ya(Mr,Lr," ")}),$&&ot?$.createHTML(Mr):Mr},t.setConfig=function(){let ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ir(ne),xe=!0},t.clearConfig=function(){Sr=null,xe=!1},t.isValidAttribute=function(ne,Q,Je){Sr||ir({});const lt=Ut(ne),mr=Ut(Q);return jt(lt,mr,Je)},t.addHook=function(ne,Q){typeof Q=="function"&&Ga(R[ne],Q)},t.removeHook=function(ne,Q){if(Q!==void 0){const Je=hk(R[ne],Q);return Je===-1?void 0:pk(R[ne],Je,1)[0]}return wm(R[ne])},t.removeHooks=function(ne){R[ne]=[]},t.removeAllHooks=function(){R=Am()},t}var $k=j2();function L2(e){return e.map(t=>!t.children||t.children.length===0?{...t,children:[{text:""}]}:{...t,children:t.children.map(r=>typeof r=="object"&&"type"in r?L2([r])[0]:r)})}const Bm="__rtext_escaped_dollar__",Nk=2e3;function el(e){if(!e)return"";try{return decodeURIComponent(e)}catch(t){return console.warn("Failed to decode LaTeX formula:",e,t),e}}function Ok(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Fm(e){return $k.sanitize(e,{ADD_TAGS:["retrive-tag","retrieve-sql-data","latex-inline","latex-block","think-block"],ADD_ATTR:["id","image_urls","fromType","data-formula","src","alt","width","height","frameborder","title","class","href"]})}function Tm(e,t){const r=(e||"").trim();return!(!r||r.length>Nk||t==="inline"&&/[\r\n]/.test(r)||/[<>]/.test(r)||/\[\/?retrive-tag/i.test(r)||/\*\*|__/.test(r)||!(/\\[a-zA-Z]+/.test(r)||/[_^]/.test(r)||/[{}]/.test(r)||/[=+\-*/]/.test(r)||/[0-9]/.test(r)))}function Mk(e){const t=new Map;let r=e||"";if(!r)return{content:r,placeholders:t};let n=0;r=r.replace(/\\\$/g,Bm);const o=(u,f)=>{const d=`RTEXT_LATEX_PLACEHOLDER_${n++}_${u.toUpperCase()}`;return t.set(d,{type:u,formula:(f||"").trim()}),d},a=/\$\$([\s\S]+?)\$\$/g;r=r.replace(a,(u,f)=>Tm(f,"block")?o("block",f):u);const l=new RegExp("(?<!\\\\)\\$(?!\\$)([^\\n\\r$]+?)(?<!\\\\)\\$(?!\\$)","g");return r=r.replace(l,(u,f)=>Tm(f,"inline")?o("inline",f):u),r=r.replace(new RegExp(Bm,"g"),"\\$"),{content:r,placeholders:t}}function Ik(e,t){if(!e||t.size===0)return e;let r=e;return t.forEach((n,o)=>{const a=n.type==="block"?"latex-block":"latex-inline",l=encodeURIComponent(n.formula),u=`<${a} data-formula="${l}"></${a}>`;r=r.replace(new RegExp(Ok(o),"g"),u)}),r}function H2(e,t){const r=(t==null?void 0:t.disabledTags)||[];console.log("\u{1F50D} deserializeMarkdown \u5F00\u59CB\u5904\u7406:",{markdownLength:e.length,basePath:t==null?void 0:t.basePath,hasImgTags:e.includes("<img"),hasMarkdownImages:e.includes("![")});function n(d){var m;if(d.indexOf("<think>")>-1)if(d.indexOf("</think>")>-1){const g=/<think>([\s\S]*?)<\/think>([\s\S]*)/s,v=d.match(g);return v?{thinkContent:v[1],content:v[2],finish:!0}:{thinkContent:"",content:d,finish:!0}}else{const g=/<think>(.*?)(?=<|\s*$)/s;return{thinkContent:((m=d.match(g))==null?void 0:m[1])||"",content:""}}else return{thinkContent:"",content:d}}const{thinkContent:o,content:a,finish:l}=n(e||"");let u=[],f=0;if(!r.includes("think")&&o){const d=o.split(/\n+/).map(m=>m.trim()).filter(Boolean).flatMap(m=>{if(/<retrive-tag/i.test(m)){const g=document.createElement("div");return g.innerHTML=Fm(m),$m(g,t==null?void 0:t.basePath)}else return[{type:"paragraph",children:[{text:m}]}]});u.push({type:"think",id:`think-${f++}`,thinkContent:o,finish:l,children:d})}if(a){const{content:d,placeholders:m}=Mk(a);let g=d;r.includes("retrive")||(g=g.replace(/\[retrive-tag([^\]]*)\]\[([^\]]+)\]\[\/retrive-tag\]/g,(b,C,p)=>`<retrive-tag${C?" "+C.trim():""}>${p}</retrive-tag>`)),r.includes("retrieve-sql-data")||(g=g.replace(/<retrieve-sql-data\s+id="([^"]+)"\s*\/?>/g,(b,C)=>`<retrieve-sql-data id="${C}"></retrieve-sql-data>`)),br.setOptions({gfm:!0,breaks:!0,pedantic:!1});const v=br(g);let y=typeof v=="string"?v:"";if(y=Ik(y,m),console.log("\u{1F4DD} marked \u89E3\u6790\u540E\u7684 HTML:",{htmlLength:y.length,hasImgTags:y.includes("<img"),basePath:t==null?void 0:t.basePath,htmlContent:y}),typeof v=="string"){const b=document.createElement("div");b.innerHTML=Fm(y),console.log("\u{1F527} \u521B\u5EFA DOM \u5143\u7D20\uFF0C\u51C6\u5907\u89E3\u6790:",{childNodesCount:b.childNodes.length,basePath:t==null?void 0:t.basePath,allElements:Array.from(b.querySelectorAll("*")).map(p=>p.tagName),imgElements:Array.from(b.querySelectorAll("img")).map(p=>({src:p.src,alt:p.alt}))});const C=$m(b,t==null?void 0:t.basePath);console.log("\u2705 deserializeHtmlNode \u89E3\u6790\u7ED3\u679C:",{partLength:C.length,hasImageElements:C.some(p=>p.type==="image")}),C&&C.length>0&&(u=u.concat(C))}}return!u||u.length===0?[{type:"paragraph",children:[{text:""}]}]:L2(u)}function $m(e,t){const r=[];return console.log("\u{1F3AF} deserializeHtmlNode \u5F00\u59CB\u89E3\u6790:",{nodeType:e.nodeType,nodeName:e.nodeName,basePath:t,childNodesCount:e.childNodes.length}),((n,o)=>(o.forEach(a=>{var l;if(a.nodeType===Node.ELEMENT_NODE){const u=a;switch(console.log("\u{1F50D} \u5904\u7406\u5143\u7D20\u8282\u70B9:",{tagName:u.tagName,isImg:u.tagName==="IMG",src:u.getAttribute("src"),basePath:t}),u.tagName.toLowerCase()){case"p":n.push({type:"paragraph",children:Jr(u,t)});break;case"h1":n.push({type:"heading-one",children:Jr(u,t)});break;case"h2":n.push({type:"heading-two",children:Jr(u,t)});break;case"h3":n.push({type:"heading-three",children:Jr(u,t)});break;case"ul":n.push({type:"bulleted-list",children:Array.from(u.children).map(d=>({type:"list-item",children:Jr(d)}))});break;case"ol":const f={type:"numbered-list",children:Array.from(u.children).map(d=>({type:"list-item",children:Jr(d)}))};n.push(f);break;case"li":n.push({type:"list-item",children:Jr(u,t)});break;case"pre":{const d=u.querySelector("code");let m;if(d){const g=(d.getAttribute("class")||"").match(/language-(\w+)/);g&&(m=g[1]),n.push({type:"code-block",language:m,children:Jr(d)})}else n.push({type:"code-block",language:m,children:Jr(u,t)});break}case"code":{u.closest("pre")||n.push({type:"paragraph",children:Jr(u,t)});break}case"retrive-tag":{const d=Jr(u,t);d.length>0&&n.push({type:"paragraph",children:d});break}case"retrieve-sql-data":{const d=u.getAttribute("id")||"";n.push({type:"retrieve-sql-data",id:d,children:[{text:""}]});break}case"blockquote":n.push({type:"block-quote",children:Jr(u,t)});break;case"table":n.push(Rk(u));break;case"img":{const d=u.getAttribute("src")||"",m=u.getAttribute("alt")||"";let g=d;if(t)if(d.startsWith("./"))g=d.replace(/^\.\//,t+"/");else if(d.startsWith("../")){const v=t.substring(0,t.lastIndexOf("/"));g=d.replace(/^\.\.\//,v+"/")}else!d.startsWith("/")&&!d.startsWith("http")&&(g=`${t}/${d}`);console.log("\u56FE\u7247\u8DEF\u5F84\u5904\u7406:",{src:d,basePath:t,processedSrc:g}),n.push({type:"image",url:g,alt:m,children:[{text:""}]});break}case"iframe":{const d=u.getAttribute("src")||"",m=u.getAttribute("width")||"100%",g=u.getAttribute("height")||"400",v=u.getAttribute("frameborder")||"0",y=u.getAttribute("title")||"";let b=d;if(t)if(d.startsWith("./"))b=d.replace(/^\.\//,t+"/");else if(d.startsWith("../")){const C=t.substring(0,t.lastIndexOf("/"));b=d.replace(/^\.\.\//,C+"/")}else!d.startsWith("/")&&!d.startsWith("http")&&(b=`${t}/${d}`);console.log("iframe\u8DEF\u5F84\u5904\u7406:",{src:d,basePath:t,processedSrc:b}),n.push({type:"iframe",src:b,width:m,height:g,frameborder:v,title:y,children:[{text:""}]});break}case"latex-inline":{const d=el(u.getAttribute("data-formula"));n.push({type:"latex-inline",formula:d,children:[{text:""}]});break}case"latex-block":{const d=el(u.getAttribute("data-formula"));n.push({type:"latex-block",formula:d,children:[{text:""}]});break}case"think-block":n.push({type:"think",children:Jr(u)});break;default:n.push({type:"paragraph",children:Jr(u,t)});break}}else a.nodeType===Node.TEXT_NODE&&((l=a.textContent)!=null&&l.trim())&&n.push({type:"paragraph",children:[{text:a.textContent}]})}),n))(r,e.childNodes),r}function Jr(e,t){const r=[];function n(a){const l=[];let u="",f=!1,d=!1,m=0;for(;m<a.length;)a.startsWith("**",m)?(u&&(l.push({text:u,code:!0,bold:f,italic:d}),u=""),f=!f,m+=2):a.startsWith("*",m)?(u&&(l.push({text:u,code:!0,bold:f,italic:d}),u=""),d=!d,m+=1):(u+=a[m],m+=1);return u&&l.push({text:u,code:!0,bold:f,italic:d}),l}function o(a,l={}){var u,f;if(a.nodeType===Node.TEXT_NODE){const d=(u=a.textContent)==null?void 0:u.trim();return d?l.code?n(d):[{text:d,...l}]:[]}if(a.nodeType===Node.ELEMENT_NODE){const d=a,m={...l};switch(d.tagName.toLowerCase()){case"em":case"i":m.italic=!0;break;case"strong":case"b":m.bold=!0;break;case"code":d.closest("pre")||(m.code=!0);break;case"del":case"s":m.strikethrough=!0;break;case"u":m.underline=!0;break;case"a":m.link=d.getAttribute("href")||void 0;break;case"br":return[{text:`
1108
+ `,...m}];case"retrive-tag":{const v={};for(const{name:C,value:p}of Array.from(d.attributes))v[C]=p;const y=d.textContent||""||"[0]",b=v.fromtype||v.fromType||"";return[{text:y,retrive:!0,...v,fromtype:b}]}case"retrieve-sql-data":return[{type:"retrieve-sql-data",id:d.getAttribute("id")||"",children:[{text:""}]}];case"img":{const v=d.getAttribute("src")||"",y=d.getAttribute("alt")||"";console.log("\u{1F50D} deserializeChildren \u5904\u7406\u5D4C\u5957\u56FE\u7247:",{src:v,alt:y,basePath:t});let b=v;if(t)if(v.startsWith("./"))b=v.replace(/^\.\//,t+"/");else if(v.startsWith("../")){const C=t.substring(0,t.lastIndexOf("/"));b=v.replace(/^\.\.\//,C+"/")}else!v.startsWith("/")&&!v.startsWith("http")&&(b=`${t}/${v}`);return console.log("\u{1F50D} deserializeChildren \u56FE\u7247\u8DEF\u5F84\u8F6C\u6362:",{src:v,processedSrc:b}),[{type:"image",url:b,alt:y,children:[{text:""}]}]}case"iframe":{const v=d.getAttribute("src")||"",y=d.getAttribute("width")||"100%",b=d.getAttribute("height")||"400",C=d.getAttribute("frameborder")||"0",p=d.getAttribute("title")||"";console.log("\u{1F50D} deserializeChildren \u5904\u7406\u5D4C\u5957iframe:",{src:v,width:y,height:b,basePath:t});let S=v;if(t)if(v.startsWith("./"))S=v.replace(/^\.\//,t+"/");else if(v.startsWith("../")){const B=t.substring(0,t.lastIndexOf("/"));S=v.replace(/^\.\.\//,B+"/")}else!v.startsWith("/")&&!v.startsWith("http")&&(S=`${t}/${v}`);return console.log("\u{1F50D} deserializeChildren iframe\u8DEF\u5F84\u8F6C\u6362:",{src:v,processedSrc:S}),[{type:"iframe",src:S,width:y,height:b,frameborder:C,title:p,children:[{text:""}]}]}case"latex-inline":return[{type:"latex-inline",formula:el(d.getAttribute("data-formula")),children:[{text:""}]}];case"latex-block":return[{type:"latex-block",formula:el(d.getAttribute("data-formula")),children:[{text:""}]}]}if(d.childNodes.length===0&&((f=d.textContent)!=null&&f.trim()))return m.code?n(d.textContent):[{text:d.textContent,...m}];let g=[];for(const v of Array.from(d.childNodes))g=g.concat(o(v,m));return g}return[]}for(const a of Array.from(e.childNodes))r.push(...o(a));return r}function Rk(e){const t=[],r=e.querySelector("thead"),n=e.querySelector("tbody");if(!r&&!n){const o=Array.from(e.querySelectorAll("tr"));o.length>0&&(t.push({type:"table-row",children:Array.from(o[0].children).map(a=>({type:"table-cell",header:!0,children:Jr(a)}))}),o.slice(1).forEach(a=>{t.push({type:"table-row",children:Array.from(a.children).map(l=>({type:"table-cell",header:!1,children:Jr(l)}))})}))}else{if(r){const o=r.querySelector("tr");o&&t.push({type:"table-row",children:Array.from(o.querySelectorAll("th")).map(a=>({type:"table-cell",header:!0,children:Jr(a)}))})}n&&Array.from(n.querySelectorAll("tr")).forEach(o=>{t.push({type:"table-row",children:Array.from(o.querySelectorAll("td")).map(a=>({type:"table-cell",header:!1,children:Jr(a)}))})})}return{type:"table",children:t}}const Pk=Xe.div.attrs({className:"unified-rich-text-container"})`
1109
+ border: ${e=>e.$isEditing?"1px solid #dee2e6":"none"};
1110
+ border-radius: ${e=>{var t;return((t=e.theme)==null?void 0:t.borderRadius)||"4px"}};
1111
+ background-color: ${e=>{var t;return((t=e.theme)==null?void 0:t.backgroundColor)||"transparent"}};
1112
+ min-height: ${e=>{var t;return((t=e.theme)==null?void 0:t.minHeight)||"200px"}};
1113
+ overflow: hidden;
1114
+ transition: all 0.2s ease-in-out;
1115
+ padding-top: 14px;
1116
+ ${e=>{var t,r;return e.$isEditing&&`
1117
+ &:focus-within {
1118
+ border-color: ${((t=e.theme)==null?void 0:t.primaryColor)||"#007bff"};
1119
+ box-shadow: 0 0 0 2px ${((r=e.theme)==null?void 0:r.primaryColor)||"#007bff"}20;
1120
+ }
1121
+ `}}
1122
+ `,Qu=Xe.div.attrs({className:"unified-rich-text-editable-container"})`
1123
+ padding: ${e=>{var t;return((t=e.theme)==null?void 0:t.padding)||"0rem 1rem"}};
1124
+ min-height: inherit;
1125
+ outline: none;
1126
+
1127
+ & > * + * {
1128
+ margin-top: ${e=>{var t;return((t=e.theme)==null?void 0:t.margin)||"0.5rem"}};
1129
+ }
1130
+ `,Nm=(e,t)=>t<0?e:`${e.slice(0,t)}\\${e.slice(t)}`,Om=(e,t)=>{if(!e)return-1;const r=t.length;let n=-1;for(let o=0;o<e.length;o++){if(e[o]==="\\"){o+=1;continue}if(r===2){if(e.startsWith("$$",o)){n===-1?n=o:n=-1,o+=1;continue}}else if(r===1&&e[o]==="$"){if(e[o+1]==="$"){o+=1;continue}n===-1?n=o:n=-1}}return n},zk=e=>{const t=e||"";if(!t)return{content:"",hasPendingLatex:!1};let r=t,n=!1;const o=[],a=Om(t,"$$");a!==-1&&(r=Nm(r,a),o.push(a),n=!0);const l=Om(t,"$");if(l!==-1){const u=o.filter(f=>f<=l).length;r=Nm(r,l+u),n=!0}return{content:r,hasPendingLatex:n}};var Ai=(e=>(e.SLATE="slate",e.MARKDOWN="markdown",e.HTML="html",e.TEXT="text",e))(Ai||{});const El=({dataSource:e,isEditing:t=!1,placeholder:r="\u5F00\u59CB\u8F93\u5165...",basePath:n,size:o="sm",theme:a={},onChange:l,onFocus:u,onBlur:f,renderElement:d,renderLeaf:m,onRetriveTagClick:g,eventsEmit:v,onEditorReady:y,extraProps:b={},className:C,style:p,styles:S,enableTemplateInput:B=!1,disabledTags:k=[],enablePrism:$=!1,enableTemplateAutocomplete:T=!1})=>{const O=ol(),F=At(()=>{var ie,le,ue,Se,Be,ge,Ee,Ae,Fe;return{primaryColor:((ie=O==null?void 0:O.colors)==null?void 0:ie.primary)||(a==null?void 0:a.primaryColor)||"#007bff",secondaryColor:((le=O==null?void 0:O.colors)==null?void 0:le.secondary)||(a==null?void 0:a.secondaryColor)||"#6c757d",backgroundColor:((ue=O==null?void 0:O.colors)==null?void 0:ue.background)||(a==null?void 0:a.backgroundColor)||"transparent",textColor:((Se=O==null?void 0:O.colors)==null?void 0:Se.text)||(a==null?void 0:a.textColor)||"#24292f",borderColor:((Be=O==null?void 0:O.colors)==null?void 0:Be.border)||(a==null?void 0:a.borderColor)||"#dee2e6",disabledBackground:((ge=O==null?void 0:O.colors)==null?void 0:ge.disabledBackground)||(a==null?void 0:a.disabledBackground)||"#f8f9fa",hoverBackground:(a==null?void 0:a.hoverBackground)||"rgba(0,0,0,0.06)",borderRadius:((Ee=O==null?void 0:O.space)==null?void 0:Ee.radius)||(a==null?void 0:a.borderRadius)||"4px",padding:((Ae=O==null?void 0:O.space)==null?void 0:Ae.padding)||(a==null?void 0:a.padding)||"0rem 1rem",margin:((Fe=O==null?void 0:O.space)==null?void 0:Fe.margin)||(a==null?void 0:a.margin)||"0.5rem",minHeight:(a==null?void 0:a.minHeight)||"200px",baseFontSize:(a==null?void 0:a.baseFontSize)||(o==="md"?14:12),...a}},[O,a,o]),P=Vt();if(!P.current){const ie=Cx(),le=RC(ie),{isInline:ue}=le;le.isInline=ge=>!k.includes("template")&&ge.type==="template"?!0:ue(ge);const{isVoid:Se}=le;le.isVoid=ge=>!k.includes("template")&&ge.type==="template"?!0:Se(ge);const Be=ge=>{if(!(B&&!k.includes("template")))return ge;const{insertText:Ee,insertData:Ae}=ge,Fe=()=>{const xe=/<template\b[^>]*>([\s\S]*?)<\/template>/g,Ce=Array.from(z.nodes(ge,{match:_e=>Ct.isText(_e)&&xe.test(_e.text)}));if(Ce.length!==0)for(const _e of Ce){const[ht,ot]=_e,Ie=ht.text||"",Ke=[];let Ue=0,vt;for(xe.lastIndex=0;(vt=xe.exec(Ie))!==null;){if(vt.index>Ue){const tt=Ie.slice(Ue,vt.index);tt&&Ke.push({text:tt})}Ke.push({type:"template",placeholder:(vt[1]||"").trim(),value:"",style:"blue",fieldId:`template-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,children:[{text:""}],inline:!0}),Ue=vt.index+vt[0].length}if(Ue<Ie.length){const tt=Ie.slice(Ue);tt&&Ke.push({text:tt})}Ge.removeNodes(ge,{at:ot}),Ge.insertNodes(ge,Ke,{at:ot})}};return ge.insertText=xe=>{Ee(xe),Fe()},ge.insertData=xe=>{const Ce=xe.getData("text/plain");if(Ce&&/<template\b[\s\S]*?<\/template>/.test(Ce)){Ee(Ce),Fe();return}return Ae(xe)},ge};P.current=Be(le)}const N=P.current;sr(()=>{N&&y&&t&&y(N)},[N,y,t]);const[q,R]=Ht(()=>e.type==="slate"?e.content||[{type:"paragraph",children:[{text:""}]}]:[{type:"paragraph",children:[{text:""}]}]);Vt(null);const[X,G]=Ht(0);sr(()=>{if(e.type==="slate"){console.log("UnifiedRichText: dataSource.content \u53D8\u5316:",e.content);const ie=e.content||[{type:"paragraph",children:[{text:""}]}];if(console.log("UnifiedRichText: \u8BBE\u7F6E\u65B0\u7684 value:",ie),ie===q)return;R(ie),G(le=>le+1)}},[e.type,e.content,q]);const _=Vt(void 0),j=At(()=>{if(e.type!=="markdown")return{content:"",hasPendingLatex:!1};const ie=typeof e.content=="string"?e.content:JSON.stringify(e.content||"");return zk(ie)},[e.type,e.content]);sr(()=>{if(e.type!=="markdown")return;const ie=j.content;_.current!==ie&&(_.current=ie,G(le=>le+1))},[e.type,j.content]);const W=At(()=>e.type!=="markdown"?b:{...b||{},hasPendingLatex:j.hasPendingLatex},[b,e.type,j.hasPendingLatex]),U=Vt("");sr(()=>{if(e.type!=="markdown")return;const ie=JSON.stringify(W||{});ie!==U.current&&(U.current=ie,G(le=>le+1))},[W,e.type]);const ee=zt(ie=>{console.log("UnifiedRichText: \u5185\u5BB9\u53D8\u5316:",ie),ie&&Array.isArray(ie)?(R(ie),l==null||l(ie,"slate")):console.log("UnifiedRichText: \u5FFD\u7565\u65E0\u6548\u7684\u5185\u5BB9\u53D8\u5316:",ie)},[l]),V=At(()=>{const ie=F==null?void 0:F.baseFontSize;return typeof ie=="number"&&!Number.isNaN(ie)?ie:o==="md"?14:12},[F,o]),Y=typeof $=="boolean"?$:!1,fe=zt(ie=>{const le={...ie,size:o,styles:S,eventsEmit:v,extraProps:W,enablePrism:Y};return d?d(le):lk(le)},[d,o,S,v,W,Y]),be=zt(ie=>{const le={...ie,styles:S,onRetriveTagClick:g};return m?m(le):uk(le)},[m,S,g]);sr(()=>(window.copyCodeFromData=ie=>{const le=ie.getAttribute("data-code");if(!le){console.error("No code content found");return}const ue=le.replace(/\\n/g,`
1131
+ `).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\'/g,"'").replace(/\\\\/g,"\\").replace(/&quot;/g,'"');navigator.clipboard.writeText(ue).then(()=>{const Se=ie.innerHTML;ie.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#2da44e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20,6 9,17 4,12"></polyline></svg>',ie.classList.add("copied"),setTimeout(()=>{ie.innerHTML=Se,ie.classList.remove("copied")},2e3)}).catch(Se=>{console.error("\u590D\u5236\u5931\u8D25:",Se);const Be=ie.innerHTML;ie.innerHTML='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',ie.style.background="#d73a49",ie.style.borderColor="#d73a49",ie.style.color="white",setTimeout(()=>{ie.innerHTML=Be,ie.style.background="",ie.style.borderColor="",ie.style.color=""},2e3)})},()=>{delete window.copyCodeFromData}),[]);const he=At(()=>{var ie,le;if(e.type!=="markdown")return null;try{console.log("\u{1F50D} UnifiedRichText processing Markdown content:",{contentLength:(ie=j.content)==null?void 0:ie.length,basePath:n,hasImages:(le=j.content)==null?void 0:le.includes("![")});const ue=H2(j.content||"",{basePath:n});if(console.log("\u{1F3AF} Deserialized Slate content:",{slateLength:ue.length,hasImageElements:ue.some(Fe=>Fe.type==="image"),imageElements:ue.filter(Fe=>Fe.type==="image")}),ue&&ue.length>0)return K.jsx(Wu,{theme:F,$size:o,children:K.jsx(Ru,{editor:N,initialValue:ue,onChange:()=>{},children:K.jsx(Qu,{theme:F,children:K.jsx(Iu,{renderElement:fe,renderLeaf:be,readOnly:!0,style:{minHeight:"inherit",outline:"none",border:"none",background:"transparent",fontSize:`${V}px`}})})},X)});const Se={breaks:!0,gfm:!0,headerIds:!0,mangle:!1,sanitize:!1,pedantic:!1,smartLists:!0,smartypants:!0};let Be=br(j.content||"",Se);Be=Be.replace(/<table([^>]*)>/g,'<div class="table-container"><table$1>'),Be=Be.replace(/<\/table>/g,"</table></div>"),Be=Be.replace(/<pre><code([^>]*)>([\s\S]*?)<\/code><\/pre>/g,(Fe,xe,Ce)=>{let _e;const ht=xe.match(/class=["']([^"']+)["']/);if(ht){const Ke=ht[1].match(/language-(\w+)/);Ke&&(_e=Ke[1])}let ot=Ce;if(_e&&Hu.languages[_e])try{ot=Hu.highlight(Ce,Hu.languages[_e],_e)}catch(Ke){console.warn("Failed to highlight code:",Ke),ot=Ce}const Ie=Ce.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/"/g,"&quot;");return`<div class="code-block-wrapper">${_e?`<div class="code-block-language">${_e}</div>`:""}<pre><code${xe}>${ot}</code><button class="code-copy-btn" data-code="${Ie}" onclick="copyCodeFromData(this)" title="\u590D\u5236\u4EE3\u7801"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg></button></pre></div>`});const ge=(F==null?void 0:F.disabledBackground)||(F==null?void 0:F.backgroundColor)||"#ffffff",Ee=(Fe,xe)=>Fe.startsWith("#")?`${Fe}${Math.round(xe*255).toString(16).padStart(2,"0")}`:Fe,Ae=`
1132
+ <style>
1133
+ .table-container{ overflow:auto; border:1px solid ${(F==null?void 0:F.borderColor)||"#e5e7eb"}; border-radius: 6px; background:${(F==null?void 0:F.backgroundColor)||"transparent"} !important; }
1134
+ .table-container table{ background:${(F==null?void 0:F.backgroundColor)||"transparent"} !important; color:${(F==null?void 0:F.textColor)||"#24292f"} !important; }
1135
+ .table-container th{ background:${(F==null?void 0:F.disabledBackground)||"#f6f8fa"} !important; color:${(F==null?void 0:F.textColor)||"#24292f"} !important; }
1136
+ .table-container td{ color:${(F==null?void 0:F.textColor)||"#24292f"} !important; background:${(F==null?void 0:F.backgroundColor)||"transparent"} !important; }
1137
+ .table-container tr:nth-child(even) td{ background:${(F==null?void 0:F.disabledBackground)||"#f6f8fa"} !important; }
1138
+ .code-block-wrapper{ position:relative; margin:16px 0; border-radius:6px; overflow:hidden; border:1px solid ${(F==null?void 0:F.borderColor)||"#d0d7de"}; background:${ge}; }
1139
+ .code-block-language{ display:flex; align-items:center; justify-content:space-between; padding:8px 12px; background:${(F==null?void 0:F.disabledBackground)||"#f6f8fa"}; border-bottom:1px solid ${(F==null?void 0:F.borderColor)||"#d0d7de"}; font-size:12px; color:${(F==null?void 0:F.textColor)||"#656d76"}; font-weight:500; }
1140
+ .code-block-wrapper pre{ position:relative; margin:0; padding:16px; overflow-x:auto; background:${ge}; border:none; border-radius:0; color:${(F==null?void 0:F.textColor)||"#24292f"}; font-family:'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size:13px; line-height:1.6; }
1141
+ .code-block-wrapper pre code{ background:transparent; padding:0; color:inherit; font-size:inherit; font-family:inherit; }
1142
+ .code-block-wrapper pre .code-copy-btn{ position:absolute; top:8px; right:8px; background:transparent; border:1px solid ${(F==null?void 0:F.borderColor)||"#e5e7eb"}; color:${(F==null?void 0:F.textColor)||"#24292f"}; border-radius:4px; padding:4px 8px; cursor:pointer; font-size:12px; transition:all 0.2s ease; }
1143
+ .code-block-wrapper pre .code-copy-btn:hover{ background:${(F==null?void 0:F.hoverBackground)||"rgba(0,0,0,0.06)"}; }
1144
+ .code-block-wrapper pre .code-copy-btn.copied{ background:#2da44e; border-color:#2da44e; color:#ffffff; }
1145
+ </style>
1146
+ `;return K.jsx("div",{style:{padding:(F==null?void 0:F.padding)||"1rem",fontSize:`${V}px`,lineHeight:1.6,color:(F==null?void 0:F.textColor)||"#24292f"},"data-pending-latex":j.hasPendingLatex||void 0,dangerouslySetInnerHTML:{__html:Ae+Be}})}catch(ue){return console.error("Markdown parsing error:",ue),K.jsx("div",{children:e.content})}},[e,F,N,X,fe,be,V,j]),De=At(()=>e.type!=="html"?null:K.jsx("div",{style:{padding:(F==null?void 0:F.padding)||"1rem",fontSize:`${V}px`,lineHeight:1.6,color:(F==null?void 0:F.textColor)||"#24292f"},dangerouslySetInnerHTML:{__html:e.content||""}}),[e,F,V]),$e=At(()=>e.type!=="text"?null:K.jsx("div",{style:{padding:(F==null?void 0:F.padding)||"1rem",fontSize:`${V}px`,lineHeight:1.6,color:(F==null?void 0:F.textColor)||"#24292f"},children:K.jsx("span",{children:e.content||""})}),[e,F,V]),Z=()=>{switch(e.type){case"markdown":return he;case"html":return De;case"text":return $e;case"slate":default:return t?K.jsx(Wu,{theme:F,$size:o,children:K.jsx(Ru,{editor:N,initialValue:q,onChange:ee,children:K.jsx(Qu,{theme:F,children:K.jsx(Iu,{renderElement:fe,renderLeaf:be,placeholder:r,readOnly:!1,onFocus:u,onBlur:f,onKeyDown:ie=>{if(!T||ie.key!=="Tab"||!N.selection||!Oe.isCollapsed(N.selection))return;const{focus:le}=N.selection,ue=z.before(N,le,{unit:"character",distance:2});if(!ue)return;const Se=z.range(N,ue,le);z.string(N,Se)==="<t"&&(ie.preventDefault(),Ge.delete(N,{at:Se}),Ge.insertText(N,"<template "))},style:{minHeight:"inherit",outline:"none",fontSize:`${V}px`}})})},X)}):K.jsx(Wu,{theme:F,$size:o,children:K.jsx(Ru,{editor:N,initialValue:q,onChange:()=>{},children:K.jsx(Qu,{theme:F,children:K.jsx(Iu,{renderElement:fe,renderLeaf:be,readOnly:!0,style:{minHeight:"inherit",outline:"none",border:"none",background:"transparent",fontSize:`${V}px`}})})},X)})}};return K.jsx(Pk,{theme:F,$isEditing:t,className:C,style:p,children:Z()})};var rc={exports:{}},_k=rc.exports,Mm;function jk(){return Mm||(Mm=1,(function(e,t){(function(r,n){e.exports=n()})(_k,(function(){var r=1e3,n=6e4,o=36e5,a="millisecond",l="second",u="minute",f="hour",d="day",m="week",g="month",v="quarter",y="year",b="date",C="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,B={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var j=["th","st","nd","rd"],W=_%100;return"["+_+(j[(W-20)%10]||j[W]||j[0])+"]"}},k=function(_,j,W){var U=String(_);return!U||U.length>=j?_:""+Array(j+1-U.length).join(W)+_},$={s:k,z:function(_){var j=-_.utcOffset(),W=Math.abs(j),U=Math.floor(W/60),ee=W%60;return(j<=0?"+":"-")+k(U,2,"0")+":"+k(ee,2,"0")},m:function _(j,W){if(j.date()<W.date())return-_(W,j);var U=12*(W.year()-j.year())+(W.month()-j.month()),ee=j.clone().add(U,g),V=W-ee<0,Y=j.clone().add(U+(V?-1:1),g);return+(-(U+(W-ee)/(V?ee-Y:Y-ee))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:g,y,w:m,d,D:b,h:f,m:u,s:l,ms:a,Q:v}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},T="en",O={};O[T]=B;var F="$isDayjsObject",P=function(_){return _ instanceof X||!(!_||!_[F])},N=function _(j,W,U){var ee;if(!j)return T;if(typeof j=="string"){var V=j.toLowerCase();O[V]&&(ee=V),W&&(O[V]=W,ee=V);var Y=j.split("-");if(!ee&&Y.length>1)return _(Y[0])}else{var fe=j.name;O[fe]=j,ee=fe}return!U&&ee&&(T=ee),ee||!U&&T},q=function(_,j){if(P(_))return _.clone();var W=typeof j=="object"?j:{};return W.date=_,W.args=arguments,new X(W)},R=$;R.l=N,R.i=P,R.w=function(_,j){return q(_,{locale:j.$L,utc:j.$u,x:j.$x,$offset:j.$offset})};var X=(function(){function _(W){this.$L=N(W.locale,null,!0),this.parse(W),this.$x=this.$x||W.x||{},this[F]=!0}var j=_.prototype;return j.parse=function(W){this.$d=(function(U){var ee=U.date,V=U.utc;if(ee===null)return new Date(NaN);if(R.u(ee))return new Date;if(ee instanceof Date)return new Date(ee);if(typeof ee=="string"&&!/Z$/i.test(ee)){var Y=ee.match(p);if(Y){var fe=Y[2]-1||0,be=(Y[7]||"0").substring(0,3);return V?new Date(Date.UTC(Y[1],fe,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,be)):new Date(Y[1],fe,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,be)}}return new Date(ee)})(W),this.init()},j.init=function(){var W=this.$d;this.$y=W.getFullYear(),this.$M=W.getMonth(),this.$D=W.getDate(),this.$W=W.getDay(),this.$H=W.getHours(),this.$m=W.getMinutes(),this.$s=W.getSeconds(),this.$ms=W.getMilliseconds()},j.$utils=function(){return R},j.isValid=function(){return this.$d.toString()!==C},j.isSame=function(W,U){var ee=q(W);return this.startOf(U)<=ee&&ee<=this.endOf(U)},j.isAfter=function(W,U){return q(W)<this.startOf(U)},j.isBefore=function(W,U){return this.endOf(U)<q(W)},j.$g=function(W,U,ee){return R.u(W)?this[U]:this.set(ee,W)},j.unix=function(){return Math.floor(this.valueOf()/1e3)},j.valueOf=function(){return this.$d.getTime()},j.startOf=function(W,U){var ee=this,V=!!R.u(U)||U,Y=R.p(W),fe=function(ue,Se){var Be=R.w(ee.$u?Date.UTC(ee.$y,Se,ue):new Date(ee.$y,Se,ue),ee);return V?Be:Be.endOf(d)},be=function(ue,Se){return R.w(ee.toDate()[ue].apply(ee.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(Se)),ee)},he=this.$W,De=this.$M,$e=this.$D,Z="set"+(this.$u?"UTC":"");switch(Y){case y:return V?fe(1,0):fe(31,11);case g:return V?fe(1,De):fe(0,De+1);case m:var ie=this.$locale().weekStart||0,le=(he<ie?he+7:he)-ie;return fe(V?$e-le:$e+(6-le),De);case d:case b:return be(Z+"Hours",0);case f:return be(Z+"Minutes",1);case u:return be(Z+"Seconds",2);case l:return be(Z+"Milliseconds",3);default:return this.clone()}},j.endOf=function(W){return this.startOf(W,!1)},j.$set=function(W,U){var ee,V=R.p(W),Y="set"+(this.$u?"UTC":""),fe=(ee={},ee[d]=Y+"Date",ee[b]=Y+"Date",ee[g]=Y+"Month",ee[y]=Y+"FullYear",ee[f]=Y+"Hours",ee[u]=Y+"Minutes",ee[l]=Y+"Seconds",ee[a]=Y+"Milliseconds",ee)[V],be=V===d?this.$D+(U-this.$W):U;if(V===g||V===y){var he=this.clone().set(b,1);he.$d[fe](be),he.init(),this.$d=he.set(b,Math.min(this.$D,he.daysInMonth())).$d}else fe&&this.$d[fe](be);return this.init(),this},j.set=function(W,U){return this.clone().$set(W,U)},j.get=function(W){return this[R.p(W)]()},j.add=function(W,U){var ee,V=this;W=Number(W);var Y=R.p(U),fe=function(De){var $e=q(V);return R.w($e.date($e.date()+Math.round(De*W)),V)};if(Y===g)return this.set(g,this.$M+W);if(Y===y)return this.set(y,this.$y+W);if(Y===d)return fe(1);if(Y===m)return fe(7);var be=(ee={},ee[u]=n,ee[f]=o,ee[l]=r,ee)[Y]||1,he=this.$d.getTime()+W*be;return R.w(he,this)},j.subtract=function(W,U){return this.add(-1*W,U)},j.format=function(W){var U=this,ee=this.$locale();if(!this.isValid())return ee.invalidDate||C;var V=W||"YYYY-MM-DDTHH:mm:ssZ",Y=R.z(this),fe=this.$H,be=this.$m,he=this.$M,De=ee.weekdays,$e=ee.months,Z=ee.meridiem,ie=function(Se,Be,ge,Ee){return Se&&(Se[Be]||Se(U,V))||ge[Be].slice(0,Ee)},le=function(Se){return R.s(fe%12||12,Se,"0")},ue=Z||function(Se,Be,ge){var Ee=Se<12?"AM":"PM";return ge?Ee.toLowerCase():Ee};return V.replace(S,(function(Se,Be){return Be||(function(ge){switch(ge){case"YY":return String(U.$y).slice(-2);case"YYYY":return R.s(U.$y,4,"0");case"M":return he+1;case"MM":return R.s(he+1,2,"0");case"MMM":return ie(ee.monthsShort,he,$e,3);case"MMMM":return ie($e,he);case"D":return U.$D;case"DD":return R.s(U.$D,2,"0");case"d":return String(U.$W);case"dd":return ie(ee.weekdaysMin,U.$W,De,2);case"ddd":return ie(ee.weekdaysShort,U.$W,De,3);case"dddd":return De[U.$W];case"H":return String(fe);case"HH":return R.s(fe,2,"0");case"h":return le(1);case"hh":return le(2);case"a":return ue(fe,be,!0);case"A":return ue(fe,be,!1);case"m":return String(be);case"mm":return R.s(be,2,"0");case"s":return String(U.$s);case"ss":return R.s(U.$s,2,"0");case"SSS":return R.s(U.$ms,3,"0");case"Z":return Y}return null})(Se)||Y.replace(":","")}))},j.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},j.diff=function(W,U,ee){var V,Y=this,fe=R.p(U),be=q(W),he=(be.utcOffset()-this.utcOffset())*n,De=this-be,$e=function(){return R.m(Y,be)};switch(fe){case y:V=$e()/12;break;case g:V=$e();break;case v:V=$e()/3;break;case m:V=(De-he)/6048e5;break;case d:V=(De-he)/864e5;break;case f:V=De/o;break;case u:V=De/n;break;case l:V=De/r;break;default:V=De}return ee?V:R.a(V)},j.daysInMonth=function(){return this.endOf(g).$D},j.$locale=function(){return O[this.$L]},j.locale=function(W,U){if(!W)return this.$L;var ee=this.clone(),V=N(W,U,!0);return V&&(ee.$L=V),ee},j.clone=function(){return R.w(this.$d,this)},j.toDate=function(){return new Date(this.valueOf())},j.toJSON=function(){return this.isValid()?this.toISOString():null},j.toISOString=function(){return this.$d.toISOString()},j.toString=function(){return this.$d.toUTCString()},_})(),G=X.prototype;return q.prototype=G,[["$ms",a],["$s",l],["$m",u],["$H",f],["$W",d],["$M",g],["$y",y],["$D",b]].forEach((function(_){G[_[1]]=function(j){return this.$g(j,_[0],_[1])}})),q.extend=function(_,j){return _.$i||(_(j,X,q),_.$i=!0),q},q.locale=N,q.isDayjs=P,q.unix=function(_){return q(1e3*_)},q.en=O[T],q.Ls=O,q.p={},q}))})(rc)),rc.exports}var Lk=jk();const Hk=Ii(Lk),e0=({src:e,index:t,token:r,url:n,eventsEmit:o,...a})=>{const[l,u]=Ht(""),f=async g=>{try{const v=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:r},body:JSON.stringify({convertedFilePath:g})});if(!v.ok)throw new Error(`Fetch failed: ${v.status}`);return{data:await v.arrayBuffer()}}catch{return null}},d=async g=>{const v=await f(g);if(!v)return;const y=new Blob([v.data]);return window.URL.createObjectURL(y)},m=async g=>{const v=await d(g);u(v||"")};return sr(()=>{try{if(!r||!n){u(e);return}m(e)}catch{u(e)}},[e]),K.jsx(K.Fragment,{children:l&&K.jsx(N1,{src:l,...a,preview:!1,onClick:()=>o&&o("imageClick",l)},t||1)})},Kk=e=>D.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},D.createElement("g",{clipPath:"url(#clip0_5260_38039)"},D.createElement("path",{d:"M8.00004 14.6668C11.6819 14.6668 14.6667 11.6821 14.6667 8.00016C14.6667 4.31826 11.6819 1.3335 8.00004 1.3335C4.31814 1.3335 1.33337 4.31826 1.33337 8.00016C1.33337 11.6821 4.31814 14.6668 8.00004 14.6668Z",fill:"#4E6EF2",stroke:"#4E6EF2",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),D.createElement("path",{d:"M6 7.99984L7.33333 9.33317L10 6.6665",stroke:"white",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})),D.createElement("defs",null,D.createElement("clipPath",{id:"clip0_5260_38039"},D.createElement("rect",{width:16,height:16,fill:"white"})))),qk=e=>D.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},D.createElement("path",{d:"M14.4867 12L9.15333 2.66665C9.03704 2.46146 8.8684 2.29078 8.66462 2.17203C8.46083 2.05329 8.22919 1.99072 7.99333 1.99072C7.75747 1.99072 7.52584 2.05329 7.32205 2.17203C7.11826 2.29078 6.94962 2.46146 6.83333 2.66665L1.5 12C1.38245 12.2036 1.32082 12.4346 1.32134 12.6697C1.32186 12.9047 1.38452 13.1355 1.50296 13.3385C1.62141 13.5416 1.79143 13.7097 1.9958 13.8259C2.20016 13.942 2.4316 14.0021 2.66667 14H13.3333C13.5673 13.9997 13.797 13.938 13.9995 13.8208C14.202 13.7037 14.3701 13.5354 14.487 13.3327C14.6039 13.1301 14.6654 12.9002 14.6653 12.6663C14.6652 12.4324 14.6036 12.2026 14.4867 12Z",fill:"#4E6EF2",stroke:"#4E6EF2",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),D.createElement("path",{d:"M8 6V8.66667",stroke:"white",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),D.createElement("path",{d:"M8 11.3335H8.00667",stroke:"white",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})),Im=e=>D.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},D.createElement("path",{d:"M14 7.99981C13.9999 9.26686 13.5988 10.5014 12.854 11.5264C12.1092 12.5515 11.059 13.3144 9.85392 13.7059C8.64886 14.0974 7.3508 14.0974 6.14576 13.7058C4.94073 13.3142 3.89059 12.5512 3.14584 11.5261C2.4011 10.5011 1.99999 9.26653 2 7.99947C2.00001 6.73241 2.40114 5.49788 3.14589 4.47281C3.89065 3.44773 4.9408 2.68474 6.14584 2.29319C7.35088 1.90164 8.64895 1.90162 9.854 2.29314",stroke:"#4E6EF2",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})),Vk=e=>D.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},D.createElement("g",{clipPath:"url(#clip0_5260_38091)"},D.createElement("path",{d:"M7.99998 14.6668C11.6819 14.6668 14.6666 11.6821 14.6666 8.00016C14.6666 4.31826 11.6819 1.3335 7.99998 1.3335C4.31808 1.3335 1.33331 4.31826 1.33331 8.00016C1.33331 11.6821 4.31808 14.6668 7.99998 14.6668Z",fill:"#4E6EF2",stroke:"#4E6EF2",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),D.createElement("path",{d:"M10 6L6 10",stroke:"white",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),D.createElement("path",{d:"M6 6L10 10",stroke:"white",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})),D.createElement("defs",null,D.createElement("clipPath",{id:"clip0_5260_38091"},D.createElement("rect",{width:16,height:16,fill:"white"})))),Wk=Xe.div.attrs({className:"thought-chain-section-wrapper"})`
1147
+ padding: 12px 0 8px 0;
1148
+ `,Uk=Xe.div.attrs({className:"thought-chain-section-title-row"})`
1149
+ display: flex;
1150
+ align-items: center;
1151
+ gap: 8px;
1152
+ margin-bottom: 8px;
1153
+ padding-left: 20px;
1154
+ `,Xk=$2`
1155
+ from {
1156
+ transform: rotate(0deg);
1157
+ }
1158
+ to {
1159
+ transform: rotate(360deg);
1160
+ }
1161
+ `,Gk=Xe.div.attrs({className:"thought-chain-section-icon"})`
1162
+ width: 16px;
1163
+ height: 16px;
1164
+ flex-shrink: 0;
1165
+ display: flex;
1166
+ align-items: center;
1167
+ justify-content: center;
1168
+
1169
+ svg {
1170
+ width: 100%;
1171
+ height: 100%;
1172
+ ${({$isRotating:e})=>e?kl`
1173
+ animation: ${Xk} 2s linear infinite;
1174
+ `:""}
1175
+ }
1176
+ `,Yk=Xe.div.attrs({className:"thought-chain-section-title"})`
1177
+ font-size: 14px;
1178
+ font-weight: 600;
1179
+ color: #111827;
1180
+ display: flex;
1181
+ align-items: center;
1182
+ gap: 6px;
1183
+ `,Zk=Xe.span.attrs({className:"thought-chain-section-time"})`
1184
+ font-size: 12px;
1185
+ font-weight: 400;
1186
+ color: #6b7280;
1187
+ `,Jk=Xe.span.attrs({className:"thought-chain-node-step-time"})`
1188
+ font-size: 12px;
1189
+ font-weight: 400;
1190
+ color: #6b7280;
1191
+ flex-shrink: 0;
1192
+ align-self: flex-start;
1193
+ padding-top: 2px;
1194
+ `,Qk=Xe.div.attrs({className:"thought-chain-vertical-line"})`
1195
+ position: absolute;
1196
+ left: 10px;
1197
+ top: 0;
1198
+ bottom: 0;
1199
+ width: 2px;
1200
+ background: #e5e7eb;
1201
+ z-index: 0;
1202
+ `,eE=Xe.div.attrs({className:"thought-chain-content-container"})`
1203
+ position: relative;
1204
+ padding-left: 0px;
1205
+ margin-left:18px
1206
+ `,tE=Xe.div.attrs({className:"thought-chain-node-item"})`
1207
+ display: flex;
1208
+ align-items: flex-start;
1209
+ gap: 12px;
1210
+ padding: 8px 0;
1211
+ position: relative;
1212
+ `,rE=Xe.div.attrs({className:"thought-chain-node-content-area"})`
1213
+ flex: 1;
1214
+ margin-left: 20px;
1215
+ display: flex;
1216
+ flex-direction: column;
1217
+ gap: 4px;
1218
+ `,Rm=Xe.div.attrs({className:"thought-chain-content-text-wrapper"})`
1219
+ font-size: 13px;
1220
+ line-height: 1.6;
1221
+ color: #374151;
1222
+ opacity: 0.7;
1223
+ `,nE=Xe.div.attrs({className:"thought-chain-loading-text"})`
1224
+ font-size: 13px;
1225
+ line-height: 1.6;
1226
+ color: #9ca3af;
1227
+ font-style: italic;
1228
+ padding-left: 15px;
1229
+ `;function oE(e){switch(e){case 1:return{label:"\u8FD0\u884C\u4E2D",color:"#2563eb",icon:Im,isRotating:!0};case 2:return{label:"\u6267\u884C\u5B8C\u6210",color:"#16a34a",icon:Kk,isRotating:!1};case 3:return{label:"\u6267\u884C\u5931\u8D25",color:"#dc2626",icon:Vk,isRotating:!1};case 4:return{label:"\u5F02\u5E38",color:"#f97316",icon:qk,isRotating:!1};default:return{label:"\u672A\u77E5",color:"#9ca3af",icon:Im,isRotating:!1}}}const t0=({title:e,content:t,nodes:r,mode:n="history"})=>{var m;if(!r||r.length===0)return null;const o=r.reduce((g,v)=>{const y=v.respTime;return g+(typeof y=="number"&&y>0?y:0)},0),a=o>0?`\xB7 ${(o/1e3).toFixed(2)} \u79D2`:"",l=g=>typeof g!="number"||g<=0?"":`${(g/1e3).toFixed(2)} \u79D2`,u=((m=r[0])==null?void 0:m.nodeStatus)??3,f=oE(u),d=f.icon;return K.jsxs(Wk,{children:[K.jsxs(Uk,{children:[K.jsx(Gk,{$isRotating:f.isRotating,children:K.jsx(d,{})}),K.jsxs(Yk,{children:[e,a&&K.jsx(Zk,{children:a})]})]}),K.jsxs(eE,{children:[K.jsx(Qk,{}),r.map(g=>{var b,C,p,S,B,k;const v=((b=g==null?void 0:g.rawContent)==null?void 0:b.type)==="markdown"||((p=(C=g==null?void 0:g.rawContent)==null?void 0:C.reply)==null?void 0:p.type)==="markdown"||(g==null?void 0:g.format)==="markdown"||((S=g.content)==null?void 0:S.includes("```"))||((B=g.content)==null?void 0:B.includes("**"))||((k=g.content)==null?void 0:k.includes("##")),y=g.nodeStatus===1&&!g.content;return K.jsx(tE,{children:K.jsxs(rE,{children:[r.length>1&&l(g.respTime)&&K.jsxs(Jk,{children:["\u7528\u65F6 ",l(g.respTime)]}),y?K.jsx(nE,{children:"\u601D\u8003\u4E2D..."}):g.content&&(v?K.jsx(Rm,{children:K.jsx(El,{dataSource:{type:Ai.MARKDOWN,content:g.content},styles:{text:{fontSize:"14px",lineHeight:"1.6",color:"#374151"}},theme:{baseFontSize:14,minHeight:"auto"}})}):K.jsx(Rm,{className:"px-[15px]",children:g.content}))]})},g.id)})]})]})};function Ss(e,t){const r={plan:{inProgress:"\u7406\u89E3\u89C4\u5212\u4E2D",completed:"\u7406\u89E3\u89C4\u5212\u5B8C\u6210"},retrieve:{inProgress:"\u53EC\u56DE\u4E2D",completed:"\u53EC\u56DE\u6210\u529F"},think:{inProgress:"\u6A21\u578B\u601D\u8003\u4E2D",completed:"\u6A21\u578B\u601D\u8003\u5B8C\u6210"},reason:{inProgress:"\u63A8\u7406\u4E2D",completed:"\u63A8\u7406\u5B8C\u6210"}}[e]||{inProgress:"",completed:""};switch(t){case 1:return r.inProgress;case 2:return r.completed;case 3:return`${r.completed}\uFF08\u5931\u8D25\uFF09`;case 4:return`${r.completed}\uFF08\u5F02\u5E38\uFF09`;default:return r.completed}}function aE(e){return!Array.isArray(e)||e.length===0?[]:e.map((t,r)=>{var u,f;const n=t.businessType||"plan",o=t.nodeStatus||1,a=t.content||((u=t==null?void 0:t.reply)==null?void 0:u.content)||"",l=(t==null?void 0:t.type)||((f=t==null?void 0:t.reply)==null?void 0:f.type);return{id:`${n}-${r}`,businessType:n,nodeStatus:o,title:Ss(n,o),content:a,...l?{format:l}:{},rawContent:t,respTime:t.respTime??t.chainRespTime??void 0}})}const iE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAABCcAAAQnAEmzTo0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANzSURBVHgBlVbtUeMwEN2Vk5m7HwemgjMVwFVwUAAQKiAUcBAqwKmArwIIFRCgAKACoALcASEwcz/A2ntrSY5InB+nGU9sabX79PT0FKaodXrjjght4TXFM7KW7pOkfTc8/l5QQ+v0JC3LcdcYXtE5QlyIlaebs4VBiGEX+Dez8nlJIqtNiZhpwNzuh0IaL/JxCDBdam6FMe11ja8KbO2PLxHcYZLCGu4nQEIkqbXSQfodP2kkIv2EE7Fkc0WM+BGqDy1jpW4OCgsKcwZQd1cnC+vc6b2vWmsfNDkbi6pLxVcaXjJrTR4V8k1OjLE54kdT8anY5FkAANStGyrLtSqc6Go6uTbtuz5d7CqiiLIh+nrTyX38SEgu9L0sJTPR2ExwaJt7b8r3mlLCFVXU2fjz2qP5beSAoECZsP/gn02RuqFYX17FCB9YQwc+/kjpbZqDMVUVgaJHk1A51A9FpfxNB0Mt5+Edm3nOls4nY/aoqQDo9oXLR6OceX6hGtObIH9bg7pulZoJNCmqpy5Aa5t742e3Stc2euMuKlQq0v3jkAySvMXryJhymWx7B1I8rvNWCjO7w+Mfdy7+BXI0tyrHiJjcmNaFlY9bLaAK0ngOw+EskNug1CXGhnq5heTxCj2ouBV4FP0AZ2BXO2oVMZe7HCXXpMJBWZ+PNNPqvkJj/XumAJGrH6LqAiUlHfHJHb+yz1J/p7MF2lkcGw0gtpV9KaCbhGSHPrwP/RZKVyhopbU/nR70bAXUwWb0dPuxy6DIluv4VBvw3C3mGBwQJee1gkR62KMUMr2qUMFxgbobiqlimO3uFVSDuBWd5xWZV5u8uT9+djtfLsd2AfvuwtmOpJEiry7h/jCy51iR16cLSxw6QMsj0P+aTrK595oj1aFHqodyNLFp6cOT8uk54fxUZlfCYh0LdN+EUhNocf8J2XprAfqm5C6XPOmvml0rKeH7XDE11+zA7zZJ8uCQCwVrp/mt0ex+z4//RsJ6oXiE1fn4RvMBTcyO4wsCSzu4OVusLULvXGvfIVFRRaSVFFkp4Myh5GO1h/jO3t573ynJDsIqnRfB20GTc0bwzeAZl0YKqJEduxuMnCnmX264yZyMvD8FsDxBC0n6+7SehwsGK7swxgxnvchdpUiwhV1J4zlWqB+Y4Gn+3CUietyLeX9X/mfOP1bpFRs68mWiAAAAAElFTkSuQmCC",sE=Xe.div.attrs({className:"thought-chain-card-wrapper"})`
1230
+ width: 100%;
1231
+ border-radius: 8px;
1232
+ background-color: #f9fafb;
1233
+ padding: 12px 16px;
1234
+ box-sizing: border-box;
1235
+ `,lE=Xe.div.attrs({className:"thought-chain-card-header"})`
1236
+ display: flex;
1237
+ align-items: center;
1238
+ justify-content: space-between;
1239
+ cursor: pointer;
1240
+ padding: 4px 0;
1241
+ `,uE=Xe.div.attrs({className:"thought-chain-card-header-left"})`
1242
+ display: flex;
1243
+ align-items: center;
1244
+ gap: 8px;
1245
+ flex: 1;
1246
+ `,cE=$2`
1247
+ from {
1248
+ transform: rotate(0deg);
1249
+ }
1250
+ to {
1251
+ transform: rotate(360deg);
1252
+ }
1253
+ `,dE=Xe.div.attrs({className:"thought-chain-card-avatar"})`
1254
+ width: 25px;
1255
+ height: 25px;
1256
+ border-radius: 9999px;
1257
+ display: flex;
1258
+ align-items: center;
1259
+ justify-content: center;
1260
+ flex-shrink: 0;
1261
+ overflow: hidden;
1262
+
1263
+ img {
1264
+ width: 80%;
1265
+ height: 80%;
1266
+ object-fit: contain;
1267
+ ${({$isRotating:e})=>e?kl`
1268
+ animation: ${cE} 2s linear infinite;
1269
+ `:""}
1270
+ }
1271
+ `,fE=Xe.div.attrs({className:"thought-chain-card-header-title"})`
1272
+ display: flex;
1273
+ align-items: center;
1274
+ gap: 6px;
1275
+ `,hE=Xe.span.attrs({className:"thought-chain-card-header-main-text"})`
1276
+ font-size: 14px;
1277
+ font-weight: 600;
1278
+ color: #111827;
1279
+ `,Pm=Xe.span.attrs({className:"thought-chain-card-header-sub-text"})`
1280
+ font-size: 14px;
1281
+ color: #6b7280;
1282
+ `,pE=Xe.div.attrs({className:"thought-chain-card-header-right"})`
1283
+ display: flex;
1284
+ align-items: center;
1285
+ flex-shrink: 0;
1286
+ `,mE=Xe.div.attrs({className:"thought-chain-card-body"})`
1287
+ margin-top: 12px;
1288
+ display: flex;
1289
+ flex-direction: column;
1290
+ gap: 0;
1291
+ `,gE=Xe.div.attrs({className:"thought-chain-card-empty-text"})`
1292
+ font-size: 12px;
1293
+ color: #9ca3af;
1294
+ `,vE=({nodes:e,mode:t="history",status:r,simpleThinkOnly:n=!1,chainRespTime:o})=>{const[a,l]=Ht(!1),u=At(()=>{const b={};return(e||[]).forEach(C=>{b[C.businessType]||(b[C.businessType]=[]),b[C.businessType].push(C)}),b},[e]),f=At(()=>typeof r=="number"?r===4:t==="live"?e.some(b=>b.nodeStatus===1):!1,[t,r,e]),d=At(()=>!e||e.length===0?!1:t==="history"?e.every(b=>b.nodeStatus===2):e.every(b=>b.nodeStatus===2),[e,t]),m=At(()=>f?"\u6B63\u5728\u601D\u8003\u4E2D":d?"\u601D\u8003\u5B8C\u6210":e&&e.length>0&&!d?"\u6B63\u5728\u601D\u8003\u4E2D":"",[f,d,e]),g=At(()=>f?"\u6A21\u578B\u6B63\u5728\u8FDB\u884C\u5206\u6B65\u63A8\u7406":d?"":"\u6A21\u578B\u6B63\u5728\u8FDB\u884C\u5206\u6B65\u63A8\u7406",[f,d]),v=e&&e.length>0,y=At(()=>!o||o<=0?"":`\xB7 ${(o/1e3).toFixed(2)} \u79D2`,[o]);return K.jsxs(sE,{"data-mode":t,children:[K.jsxs(lE,{onClick:()=>l(b=>!b),children:[K.jsxs(uE,{children:[K.jsx(dE,{$isRotating:f,children:K.jsx("img",{src:iE,alt:"thinking"})}),K.jsxs(fE,{children:[K.jsx(hE,{children:m}),y&&d&&K.jsxs(Pm,{children:["\u603B\u8BA1\u7528\u65F6",y]}),g&&K.jsxs(Pm,{children:["\xB7 ",g]})]})]}),K.jsx(pE,{children:a?K.jsx(ni,{size:18,color:"#6b7280"}):K.jsx(oi,{size:18,color:"#6b7280"})})]}),!a&&K.jsxs(mE,{children:[!v&&K.jsx(gE,{children:"\u5F53\u524D\u4F1A\u8BDD\u672A\u8FD4\u56DE\u7ED3\u6784\u5316\u601D\u7EF4\u94FE\u6570\u636E\u3002"}),u.plan&&u.plan.length>0&&K.jsx(t0,{title:Ss("plan",u.plan[0].nodeStatus),nodes:u.plan,mode:t}),u.retrieve&&u.retrieve.length>0&&K.jsx(t0,{title:Ss("retrieve",u.retrieve[0].nodeStatus),nodes:u.retrieve,mode:t}),u.think&&u.think.length>0&&K.jsx(t0,{title:Ss("think",u.think[0].nodeStatus),nodes:u.think,mode:t})]})]})},bE=({data:e,styles:t,onCategoryClick:r,onViewAllClick:n,className:o,style:a,showCategoryIcon:l=!0,renderCategoryIcon:u})=>{const f=(t==null?void 0:t.theme)||{},d=b=>{r==null||r(b)},m=()=>{e.viewAllPath&&(typeof e.viewAllPath=="function"?e.viewAllPath():window.open(e.viewAllPath,"_blank")),n==null||n()},g=b=>{const C=(b||"").toLowerCase();return["png","jpg","jpeg","gif","bmp","webp","svg","ico"].includes(C)?"rag/pic":C==="pdf"?"rag/pdf":C==="ofd"?"rag/ofd":["doc","docx"].includes(C)?"rag/word":["xls","xlsx","xlsm","xlsb","xltx","xltm","xlt","xlam"].includes(C)?"rag/excel":["ppt","pptx"].includes(C)?"rag/ppt":C==="txt"||C==="md"?"rag/txt":C==="csv"?"rag/csv":["zip","rar","7z"].includes(C)?"rag/zip":["odt","ods","odp","odf"].includes(C)?"rag/odf":C==="json"?"rag/json":"rag/file"},v=b=>{if(u)return u(b);if(l){if(b.itemType==="dir")return K.jsx(ao,{type:"rag/folder",size:16});if(b.itemType==="file"&&b.fileType){const C=g(b.fileType);return K.jsx(ao,{type:C,size:16})}return K.jsx(ao,{type:"rag/folder",size:16})}return null},y=e.categories.filter(b=>b.visible!==!1);return!y||y.length===0?null:K.jsxs(yE,{className:`knowledge-base-document-list ${o||""}`,style:a,$theme:f,children:[K.jsx(xE,{children:e.title}),e.subtitle&&K.jsxs(wE,{children:[e.subtitle," (\u5171",e.totalCount,"\u4E2A):"]}),K.jsx(CE,{children:y.map((b,C)=>K.jsxs(DE,{onClick:()=>d(b),$theme:f,children:[v(b),K.jsx(kE,{children:b.name}),b.itemType==="dir"&&K.jsxs(EE,{children:["(",b.documentCount,")"]})]},b.id||C))}),e.showViewAll!==!1&&K.jsx(SE,{onClick:m,$theme:f,children:e.viewAllText||"\u67E5\u770B\u5168\u90E8>>"})]})},yE=Xe.div.attrs({className:"knowledge-base-document-list-container"})`
1295
+ margin-bottom: 16px;
1296
+ padding: 16px;
1297
+ margin-left:25px;
1298
+
1299
+ background: ${({$theme:e})=>{var t;return((t=e==null?void 0:e.colors)==null?void 0:t.background)||"#ffffff"}};
1300
+ border-radius: 8px;
1301
+ `,xE=Xe.h3.attrs({className:"knowledge-base-document-list-title"})`
1302
+ font-size: 18px;
1303
+ font-weight: 600;
1304
+ color: #1f2937;
1305
+ margin: 0 0 8px 0;
1306
+ `,wE=Xe.div.attrs({className:"knowledge-base-document-list-subtitle"})`
1307
+ font-size: 14px;
1308
+ color: #6b7280;
1309
+ margin-bottom: 12px;
1310
+ `,CE=Xe.div.attrs({className:"knowledge-base-document-list-category-list"})`
1311
+ display: flex;
1312
+ flex-direction: column;
1313
+ gap: 8px;
1314
+ margin-bottom: 12px;
1315
+ `,DE=Xe.div.attrs({className:"knowledge-base-document-list-category-item"})`
1316
+ display: flex;
1317
+ align-items: center;
1318
+ gap: 8px;
1319
+ padding: 8px 0;
1320
+ cursor: pointer;
1321
+ transition: all 0.2s ease;
1322
+
1323
+ &:hover {
1324
+ opacity: 0.8;
1325
+ }
1326
+ `,kE=Xe.span.attrs({className:"knowledge-base-document-list-category-name"})`
1327
+ font-size: 14px;
1328
+ color: #1f2937;
1329
+ `,EE=Xe.span.attrs({className:"knowledge-base-document-list-category-count"})`
1330
+ font-size: 14px;
1331
+ color: #6b7280;
1332
+ `,SE=Xe.a.attrs({className:"knowledge-base-document-list-view-all"})`
1333
+ display: inline-block;
1334
+ font-size: 14px;
1335
+ color: ${({$theme:e})=>{var t;return((t=e==null?void 0:e.colors)==null?void 0:t.primary)||"#3b82f6"}};
1336
+ text-decoration: none;
1337
+ cursor: pointer;
1338
+ transition: color 0.2s ease;
1339
+
1340
+ &:hover {
1341
+ color: ${({$theme:e})=>{var t;return((t=e==null?void 0:e.colors)==null?void 0:t.primary)||"#2563eb"}};
1342
+ text-decoration: underline;
1343
+ }
1344
+ `;function AE(e,t){const[r,n]=Ht(()=>BE(e,t));return sr(()=>{if(e==="desktop"){n(!1);return}if(e==="mobile"){n(!0);return}if(typeof window>"u")return;const o=window.matchMedia(`(max-width: ${Math.max(0,t-1)}px)`),a=()=>n(o.matches);return a(),o.addEventListener("change",a),()=>o.removeEventListener("change",a)},[e,t]),r}function BE(e,t){return e==="desktop"?!1:e==="mobile"?!0:typeof window>"u"?!1:window.matchMedia(`(max-width: ${Math.max(0,t-1)}px)`).matches}function r0(e,t,r=18){var l;const n=(e||"").toLowerCase(),o=((l=t==null?void 0:t.theme)==null?void 0:l.icons)||{},a=(u,f,d)=>{const m=[u,...d||[]];for(const g of m){const v=o[g];if(v){if(We.isValidElement(v))return v;if(typeof v=="string")return K.jsx("img",{src:v,alt:g,style:{width:r,height:r}})}}return K.jsx(ao,{type:f,size:r})};return["png","jpg","jpeg","gif","bmp","webp","svg","ico"].includes(n)?a("image","rag/pic",["png","jpg","jpeg"]):n==="pdf"?a("pdf","rag/pdf"):n==="ofd"?a("ofd","rag/ofd"):["doc","docx"].includes(n)?a("docx","rag/word",["doc"]):["xls","xlsx","xlsm","xlsb","xltx","xltm","xlt","xlam"].includes(n)?a("sheets","rag/excel",["excel","xls","xlsx"]):n==="csv"?a("csv","rag/csv",["sheets","excel"]):["ppt","pptx"].includes(n)?a("pptx","rag/ppt",["ppt"]):n==="txt"||n==="md"?a("txt","rag/txt",["md"]):["zip","rar","7z"].includes(n)?a("archive","rag/zip",["zip","rar"]):["odt","ods","odp","odf"].includes(n)?a("odt","rag/odf"):["html","htm","url"].includes(n)?a("html","rag/url",["htm","url"]):n==="json"?a("json","rag/json"):K.jsx(ao,{type:"rag/file",size:r})}function zm(e){const t=e.replace(/"pk":\s*(\d+)/g,'"pk":"$1"').replace(/"order_num":\s*(\d+)/g,'"order_num":"$1"').replace(/"related_pk":\s*(\d+)/g,'"related_pk":"$1"');return JSON.parse(t)}function fa(e){let t=[];for(const r of e)r.retrive===!0&&t.push(r),Array.isArray(r.children)&&(t=t.concat(fa(r.children)));return t}function FE(e){const t=[],r=/<retrive-tag[^>]*image_urls=['"]([^'"]+)['"][^>]*>/g;let n;for(;n=r.exec(e);){const a=n[1].split(";").map(l=>l.trim()).filter(Boolean);t.push(...a)}const o=/\[retrive-tag[^\]]*image_urls=['"]([^'"]+)['"][^\]]*\]\[[^\]]+\]\[\/retrive-tag\]/g;for(;n=o.exec(e);){const a=n[1].split(";").map(l=>l.trim()).filter(Boolean);t.push(...a)}return Array.from(new Set(t))}function da(e){if(e==null)return null;const t=Number(e);return Number.isNaN(t)?null:t}function TE(e){const t=[];let r=1;const n=o=>{o.forEach(a=>{(a==null?void 0:a.type)==="retrieve-sql-data"&&(a!=null&&a.id)&&t.push({id:String(a.id),index:r++}),Array.isArray(a==null?void 0:a.children)&&a.children.length&&n(a.children)})};return Array.isArray(e)&&e.length&&n(e),t}const $E=Xe.div.attrs({className:"chat-message-container"})`
1345
+ display: flex;
1346
+ flex-direction: column;
1347
+ margin-bottom: 0.5rem;
1348
+ animation: fadeIn 0.3s ease-in-out;
1349
+ width: 100%;
1350
+ text-wrap: wrap;
1351
+
1352
+ ${e=>e.$isMobile&&`
1353
+ word-break: break-word;
1354
+ overflow-wrap: anywhere;
1355
+ & pre,
1356
+ & code,
1357
+ & table {
1358
+ max-width: 100%;
1359
+ overflow-x: auto;
1360
+ }
1361
+ `}
1362
+
1363
+ ${e=>e.$align==="right"&&`
1364
+ align-items: flex-end;
1365
+ `}
1366
+
1367
+ ${e=>e.$align==="center"&&`
1368
+ align-items: center;
1369
+ `}
1370
+
1371
+ @keyframes fadeIn {
1372
+ from {
1373
+ opacity: 0;
1374
+ transform: translateY(10px);
1375
+ }
1376
+ to {
1377
+ opacity: 1;
1378
+ transform: translateY(0);
1379
+ }
1380
+ }
1381
+ `,NE=Xe.div.attrs({className:"chat-message-header"})`
1382
+ display: flex;
1383
+ align-items: center;
1384
+ gap: 0.25rem;
1385
+ margin-bottom: 0.5rem;
1386
+ width: 100%;
1387
+
1388
+ ${e=>e.$isUser&&`
1389
+ flex-direction: row-reverse;
1390
+ justify-content: end;
1391
+ `}
1392
+ `,OE=Xe.div.attrs({className:"chat-message-avatar"})`
1393
+ background: ${e=>e.$src?`url('${e.$src}') center/cover no-repeat`:"var(--avatar-bg, #e5e7eb)"};
1394
+ border-radius: 50%;
1395
+ width: 2rem;
1396
+ height: 2rem;
1397
+ flex-shrink: 0;
1398
+ display: flex;
1399
+ align-items: center;
1400
+ justify-content: center;
1401
+ font-size: 1rem;
1402
+ `,ME=Xe.div.attrs({className:"chat-message-content"})`
1403
+ width: 100%;
1404
+
1405
+ /* 思考状态图标旋转动画:不要依赖宿主是否引入 Tailwind 的 keyframes(headless 场景容易缺失) */
1406
+ @keyframes rtext-think-spin {
1407
+ from {
1408
+ transform: rotate(0deg);
1409
+ }
1410
+ to {
1411
+ transform: rotate(360deg);
1412
+ }
1413
+ }
1414
+
1415
+ .think-icon.is-spinning {
1416
+ display: inline-flex;
1417
+ align-items: center;
1418
+ justify-content: center;
1419
+ }
1420
+ .think-icon.is-spinning svg,
1421
+ .think-icon.is-spinning > * {
1422
+ animation: rtext-think-spin 1.2s linear infinite;
1423
+ transform-origin: 50% 50%;
1424
+ }
1425
+
1426
+ .message-time {
1427
+ font-size: 0.75rem;
1428
+ color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.disabled)||"#6b7280"}};
1429
+ }
1430
+
1431
+ .message-card {
1432
+ background: ${e=>e.$isUser?"linear-gradient(180deg, #E3ECFF 0%, #EEEBFF 100%)":"#ffffff"};
1433
+ border: 1px solid ${e=>(e.$isUser,"transparent")};
1434
+ border-radius: 0.5rem;
1435
+ padding-top: 12px;
1436
+ padding-bottom: 12px;
1437
+ overflow: hidden;
1438
+ max-width: ${e=>e.$isUser?"fit-content":"100%"};
1439
+ margin-left: ${e=>e.$isUser?"auto":"0"};
1440
+ margin-right: ${e=>e.$isUser?e.$compact?"10px":"40px":"0"};
1441
+ padding: ${e=>e.$compact?"0.25rem 0.75rem":"0.25rem 1.8rem"};
1442
+ .message-text {
1443
+ width: 100%;
1444
+ line-height: 1.6;
1445
+ white-space: pre-wrap !important; /* 保留换行和空格格式,使用 !important 确保优先级 */
1446
+ border-radius: 0.5rem;
1447
+ min-height: ${e=>e.$isUser?"auto":"40px"};
1448
+ font-size: 0.875rem;
1449
+
1450
+ /* 确保子元素也继承 white-space 属性 */
1451
+ & > * {
1452
+ white-space: pre-wrap !important;
1453
+ }
1454
+ }
1455
+ }
1456
+ `,IE=Xe.div.attrs({className:"chat-message-actions-container"})`
1457
+ margin-top: 0.5rem;
1458
+ display: flex;
1459
+ padding: 0.5rem;
1460
+ align-items: center;
1461
+ flex-wrap: ${e=>e.$touchFriendly?"wrap":"nowrap"};
1462
+
1463
+ gap: 0.75rem;
1464
+
1465
+ button {
1466
+ display: flex;
1467
+ align-items: center;
1468
+ gap: 0.25rem;
1469
+ font-size: 0.875rem;
1470
+ color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.disabled)||"#6b7280"}};
1471
+ background: none;
1472
+ border: none;
1473
+ cursor: pointer;
1474
+ transition: color 0.2s;
1475
+ ${e=>e.$touchFriendly&&`
1476
+ min-width: 44px;
1477
+ min-height: 44px;
1478
+ justify-content: center;
1479
+ `}
1480
+
1481
+ &:hover {
1482
+ color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.primary)||"#3b82f6"}};
1483
+ }
1484
+
1485
+ &.active {
1486
+ color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.primary)||"#3b82f6"}} !important;
1487
+ }
1488
+ }
1489
+ `,RE=Xe.div.attrs({className:"chat-message-follow-up-container"})`
1490
+ margin-top: 1rem;
1491
+ padding: ${e=>e.$compact?"0 0.5rem":"0 2.9rem"};
1492
+
1493
+ border-radius: 0.5rem;
1494
+
1495
+ @keyframes followUpIn {
1496
+ from {
1497
+ opacity: 0;
1498
+ transform: translateY(6px);
1499
+ }
1500
+ to {
1501
+ opacity: 1;
1502
+ transform: translateY(0);
1503
+ }
1504
+ }
1505
+
1506
+ .follow-up-title {
1507
+ font-size: 0.875rem;
1508
+ font-weight: 600;
1509
+ color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.text)||"#374151"}};
1510
+ margin-bottom: 0.75rem;
1511
+ }
1512
+
1513
+ .follow-up-list {
1514
+ display: flex;
1515
+ flex-direction: column;
1516
+ gap: 0.5rem;
1517
+ }
1518
+
1519
+ .follow-up-item {
1520
+ width: fit-content;
1521
+ background: #ffffff;
1522
+ border: 1px solid #e5e7eb;
1523
+ border-radius: 0.375rem;
1524
+ padding: 0.75rem 1rem;
1525
+ cursor: pointer;
1526
+ transition: all 0.2s ease;
1527
+ text-align: left;
1528
+ color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.text)||"#374151"}};
1529
+ font-size: 0.875rem;
1530
+ line-height: 1.4;
1531
+ opacity: 0;
1532
+ transform: translateY(6px);
1533
+ animation: followUpIn 280ms ease forwards;
1534
+ animation-play-state: running;
1535
+
1536
+ &:hover {
1537
+ background: #e5e7eb;
1538
+ border-color: #d1d5db;
1539
+ }
1540
+
1541
+ &:active {
1542
+ transform: translateY(1px);
1543
+ }
1544
+ }
1545
+ `,cs=Xe.div.attrs({className:"chat-message-reference-container"})`
1546
+ padding: 1rem;
1547
+ background: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.background)||"#ffffff"}};
1548
+
1549
+ border-radius: 0.5rem;
1550
+
1551
+ .reference-title {
1552
+ font-size: 0.875rem;
1553
+ font-weight: 600;
1554
+ color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.text)||"#374151"}};
1555
+ margin-bottom: 0.75rem;
1556
+ }
1557
+
1558
+ .reference-list {
1559
+ display: flex;
1560
+ flex-direction: column;
1561
+ gap: 0.5rem;
1562
+ }
1563
+
1564
+ .reference-item {
1565
+ background: #ffffff;
1566
+
1567
+ border-radius: 0.375rem;
1568
+ padding: 0.75rem 0;
1569
+ display: flex;
1570
+ align-items: center;
1571
+ gap: 0.5rem;
1572
+
1573
+ .file-icon {
1574
+ width: 2rem;
1575
+ height: 2rem;
1576
+ background: #e2e8f0;
1577
+ border-radius: 0.25rem;
1578
+ display: flex;
1579
+ align-items: center;
1580
+ justify-content: center;
1581
+ font-size: 0.75rem;
1582
+ color: #64748b;
1583
+ }
1584
+
1585
+ .file-info {
1586
+ flex: 1;
1587
+
1588
+ .file-name {
1589
+ font-size: 0.875rem;
1590
+ font-weight: 500;
1591
+ color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.text)||"#374151"}};
1592
+ margin-bottom: 0.25rem;
1593
+ }
1594
+
1595
+ .file-meta {
1596
+ font-size: 0.75rem;
1597
+ color: #64748b;
1598
+ }
1599
+ }
1600
+
1601
+ .file-score {
1602
+ font-size: 0.75rem;
1603
+ color: #059669;
1604
+ font-weight: 500;
1605
+ }
1606
+ }
1607
+ `,PE=Xe.div.attrs({className:"chat-message-image-preview-modal"})`
1608
+ position: fixed;
1609
+ top: 0;
1610
+ left: 0;
1611
+ right: 0;
1612
+ bottom: 0;
1613
+ background: rgba(0, 0, 0, 0.8);
1614
+ display: ${e=>e.$show?"flex":"none"};
1615
+ align-items: center;
1616
+ justify-content: center;
1617
+ z-index: 1000;
1618
+ cursor: pointer;
1619
+
1620
+ .modal-content {
1621
+ max-width: 90vw;
1622
+ max-height: 90vh;
1623
+ position: relative;
1624
+ cursor: default;
1625
+ display: flex;
1626
+ flex-direction: column;
1627
+ align-items: center;
1628
+ }
1629
+
1630
+ .modal-image {
1631
+ max-width: 100%;
1632
+ max-height: calc(90vh - 60px);
1633
+ object-fit: contain;
1634
+ border-radius: 8px;
1635
+ }
1636
+
1637
+ .modal-close {
1638
+ margin-top: 16px;
1639
+ background: rgba(255, 255, 255, 0.3);
1640
+ border: none;
1641
+ border-radius: 20px;
1642
+ padding: 8px 20px;
1643
+ display: flex;
1644
+ align-items: center;
1645
+ justify-content: center;
1646
+ cursor: pointer;
1647
+ font-size: 14px;
1648
+ color: #333;
1649
+ font-weight: 500;
1650
+ transition: all 0.2s ease;
1651
+
1652
+ &:hover {
1653
+ background: rgba(255, 255, 255, 1);
1654
+ transform: translateY(-1px);
1655
+ }
1656
+ }
1657
+ `,n0=Xe.div.attrs({className:"chat-message-image-gallery-container"})`
1658
+ padding: 0rem 0.5rem;
1659
+ background: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.background)||"#ffffff"}};
1660
+
1661
+ .gallery-grid {
1662
+ display: grid;
1663
+ grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
1664
+ gap: 0.75rem;
1665
+ }
1666
+
1667
+ .gallery-item {
1668
+ position: relative;
1669
+ aspect-ratio: 1;
1670
+ border-radius: 0.375rem;
1671
+ overflow: hidden;
1672
+ cursor: pointer;
1673
+ transition:
1674
+ transform 0.2s ease,
1675
+ box-shadow 0.2s ease;
1676
+ border: 2px solid transparent;
1677
+
1678
+ &:hover {
1679
+ transform: translateY(-2px);
1680
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
1681
+ border-color: ${e=>{var t,r;return((r=(t=e.$theme)==null?void 0:t.colors)==null?void 0:r.primary)||"#3b82f6"}};
1682
+ }
1683
+
1684
+ .gallery-image {
1685
+ width: 100%;
1686
+ height: 100%;
1687
+ object-fit: cover;
1688
+ background: #f3f4f6;
1689
+ }
1690
+
1691
+ .gallery-overlay {
1692
+ position: absolute;
1693
+ bottom: 0;
1694
+ left: 0;
1695
+ right: 0;
1696
+ background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
1697
+ color: white;
1698
+ padding: 0.5rem;
1699
+ font-size: 0.75rem;
1700
+ text-align: center;
1701
+ opacity: 0;
1702
+ transition: opacity 0.2s ease;
1703
+ }
1704
+
1705
+ &:hover .gallery-overlay {
1706
+ opacity: 1;
1707
+ }
1708
+ }
1709
+ `,JE=({token:e,streamUrl:t,is_download:r,content:n,contentType:o="plainText",align:a="left",displayStatus:l="ready",avatar:u,isUser:f=!1,userAvatar:d,aiAvatar:m,date:g,time:v,timestamp:y,showTime:b=!0,errorMessage:C,styles:p,reference:S,webReference:B,faqReference:k,databaseReference:$,graphReference:T,filePaths:O,currentFiles:F,fileManagerData:P,audioUrl:N,feedbackResult:q,queryId:R,defaultAnswer:X,isWelcome:G=!1,isLast:_=!1,respTime:j,tokens:W,resultType:U,followUpQuestions:ee=[],tools:V={},eventsEmit:Y,referenceMode:fe="list",enableThoughtChain:be=!1,thoughtChainVersionMode:he="auto",chain:De,thoughtChainNodes:$e,knowledgeBases:Z,enableCot:ie,chainRespTime:le,thoughtChainStatus:ue,enablePrism:Se=!1,renderMode:Be="desktop",breakpoint:ge=768,dense:Ee=!1})=>{sr(()=>{console.log("isUser",f),console.log("isLast",_)},[_,f]);const Ae=AE(Be,ge),Fe=Ae||!!Ee,xe=ol(),Ce=At(()=>{var oe,Te,ct,Ye,ae,Re,Pe,ut,ve,me,ce;return{colors:{primary:((oe=xe==null?void 0:xe.colors)==null?void 0:oe.primary)||"#3b82f6",background:((Te=xe==null?void 0:xe.colors)==null?void 0:Te.background)||"#ffffff",userBackground:((ct=xe==null?void 0:xe.colors)==null?void 0:ct.primary)||"#3b82f6",border:((Ye=xe==null?void 0:xe.colors)==null?void 0:Ye.border)||"#e5e7eb",text:((ae=xe==null?void 0:xe.colors)==null?void 0:ae.text)||"#374151",disabled:((Re=xe==null?void 0:xe.colors)==null?void 0:Re.disabled)||"#6b7280",info:((Pe=xe==null?void 0:xe.colors)==null?void 0:Pe.info)||"#3b82f6",warning:((ut=xe==null?void 0:xe.colors)==null?void 0:ut.warning)||"#f59e0b",error:((ve=xe==null?void 0:xe.colors)==null?void 0:ve.error)||"#ef4444",...(me=p==null?void 0:p.theme)==null?void 0:me.colors},icons:{aiAvatar:m||"/vite.svg",userAvatar:d||"/default-user-avatar.png",...(ce=p==null?void 0:p.theme)==null?void 0:ce.icons}}},[xe,p,m,d]),_e=At(()=>{const oe=v||g||y;return!oe||!b?null:Hk(oe).format("YY-MM-DD HH:mm:ss")},[v,g,y,b]),[ht,ot]=Ht([]),[Ie,Ke]=Ht(null),[Ue,vt]=Ht(!1),[tt,nt]=Ht(!1),[It,$t]=Ht(!1),[Bt,Mt]=Ht(!1),[je,pe]=Ht(!1),it=(oe,Te)=>{switch(console.log("handleImageClick",oe,Te),oe){case"imageClick":Ke(Te);break}},Nt=At(()=>{if(!be)return[];if(he==="v1")return[];if(Array.isArray($e)&&$e.length)return $e;const oe=De||(n==null?void 0:n.chain),Te=aE(oe);return ie===0?Te.filter(ct=>ct.businessType==="think"):Te},[be,he,$e,De,n,ie]),Ft=()=>{if(be&&he!=="v1")return null;const oe={processing:{text:"AI \u6B63\u5728\u601D\u8003...",icon:K.jsx(ao,{type:"rag/think",size:16}),spinning:!0},thinking:{text:"\u6DF1\u5EA6\u601D\u8003\u4E2D",icon:K.jsx(ao,{type:"rag/think",size:16}),spinning:!0},uploading:{text:"\u6587\u4EF6\u4E0A\u4F20\u4E2D...",icon:"\u{1F4E4}"},analyzing:{text:"\u77E5\u8BC6\u89E3\u6790\u4E2D...",icon:"\u{1F50D}"},error:{text:C||"\u62B1\u6B49\uFF0C\u672C\u6B21\u8BF7\u6C42\u51FA\u9519\u4E86\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5",icon:"\u274C"},initializing:{text:"\u6B63\u5728\u521D\u59CB\u5316...",icon:"\u2699\uFE0F"},ready:{text:"\u601D\u8003\u5B8C\u6210",icon:K.jsx(ao,{type:"rag/think",size:16}),spinning:!1}}[l]||{text:"\u5904\u7406\u4E2D...",icon:K.jsx(ao,{type:"rag/think",size:16}),spinning:!0},Te=j?`(\u7528\u65F6 ${Math.round(j/1e3)} \u79D2)`:"";return K.jsx("div",{className:"think-header",children:K.jsx("div",{className:"think-header-left ml-[16px]",children:K.jsxs("div",{className:"flex items-center gap-x-1 bg-[#F5F7FA] p-2 rounded w-full",children:[K.jsx("div",{className:`think-icon${oe.spinning?" is-spinning":""}`,children:oe.icon}),K.jsx("div",{className:"think-title",children:oe.text}),Te&&K.jsx("div",{className:"think-time",children:Te}),re&&K.jsx("button",{className:"think-collapse-btn ml-2 cursor-pointer",title:"\u6536\u8D77/\u5C55\u5F00",onClick:()=>{pe(!je)},children:K.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:je?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"},children:K.jsx("path",{d:"m18 15-6-6-6 6"})})})]})})})},yt=()=>{if(!be||he==="v1"||f||!Nt.length)return null;const oe=ue!==void 0?ue===4?4:2:l==="ready"?2:1,Te=ie===0;return K.jsx("div",{className:"thought-chain-wrapper ml-[16px] mr-[16px] mt-2",children:K.jsx(vE,{mode:o==="stream"?"live":"history",nodes:Nt,status:oe,simpleThinkOnly:Te,chainRespTime:le})})},[Rt,St]=Ht([]),[Kt,tr]=Ht(null),lr=At(()=>{try{if(!S)return[];let oe;if(typeof S=="string")oe=JSON.parse(S);else if(Array.isArray(S))oe=S;else if(typeof S=="object")oe=[S];else return[];return Array.isArray(oe)?oe:[]}catch(oe){return console.warn("\u89E3\u6790 rawReferenceList \u5931\u8D25:",oe,S),[]}},[S]),_t=(oe,Te)=>{var Pe,ut,ve;const ct=((Pe=oe==null?void 0:oe.metadata)==null?void 0:Pe.source)||(oe==null?void 0:oe.file_path)||(oe==null?void 0:oe.path)||(oe==null?void 0:oe.convertedFilePath)||(oe==null?void 0:oe.parsedFilePath)||"",Ye=((ut=oe==null?void 0:oe.metadata)==null?void 0:ut.title)||(oe==null?void 0:oe.file_name)||"",ae=((ve=oe==null?void 0:oe.metadata)==null?void 0:ve.id)||(oe==null?void 0:oe.id)||(oe==null?void 0:oe.file_id)||"",Re=lr.find(me=>{var Tt,dt,qe;const ce=((Tt=me==null?void 0:me.metadata)==null?void 0:Tt.source)||(me==null?void 0:me.file_path)||(me==null?void 0:me.path)||(me==null?void 0:me.convertedFilePath)||(me==null?void 0:me.parsedFilePath)||"",He=((dt=me==null?void 0:me.metadata)==null?void 0:dt.title)||(me==null?void 0:me.file_name)||"",Qe=((qe=me==null?void 0:me.metadata)==null?void 0:qe.id)||(me==null?void 0:me.id)||"";return ae&&Qe&&String(ae)===String(Qe)||ct&&ce&&ce===ct||Ye&&He&&He===Ye});if(Re){const me=(Re!=null&&Re.references&&Array.isArray(Re.references)?Re.references:[Re]).find(ce=>String(ce.order_num)===String(Te)||String(ce.id)===String(Te));if(me)return me}for(const me of lr){if(me!=null&&me.references&&Array.isArray(me.references)){const ce=me.references.find(He=>String(He.order_num)===String(Te)||String(He.id)===String(Te));if(ce)return ce}if(String(me.order_num)===String(Te)||String(me.id)===String(Te))return me}return null},Er=(oe,Te)=>{function ct(me,ce){for(const He of me){if(He.references&&Array.isArray(He.references)){const Qe=He.references.find(Tt=>String(Tt.order_num)===String(ce)||String(Tt.id)===String(ce));if(Qe)return Qe}if(String(He.order_num)===String(ce)||String(He.id)===String(ce))return He}return null}let Ye=[];try{if(S){const me=JSON.parse(S);Ye=Array.isArray(me)?me:me&&Array.isArray(me.knowledgeRefs)?me.knowledgeRefs:[]}}catch(me){console.error("Failed to parse reference:",me)}let ae=ct(Ye,oe.id),Re=-1;if(!ae&&String(oe==null?void 0:oe.fromtype)==="10"&&k){let me=[];try{me=typeof k=="string"?zm(k):k,Array.isArray(me)||(me=[me])}catch{}const ce=me.findIndex(He=>String((He==null?void 0:He.pk)??(He==null?void 0:He.order_num)??(He==null?void 0:He.id))===String(oe==null?void 0:oe.id));if(ce>=0)ae=me[ce],Re=ce;else{const He=Number(oe==null?void 0:oe.id);Number.isInteger(He)&&He>=1&&He<=me.length&&(ae=me[He-1],Re=He-1)}}const Pe=me=>{if(typeof n!="string")return;const ce=new RegExp(`\\[retrive-tag[^\\]]*id=['"]${me}['"][^\\]]*\\]\\[([^\\]]+)\\]\\\\/retrive-tag\\]`,"g").exec(n);if(ce&&ce[1]){const He=Number(ce[1]);return Number.isNaN(He)?void 0:He}};let ut;if(String(oe==null?void 0:oe.fromtype)==="10"&&ae){const me=Re>=0?Re+1:Pe(String(oe==null?void 0:oe.id))??1,ce=st(ae,me);ce.tags=[{id:oe==null?void 0:oe.id,index:me,image_urls:(oe==null?void 0:oe.imageUrls)||(oe==null?void 0:oe.image_urls)||[],metadata:(ae==null?void 0:ae.metadata)||{}}],ut={queryId:R,knowledgeRefs:[ce],webRefs:[],graphRefs:[],databaseRefs:[],images:[],raw:{faqReference:k,retriveNodes:[]}}}const ve={tagInfo:{id:oe==null?void 0:oe.id,index:Pe(String(oe==null?void 0:oe.id)),image_urls:(oe==null?void 0:oe.imageUrls)||(oe==null?void 0:oe.image_urls)||[]},fromtype:String((oe==null?void 0:oe.fromtype)??""),leaf:oe,attributes:Te,referenceDoc:ae||void 0,referencesPayloadSingle:ut};if(String(oe==null?void 0:oe.fromtype)==="2"&&T){const me=String((oe==null?void 0:oe.id)??""),ce=Array.isArray(te)?te:[],He=dt=>(Array.isArray(dt==null?void 0:dt.traceNodes)?dt.traceNodes:[]).find(qe=>String(qe==null?void 0:qe.id)===me),Qe=dt=>(Array.isArray(dt==null?void 0:dt.tags)?dt.tags:[]).find(qe=>String(qe==null?void 0:qe.id)===me);let Tt=ce.find(dt=>!!He(dt)||!!Qe(dt));if(!Tt){const dt=String(me||"").split("_")[0];Tt=ce.find(qe=>String(qe==null?void 0:qe.id)===dt)}Tt&&(ve.graph={id:Tt.id,graphName:Tt.graphName,fetchUrl:Tt.fetchUrl,cyphers:Tt.cyphers},ve.traceNode=He(Tt),ve.graphReference=Tt)}Y==null||Y("action_retrive_tag",ve),Y==null||Y("retrive_tag:click",ve)},Cr=oe=>{if(console.log("ChatMessageAdapter received retrieve-sql-data:request-data:",oe),console.log("databaseReference available:",!!$),oe.id&&$){console.log("Sending retrieve-sql-data:data-response with databaseReference"),console.log("databaseReference data:",$);const Te=new CustomEvent("retrieve-sql-data:data-response",{detail:{id:oe.id,databaseReference:$}});console.log("Dispatching event:",Te),window.dispatchEvent(Te)}else console.log("Cannot send response - missing id or databaseReference")};We.useEffect(()=>{const oe=Te=>{Cr(Te.detail)};return window.addEventListener("retrieve-sql-data:request-data",oe),()=>{window.removeEventListener("retrieve-sql-data:request-data",oe)}},[$]),We.useEffect(()=>{const oe=Te=>{Zr(Te.detail)};return window.addEventListener("rtext_pagination_click",oe),()=>{window.removeEventListener("rtext_pagination_click",oe)}},[Kt]);const Zr=oe=>{if(console.log("ChatMessageAdapter received rtext_pagination_click:",oe),oe.replacePredataFunction&&Kt){const Te={...Kt,rows:Kt.rows};oe.replacePredataFunction(Te)}Y==null||Y("rtext_pagination_click",oe)},Ut=Vt(new Map),Sr=Vt(1),zr=Vt(""),cr=Vt({0:1,1:1,2:1,3:1,10:1}),ir=Vt(!1),Ot=At(()=>{if(typeof n=="string"){let oe=n;const Te=[];R&&R!==zr.current&&(Ut.current.clear(),Sr.current=1,cr.current={0:1,1:1,2:1,3:1,10:1},zr.current=R,ir.current=!1);const ct=S===""||S==="[]"||Array.isArray(S)&&S.length===0||S==null;return o==="stream"&&ct?ir.current||(Ut.current.clear(),Sr.current=1,cr.current={0:1,1:1,2:1,3:1,10:1},ir.current=!0):ct||(ir.current=!1),o==="stream"&&(oe=oe.replace(/\[retrive-tag([^\]]*)\]\[([^\]]+)\]\[\/retrive-tag\]/g,(Ye,ae)=>{const Re=ae.match(/id=['"]([^'"]+)['"]/),Pe=ae.match(/fromType=['"]([^'"]+)['"]/);if(Re){const ut=Re[1],ve=Pe?Pe[1]:"0";if(!Ut.current.has(ut)){const ce=cr.current,He=ve==="1"?"1":ve==="2"?"2":ve==="3"?"3":ve==="10"?"10":"0",Qe=ce[He]??1;Ut.current.set(ut,Qe),ce[He]=Qe+1,cr.current=ce}const me=Ut.current.get(ut);return`[retrive-tag${ae}][${me}][/retrive-tag]`}return Ye})),oe=oe.replace(/\[retrive-tag[^\]]*fromType=['"](?:0|10)['"][^\]]*\]\[([^\]]+)\]\[\/retrive-tag\]/g,Ye=>{const ae=Ye.match(/image_urls=['"]([^'"]+)['"]/);if(ae){const Re=ae[1].split(";").map(Pe=>Pe.trim()).filter(Boolean);Te.push(...Re)}return Ye}),Te.length>0&&ot(Te),oe}return n},[n,o,R,S]),w=At(()=>{if(typeof Ot=="string")try{return H2(Ot)}catch(oe){return console.error("Failed to deserialize markdown:",oe),[]}return[]},[Ot]),E=zt(oe=>{if(!(!oe||typeof Ot!="string"))try{const Te=new RegExp(`\\[retrive-tag[^\\]]*id=['"]${oe}['"][^\\]]*\\]\\[([^\\]]+)\\]\\[\\/retrive-tag\\]`,"g").exec(Ot);if(Te&&Te[1]){const ct=Number(Te[1]);return Number.isNaN(ct)?Te[1]:ct}}catch{}},[Ot]),ze=At(()=>TE(w||[]),[w]),I=At(()=>{const oe={};return ze.forEach(Te=>{Te!=null&&Te.id&&!oe[Te.id]&&(oe[Te.id]=Te.index)}),oe},[ze]);sr(()=>{try{o==="stream"&&$&&(oe=>{try{const Te=typeof oe=="string"?JSON.parse(oe):oe;return Te?Array.isArray(Te)?Te:[Te]:[]}catch{return[]}})($).forEach(oe=>{const Te=oe==null?void 0:oe.id;if(!Te)return;const ct=new CustomEvent("retrieve-sql-data:data-response",{detail:{id:Te,databaseReference:oe}});window.dispatchEvent(ct)})}catch{}},[o,$]);const re=At(()=>{if(!Array.isArray(w))return!1;const oe=ct=>{for(const Ye of ct)if(Ye.type==="think"||Array.isArray(Ye.children)&&oe(Ye.children))return!0;return!1},Te=oe(w);return console.log("Think detection:",{slateContent:w,hasThinkElement:Te,displayStatus:l,isUser:f}),Te},[w,l,f]),rr=At(()=>({databaseReference:$,...re&&{isThinkCollapsed:je}}),[$,re,je]),pt=At(()=>u||(f?Ce.icons.userAvatar:Ce.icons.aiAvatar),[u,f,Ce.icons]),wt=At(()=>typeof n=="string"?n:Array.isArray(n)?n.map(oe=>typeof oe=="string"?oe:oe.text||"").join(""):X||"",[n,X]),xt=()=>{if(G)return null;const oe=[{key:"copy",show:V.copy!==!1,icon:R2,label:"\u590D\u5236",onClick:()=>Y==null?void 0:Y("chatbox:copy",{content:wt})},{key:"like",show:V.like!==!1,icon:Q9,label:"\u8D5E",onClick:()=>Y==null?void 0:Y("chatbox:like",{result:q,queryId:R}),active:q===1},{key:"dislike",show:V.dislike!==!1,icon:J9,label:"\u8E29",onClick:()=>Y==null?void 0:Y("chatbox:dislike",{result:q,queryId:R}),active:q===0},{key:"repeat",show:!f&&_,icon:Y9,label:"\u91CD\u590D",onClick:()=>Y==null?void 0:Y("chatbox:repeat",{content:n,queryId:R,filePaths:O,audioUrl:N})},{key:"forward",show:V.forward,icon:Z9,label:"\u8F6C\u53D1",onClick:()=>Y==null?void 0:Y("chatbox:forward",{content:wt,queryId:R})},{key:"delete",show:V.delete,icon:ek,label:"\u5220\u9664",onClick:()=>Y==null?void 0:Y("chatbox:delete",{queryId:R})},{key:"edit",show:V.edit,icon:X9,label:"\u7F16\u8F91",onClick:()=>Y==null?void 0:Y("chatbox:edit",{content:wt,queryId:R})}];return K.jsxs("div",{style:{padding:"0 2.9rem"},className:"flex justify-between items-center",children:[K.jsx(IE,{$theme:Ce,$touchFriendly:Ae,children:oe.filter(Te=>Te.show).map(Te=>{const ct=Te.icon;return K.jsx(Fs,{title:Te.label,placement:"top",children:K.jsx("button",{className:Te.active?"active":"",onClick:Te.onClick,children:K.jsx(ct,{size:18})})},Te.key)})}),!f&&l=="ready"&&!G&&K.jsxs("div",{className:"text-[10px] text-[#888888]",children:["\u672C\u6B21\u56DE\u7B54\u603B\u8BA1\u6D88\u8017 ",K.jsx("span",{style:{color:Ce.colors.primary},children:W||0})," ","tokens"]})]})},st=zt((oe,Te)=>{var me;const ct=oe.metadata||{},Ye=oe.faq_question||ct.sourceFileName||((me=ct.source)==null?void 0:me.split("/").pop())||"FAQ",ae=oe.folder_path||ct.folder_path||ct.knowledge_base_name||"",Re=ae?`${ae} - ${Ye}`:Ye,Pe=`\u77E5\u8BC6\u5E93${Te}\u540D\uFF1A${Re}`,ut=String(oe.pk??oe.order_num??oe.id??""),ve=da(oe.score??ct.score);return{id:ut,file_id:ut,file_name:Pe,file_type:"faq",type:"faq",path:"",score:ve,rrf_score:ve,tags:[],source:oe.folder_path||"",order_num:ut,pk:ut,faq_question:oe.faq_question,faq_answer:oe.faq_answer,folder_path:oe.folder_path,metadata:ct,faqIndex:Te,...oe}},[]),jt=At(()=>{if(!k)return[];let oe=[];try{const Te=typeof k=="string"?zm(k):k;oe=Array.isArray(Te)?Te:[Te]}catch{return[]}return oe.map((Te,ct)=>{var ce;const Ye=Te.metadata||{},ae=Te.faq_question||Ye.sourceFileName||((ce=Ye.source)==null?void 0:ce.split("/").pop())||"FAQ",Re=Te.folder_path||Ye.folder_path||Ye.knowledge_base_name||"",Pe=Re?`${Re} - ${ae}`:ae,ut=`\u77E5\u8BC6\u5E93${ct+1}\u540D\uFF1A${Pe}`,ve=String(Te.pk??Te.order_num??Te.id??""),me=da(Te.score??Ye.score);return{id:ve,file_id:ve,file_name:ut,file_type:"faq",type:"faq",path:"",score:me,rrf_score:me,tags:[],source:Te.folder_path||"",order_num:ve,pk:ve,faq_question:Te.faq_question,faq_answer:Te.faq_answer,folder_path:Te.folder_path,metadata:Ye,faqIndex:ct+1,...Te}})},[k]),Jt=At(()=>{if(!S)return[];let oe=[];try{let ae;if(typeof S=="string")ae=JSON.parse(S);else if(Array.isArray(S))ae=S;else if(typeof S=="object")ae=[S];else return[];oe=Array.isArray(ae)?ae:[]}catch(ae){return console.warn("\u89E3\u6790 reference \u6570\u636E\u5931\u8D25:",ae,S),[]}let Te=oe.map(ae=>{var Re;try{const Pe=ae.metadata||{};let ut="";Pe.type==="video"&&Pe.source_name&&typeof Pe.source_name=="string"?ut=Pe.source_name:ae.name&&typeof ae.name=="string"?ut=ae.name:ae.file_name&&typeof ae.file_name=="string"?ut=ae.file_name:Pe.title&&typeof Pe.title=="string"?ut=Pe.title:Pe.source&&typeof Pe.source=="string"?ut=Pe.source.split("/").pop()||"":ae.order_num?ut=String(ae.order_num):ut="\u672A\u77E5\u6587\u6863";let ve="pdf";if(Pe.type&&typeof Pe.type=="string")ve=Pe.type.toLowerCase();else if(ae.name&&typeof ae.name=="string"){const dt=ae.name.split(".").pop();dt&&(ve=dt.toLowerCase())}else if(Pe.source&&typeof Pe.source=="string"){const dt=Pe.source.split(".").pop();dt&&(ve=dt.toLowerCase())}else if(ae.file_path&&typeof ae.file_path=="string"){const dt=ae.file_path.split(".").pop();dt&&(ve=dt.toLowerCase())}const me=ae.parsedFilePath||Pe.file_path||ae.file_path||ae.convertedFilePath||Pe.link||Pe.source_link||"",{metadata:ce,...He}=ae,Qe=Pe.source||"",Tt=da(ae.score??Pe.score);return{file_id:Pe.id||ae.uid||"",file_name:ut,file_type:ve,path:me,score:Tt,tags:[],parsedFilePath:ae.parsedFilePath,source:Qe,...He}}catch(Pe){console.warn("\u89E3\u6790\u5F15\u7528\u6587\u6863\u65F6\u51FA\u9519:",Pe,ae);const{metadata:ut,...ve}=ae,me=((Re=ae.metadata)==null?void 0:Re.source)||ae.file_path||ae.convertedFilePath||"",ce=da(ae.score);return{file_id:ae.uid||"",file_name:ae.name||"\u672A\u77E5\u6587\u6863",file_type:"unknown",path:ae.convertedFilePath||ae.file_path||"",score:ce,tags:[],parsedFilePath:ae.parsedFilePath,source:me,...ve}}});const ct=fa(w||[]);if(ct&&ct.length){const ae=ct.filter(Pe=>Pe.fromtype==="0"),Re=ct.filter(Pe=>Pe.fromtype==="3");Te=Te.map(Pe=>{const ut=ae.map(me=>{var Tt;const ce=oe.find(dt=>String(dt.order_num)===String(me.id));if(!ce||!((Tt=ce==null?void 0:ce.metadata)!=null&&Tt.source))return null;const He=Pe.source||"",Qe=ce.metadata.source||"";return He&&Qe&&He!==Qe?null:{id:me.id||"",index:E(String(me.id))||me.indexId||"",image_urls:me.imageUrls?Array.isArray(me.imageUrls)?me.imageUrls:[me.imageUrls]:me.image_urls?me.image_urls.split(";").map(dt=>dt.trim()).filter(Boolean):[],metadata:ce.metadata||{},order_num:ce.order_num,parsedFilePath:ce.parsedFilePath}}).filter(me=>me!==null),ve=Re.map(me=>{var Tt;const ce=oe.find(dt=>String(dt.order_num)===String(me.id));if(!ce||!((Tt=ce==null?void 0:ce.metadata)!=null&&Tt.source))return null;const He=Pe.source||"",Qe=ce.metadata.source||"";return He&&Qe&&He!==Qe?null:{id:me.id||"",index:E(String(me.id))||me.indexId||"",image_urls:me.imageUrls?Array.isArray(me.imageUrls)?me.imageUrls:[me.imageUrls]:me.image_urls?me.image_urls.split(";").map(dt=>dt.trim()).filter(Boolean):[],metadata:ce.metadata||{},order_num:ce.order_num,parsedFilePath:ce.parsedFilePath}}).filter(me=>me!==null);return{...Pe,tags:[...ut,...ve]}})}const Ye=new Map;return Te.filter(ae=>{const Re=(ae==null?void 0:ae.source)||ae.file_name;return Re?Ye.has(Re)?!1:(Ye.set(Re,!0),!0):!0}).sort((ae,Re)=>Number((Re==null?void 0:Re.score)??0)-Number((ae==null?void 0:ae.score)??0))},[S,w,Ot,E]),yr=At(()=>{if(!B)return[];let oe=[];try{let Ye;if(typeof B=="string")Ye=JSON.parse(B);else if(Array.isArray(B))Ye=B;else if(typeof B=="object")Ye=[B];else return[];oe=Array.isArray(Ye)?Ye:[]}catch(Ye){return console.warn("\u89E3\u6790 webReference \u6570\u636E\u5931\u8D25:",Ye,B),[]}if(!(oe!=null&&oe.length))return[];let Te=oe.map(Ye=>{var Re,Pe,ut;const ae=(Ye==null?void 0:Ye.score)??((Re=Ye==null?void 0:Ye.metadata)==null?void 0:Re.score);return{link:(Pe=Ye==null?void 0:Ye.metadata)==null?void 0:Pe.link,file_name:(ut=Ye==null?void 0:Ye.metadata)==null?void 0:ut.title,score:da(ae),tags:[]}});const ct=fa(w||[]);if(ct&&ct.length){const Ye=ct.filter(ae=>ae.fromtype==="1");Te=Te.map(ae=>{const Re=Ye.map(Pe=>{var ve;const ut=oe.find(me=>String(me.order_num)===String(Pe.id));return!ut||!((ve=ut==null?void 0:ut.metadata)!=null&&ve.title)||ut.metadata.title!==ae.file_name?null:{id:Pe.id||"",index:E(String(Pe.id))||Pe.indexId||"",image_urls:Pe.imageUrls?Array.isArray(Pe.imageUrls)?Pe.imageUrls:[Pe.imageUrls]:Pe.image_urls?Pe.image_urls.split(";").map(me=>me.trim()).filter(Boolean):[],metadata:ut.metadata||{},order_num:ut.order_num}}).filter(Pe=>Pe!==null);return{...ae,tags:Re}})}return Te.sort((Ye,ae)=>Number((ae==null?void 0:ae.score)??0)-Number((Ye==null?void 0:Ye.score)??0))},[B,w,Ot,E]),te=At(()=>{if(console.log("[ChatMessageAdapter] parseGraphReferenceData - graphReference:",T,"type:",typeof T),!T)return console.log("[ChatMessageAdapter] graphReference \u4E3A\u7A7A\uFF0C\u8FD4\u56DE\u7A7A\u6570\u7EC4"),[];let oe=[];try{if(typeof T=="string"){if(T==="[]"||T==="null"||T.trim()==="")return console.log("[ChatMessageAdapter] graphReference \u662F\u7A7A\u5B57\u7B26\u4E32\uFF0C\u8FD4\u56DE\u7A7A\u6570\u7EC4"),[];const ae=JSON.parse(T);oe=Array.isArray(ae)?ae:[],console.log("[ChatMessageAdapter] \u89E3\u6790\u5B57\u7B26\u4E32\u683C\u5F0F\u6210\u529F\uFF0Crefs.length:",oe.length)}else if(Array.isArray(T))oe=T,console.log("[ChatMessageAdapter] graphReference \u662F\u6570\u7EC4\u683C\u5F0F\uFF0Crefs.length:",oe.length);else if(typeof T=="object"&&T!==null)oe=[T],console.log("[ChatMessageAdapter] graphReference \u662F\u5BF9\u8C61\u683C\u5F0F\uFF0C\u8F6C\u6362\u4E3A\u6570\u7EC4\uFF0Crefs.length:",oe.length);else return console.warn("[ChatMessageAdapter] graphReference \u683C\u5F0F\u4E0D\u652F\u6301:",typeof T,T),[]}catch(ae){return console.error("[ChatMessageAdapter] Failed to parse graphReference:",ae,T),[]}const Te=(ae,Re)=>{const Pe=(ae==null?void 0:ae.metadata)??{},ut=(ae==null?void 0:ae.graphName)??(ae==null?void 0:ae.graph_name)??(Pe==null?void 0:Pe.index_name)??`\u56FE\u8C31${Re+1}`,ve=(ae==null?void 0:ae.fetchUrl)??(ae==null?void 0:ae.fetch_url)??(Pe==null?void 0:Pe.fetchUrl)??(Pe==null?void 0:Pe.fetch_url),me=Array.isArray(ae==null?void 0:ae.cyphers)&&ae.cyphers.length?ae.cyphers:typeof(ae==null?void 0:ae.cypher)=="string"&&ae.cypher.trim()?[ae.cypher]:[];let ce=[];if(Array.isArray(ae==null?void 0:ae.traceNodes)&&ae.traceNodes.length)ce=ae.traceNodes;else if(Array.isArray(Pe==null?void 0:Pe.trace_nodes)&&Pe.trace_nodes.length){const Tt=(ae==null?void 0:ae.order_num)??(ae==null?void 0:ae.orderNum)??(Pe==null?void 0:Pe.order_num);ce=Pe.trace_nodes.map((dt,qe)=>({...dt,id:String(Tt??(dt==null?void 0:dt.id)??(dt==null?void 0:dt.vid)??`${(ae==null?void 0:ae.id)??`graph-${Re}`}_${qe}`),metadata:(dt==null?void 0:dt.metadata)??{}}))}else(ae!=null&&ae.order_num||ae!=null&&ae.orderNum)&&(ce=[{id:String((ae==null?void 0:ae.order_num)??(ae==null?void 0:ae.orderNum)),name:(ae==null?void 0:ae.name)??ut,nodeType:"graph",metadata:{}}]);const{metadata:He,...Qe}=ae||{};return{id:(ae==null?void 0:ae.id)||`graph-${Re}`,graphName:ut,fetchUrl:ve,cyphers:me,traceNodes:ce,tags:[],...Qe}};let ct=oe.map((ae,Re)=>Te(ae,Re));const Ye=fa(w||[]);if(Ye&&Ye.length){const ae=Ye.filter(Re=>Re.fromtype==="2");ct=ct.map(Re=>{let Pe=[];Array.isArray(Re.traceNodes)&&Re.traceNodes.length>0?Pe=Re.traceNodes.map((me,ce)=>({id:me.id,index:E(String(me.id))??ce+1,image_urls:[],metadata:me.metadata||{},...me})):Pe=ae.filter(me=>String(me.id)===String(Re.id)).map(me=>({id:me.id||"",index:E(String(me.id))||me.indexId||"",image_urls:me.imageUrls?Array.isArray(me.imageUrls)?me.imageUrls:[me.imageUrls]:me.image_urls?me.image_urls.split(";").map(ce=>ce.trim()).filter(Boolean):[],metadata:{}}));const ut=new Set,ve=Pe.filter(me=>ut.has(String(me.id))?!1:(ut.add(String(me.id)),!0)).sort((me,ce)=>Number(me.index)-Number(ce.index));return{...Re,tags:ve}})}return Object.values((ct||[]).reduce((ae,Re)=>{var ve;const Pe=Re.graphName||Re.name||`__unknown__${Re.id}`,ut={...(Re.tags||[])[0]||{},cypher:Re.cypher||((ve=Re==null?void 0:Re.cyphers)==null?void 0:ve[0]),fetchUrl:Re.fetchUrl,id:Re.id,traceNodes:Re.traceNodes,order_num:Re.order_num,name:Pe};return ae[Pe]?(ae[Pe].tags=(ae[Pe].tags||[]).concat(ut?[ut]:[]),Re.traceNodes&&Array.isArray(Re.traceNodes)&&(ae[Pe].traceNodes=Array.isArray(ae[Pe].traceNodes)?ae[Pe].traceNodes.concat(Re.traceNodes):Re.traceNodes)):ae[Pe]={...Re,name:Pe,tags:ut?[ut]:[]},ae},{})).map(ae=>(ae.tags=(ae.tags||[]).slice().sort((Re,Pe)=>{const ut=Number((Re==null?void 0:Re.index)??0),ve=Number((Pe==null?void 0:Pe.index)??0);return ut-ve}),ae)).sort((ae,Re)=>(Re.score||0)-(ae.score||0))},[T,w,Ot,E]),ne=At(()=>{const oe=[...fa(w||[]).filter(Te=>Te.imageUrls&&Array.isArray(Te.imageUrls)).flatMap(Te=>Te.imageUrls),...ht];return Array.from(new Set(oe))},[w,ht]),Q=At(()=>typeof n!="string"?[]:FE(n),[n]),Je=At(()=>Array.from(new Set([...ne||[],...Q||[]])),[ne,Q]),lt=At(()=>{var oe,Te,ct,Ye,ae,Re,Pe,ut;if(!$)return null;try{const ve=typeof $=="string"?JSON.parse($):$;if(Array.isArray(ve)&&ve.length>0){const me=ve[0];if(me.retrieveSqlData)return{dataFetchUrl:me.retrieveSqlData.fetchUrl||"/index/knowledgeBase/file/stream",databaseName:me.retrieveSqlData.databaseName||"\u6570\u636E\u5E93",tableName:me.retrieveSqlData.tableName||"\u6570\u636E\u8868",total:me.retrieveSqlData.total||0,type:me.retrieveSqlData.type||"COLLECTION",preData:{columns:((Te=(oe=me.retrieveSqlData.preData)==null?void 0:oe[0])==null?void 0:Te.columns)||[],rows:((Ye=(ct=me.retrieveSqlData.preData)==null?void 0:ct[0])==null?void 0:Ye.data)||[]}}}return ve.retrieveSqlData?{dataFetchUrl:ve.retrieveSqlData.fetchUrl||"/index/knowledgeBase/file/stream",databaseName:ve.retrieveSqlData.databaseName||"\u6570\u636E\u5E93",tableName:ve.retrieveSqlData.tableName||"\u6570\u636E\u8868",total:ve.retrieveSqlData.total||0,type:ve.retrieveSqlData.type||"COLLECTION",preData:{columns:((Re=(ae=ve.retrieveSqlData.preData)==null?void 0:ae[0])==null?void 0:Re.columns)||[],rows:((ut=(Pe=ve.retrieveSqlData.preData)==null?void 0:Pe[0])==null?void 0:ut.data)||[]}}:{dataFetchUrl:ve.dataFetchUrl||"/index/knowledgeBase/file/stream",databaseName:ve.databaseName||"\u6570\u636E\u5E93",tableName:ve.tableName||"\u6570\u636E\u8868",total:ve.total||0,type:ve.type||"COLLECTION",preData:ve.preData||{columns:[],rows:[]}}}catch(ve){return console.error("Failed to parse databaseReference:",ve),null}},[$]),mr=oe=>{const{dataSourceType:Te,databaseName:ct,businessTableName:Ye,tableName:ae}=oe;return Te==="DataTable"?`${ct||"\u6570\u636E\u5E93"} - ${Ye||"\u6570\u636E\u8868"}`:Te==="DirectDB"?`${ct||"\u6570\u636E\u5E93"} - ${ae||"\u6570\u636E\u8868"}`:ct||Ye||ae||"\u6570\u636E\u5E93"};We.useEffect(()=>{tr(null),ot([])},[R]),We.useEffect(()=>{var ct;const oe=Ye=>{try{const ae=typeof Ye=="string"?JSON.parse(Ye):Ye;return ae?Array.isArray(ae)?ae:[ae]:[]}catch(ae){return console.error("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] normalizeDbReferenceList \u5931\u8D25:",ae),[]}},Te=(Ye,ae)=>{if(!Array.isArray(Ye))return[];const Re=ae!=null&&ae.id?String(ae.id):void 0,Pe=Re?E(Re):void 0,ut=Re?I[Re]:void 0,ve=Pe??ut??(ae==null?void 0:ae.referenceIndex)??void 0,me=Re&&ve!==void 0?[{id:Re,index:ve}]:[];return Ye.map(ce=>{var He,Qe,Tt,dt;return{...ce,id:ce.id||Re||ce.tableName,referenceId:Re,referenceIndex:ve,tags:me,fetchUrl:ce.fetchUrl||((He=ae==null?void 0:ae.retrieveSqlData)==null?void 0:He.fetchUrl)||(lt==null?void 0:lt.dataFetchUrl)||"",databaseName:ce.databaseName||((Qe=ae==null?void 0:ae.retrieveSqlData)==null?void 0:Qe.databaseName)||(lt==null?void 0:lt.databaseName)||"",tableName:ce.tableName||((Tt=ae==null?void 0:ae.retrieveSqlData)==null?void 0:Tt.tableName)||(lt==null?void 0:lt.tableName)||"",dataSourceType:ce.dataSourceType||((dt=ae==null?void 0:ae.retrieveSqlData)==null?void 0:dt.type)||(lt==null?void 0:lt.type)||"DataTable"}})};if($){const Ye=oe($),ae=[];if(Ye.forEach(Re=>{var Pe,ut,ve;if(Array.isArray(Re==null?void 0:Re.retrieveTableDataList)&&Re.retrieveTableDataList.length)ae.push(...Te(Re.retrieveTableDataList,Re));else if(Array.isArray((ve=(ut=(Pe=Re==null?void 0:Re.retrieveSqlData)==null?void 0:Pe.preData)==null?void 0:ut[0])==null?void 0:ve.data)&&Re.retrieveSqlData.preData[0].data.length){const me={businessTableName:Re.retrieveSqlData.tableName||"\u6570\u636E\u8868",databaseName:Re.retrieveSqlData.databaseName||(lt==null?void 0:lt.databaseName)||"\u6570\u636E\u5E93",tableName:Re.retrieveSqlData.tableName||(lt==null?void 0:lt.tableName)||"\u6570\u636E\u8868",fetchUrl:Re.retrieveSqlData.fetchUrl||(lt==null?void 0:lt.dataFetchUrl)||"",dataSourceType:Re.retrieveSqlData.type||"DirectDB",total:Re.retrieveSqlData.total};ae.push(...Te([me],Re))}}),ae.length>0){St(ae);return}if((ct=lt==null?void 0:lt.preData)!=null&&ct.rows){const Re=Te(lt.preData.rows,{});St(Re);return}console.warn("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] \u672A\u627E\u5230\u53EF\u7528\u7684\u6570\u636E\u5E93\u6570\u636E")}else console.log("[\u6570\u636E\u5E93\u5F15\u7528\u89E3\u6790] databaseReference \u4E0D\u5B58\u5728\uFF0C\u6E05\u7A7A databaseData");St([])},[$,lt,R,I,E]);const Lt=zt(()=>{try{const oe=Array.isArray(Jt)?Jt:[],Te=Array.isArray(jt)?jt:[],ct=fa(w||[]),Ye=ct.filter(qe=>qe.fromtype==="10"),ae=Te.map(qe=>{const Pt=Ye.filter(dr=>String(dr.id)===String(qe.pk||qe.order_num)).map(dr=>({id:dr.id||"",index:E(String(dr.id))??dr.indexId??"",image_urls:dr.imageUrls?Array.isArray(dr.imageUrls)?dr.imageUrls:[dr.imageUrls]:dr.image_urls?dr.image_urls.split(";").map(Vr=>Vr.trim()).filter(Boolean):[],metadata:qe.metadata||{}}));return{...qe,tags:Pt}}),Re=[...oe,...ae],Pe=Array.isArray(yr)?yr:[],ut=Array.isArray(te)?te:[],ve=Je,me=qe=>typeof Ot!="string"?!1:new RegExp(`\\[retrive-tag[^\\]]*id=['"]${qe}['"][^\\]]*\\]\\[([^\\]]+)\\]\\[\\/retrive-tag\\]`,"g").test(Ot),ce=qe=>{const Pt=new Map;return qe.forEach(dr=>{if(dr.id){const Vr=String(dr.id);if(!Pt.has(Vr))Pt.set(Vr,dr);else{const un=Pt.get(Vr),we=Number(dr.index)||0,fr=Number(un.index)||0;(we<fr||we===fr&&!un.index)&&Pt.set(Vr,dr)}}}),Array.from(Pt.values())},He=Re.map(qe=>({...qe,tags:ce((qe.tags||[]).filter(Pt=>Pt.id&&me(String(Pt.id))))})),Qe=Pe.map(qe=>({...qe,tags:ce((qe.tags||[]).filter(Pt=>Pt.id&&me(String(Pt.id))))})),Tt=ut.map(qe=>({...qe,tags:ce((qe.tags||[]).filter(Pt=>Pt.id&&me(String(Pt.id))))})),dt=Rt&&Rt.length>0?Rt.map(qe=>({id:qe.id||qe.tableName||qe.referenceId||"",databaseName:qe.databaseName||(lt==null?void 0:lt.databaseName)||"",tableName:qe.tableName||(lt==null?void 0:lt.tableName)||"",fetchUrl:qe.fetchUrl||(lt==null?void 0:lt.dataFetchUrl)||"",score:da(qe.score),tags:qe.tags||[],referenceIndex:qe.referenceIndex,metadata:qe.metadata?{...qe.metadata,data:void 0,dataList:void 0,rows:void 0,preData:void 0}:{}})):[];return{queryId:R,knowledgeRefs:He,webRefs:Qe,graphRefs:Tt,databaseRefs:dt,images:ve,raw:{reference:S,webReference:B,faqReference:k,graphReference:T,databaseReference:$,retriveNodes:ct}}}catch{return{queryId:R,knowledgeRefs:[],webRefs:[],graphRefs:[],databaseRefs:[],images:[],raw:{reference:S,webReference:B,faqReference:k,graphReference:T,databaseReference:$,retriveNodes:[]}}}},[Jt,jt,yr,te,lt,Rt,Je,w,R,S,B,k,T,$,Ot,E]),bt=At(()=>{if(!f)return[];if(Array.isArray(F))return F;if(typeof F=="string"&&F)try{return JSON.parse(F)}catch{return[]}return[]},[f,F]),Mr=()=>{if(!f||bt.length===0)return null;const oe=ve=>{if(!ve)return"";if(typeof ve=="string"&&(ve.includes("KB")||ve.includes("MB")||ve.includes("GB")||ve.includes("B")))return ve;const me=typeof ve=="string"?parseFloat(ve)||0:ve;return me<1024?`${me}B`:me<1024*1024?`${(me/1024).toFixed(1)}KB`:`${(me/1024/1024).toFixed(1)}MB`},Te=ve=>ve!=null&&ve.status&&(String(ve.status).toLowerCase()==="uploading"||String(ve.status).toLowerCase()==="parsing")?!1:!!(ve!=null&&ve.url||ve!=null&&ve.filePath||ve!=null&&ve.convertedFilePath),ct=bt.filter(ve=>{const me=(ve.name||"").split(".").pop()||"";return["image","jpg","jpeg","png","gif","bmp","webp"].includes(me.toLowerCase())}),Ye=bt.filter(ve=>{const me=(ve.name||"").split(".").pop()||"";return!["image","jpg","jpeg","png","gif","bmp","webp"].includes(me.toLowerCase())}),ae=ct.filter(Te),Re=ct.filter(ve=>!Te(ve)),Pe=Ye.filter(Te),ut=Ye.filter(ve=>!Te(ve));return Pe.length+ut.length,K.jsxs("div",{className:"mt-4 mb-4",style:{width:"100%",paddingLeft:f?"0":"1.8rem",paddingRight:f?"1.8rem":"0",display:"flex",flexDirection:"column",alignItems:f?"flex-end":"flex-start"},children:[(ae.length>0||Re.length>0)&&K.jsx(n0,{$theme:Ce,children:K.jsxs("div",{className:"gallery-grid",style:{direction:"rtl"},children:[Re.map((ve,me)=>{var ce;return K.jsx("div",{className:"gallery-item",style:{background:"#f5f6fa",display:"flex",alignItems:"center",justifyContent:"center"},children:K.jsx("div",{className:"animate-spin",style:{width:24,height:24,border:"2px solid #d1d5db",borderTopColor:((ce=Ce.colors)==null?void 0:ce.primary)||"#3b82f6",borderRadius:"9999px"}})},`pending-img-${me}`)}),ae.map(ve=>K.jsxs("div",{className:"gallery-item",onClick:()=>{Y==null||Y("reference_file:click",{...ve,file:ve.name,file_type:ve.file_type||"image",url:ve.url||ve.filePath,parse_url:ve.parseUrl||ve.convertedFilePath,retrieve_tags:ve.retrieveTags||[],file_id:ve.uid||ve.file_id,parsed_file_type:ve.parsed_file_type||"image",references:ve,type:ve.type||"image",isUploadFile:!0,pdfPages:ve.pdfPages||0})},children:[K.jsx(e0,{src:ve.url||ve.filePath,alt:ve.name,className:"gallery-image",token:e,url:t,eventsEmit:it}),K.jsx("div",{className:"gallery-overlay",children:ve.name})]},ve.uid||ve.name))]})}),(Pe.length>0||ut.length>0)&&K.jsx("div",{style:{display:"flex",flexDirection:"column",marginTop:"6px",alignItems:f?"flex-end":"flex-start",width:"100%"},children:K.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"flex-end",direction:"ltr",paddingLeft:f?"0":"0.5rem",paddingRight:f?"0.5rem":"0",justifyContent:"flex-end",width:"100%",maxWidth:"100%"},children:[ut.map((ve,me)=>{const ce=(ve.name||"").split(".").pop()||"",He=r0(ce,p,18);return K.jsxs("div",{className:"group gap-x-3 items-center file-display-card relative flex w-[240px] bg-white border border-gray-200 rounded-lg shadow-sm px-3 py-2.5 transition-all",children:[K.jsx("div",{className:"pt-0.5 flex-shrink-0",style:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:K.jsx("div",{style:{transform:"scale(1.2)",transformOrigin:"center"},children:He})}),K.jsx("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:K.jsxs("div",{className:"flex items-center justify-between gap-1.5",children:[K.jsx("div",{style:{height:"13px",borderRadius:"4px",backgroundColor:"#d1d5db",width:"140px"}}),K.jsx("div",{style:{height:"12px",borderRadius:"4px",backgroundColor:"#d1d5db",width:"40px"}})]})})]},`pending-doc-${ve.uid||me}`)}),Pe.map(ve=>{var Tt;const me=(ve.name||"").split(".").pop()||"",ce=ve.size??((Tt=ve.file)==null?void 0:Tt.size)??ve.fileSize,He=oe(ce),Qe=r0(me,p,18);return K.jsxs("div",{className:"group gap-x-3 items-center file-display-card relative flex w-[240px] min-h-[56px] bg-white border border-gray-200 rounded-lg shadow-sm px-3 py-2.5 transition-all hover:shadow-md hover:border-blue-300",style:{cursor:"pointer"},title:ve.name,onClick:()=>{Y==null||Y("reference_file:click",{...ve,file:ve.name,file_type:ve.file_type||me,url:ve.url||ve.filePath,parse_url:ve.parseUrl||ve.convertedFilePath,retrieve_tags:ve.retrieveTags||[],file_id:ve.uid||ve.file_id,parsed_file_type:ve.parsed_file_type||me,references:ve,type:ve.type||"file",isUploadFile:!0,pdfPages:ve.pdfPages||0})},children:[K.jsx("div",{style:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:K.jsx("div",{style:{transform:"scale(1.65)",marginBottom:"4px",transformOrigin:"center"},children:Qe})}),K.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[K.jsx("div",{className:"flex",children:K.jsx("div",{className:"flex items-center justify-between gap-1.5",children:K.jsx("span",{className:"text-[13px] font-medium truncate max-w-[140px]",title:ve.name,children:ve.name})})}),K.jsx("div",{className:" text-[12px] text-gray-400 whitespace-nowrap",children:He})]})]},ve.uid||ve.name)})]})})]})},Lr=()=>{if(console.log("[ChatMessageAdapter] convertKnowledgeBasesToDocumentList - knowledgeBases:",Z),!Z||!Array.isArray(Z)||Z.length===0)return console.log("[ChatMessageAdapter] convertKnowledgeBasesToDocumentList - knowledgeBases \u4E3A\u7A7A\u6216\u4E0D\u662F\u6570\u7EC4"),null;const oe=[];let Te=0;if(Z.forEach((ce,He)=>{ce&&ce.treeData&&Array.isArray(ce.treeData)&&(ce.treeData.forEach(Qe=>{oe.push({...Qe,_kbIndex:He,_kbName:ce.knowledgeBaseName||""})}),Te+=ce.totalFileCount||0)}),oe.length===0)return console.log("[ChatMessageAdapter] convertKnowledgeBasesToDocumentList - \u6CA1\u6709\u6709\u6548\u7684 treeData"),null;console.log("[ChatMessageAdapter] convertKnowledgeBasesToDocumentList - \u5408\u5E76\u540E\u7684 allTreeData \u957F\u5EA6:",oe.length);const ct=oe.filter(ce=>ce.type==="dir"),Ye=oe.filter(ce=>ce.type==="file");console.log("[ChatMessageAdapter] convertKnowledgeBasesToDocumentList - dirItems:",ct.length,"fileItems:",Ye.length);let ae=[],Re="\u6309\u76EE\u5F55\u5206\u7C7B";if(ct.length>0){const ce=ct.map((He,Qe)=>({id:`${He._kbIndex}-${He.name||Qe}`||Qe,name:He.name||"",documentCount:He.fileCount||0,visible:!0,itemType:"dir"}));ae.push(...ce)}if(Ye.length>0){const ce=Ye.map((He,Qe)=>({id:`${He._kbIndex}-${He.name||Qe}`||Qe,name:He.name||"\u672A\u77E5\u6587\u4EF6",documentCount:0,visible:!0,itemType:"file",fileType:He.fileType||""}));ae.push(...ce)}if(ct.length===0&&Ye.length>0&&(Re="\u77E5\u8BC6\u5E93\u6587\u6863"),console.log("[ChatMessageAdapter] convertKnowledgeBasesToDocumentList - categories:",ae),ae.length===0)return console.log("[ChatMessageAdapter] convertKnowledgeBasesToDocumentList - \u6CA1\u6709\u53EF\u7528\u7684\u5206\u7C7B"),null;const Pe=Te>0?Te:Ye.length,ut=ae.slice(0,5),ve=ae.length>5,me={title:"\u77E5\u8BC6\u5E93\u6587\u6863\u5217\u8868",subtitle:Re,totalCount:Pe,categories:ut,showViewAll:ve,viewAllText:"\u67E5\u770B\u5168\u90E8>>"};return console.log("[ChatMessageAdapter] convertKnowledgeBasesToDocumentList - result:",me),me},Sn=()=>{if(f)return null;const oe=Lr();return oe?K.jsx(bE,{data:oe,styles:p,onCategoryClick:Te=>{Y==null||Y("knowledge_base_category:click",{category:Te,knowledgeBase:Z==null?void 0:Z[0]})},onViewAllClick:()=>{Y==null||Y("knowledge_base_view_all:click",{knowledgeBases:Z})}}):null},Fr=()=>{var me;if(f)return null;console.log("[ChatMessageAdapter] renderReferences \u5F00\u59CB - referenceMode:",fe),console.log("[ChatMessageAdapter] renderReferences - graphReference \u539F\u59CB\u503C:",T),console.log("[ChatMessageAdapter] renderReferences - parseGraphReferenceData:",te);const oe=[...Array.isArray(Jt)?Jt:[],...Array.isArray(jt)?jt:[]],Te=Array.isArray(yr)?yr:[],ct=Array.isArray(te)?te:[];console.log("[ChatMessageAdapter] renderReferences - knowledgeList:",oe.length,"webList:",Te.length,"graphList:",ct.length),console.log("[ChatMessageAdapter] renderReferences - graphList \u8BE6\u60C5:",ct);const Ye=oe.length>0&&U!==5,ae=Te.length>0,Re=ct.length>0;console.log("[ChatMessageAdapter] renderReferences - hasKnowledgeRefs:",Ye,"hasWebRefs:",ae,"hasGraphRefs:",Re);const Pe=Je.length>0,ut=Rt&&Rt.length>0,ve=Ye||ae||Re||Pe||ut;if(console.log("[ChatMessageAdapter] renderReferences - hasAny:",ve),console.log("[\u5F15\u7528\u6E32\u67D3] databaseReference:",$),console.log("[\u5F15\u7528\u6E32\u67D3] databaseData:",Rt),console.log("[\u5F15\u7528\u6E32\u67D3] databaseData.length:",Rt==null?void 0:Rt.length),console.log("[\u5F15\u7528\u6E32\u67D3] hasDatabaseRefs:",ut),fe==="button"){if(console.log("[ChatMessageAdapter] referenceMode === button, hasAny:",ve),!ve)return console.log("[ChatMessageAdapter] hasAny \u4E3A false\uFF0C\u4E0D\u6E32\u67D3\u5F15\u7528"),null;const ce=Ye&&(oe==null?void 0:oe.length)||0,He=ae&&(Te==null?void 0:Te.length)||0,Qe=Re&&(ct==null?void 0:ct.length)||0,Tt=ut&&(Rt==null?void 0:Rt.length)||0;let dt=ce+He+Qe+Tt;return dt===0&&Pe&&(dt=1),K.jsxs(K.Fragment,{children:[Pe&&K.jsx(n0,{$theme:Ce,children:K.jsx("div",{className:"gallery-grid",children:Je.map((qe,Pt)=>K.jsxs("div",{className:"gallery-item",onClick:()=>{Y==null||Y("reference_file:click",{file:`\u56FE${Pt+1}`,file_type:"image",url:qe,parse_url:qe,retrieve_tags:[],references:{url:qe},type:"image",isUploadFile:!1})},children:[K.jsx(e0,{src:qe,alt:`\u56FE${Pt+1}`,className:"gallery-image",token:e,url:t,eventsEmit:it}),K.jsxs("div",{className:"gallery-overlay",children:["\u56FE",Pt+1]})]},qe+Pt))})}),K.jsx("div",{style:{padding:"6px 2.9rem"},children:K.jsxs("button",{style:{cursor:"pointer",color:((me=Ce.colors)==null?void 0:me.textDisabled)||"#86909C"},className:"text-sm flex items-center gap-x-1 px-3 py-1 rounded border border-gray-200 hover:border-blue-300 transition-colors",onClick:()=>{const qe=Lt();Y==null||Y("references:click",qe)},onMouseEnter:qe=>{var Pt;qe.currentTarget.style.color=((Pt=Ce.colors)==null?void 0:Pt.primary)||"#3b82f6"},onMouseLeave:qe=>{var Pt;qe.currentTarget.style.color=((Pt=Ce.colors)==null?void 0:Pt.textDisabled)||"#86909C"},children:[K.jsx(W9,{size:16}),K.jsxs("span",{children:["\u77E5\u8BC6\u6EAF\u6E90",dt?` ${dt}`:""]}),K.jsx(K9,{size:16})]})})]})}return ve?K.jsxs(K.Fragment,{children:[Pe&&K.jsx(n0,{$theme:Ce,children:K.jsx("div",{className:"gallery-grid",children:Je.map((ce,He)=>K.jsxs("div",{className:"gallery-item",onClick:()=>{Y==null||Y("reference_file:click",{file:`\u56FE${He+1}`,file_type:"image",url:ce,parse_url:ce,retrieve_tags:[],references:{url:ce},type:"image",isUploadFile:!1})},children:[K.jsx(e0,{src:ce,alt:`\u56FE${He+1}`,className:"gallery-image",token:e,url:t,eventsEmit:it}),K.jsxs("div",{className:"gallery-overlay",children:["\u56FE",He+1]})]},ce+He))})}),Ye&&K.jsxs(cs,{$theme:Ce,children:[K.jsx("div",{className:"reference-title justify-between items-center flex",children:K.jsxs("div",{className:"flex items-center gap-2",children:[K.jsx("span",{className:"text-[#374151]",children:"\u77E5\u8BC6\u5E93\u6587\u6863\u5F15\u7528"}),K.jsx("span",{className:"text-[#b4b4b4] text-xs",children:` (${oe.length})`}),oe.length>2&&K.jsx("div",{onClick:()=>vt(!Ue),className:"cursor-pointer hover:text-[#86909C] transition-colors",children:Ue?K.jsx(oi,{size:16,className:"text-[#b4b4b4]"}):K.jsx(ni,{size:16,className:"text-[#b4b4b4]"})})]})}),K.jsx("div",{className:"reference-list",children:(Ue?oe:oe.slice(0,2)).map((ce,He)=>ce&&K.jsx("div",{className:"reference-item",children:K.jsxs("div",{className:"file-info flex items-end gap-2",children:[K.jsx("div",{className:"flex-shrink-0",children:(()=>{const Qe=ce.file_type||(ce.file_name||"").split(".").pop()||"pdf",Tt=(ce.file_name||"").split(".").pop()||"file";return Qe==="video"||["mp4","avi","mov","wmv","flv","webm","mkv"].includes(Qe)?K.jsx("div",{className:"w-6 h-6 rounded flex items-center justify-center bg-red-100",children:K.jsx(G9,{size:16,className:"text-red-600"})}):K.jsx("div",{className:"w-6 h-6 rounded flex items-center justify-center",children:r0(Tt,p,16)})})()}),K.jsx("div",{className:"flex-1 min-w-0",children:K.jsx("div",{className:"text-sm w-[250px] font-medium text-gray-900 truncate hover:text-blue-600 cursor-pointer",onClick:Qe=>{Qe.stopPropagation(),Y==null||Y("knowledge_referenceFile_title:click",{data:{...ce,file_type:ce.file_type,file_name:ce.file_name,metadata:ce.metadata,parsedFilePath:ce.parsedFilePath}})},children:ce.file_name})}),K.jsx("div",{className:"flex items-center gap-1",children:(()=>{const Qe=new Set,Tt=(ce.tags||[]).filter(qe=>Qe.has(qe.id)?!1:(Qe.add(qe.id),!0)).sort((qe,Pt)=>Number(qe.index)-Number(Pt.index)),dt=qe=>{if(typeof Ot!="string")return qe;const Pt=new RegExp(`\\[retrive-tag[^\\]]*id=['"]${qe}['"][^\\]]*\\]\\[([^\\]]+)\\]\\[\\/retrive-tag\\]`,"g").exec(Ot);return Pt?Pt[1]:qe};return Tt.slice(0,10).map(qe=>K.jsx("span",{className:"w-6 h-6 bg-[#e6f7ff] text-[#1890ff] rounded text-xs font-medium flex items-center justify-center cursor-pointer hover:bg-orange-200 transition-colors",onClick:Pt=>{Pt.stopPropagation();const dr=_t(ce,qe.id),Vr=ce.file_type==="video"?"3":"0";Y==null||Y("retrive_tag:click",{tagInfo:dr||ce,fromtype:Vr,leaf:{id:qe.id,fromtype:Vr},attributes:{}})},children:dt(qe.id)},qe.id))})()}),typeof ce.score=="number"&&K.jsxs("div",{className:"text-sm text-gray-600",children:["\u5206\u6570: ",Number(ce.score).toFixed(2)]}),ce.file_type!=="video"&&K.jsxs("div",{className:"flex items-center gap-2",children:[K.jsx(V9,{size:16,className:"text-gray-400 hover:text-blue-600 transition-colors",style:{cursor:r?"pointer":"not-allowed"},onClick:Qe=>{r&&(Qe.stopPropagation(),Y==null||Y("referenceFile_download",{data:{...ce,file_type:ce.file_type,file_name:ce.file_name,metadata:ce.metadata,parsedFilePath:ce.parsedFilePath}}))}}),K.jsx("div",{className:"w-px h-4 bg-gray-300"}),K.jsx(U9,{size:16,className:"text-gray-400 hover:text-blue-600 transition-colors",onClick:Qe=>{Qe.stopPropagation(),Y==null||Y("referenceFile_filechat",{data:{...ce,file_type:ce.file_type,file_name:ce.file_name,metadata:ce.metadata,parsedFilePath:ce.parsedFilePath}})}})]})]})},ce.file_id||He))})]}),ut&&K.jsxs(cs,{$theme:Ce,children:[K.jsx("div",{className:"reference-title justify-between items-center flex",children:K.jsxs("div",{className:"flex items-center gap-2",children:[K.jsx("span",{className:"text-[#374151]",children:"\u6570\u636E\u5E93\u5F15\u7528"}),K.jsx("span",{className:"text-[#b4b4b4] text-xs",children:` (${Rt.length||0})`}),Rt.length>2&&K.jsx("div",{onClick:()=>$t(!It),className:"cursor-pointer hover:text-[#86909C] transition-colors",children:It?K.jsx(oi,{size:16,className:"text-[#b4b4b4]"}):K.jsx(ni,{size:16,className:"text-[#b4b4b4]"})})]})}),K.jsx("div",{className:"reference-list",children:(It?Rt:Rt.slice(0,2)).map((ce,He)=>K.jsx("div",{className:"reference-item",children:K.jsxs("div",{className:"file-info flex items-end gap-2",children:[K.jsx("div",{className:"flex-shrink-0",children:K.jsx("div",{className:"w-6 h-6 rounded flex items-center justify-center",children:K.jsx(q9,{size:20,className:"text-blue-600"})})}),K.jsx("div",{className:"flex-1 min-w-0",children:K.jsx("div",{className:"text-sm w-[250px] font-medium text-gray-900 truncate hover:text-blue-600 cursor-pointer",onClick:Qe=>{Qe.stopPropagation(),Y==null||Y("database_referenceFile_title:click",{data:{...ce,file_type:"database",file_name:mr(ce),metadata:ce,parsedFilePath:ce.fetchUrl||(lt==null?void 0:lt.dataFetchUrl)||"",file:ce.databaseName||"database",url:ce.fetchUrl||(lt==null?void 0:lt.dataFetchUrl)||"",parse_url:ce.fetchUrl||(lt==null?void 0:lt.dataFetchUrl)||"",retrieve_tags:ce.tags||[],references:ce,type:"database",isUploadFile:!1}})},children:mr(ce)})}),K.jsx("div",{className:"flex items-center gap-1",children:(Array.isArray(ce.tags)&&ce.tags.length?ce.tags:[{id:ce.referenceId||`database-${He}`,index:ce.referenceIndex??He+1}]).map(Qe=>K.jsx("span",{className:"w-6 h-6 bg-orange-100 text-orange-600 rounded text-xs font-medium flex items-center justify-center cursor-pointer hover:bg-orange-200 transition-colors",children:Qe.index??He+1},`${Qe.id||"database"}-${Qe.index}`))}),typeof ce.score=="number"&&K.jsxs("div",{className:"text-sm text-gray-600",children:["\u5206\u6570: ",Number(ce.score).toFixed(2)]})]})},ce.tableName||He))})]}),ae&&K.jsxs(cs,{$theme:Ce,children:[K.jsx("div",{className:"reference-title justify-between items-center flex",children:K.jsxs("div",{className:"flex items-center gap-2",children:[K.jsx("span",{className:"text-[#374151]",children:"\u4E92\u8054\u7F51\u641C\u7D22\u5F15\u7528"}),K.jsx("span",{className:"text-[#b4b4b4] text-xs",children:` (${Te.length})`}),Te.length>2&&K.jsx("div",{onClick:()=>nt(!tt),className:"cursor-pointer hover:text-[#86909C] transition-colors",children:tt?K.jsx(oi,{size:16,className:"text-[#b4b4b4]"}):K.jsx(ni,{size:16,className:"text-[#b4b4b4]"})})]})}),K.jsx("div",{className:"reference-list",children:(tt?Te:Te.slice(0,2)).map((ce,He)=>K.jsx("div",{className:"reference-item",children:K.jsxs("div",{className:"file-info flex items-end gap-2",children:[K.jsx("div",{className:"flex-shrink-0",children:K.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center",children:K.jsx(ao,{type:"rag/netretrive",size:32,className:"text-green-600"})})}),K.jsx("div",{className:"flex-1 min-w-0",children:K.jsx("div",{className:"text-sm w-[250px] font-medium text-gray-900 truncate hover:text-blue-600 cursor-pointer",onClick:Qe=>{Qe.stopPropagation(),Y==null||Y("web_referenceFile_title:click",{data:{...ce,file_type:ce.file_type,file_name:ce.file_name,metadata:ce.metadata,parsedFilePath:ce.parsedFilePath,file:ce.file_name,url:ce.link,parse_url:ce.link,retrieve_tags:ce.tags||[],references:ce,type:"file",isUploadFile:!1}})},children:ce.file_name})}),K.jsx("div",{className:"flex items-center gap-1",children:(()=>{const Qe=new Set,Tt=(ce.tags||[]).filter(qe=>Qe.has(qe.id)?!1:(Qe.add(qe.id),!0)).sort((qe,Pt)=>Number(qe.index)-Number(Pt.index)),dt=qe=>{if(typeof Ot!="string")return qe;const Pt=new RegExp(`\\[retrive-tag[^\\]]*id=['"]${qe}['"][^\\]]*\\]\\[([^\\]]+)\\]\\[\\/retrive-tag\\]`,"g").exec(Ot);return Pt?Pt[1]:qe};return Tt.slice(0,1).map(qe=>K.jsx("span",{className:"w-6 h-6 bg-[#f6ffed] text-[#52c41a] rounded text-xs font-medium flex items-center justify-center cursor-pointer hover:bg-orange-200 transition-colors",onClick:Pt=>{Pt.stopPropagation();const dr=_t(ce,qe.id);Y==null||Y("retrive_tag:click",{tagInfo:dr||ce,fromtype:"1",leaf:{id:qe.id,fromtype:"1"},attributes:{}})},children:dt(qe.id)},qe.id))})()}),typeof ce.score=="number"&&K.jsxs("div",{className:"text-sm text-gray-600",children:["\u5206\u6570: ",Number(ce.score).toFixed(2)]})]})},(ce.link||"")+He))})]}),Re&&K.jsxs(cs,{$theme:Ce,children:[K.jsx("div",{className:"reference-title justify-between items-center flex",children:K.jsxs("div",{className:"flex items-center gap-2",children:[K.jsx("span",{className:"text-[#374151]",children:"\u56FE\u8C31\u5F15\u7528"}),K.jsx("span",{className:"text-[#b4b4b4] text-xs",children:` (${ct.length})`}),ct.length>2&&K.jsx("div",{onClick:()=>Mt(!Bt),className:"cursor-pointer hover:text-[#86909C] transition-colors",children:Bt?K.jsx(oi,{size:16,className:"text-[#b4b4b4]"}):K.jsx(ni,{size:16,className:"text-[#b4b4b4]"})})]})}),K.jsx("div",{className:"reference-list",children:(Bt?ct:ct.slice(0,2)).map((ce,He)=>K.jsx("div",{className:"reference-item",children:K.jsxs("div",{className:"file-info flex items-end gap-2",children:[K.jsx("div",{className:"flex-shrink-0",children:K.jsx("div",{className:"w-6 h-6 rounded flex items-center justify-center",children:K.jsx("div",{className:"w-6 h-6 bg-purple-100 text-purple-600 rounded text-xs font-medium flex items-center justify-center",children:"\u56FE"})})}),K.jsx("div",{className:"flex-1 min-w-0",children:K.jsx("div",{className:"text-sm w-[250px] font-medium text-gray-900 truncate",children:ce.graphName||`\u56FE\u8C31${He+1}`})}),K.jsx("div",{className:"flex items-center gap-1",children:(()=>{const Qe=new Set,Tt=(ce.tags||[]).filter(qe=>Qe.has(qe.id)?!1:(Qe.add(qe.id),!0)).sort((qe,Pt)=>Number(qe.index)-Number(Pt.index)),dt=qe=>{if(typeof Ot!="string")return null;const Pt=new RegExp(`\\[retrive-tag[^\\]]*id=['"]${qe}['"][^\\]]*\\]\\[([^\\]]+)\\]\\[\\/retrive-tag\\]`,"g").exec(Ot);return Pt?Pt[1]??null:null};return Tt.map(qe=>({tag:qe,num:dt(qe.id)})).filter(qe=>qe.num!==null&&qe.num!==void 0&&qe.num!=="").slice(0,10).map(({tag:qe,num:Pt})=>K.jsx("span",{className:"w-6 h-6 bg-purple-100 text-purple-600 rounded text-xs font-medium flex items-center justify-center cursor-pointer hover:bg-purple-200 transition-colors",onClick:dr=>{dr.stopPropagation();const Vr=Array.isArray(ce.traceNodes)?ce.traceNodes.find(un=>String(un==null?void 0:un.id)===String(qe.id)):void 0;Y==null||Y("retrive_tag:click",{tagInfo:{id:qe.id,index:qe.index,image_urls:qe.image_urls||[]},fromtype:"2",graph:{id:ce.id,graphName:ce.graphName,fetchUrl:ce.fetchUrl,cyphers:ce.cyphers},traceNode:Vr})},children:Pt},qe.id))})()})]})},ce.id||He))})]})]}):null},nn=()=>f||!_||!ee||ee.length===0?null:K.jsx(RE,{$theme:Ce,$compact:Fe,children:K.jsx("div",{className:"follow-up-list",children:ee.map((oe,Te)=>K.jsx("div",{className:"follow-up-item",style:{animationDelay:`${Te*260}ms`},onClick:()=>{Y==null||Y("chatbox:follow_up_question_click",{question:oe,queryId:R})},children:oe},`${String(oe)}-${Te}`))})});return K.jsxs($E,{$align:a,$isUser:f,$isMobile:Fe,children:[K.jsxs(NE,{$isUser:f,children:[K.jsx(OE,{$src:pt,$isUser:f}),_e&&K.jsx("div",{className:"message-time px-2 text-sm text-[#888888]",children:_e})]}),Mr(),K.jsx(ME,{$isUser:f,$theme:Ce,$compact:Fe,children:K.jsx("div",{className:"message-card",children:K.jsx("div",{className:"message-text",children:o==="stream"?K.jsxs(K.Fragment,{children:[!f&&Ft(),yt(),K.jsx(El,{dataSource:{type:Ai.MARKDOWN,content:Ot},styles:{letterSpacing:p==null?void 0:p.letterSpacing,lineHeight:p==null?void 0:p.lineHeight,templateField:p==null?void 0:p.templateField,text:p==null?void 0:p.text},theme:{...p==null?void 0:p.theme,baseFontSize:16,minHeight:"60px"},onRetriveTagClick:Er,eventsEmit:Y,extraProps:rr,enablePrism:Se},`md-${(Ot||"").length}-think-${je}`)]}):K.jsx("div",{style:{whiteSpace:"pre-wrap"},children:wt})})})}),Sn(),Fr(),!f&&xt(),nn(),typeof document<"u"&&q4(K.jsx(PE,{$show:Ie!==null,onClick:()=>Ke(null),children:Ie&&K.jsxs("div",{className:"modal-content",onClick:oe=>oe.stopPropagation(),children:[K.jsx("img",{src:Ie,alt:"\u9884\u89C8\u56FE\u7247",className:"modal-image"}),K.jsx("button",{className:"modal-close",onClick:()=>Ke(null),children:"\u5173\u95ED"})]})}),document.body)]})};Xe.div.attrs({className:"retrive-chat-message-container"})`
1710
+ display: flex;
1711
+ flex-direction: column;
1712
+ width: 100%;
1713
+ margin-bottom: 16px;
1714
+ `;Xe.div.attrs({className:"retrive-chat-message-header"})`
1715
+ display: flex;
1716
+ align-items: flex-start;
1717
+ gap: 12px;
1718
+ margin-bottom: 12px;
1719
+ `;Xe.div.attrs({className:"retrive-chat-avatar-wrapper"})`
1720
+ width: 40px;
1721
+ height: 40px;
1722
+ border-radius: 50%;
1723
+ overflow: hidden;
1724
+ flex-shrink: 0;
1725
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.background)||"#f3f4f6"}};
1726
+
1727
+ img {
1728
+ width: 100%;
1729
+ height: 100%;
1730
+ object-fit: cover;
1731
+ }
1732
+ `;Xe.div.attrs({className:"retrive-chat-content-wrapper"})`
1733
+ flex: 1;
1734
+ display: flex;
1735
+ flex-direction: column;
1736
+ align-items: ${({isUser:e})=>e?"flex-end":"flex-start"};
1737
+ `;Xe.div.attrs({className:"retrive-chat-timestamp"})`
1738
+ font-size: 12px;
1739
+ color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.disabled)||"#9ca3af"}};
1740
+ margin-bottom: 8px;
1741
+ `;Xe.div.attrs({className:"retrive-chat-user-bubble"})`
1742
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.userBackground)||"#3b82f6"}};
1743
+ color: white;
1744
+ padding: 12px 16px;
1745
+ border-radius: 12px;
1746
+ max-width: 80%;
1747
+ word-wrap: break-word;
1748
+ `;Xe.div.attrs({className:"retrive-chat-ai-message-card"})`
1749
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.background)||"#ffffff"}};
1750
+ border-radius: 12px;
1751
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
1752
+ padding: 0;
1753
+ width: 100%;
1754
+ max-width: 100%;
1755
+ overflow: hidden;
1756
+ `;Xe.div.attrs({className:"retrive-chat-tabs-container"})`
1757
+ display: flex;
1758
+ border-bottom: 1px solid ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.border)||"#e5e7eb"}};
1759
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.background)||"#ffffff"}};
1760
+ `;Xe.button.attrs({className:"retrive-chat-tab-button"})`
1761
+ display: flex;
1762
+ position: relative;
1763
+ align-items: center;
1764
+ gap: 6px;
1765
+ padding: 12px 20px;
1766
+ background: transparent;
1767
+ border: none;
1768
+ border-bottom: 2px solid ${({active:e,theme:t})=>{var r;return e?((r=t.colors)==null?void 0:r.primary)||"#3b82f6":"transparent"}};
1769
+ color: ${({active:e,theme:t})=>{var r,n;return e?((r=t.colors)==null?void 0:r.text)||"#374151":((n=t.colors)==null?void 0:n.disabled)||"#9ca3af"}};
1770
+ font-size: 14px;
1771
+ font-weight: ${({active:e})=>e?500:400};
1772
+ cursor: pointer;
1773
+ transition: all 0.2s ease;
1774
+
1775
+ &:hover {
1776
+ color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.text)||"#374151"}};
1777
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.background)||"#f9fafb"}};
1778
+ }
1779
+
1780
+ svg {
1781
+ width: 16px;
1782
+ height: 16px;
1783
+ }
1784
+ `;Xe.span.attrs({className:"retrive-chat-tab-badge"})`
1785
+ position: absolute;
1786
+ top: 4px;
1787
+ right: 10px;
1788
+ display: inline-flex;
1789
+ align-items: center;
1790
+ justify-content: center;
1791
+ min-width: 16px;
1792
+ height: 16px;
1793
+ padding: 0 4px;
1794
+ border-radius: 999px;
1795
+ font-size: 11px;
1796
+ font-weight: 500;
1797
+ background: #ef4444;
1798
+ color: #ffffff;
1799
+ line-height: 1;
1800
+ `;Xe.div.attrs({className:"retrive-chat-tab-content"})`
1801
+ padding: 20px;
1802
+ `;Xe.div.attrs({className:"retrive-chat-llm-config-container"})`
1803
+ margin-bottom: 20px;
1804
+ `;Xe.div.attrs({className:"retrive-chat-llm-config-title"})`
1805
+ display: flex;
1806
+ align-items: center;
1807
+ gap: 8px;
1808
+ font-size: 14px;
1809
+ font-weight: 500;
1810
+ color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.text)||"#374151"}};
1811
+ margin-bottom: 12px;
1812
+
1813
+ .dot {
1814
+ width: 8px;
1815
+ height: 8px;
1816
+ border-radius: 50%;
1817
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.primary)||"#3b82f6"}};
1818
+ }
1819
+ `;Xe.div.attrs({className:"retrive-chat-llm-config-grid"})`
1820
+ display: grid;
1821
+ grid-template-columns: repeat(2, 1fr);
1822
+ gap: 12px;
1823
+ `;Xe.div.attrs({className:"retrive-chat-llm-config-item"})`
1824
+ display: flex;
1825
+ align-items: center;
1826
+ gap: 8px;
1827
+ font-size: 13px;
1828
+ color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.text)||"#374151"}};
1829
+
1830
+ .dot {
1831
+ width: 6px;
1832
+ height: 6px;
1833
+ border-radius: 50%;
1834
+ flex-shrink: 0;
1835
+ }
1836
+
1837
+ .dot-green {
1838
+ background: #10b981;
1839
+ }
1840
+
1841
+ .dot-blue {
1842
+ background: #3b82f6;
1843
+ }
1844
+
1845
+ .dot-purple {
1846
+ background: #8b5cf6;
1847
+ }
1848
+
1849
+ .dot-yellow {
1850
+ background: #f59e0b;
1851
+ }
1852
+ `;Xe.div.attrs({className:"retrive-chat-semantic-content"})`
1853
+ color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.text)||"#374151"}};
1854
+ line-height: 1.6;
1855
+ font-size: 14px;
1856
+ `;Xe.div.attrs({className:"retrive-chat-stats-container"})`
1857
+ display: flex;
1858
+ gap: 16px;
1859
+ padding: 12px 20px;
1860
+ border-top: 1px solid ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.border)||"#e5e7eb"}};
1861
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.background)||"#f9fafb"}};
1862
+ font-size: 12px;
1863
+ color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.disabled)||"#9ca3af"}};
1864
+ `;Xe.div.attrs({className:"retrive-chat-empty-state"})`
1865
+ padding: 24px 16px;
1866
+ text-align: center;
1867
+ font-size: 13px;
1868
+ color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.disabled)||"#9ca3af"}};
1869
+ `;Xe.div.attrs({className:"retrive-chat-tools-container"})`
1870
+ display: flex;
1871
+ gap: 8px;
1872
+ padding: 12px 20px;
1873
+ border-top: 1px solid ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.border)||"#e5e7eb"}};
1874
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.background)||"#ffffff"}};
1875
+ `;Xe.button.attrs({className:"retrive-chat-tool-button"})`
1876
+ display: flex;
1877
+ align-items: center;
1878
+ justify-content: center;
1879
+ width: 32px;
1880
+ height: 32px;
1881
+ border: 1px solid ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.border)||"#e5e7eb"}};
1882
+ border-radius: 6px;
1883
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.background)||"#ffffff"}};
1884
+ color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.text)||"#374151"}};
1885
+ cursor: pointer;
1886
+ transition: all 0.2s ease;
1887
+
1888
+ &:hover {
1889
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.background)||"#f3f4f6"}};
1890
+ border-color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.primary)||"#3b82f6"}};
1891
+ }
1892
+
1893
+ svg {
1894
+ width: 16px;
1895
+ height: 16px;
1896
+ }
1897
+ `;Xe.div.attrs({className:"retrive-chat-prompt-content"})`
1898
+ font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
1899
+ font-size: 13px;
1900
+ line-height: 1.6;
1901
+ color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.text)||"#374151"}};
1902
+ white-space: pre-wrap;
1903
+ word-break: break-word;
1904
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.background)||"#f9fafb"}};
1905
+ padding: 16px;
1906
+ border-radius: 8px;
1907
+ border: 1px solid ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.border)||"#e5e7eb"}};
1908
+ `;Xe.div.attrs({className:"retrive-chat-config-container"})`
1909
+ display: grid;
1910
+ grid-template-columns: 1fr 1fr;
1911
+ gap: 24px;
1912
+ `;Xe.div.attrs({className:"retrive-chat-config-section"})`
1913
+ display: flex;
1914
+ flex-direction: column;
1915
+ `;Xe.div.attrs({className:"retrive-chat-config-section-title"})`
1916
+ display: flex;
1917
+ align-items: center;
1918
+ gap: 8px;
1919
+ font-size: 14px;
1920
+ font-weight: 500;
1921
+ color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.text)||"#374151"}};
1922
+ margin-bottom: 16px;
1923
+
1924
+ .dot {
1925
+ width: 8px;
1926
+ height: 8px;
1927
+ border-radius: 50%;
1928
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.primary)||"#3b82f6"}};
1929
+ }
1930
+ `;Xe.div.attrs({className:"retrive-chat-config-item-list"})`
1931
+ display: flex;
1932
+ flex-direction: column;
1933
+ gap: 12px;
1934
+ `;Xe.div.attrs({className:"retrive-chat-config-item"})`
1935
+ display: flex;
1936
+ justify-content: space-between;
1937
+ align-items: center;
1938
+ padding: 8px 0;
1939
+ border-bottom: 1px solid ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.border)||"#e5e7eb"}};
1940
+
1941
+ &:last-child {
1942
+ border-bottom: none;
1943
+ }
1944
+ `;Xe.span.attrs({className:"retrive-chat-config-item-label"})`
1945
+ font-size: 13px;
1946
+ color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.text)||"#374151"}};
1947
+ `;Xe.span.attrs({className:"retrive-chat-config-item-value"})`
1948
+ font-size: 13px;
1949
+ font-weight: 500;
1950
+ color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.primary)||"#3b82f6"}};
1951
+ `;Xe.span.attrs({className:"retrive-chat-switch-status"})`
1952
+ font-size: 13px;
1953
+ font-weight: 500;
1954
+ color: ${({enabled:e,theme:t})=>{var r,n;return e?((r=t.colors)==null?void 0:r.success)||"#10b981":((n=t.colors)==null?void 0:n.disabled)||"#9ca3af"}};
1955
+ `;Xe.div.attrs({className:"retrive-chat-retrieve-container"})`
1956
+ display: flex;
1957
+ flex-direction: column;
1958
+ gap: 4px;
1959
+ `;Xe.div.attrs({className:"retrive-chat-retrieve-chunk"})`
1960
+ display: flex;
1961
+ flex-direction: column;
1962
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.background)||"#ffffff"}};
1963
+ border-radius: 12px;
1964
+ border: 1px solid #f7f7f7;
1965
+ overflow: hidden;
1966
+ transition: all 0.3s ease;
1967
+
1968
+ &:hover {
1969
+
1970
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
1971
+
1972
+ }
1973
+ `;Xe.div.attrs({className:"retrive-chat-retrieve-chunk-header"})`
1974
+ display: flex;
1975
+ align-items: center;
1976
+ justify-content: space-between;
1977
+ padding: 5px 10px;
1978
+ cursor: pointer;
1979
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.background)||"#fafafa"}};
1980
+ border-bottom: 1px solid #f7f7f7;
1981
+ transition: background-color 0.2s ease;
1982
+
1983
+ &:hover {
1984
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.background)||"#f5f5f5"}};
1985
+ }
1986
+ `;Xe.div.attrs({className:"retrive-chat-retrieve-chunk-title"})`
1987
+ display: flex;
1988
+ align-items: center;
1989
+ gap: 10px;
1990
+ font-size: 15px;
1991
+ font-weight: 600;
1992
+ color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.text)||"#111827"}};
1993
+
1994
+ .dot {
1995
+ width: 10px;
1996
+ height: 10px;
1997
+ border-radius: 50%;
1998
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.primary)||"#3b82f6"}};
1999
+ flex-shrink: 0;
2000
+ }
2001
+ `;Xe.div.attrs({className:"retrive-chat-retrieve-chunk-content"})`
2002
+ display: ${({$isExpanded:e})=>e?"flex":"none"};
2003
+ flex-direction: column;
2004
+ gap: 20px;
2005
+ padding: 6px;
2006
+ animation: ${({$isExpanded:e})=>e?"fadeIn":"none"} 0.3s ease;
2007
+ `;Xe.div.attrs({className:"retrive-chat-chunk-info-container"})`
2008
+ padding: 12px 0px;
2009
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.background)||"#ffffff"}};
2010
+ display: flex;
2011
+ align-items: center;
2012
+ flex-wrap: nowrap;
2013
+ gap: 4px;
2014
+ font-size: 13px;
2015
+ overflow-x: auto;
2016
+ `;Xe.div.attrs({className:"retrive-chat-chunk-info-item"})`
2017
+ display: flex;
2018
+ align-items: center;
2019
+ gap: 6px;
2020
+ white-space: nowrap;
2021
+ flex-shrink: 0;
2022
+ `;Xe.span.attrs({className:"retrive-chat-chunk-info-label"})`
2023
+ font-size: 13px;
2024
+ font-weight: 400;
2025
+ color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.disabled)||"#6b7280"}};
2026
+ `;Xe.span.attrs({className:"retrive-chat-chunk-info-value"})`
2027
+ font-size: 13px;
2028
+ font-weight: 600;
2029
+ color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.text)||"#111827"}};
2030
+ padding: 2px 8px;
2031
+ background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.background)||"#f3f4f6"}};
2032
+ border-radius: 4px;
2033
+ `;Xe.div.attrs({className:"retrive-chat-chunk-content-section"})`
2034
+ display: flex;
2035
+ flex-direction: column;
2036
+ gap: 4px;
2037
+ `;Xe.div.attrs({className:"retrive-chat-chunk-section-title"})`
2038
+ font-size: 14px;
2039
+ font-weight: 600;
2040
+ color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.text)||"#111827"}};
2041
+ margin-bottom: 4px;
2042
+ `;Xe.div.attrs({className:"retrive-chat-chunk-content-wrapper"})`
2043
+ padding: 12px;
2044
+ background: #f5f5f5;
2045
+ border-radius: 8px;
2046
+
2047
+ `;Xe.div.attrs({className:"retrive-chat-chunk-file-source-section"})`
2048
+ display: flex;
2049
+ flex-direction: column;
2050
+ gap: 5px;
2051
+ padding: 15px;
2052
+ `;Xe.div.attrs({className:"retrive-chat-file-source"})`
2053
+ display: flex;
2054
+ align-items: flex-end;
2055
+ gap: 8px;
2056
+ `;const zE=Xe.div`
2057
+ position: relative;
2058
+ width: 100%;
2059
+ height: 100%;
2060
+ overflow: ${e=>e.$isVirtualized?"hidden":"auto"};
2061
+ background-color: ${e=>{var t;return((t=e.theme)==null?void 0:t.backgroundColor)||"#ffffff"}};
2062
+ border-radius: ${e=>{var t;return((t=e.theme)==null?void 0:t.borderRadius)||"8px"}};
2063
+
2064
+ /* 自定义滚动条 */
2065
+ &::-webkit-scrollbar {
2066
+ width: 8px;
2067
+ }
2068
+
2069
+ &::-webkit-scrollbar-track {
2070
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.scrollbarTrack)||"#f1f1f1"}};
2071
+ border-radius: 4px;
2072
+ }
2073
+
2074
+ &::-webkit-scrollbar-thumb {
2075
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.scrollbarThumb)||"#c1c1c1"}};
2076
+ border-radius: 4px;
2077
+
2078
+ &:hover {
2079
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.scrollbarThumbHover)||"#a8a8a8"}};
2080
+ }
2081
+ }
2082
+ `,_E=Xe.div`
2083
+ position: relative;
2084
+ width: 100%;
2085
+ height: 100%;
2086
+ overflow: auto;
2087
+ background-color: ${e=>{var t;return((t=e.theme)==null?void 0:t.backgroundColor)||"#ffffff"}};
2088
+
2089
+ /* 自定义滚动条 */
2090
+ &::-webkit-scrollbar {
2091
+ width: 8px;
2092
+ }
2093
+
2094
+ &::-webkit-scrollbar-track {
2095
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.scrollbarTrack)||"#f1f1f1"}};
2096
+ border-radius: 4px;
2097
+ }
2098
+
2099
+ &::-webkit-scrollbar-thumb {
2100
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.scrollbarThumb)||"#c1c1c1"}};
2101
+ border-radius: 4px;
2102
+
2103
+ &:hover {
2104
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.scrollbarThumbHover)||"#a8a8a8"}};
2105
+ }
2106
+ }
2107
+ `,_m=Xe.div`
2108
+ padding: ${e=>{var t;return((t=e.theme)==null?void 0:t.padding)||"1rem"}};
2109
+ min-height: ${e=>e.height||"auto"};
2110
+
2111
+ /* 富文本内容样式增强 */
2112
+ & h1, & h2, & h3, & h4, & h5, & h6 {
2113
+ scroll-margin-top: 2rem;
2114
+ }
2115
+
2116
+ & img {
2117
+ max-width: 100%;
2118
+ height: auto;
2119
+ border-radius: 0.5rem;
2120
+ margin: 1rem 0;
2121
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
2122
+ transition: transform 0.2s ease-in-out;
2123
+
2124
+ &:hover {
2125
+ transform: scale(1.02);
2126
+ }
2127
+ }
2128
+
2129
+ /* 表格样式 - 主题感知 */
2130
+ & .table-container {
2131
+ overflow: auto;
2132
+ border: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#e5e7eb"}};
2133
+ border-radius: 6px;
2134
+ margin: 1rem 0;
2135
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.backgroundColor)||"transparent"}};
2136
+ }
2137
+
2138
+ & .table-container table {
2139
+ width: 100%;
2140
+ border-collapse: collapse;
2141
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.backgroundColor)||"transparent"}};
2142
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
2143
+ }
2144
+
2145
+ & .table-container th,
2146
+ & .table-container td {
2147
+ border: 1px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#e5e7eb"}};
2148
+ padding: 8px 12px;
2149
+ text-align: left;
2150
+ }
2151
+
2152
+ & .table-container th {
2153
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
2154
+ font-weight: 600;
2155
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
2156
+ }
2157
+
2158
+ & .table-container td {
2159
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#24292f"}};
2160
+ }
2161
+
2162
+ & .table-container tr:nth-child(even) {
2163
+ background: ${e=>{var t;return((t=e.theme)==null?void 0:t.disabledBackground)||"#f6f8fa"}};
2164
+ }
2165
+
2166
+ & pre {
2167
+ position: relative;
2168
+
2169
+ &::before {
2170
+ content: '';
2171
+ position: absolute;
2172
+ top: 0;
2173
+ left: 0;
2174
+ right: 0;
2175
+ height: 2px;
2176
+ background: linear-gradient(90deg, #007bff, #28a745, #ffc107, #dc3545);
2177
+ border-radius: 2px 2px 0 0;
2178
+ }
2179
+ }
2180
+
2181
+ & blockquote {
2182
+ position: relative;
2183
+
2184
+ &::before {
2185
+ content: '"';
2186
+ position: absolute;
2187
+ top: -0.5rem;
2188
+ left: -1rem;
2189
+ font-size: 3rem;
2190
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.primaryColor)||"#007bff"}};
2191
+ opacity: 0.3;
2192
+ }
2193
+ }
2194
+
2195
+
2196
+ `,jE=Xe.div`
2197
+ display: flex;
2198
+ align-items: center;
2199
+ justify-content: center;
2200
+ padding: 2rem;
2201
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#6c757d"}};
2202
+ font-size: 0.875rem;
2203
+
2204
+ &::before {
2205
+ content: '';
2206
+ width: 20px;
2207
+ height: 20px;
2208
+ border: 2px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.borderColor)||"#dee2e6"}};
2209
+ border-top: 2px solid ${e=>{var t;return((t=e.theme)==null?void 0:t.primaryColor)||"#007bff"}};
2210
+ border-radius: 50%;
2211
+ animation: spin 1s linear infinite;
2212
+ margin-right: 0.5rem;
2213
+ }
2214
+
2215
+ @keyframes spin {
2216
+ 0% { transform: rotate(0deg); }
2217
+ 100% { transform: rotate(360deg); }
2218
+ }
2219
+ `,LE=Xe.div`
2220
+ display: flex;
2221
+ flex-direction: column;
2222
+ align-items: center;
2223
+ justify-content: center;
2224
+ padding: 3rem;
2225
+ color: ${e=>{var t;return((t=e.theme)==null?void 0:t.textColor)||"#6c757d"}};
2226
+ text-align: center;
2227
+
2228
+ &::before {
2229
+ content: '📄';
2230
+ font-size: 3rem;
2231
+ margin-bottom: 1rem;
2232
+ }
2233
+ `,HE=({dataSource:e,enableVirtualScroll:t=!1,itemHeight:r=200,preloadCount:n=5,enableSegmentedLoading:o=!1,onLoadMore:a,isLoadingMore:l=!1,size:u="sm",basePath:f,theme:d={},onChange:m,onScroll:g,onScrollToTop:v,onScrollToBottom:y,onSegmentClick:b,className:C,style:p,height:S="100%",enablePrism:B=!1})=>{const k=typeof B=="boolean"?B:!1,$=ol(),T=At(()=>{var ge,Ee,Ae,Fe,xe,Ce,_e,ht,ot;return{primaryColor:(d==null?void 0:d.primaryColor)||((ge=$==null?void 0:$.colors)==null?void 0:ge.primary)||"#007bff",secondaryColor:(d==null?void 0:d.secondaryColor)||((Ee=$==null?void 0:$.colors)==null?void 0:Ee.secondary)||"#6c757d",backgroundColor:(d==null?void 0:d.backgroundColor)||((Ae=$==null?void 0:$.colors)==null?void 0:Ae.background)||"#ffffff",textColor:(d==null?void 0:d.textColor)||((Fe=$==null?void 0:$.colors)==null?void 0:Fe.text)||"#24292f",borderColor:(d==null?void 0:d.borderColor)||((xe=$==null?void 0:$.colors)==null?void 0:xe.border)||"#dee2e6",disabledBackground:(d==null?void 0:d.disabledBackground)||((Ce=$==null?void 0:$.colors)==null?void 0:Ce.disabledBackground)||"#f8f9fa",hoverBackground:(d==null?void 0:d.hoverBackground)||((_e=$==null?void 0:$.colors)==null?void 0:_e.hoverBackground)||"#e9ecef",borderRadius:(d==null?void 0:d.borderRadius)||((ht=$==null?void 0:$.space)==null?void 0:ht.radius)||"8px",padding:(d==null?void 0:d.padding)||((ot=$==null?void 0:$.space)==null?void 0:ot.padding)||"1rem",scrollbarTrack:(d==null?void 0:d.scrollbarTrack)||"#f1f1f1",scrollbarThumb:(d==null?void 0:d.scrollbarThumb)||"#c1c1c1",scrollbarThumbHover:(d==null?void 0:d.scrollbarThumbHover)||"#a8a8a8",...d}},[$,d]),O=Vt(0);O.current+=1,console.log("[Markdownit] render count:",O.current);const[F,P]=Ht([]),[N,q]=Ht({start:0,end:10}),[R,X]=Ht(0),[G,_]=Ht(0),[j,W]=Ht(!1),[U,ee]=Ht(!1),[V,Y]=Ht(!1),fe=Vt(null),be=Vt(null),he=Vt(null),De=At(()=>Array.isArray(e)?e:[{id:"single",content:e.content,type:e.type,timestamp:Date.now()}],[e]);sr(()=>{console.log("[Markdownit] setSegments by processedData, len:",Array.isArray(De)?De.length:"n/a"),P(De)},[De]);const $e=At(()=>t?`${F.length*r}px`:"auto",[F.length,r,t]),Z=At(()=>{if(!t)return F;const ge=Math.max(0,N.start-n),Ee=Math.min(F.length,N.end+n);return F.slice(ge,Ee).map((Ae,Fe)=>({...Ae,virtualIndex:ge+Fe}))},[F,N,t,n]),ie=zt(ge=>{const{scrollTop:Ee,scrollHeight:Ae,clientHeight:Fe}=ge.currentTarget;console.log("[Markdownit] onScroll fired",{newScrollTop:Ee,scrollHeight:Ae,clientHeight:Fe});const xe=!t&&!g&&!v&&!y&&!o;if(console.log("[Markdownit] passiveOnly:",xe),xe||X(Ce=>Ce!==Ee?(console.log("[Markdownit] setScrollTop:",Ee),Ee):Ce),t&&!xe){const Ce=Math.floor(Ee/r),_e=Math.min(F.length,Ce+Math.ceil(G/r)+1);q(ht=>ht.start!==Ce||ht.end!==_e?(console.log("[Markdownit] setVisibleRange:",{start:Ce,end:_e}),{start:Ce,end:_e}):ht)}if(!xe){const Ce=Ee<=10;Ce!==U&&(console.log("[Markdownit] isAtTop ->",Ce),ee(Ce),Ce&&v&&(console.log("[Markdownit] onScrollToTop callback"),v()))}if(!xe){const Ce=Ee+Fe>=Ae-10;Ce!==V&&(console.log("[Markdownit] isAtBottom ->",Ce),Y(Ce),Ce&&y&&(console.log("[Markdownit] onScrollToBottom callback"),y()))}g&&(console.log("[Markdownit] onScroll callback ->",{newScrollTop:Ee,scrollHeight:Ae}),g(Ee,Ae)),o&&a&&!j&&!l&&Ae-Ee-G<100&&le()},[t,r,F.length,G,o,a,j,l,U,V,v,y,g]),le=zt(async()=>{if(!(!a||j||l)){W(!0);try{const ge=F[F.length-1],Ee=await a(ge.id);P(Ae=>[...Ae,...Ee])}catch(ge){console.error("Failed to load more segments:",ge)}finally{W(!1)}}},[a,F,j,l]);sr(()=>{const ge=()=>{fe.current&&_(fe.current.clientHeight)};return ge(),window.addEventListener("resize",ge),()=>window.removeEventListener("resize",ge)},[]);const ue=zt((ge,Ee)=>{const Ae={type:ge.type,content:ge.content},Fe=t?{position:"absolute",top:`${(ge.virtualIndex||Ee)*r}px`,left:0,right:0,height:`${r}px`}:{};return K.jsx("div",{style:Fe,onClick:()=>b==null?void 0:b(ge.id,ge),className:b?"cursor-pointer hover:bg-gray-50":"",children:K.jsx(El,{dataSource:Ae,isEditing:!1,size:u,basePath:f,theme:T,onChange:m,enablePrism:k,style:{border:"none",background:"transparent",minHeight:t?`${r}px`:"auto",padding:"0.5rem"}})},ge.id)},[t,r,T,m,b,k]),Se=()=>(console.log("[Markdownit] renderContent segments.len:",F.length,"enableVirtualScroll:",t),F.length===0?K.jsxs(LE,{theme:T,children:[K.jsx("h3",{children:"\u6682\u65E0\u5185\u5BB9"}),K.jsx("p",{children:"\u8BF7\u6DFB\u52A0\u4E00\u4E9B\u5185\u5BB9\u6765\u5F00\u59CB"})]}):t?K.jsx("div",{ref:he,style:{height:$e,position:"relative"},children:Z.map(ue)}):K.jsx("div",{ref:he,children:F.map(ue)})),Be=()=>!j&&!l?null:K.jsx(jE,{theme:T,children:l?"\u52A0\u8F7D\u66F4\u591A\u5185\u5BB9...":"\u52A0\u8F7D\u4E2D..."});return K.jsx(zE,{ref:fe,theme:T,$isVirtualized:t,className:C,style:{height:S,...p},children:t?K.jsx(_E,{ref:be,theme:T,onScroll:ie,children:K.jsx(_m,{theme:T,height:$e,children:Se()})}):K.jsxs(_m,{theme:T,onScroll:ie,children:[Se(),Be()]})})},QE=e=>{const{onRendered:t}=e;return sr(()=>{if(!t)return;const r=requestAnimationFrame(()=>{const n=document.querySelector('[data-markdownit-root="1"]');n&&(console.log("[Markdownit _onRendered] fired"),t(n))});return()=>cancelAnimationFrame(r)},[e.dataSource,e.enableVirtualScroll,t]),K.jsx("div",{"data-markdownit-root":"1",children:K.jsx(HE,{...e})})};Xe.div.attrs({className:"prompt-temp-designer-editor-wrapper"})`
2234
+ position: relative;
2235
+ `;Xe.div.attrs({className:"prompt-temp-designer-template-suggest-hint"})`
2236
+ position: absolute;
2237
+ right: 12px;
2238
+ bottom: 8px;
2239
+ padding: 2px 8px;
2240
+ border-radius: 12px;
2241
+ background: rgba(5, 90, 255, 0.06);
2242
+ color: #055aff;
2243
+ font-size: 12px;
2244
+ display: flex;
2245
+ align-items: center;
2246
+ gap: 4px;
2247
+ pointer-events: none;
2248
+ user-select: none;
2249
+ `;const jm=e=>{if(!e||e.trim()==="")return[{type:"paragraph",children:[{text:""}]}];const t=/<template\b([^>]*)>([\s\S]*?)<\/template>/g,r=[];let n=0,o,a=0;for(console.log("\u5F00\u59CB\u89E3\u6790\u6A21\u677F\u5B57\u7B26\u4E32:",e);(o=t.exec(e))!==null;){const l=o[0],u=o[1]||"",f=(o[2]||"").trim(),d=o.index,m=d+l.length;if(d>n){const S=e.slice(n,d);S.trim()!==""&&(r.push({text:S}),console.log("\u6DFB\u52A0\u6587\u672C\u5143\u7D20:",{text:S}))}const g=S=>{const B=new RegExp(`${S}\\s*=\\s*(["'])((?:\\\\.|[^\\
2250
+ ])*?)\\1`,"i"),k=u.match(B);return k?k[2]:void 0},v=/\S/.test(u),y=g("key"),b=g("placeholder"),C=y||`template-${Date.now()}-${a++}`,p={type:"template",key:C,placeholder:v?b||"\u6A21\u7248\u5B57\u7B26\u5185\u5BB9":f||"\u6A21\u7248\u5B57\u7B26\u5185\u5BB9",value:v?f:"",style:"blue",fieldId:C,children:[{text:""}],inline:!0};r.push(p),console.log("\u6DFB\u52A0template\u5143\u7D20:",p),n=m}if(n<e.length){const l=e.slice(n);l.trim()!==""&&(r.push({text:l}),console.log("\u6DFB\u52A0\u6700\u540E\u6587\u672C\u5143\u7D20:",{text:l}))}return r.length===0&&(e.trim()===""?r.push({text:""}):r.push({text:e}),console.log("\u6CA1\u6709\u627E\u5230template\u6807\u7B7E\uFF0C\u8FD4\u56DE\u539F\u59CB\u6587\u672C")),r.length>0&&r[0].type!=="paragraph"?[{type:"paragraph",children:r}]:(console.log("\u89E3\u6790\u5B8C\u6210\uFF0C\u7ED3\u679C:",r),r)},o0=e=>{if(!e||e.length===0)return"";const t=n=>{let o="",a="";return n.forEach(l=>{if(console.log("\u5904\u7406\u5B50\u5143\u7D20:",l),(l==null?void 0:l.type)==="template"){const f=l.key||l.fieldId||"",d=l.placeholder||"\u6A21\u7248\u5B57\u7B26\u5185\u5BB9",m=l.value||"",g=` key="${String(f)}" placeholder="${String(d)}"`;o+=`<template${g}>${m}</template>`,a=m||d;return}if((l==null?void 0:l.text)!==void 0){const f=l.text||"";if(f.trim()===""){console.log("\u8DF3\u8FC7\u7A7A\u6587\u672C\u5143\u7D20");return}if(f===a){console.log("\u8DF3\u8FC7\u91CD\u590D\u6587\u672C\u5143\u7D20");return}console.log(`\u627E\u5230\u6587\u672C\u5143\u7D20: ${f}`),o+=f,a=f;return}console.log("\u672A\u77E5\u5143\u7D20\u7C7B\u578B:",l);const u=(l==null?void 0:l.text)||"";u.trim()!==""&&u!==a&&(o+=u,a=u)}),o};console.log("\u8F6C\u6362Slate\u6570\u636E:",JSON.stringify(e,null,2));const r=(Array.isArray(e)?e:[]).map(n=>n?n.children?t(n.children):n.text||"":"").join(`
2251
+ `);return console.log("\u8F6C\u6362\u7ED3\u679C:",r),r},KE=e=>!e||e.length===0?"":(Array.isArray(e)?e:[]).map(t=>{if(!t)return"";if(!t.children)return t.text||"";let r="";return t.children.forEach(n=>{(n==null?void 0:n.text)!==void 0?r+=n.text:(n==null?void 0:n.type)==="template"&&(r+=n.value||n.placeholder||"")}),r}).join(`
2252
+ `),qE=e=>!e||e.length===0?"":(Array.isArray(e)?e:[]).map(t=>{if(!t)return"";if(!t.children)return t.text||"";let r="";return t.children.forEach(n=>{(n==null?void 0:n.text)!==void 0?r+=n.text:(n==null?void 0:n.type)==="template"&&(r+=`\`\`\`template\`\`\`
2253
+ ${n.value||n.placeholder}\`\`\`
2254
+ \`\`\`
2255
+ `)}),r}).join(`
2256
+ `),VE=e=>!e||e.length===0?"":(Array.isArray(e)?e:[]).map(t=>{if(!t)return"";if(!t.children)return t.text||"";let r="";return t.children.forEach(n=>{if((n==null?void 0:n.text)!==void 0)r+=n.text;else if((n==null?void 0:n.type)==="template"){const o=n.key||n.fieldId||"",a=n.placeholder||"\u6A21\u7248\u5B57\u7B26\u5185\u5BB9",l=n.value||"",u=` key="${String(o)}" placeholder="${String(a)}"`;r+=`<template${u}>${l}</template>`}}),r}).join(`
2257
+ `),eS=({data:e,onChange:t,size:r="sm",styles:n={},onGetData:o,enablePrism:a=!1})=>{var S,B,k,$,T,O,F,P,N,q,R,X,G,_,j,W,U,ee,V,Y,fe,be,he,De,$e,Z,ie,le,ue,Se,Be,ge,Ee,Ae,Fe,xe,Ce,_e,ht,ot,Ie,Ke,Ue,vt,tt,nt,It,$t,Bt,Mt,je,pe;const l=ol(),u={theme:{colors:{primary:((S=l==null?void 0:l.colors)==null?void 0:S.primary)||"#055AFF",secondary:((B=l==null?void 0:l.colors)==null?void 0:B.secondary)||"#84ADFF",background:((k=l==null?void 0:l.colors)==null?void 0:k.background)||"#E5EEFF",text:(($=l==null?void 0:l.colors)==null?void 0:$.text)||"#055AFF",border:((T=l==null?void 0:l.colors)==null?void 0:T.border)||"#84ADFF",success:((O=l==null?void 0:l.colors)==null?void 0:O.success)||"#008000",warning:((F=l==null?void 0:l.colors)==null?void 0:F.warning)||"#FFA500",error:((P=l==null?void 0:l.colors)==null?void 0:P.error)||"#FF0000",info:((N=l==null?void 0:l.colors)==null?void 0:N.info)||"#0000FF",disabled:((q=l==null?void 0:l.colors)==null?void 0:q.disabled)||"#808080",disabledBackground:((R=l==null?void 0:l.colors)==null?void 0:R.disabledBackground)||"#F5F5F5",disabledText:((X=l==null?void 0:l.colors)==null?void 0:X.disabledText)||"#808080",shadow:((G=l==null?void 0:l.colors)==null?void 0:G.shadow)||"0 1px 3px rgba(0, 0, 0, 0.12)",appBackground:((_=l==null?void 0:l.colors)==null?void 0:_.appBackground)||"transparent",listBackground:((j=l==null?void 0:l.colors)==null?void 0:j.listBackground)||"#f9f9f9",dashboardBackground:((W=l==null?void 0:l.colors)==null?void 0:W.dashboardBackground)||"#ffffff",textSecondary:((U=l==null?void 0:l.colors)==null?void 0:U.textSecondary)||"#6b7280"},space:{sidebar:((ee=l==null?void 0:l.space)==null?void 0:ee.sidebar)||"260px",size:((V=l==null?void 0:l.space)==null?void 0:V.size)||"12px",radius:((Y=l==null?void 0:l.space)==null?void 0:Y.radius)||"6px",padding:((fe=l==null?void 0:l.space)==null?void 0:fe.padding)||"16px",margin:((be=l==null?void 0:l.space)==null?void 0:be.margin)||"20px",shadow:((he=l==null?void 0:l.space)==null?void 0:he.shadow)||"0 2px 8px rgba(0,0,0,0.1)",lineHeight:((De=l==null?void 0:l.space)==null?void 0:De.lineHeight)||"1.6"},icons:(l==null?void 0:l.icons)||{},fonts:{body:{size:((Z=($e=l==null?void 0:l.fonts)==null?void 0:$e.body)==null?void 0:Z.size)||"14px",weight:((le=(ie=l==null?void 0:l.fonts)==null?void 0:ie.body)==null?void 0:le.weight)||"normal",family:((Se=(ue=l==null?void 0:l.fonts)==null?void 0:ue.body)==null?void 0:Se.family)||"PingFang SC, Microsoft YaHei, Arial, sans-serif"},heading:{size:((ge=(Be=l==null?void 0:l.fonts)==null?void 0:Be.heading)==null?void 0:ge.size)||"16px",weight:((Ae=(Ee=l==null?void 0:l.fonts)==null?void 0:Ee.heading)==null?void 0:Ae.weight)||"600",family:((xe=(Fe=l==null?void 0:l.fonts)==null?void 0:Fe.heading)==null?void 0:xe.family)||"PingFang SC, Microsoft YaHei, Arial, sans-serif"}},others:{baseFontWeight:((Ce=l==null?void 0:l.others)==null?void 0:Ce.baseFontWeight)||"normal"}},mode:(l==null?void 0:l.mode)||"light"},f={backgroundColor:((_e=l==null?void 0:l.colors)==null?void 0:_e.background)||"#E5EEFF",borderColor:((ht=l==null?void 0:l.colors)==null?void 0:ht.border)||"#84ADFF",borderRadius:((ot=l==null?void 0:l.space)==null?void 0:ot.radius)||"6px",padding:((Ie=l==null?void 0:l.space)==null?void 0:Ie.padding)||"8px 12px",margin:"2px",fontSize:((Ue=(Ke=l==null?void 0:l.fonts)==null?void 0:Ke.body)==null?void 0:Ue.size)||"14px",fontWeight:((tt=(vt=l==null?void 0:l.fonts)==null?void 0:vt.body)==null?void 0:tt.weight)||"500",minWidth:"30px",textColor:((nt=l==null?void 0:l.colors)==null?void 0:nt.text)||"#84ADFF"},d={...u,...n,theme:{...u.theme,...n==null?void 0:n.theme,colors:{...(It=u.theme)==null?void 0:It.colors,...($t=n==null?void 0:n.theme)==null?void 0:$t.colors},space:{...(Bt=u.theme)==null?void 0:Bt.space,...(Mt=n==null?void 0:n.theme)==null?void 0:Mt.space},fonts:{...(je=u.theme)==null?void 0:je.fonts,...(pe=n==null?void 0:n.theme)==null?void 0:pe.fonts}},templateField:{...f,...n==null?void 0:n.templateField}},[m,g]=Ht(()=>jm(e)),[v,y]=Ht(!1),b=Vt(e);sr(()=>{if(e===b.current)return;console.log("\u6570\u636E\u53D8\u5316\uFF0C\u540C\u6B65\u5230\u5185\u90E8\u72B6\u6001:",e);const it=jm(e);console.log("\u65B0\u7684Slate\u6570\u636E:",it),g(it)},[e]),sr(()=>{console.log("slateData \u72B6\u6001\u53D8\u5316:",m)},[m]);const C=zt((it,Nt)=>{if(Nt===Ai.SLATE&&it){console.log("\u7F16\u8F91\u5668\u5185\u5BB9\u53D8\u5316:",it),g(it);try{const yt=Array.isArray(it)&&it.length>0?it[it.length-1]:null,Rt=yt&&Array.isArray(yt.children)?yt.children:[],St=Rt.length>0?Rt[Rt.length-1]:null,Kt=(St&&typeof St.text=="string"?St.text:"").endsWith("<t");y(Kt)}catch(yt){console.warn("PromptTempDesigner: \u65E0\u6CD5\u5224\u65AD\u6A21\u677F\u63D0\u793A\u89E6\u53D1\u72B6\u6001:",yt),y(!1)}const Ft=o0(it);console.log("\u8F6C\u6362\u540E\u7684\u6A21\u677F\u5B57\u7B26\u4E32:",Ft),b.current=Ft,t==null||t(Ft)}},[t]),p=zt(it=>{if(!m||m.length===0)return"";switch(it){case"pure_string":return KE(m);case"string":return o0(m);case"markdown":return qE(m);case"html":return VE(m);default:return o0(m)}},[m]);return sr(()=>{o==null||o(p)},[p,o]),K.jsx(El,{dataSource:{type:Ai.SLATE,content:m},isEditing:!0,placeholder:"\u5F00\u59CB\u7F16\u8F91\u6A21\u7248...",onChange:C,size:"md",styles:d,enableTemplateInput:!0,enablePrism:a,enableTemplateAutocomplete:!0})};export{wc as D,Do as F,Nc as T,JE as e,eS as n,QE as r,Ai as y};