super-agent-sdk 1.0.17 → 1.0.18

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.
package/dist/widget.cjs CHANGED
@@ -1,33 +1,33 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),xa=require("react-dom/client"),d=require("react/jsx-runtime"),Me=require("./nosUploader-CgVOa1Lz.cjs");function Mr(e){const{sdk:t,sessionId:n,onSessionCreated:r,onRoundStart:i,onStreamStart:s,onStreamEnd:a,onError:o,onMessageSend:l}=e,[u,p]=k.useState([]),[c,h]=k.useState("ready"),[f,m]=k.useState(null),y=k.useRef(new Map),C=k.useRef(new Map),b=k.useRef(n),j=k.useRef(!0),S=k.useRef(u);b.current=n,j.current=u.length===0,S.current=u;const A=k.useCallback((E,R)=>{if(E===b.current)p(T=>{const F=C.current.get(E)??T,U=R(F);return C.current.set(E,U),U});else{const T=C.current.get(E)??[];C.current.set(E,R(T))}},[]),N=k.useCallback((E,R)=>{const T=y.current.get(E);T!=null&&T.stopTimer&&(clearTimeout(T.stopTimer),T.stopTimer=null),y.current.delete(E),C.current.delete(E),E===b.current&&h(R)},[]);k.useEffect(()=>{const E=n?y.current.get(n):void 0;h(E!=null&&E.busy?"streaming":"ready")},[n]);const v=k.useCallback((E,R)=>{var X;const T=b.current;if(T&&((X=y.current.get(T))!=null&&X.busy))return;l==null||l(E);const F={id:`user_${Date.now()}`,role:"user",parts:[...(R??[]).map($=>({type:"attachment",attachment:$})),{type:"text",content:E}],timestamp:Date.now()},U=`assistant_${Date.now()}`,V={id:U,role:"assistant",parts:[],timestamp:Date.now()},P=j.current,O=S.current;p($=>[...$,F,V]),T&&C.current.set(T,[...O,F,V]),h("submitted"),m(null);const x=$=>{let g="",W="",te=[],ee=!1;C.current.has($)||C.current.set($,[...O,F,V]);const ue={abortController:null,busy:!0,stopTimer:null};y.current.set($,ue);const ae=()=>{const q=[...te];if(g){const se=q.findIndex(le=>le.type==="thinking");se>=0?q[se]={type:"thinking",content:g}:q.unshift({type:"thinking",content:g})}if(W){const se=q[q.length-1];(se==null?void 0:se.type)==="text"?q[q.length-1]={type:"text",content:W}:q.push({type:"text",content:W})}A($,se=>se.map(le=>le.id===U?{...le,parts:q}:le))};ue.abortController=t.chat({sessionId:$,message:E,attachments:R&&R.length>0?R:void 0,stream:!0,onMessage:q=>{switch(ee||(ee=!0,$===b.current&&h("streaming")),q.type){case"session.start":q.roundId&&(i==null||i(q.roundId));break;case"thinking":g+=q.content;break;case"ai":W+=q.content;break;case"tool_call":W&&(te.push({type:"text",content:W}),W=""),te.push({type:"tool_call",toolName:q.toolName,toolCallId:q.toolCallId,args:q.args??"{}"});break;case"tool_result":W&&(te.push({type:"text",content:W}),W=""),te.push({type:"tool_result",toolName:q.toolName??"",toolCallId:q.toolCallId,content:q.content,artifacts:q.artifacts,renderMode:q.renderMode,html:q.html,markdown:q.markdown});break;case"interrupt":W&&(te.push({type:"text",content:W}),W=""),q.interrupt&&te.push({type:"interrupt",interrupt:q.interrupt,resolved:!1}),ae(),N($,"ready");return;case"stop":q.content&&(W=q.content),ae();return}ae()},onDone:q=>{if((W||te.length>0||g)&&ae(),q.artifacts&&q.artifacts.length>0){const le=q.artifacts;A($,je=>je.map(Ee=>Ee.id===U?{...Ee,artifacts:le}:Ee))}const se=()=>{N($,"ready"),a==null||a(q.sessionId||$)};if(P){const le=E.slice(0,30),je=q.sessionId||$;t.renameConversation(je,le).catch(()=>{}).finally(se)}else se()},onError:q=>{te.push({type:"error",content:q.message}),ae(),$===b.current&&(m(q),h("error")),o==null||o(q),N($,"error")}}),s==null||s($)};T?x(T):t.createSession().then($=>{b.current==null&&(b.current=$,r==null||r($)),x($)}).catch($=>{b.current==null&&(m($ instanceof Error?$:new Error(String($))),h("error")),o==null||o($ instanceof Error?$:new Error(String($)))})},[t,r,s,a,o,l,A,N]),L=k.useCallback(()=>{const E=b.current;if(!E)return;const R=y.current.get(E);R!=null&&R.busy&&(R.stopTimer&&clearTimeout(R.stopTimer),R.stopTimer=setTimeout(()=>{var T;R.stopTimer=null,(T=R.abortController)==null||T.abort(),N(E,"ready")},8e3),t.stopGeneration(E).catch(()=>{}))},[t,N]),_=k.useCallback(()=>{var U;const E=b.current;if(E&&((U=y.current.get(E))!=null&&U.busy))return;const R=u.findLastIndex(V=>V.role==="user");if(R<0)return;const T=u[R].parts.filter(V=>V.type==="text").map(V=>V.content).join(""),F=u[R].parts.filter(V=>V.type==="attachment").map(V=>V.attachment);p(V=>V.slice(0,R)),v(T,F.length>0?F:void 0)},[u,v]),B=k.useCallback((E,R)=>{var $;const T=b.current;if(!T||($=y.current.get(T))!=null&&$.busy)return;A(T,g=>g.map(W=>({...W,parts:W.parts.map(te=>te.type==="interrupt"&&te.interrupt.interruptId===E?{...te,resolved:!0,response:R}:te)})));const F={abortController:null,busy:!0,stopTimer:null};y.current.set(T,F);const U=new AbortController;F.abortController=U;let V=0;A(T,g=>g.length>0&&g[g.length-1].role==="assistant"?(V=g[g.length-1].parts.length,g):(V=0,[...g,{id:`assistant_${Date.now()}`,role:"assistant",parts:[],timestamp:Date.now()}])),h("streaming");let P="",O="",x=[];const X=()=>{const g=[...x];if(P){const W=g.findIndex(te=>te.type==="thinking");W>=0?g[W]={type:"thinking",content:P}:g.unshift({type:"thinking",content:P})}if(O){const W=g[g.length-1];(W==null?void 0:W.type)==="text"?g[g.length-1]={type:"text",content:O}:g.push({type:"text",content:O})}A(T,W=>{const te=W.findLastIndex(ee=>ee.role==="assistant");return te<0?W:W.map((ee,ue)=>ue===te?{...ee,parts:[...ee.parts.slice(0,V),...g]}:ee)})};t.respondInterrupt(E,T,R,g=>{let W=!1;switch(g.type){case"thinking":P+=g.content;break;case"ai":O+=g.content;break;case"tool_call":O&&(x.push({type:"text",content:O}),O=""),x.push({type:"tool_call",toolName:g.toolName,toolCallId:g.toolCallId,args:g.args??"{}"});break;case"tool_result":O&&(x.push({type:"text",content:O}),O=""),x.push({type:"tool_result",toolName:g.toolName??"",toolCallId:g.toolCallId,content:g.content,artifacts:g.artifacts,renderMode:g.renderMode,html:g.html,markdown:g.markdown});break;case"interrupt":O&&(x.push({type:"text",content:O}),O=""),g.interrupt&&x.push({type:"interrupt",interrupt:g.interrupt,resolved:!1}),W=!0;break;case"stop":g.content&&(O=g.content),a==null||a(T),W=!0;break;case"done":if(g.artifacts&&g.artifacts.length>0){const te=g.artifacts;A(T,ee=>{const ue=ee.findLastIndex(ae=>ae.role==="assistant");return ue<0?ee:ee.map((ae,q)=>q===ue?{...ae,artifacts:te}:ae)})}a==null||a(T),W=!0;break}X(),W&&N(T,"ready")},g=>{x.push({type:"error",content:g.message}),X(),T===b.current&&(m(g),h("error")),o==null||o(g),N(T,"error")},U.signal).catch(g=>{if((g==null?void 0:g.name)==="AbortError"){N(T,"ready");return}T===b.current&&(m(g instanceof Error?g:new Error(String(g))),h("error")),o==null||o(g instanceof Error?g:new Error(String(g))),N(T,"error")})},[t,o,a,A,N]),w=k.useCallback((E,R)=>{b.current=E;const T=R??C.current.get(E)??[];C.current.set(E,T),p(T)},[]),z=k.useCallback(E=>y.current.has(E)?C.current.get(E)??null:null,[]);return k.useEffect(()=>{var R;if(!n||c!=="ready"||(R=y.current.get(n))!=null&&R.busy)return;const E=Me.popPendingChat();E&&E.sessionId===n&&v(E.message)},[n,c]),{messages:u,status:c,error:f,sendMessage:v,stop:L,regenerate:_,setMessages:p,showSession:w,getLiveMessages:z,respondToInterrupt:B}}const Pr="sa_active_conversation",Rt=20;function Mn(e){try{return localStorage.getItem(`${Pr}_${e}`)}catch{return null}}function ba(e,t){try{const n=`${Pr}_${e}`;t?localStorage.setItem(n,t):localStorage.removeItem(n)}catch{}}function Rr(e){const{sdk:t,onConversationChange:n}=e,r=t.botId,[i,s]=k.useState([]),[a,o]=k.useState(()=>Mn(r)),[l,u]=k.useState(!1),[p,c]=k.useState(!0),h=k.useRef(!0),f=k.useRef(1),m=k.useRef(!1);k.useEffect(()=>()=>{h.current=!1},[]);const y=k.useCallback(L=>{o(L),ba(r,L),L&&(n==null||n(L))},[r,n]),C=k.useCallback(async()=>{if(!m.current){m.current=!0,u(!0);try{f.current=1;const L=await t.listConversations({page:1,size:Rt});if(!h.current)return;s(L.items),c(L.items.length<L.total);const _=Mn(r);_&&!L.items.find(B=>B.sessionId===_)&&y(null)}catch{}finally{m.current=!1,h.current&&u(!1)}}},[t,y]),b=k.useCallback(async()=>{if(!(m.current||!p)){m.current=!0,u(!0);try{const L=f.current+1,_=await t.listConversations({page:L,size:Rt});if(!h.current)return;f.current=L,s(w=>{const z=new Set(w.map(R=>R.sessionId)),E=_.items.filter(R=>!z.has(R.sessionId));return[...w,...E]});const B=f.current*Rt;c(B<_.total)}catch{}finally{m.current=!1,h.current&&u(!1)}}},[t,p]),j=k.useCallback(async(L,_)=>(y(L),(_==null?void 0:_.fetchHistory)===!1?[]:await t.getMessages(L)),[t,y]),S=k.useCallback(async()=>{try{const L=await t.createSession(),_=new Date().toISOString();s(B=>[{sessionId:L,botId:0,title:"新对话",createTime:_,updateTime:_},...B]),y(L)}catch{y(null)}},[t,y]),A=k.useCallback(async L=>{s(_=>_.filter(B=>B.sessionId!==L)),a===L&&y(null);try{await t.deleteConversation(L)}catch{}},[t,a,y]),N=k.useCallback(async(L,_)=>{await t.renameConversation(L,_),s(B=>B.map(w=>w.sessionId===L?{...w,title:_}:w))},[t]),{enabled:v=!0}=e;return k.useEffect(()=>{v&&C()},[v,C]),{conversations:i,activeConversationId:a,loading:l,hasMore:p,loadConversations:C,loadMore:b,switchConversation:j,newConversation:S,deleteConversation:A,renameConversation:N,setActiveConversationId:y}}function Fr(e){return!e&&e!==0?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function _r(e){return e==="pdf"?"PDF":e==="docx"?"DOC":e==="html"?"HTM":e==="md"?"MD":e.slice(0,3).toUpperCase()||"FILE"}function wa(e,t){var i;const n=(e||"").toLowerCase();if(n.includes("html"))return"html";if(n.includes("markdown"))return"md";if(n.includes("pdf"))return"pdf";if(n.includes("wordprocessingml")||n==="application/msword")return"docx";const r=((i=(t||"").split(".").pop())==null?void 0:i.toLowerCase())??"";return r==="htm"||r==="html"?"html":r==="md"||r==="markdown"?"md":r==="pdf"?"pdf":r==="doc"||r==="docx"?"docx":r}function Or(e){if(!e)return[];const t=[];for(const n of e)if(n.type==="file"&&n.data){const r=n.data.name??n.data.filename??"",i=n.data.mime??n.data.mime_type??n.data.mimeType;t.push({id:n.data.id??"",type:n.data.fileType??n.data.type??wa(i,r),filename:r,url:n.data.url??"",mime:i,size:n.data.size,summary:n.data.summary})}return t}async function kt(e){try{const t=await fetch(e.url);if(!t.ok)throw new Error(`HTTP ${t.status}`);const n=await t.blob(),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=e.filename,document.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(r),4e3)}catch{const t=document.createElement("a");t.href=e.url,t.download=e.filename,t.target="_blank",document.body.appendChild(t),t.click(),t.remove()}}const Br=k.createContext(null);function Te(){const e=k.useContext(Br);if(!e)throw new Error("useChatContext must be used within ChatProvider");return e}function Jt({sdk:e,hooks:t,attachmentUploader:n,nosUpload:r,children:i}){const[s,a]=k.useState(!1),[o,l]=k.useState(!1),[u,p]=k.useState(null),[c,h]=k.useState(null),[f,m]=k.useState(!1),[y,C]=k.useState(!1);k.useEffect(()=>{e.getToken().then(()=>{m(!0)}).catch(()=>{m(!0)})},[e]);const b=Rr({sdk:e,onConversationChange:t==null?void 0:t.onConversationChange,enabled:f}),j=Mr({sdk:e,sessionId:b.activeConversationId,onSessionCreated:P=>{b.setActiveConversationId(P)},onStreamStart:t==null?void 0:t.onStreamStart,onStreamEnd:P=>{var O;(O=t==null?void 0:t.onStreamEnd)==null||O.call(t,P),b.loadConversations()},onError:t==null?void 0:t.onError,onMessageSend:t==null?void 0:t.onMessageSend}),S=k.useCallback(P=>{if(P.type==="link"){window.open(P.url,P.target??"_blank","noopener");return}h(P)},[]),A=k.useCallback(()=>h(null),[]),N=k.useRef(0),v=k.useCallback(async P=>{const O=++N.current;if(j.getLiveMessages(P)){await b.switchConversation(P,{fetchHistory:!1}),j.showSession(P),C(!1);return}C(!0);try{const x=await b.switchConversation(P);if(N.current!==O)return;j.showSession(P,x)}finally{N.current===O&&C(!1)}},[b,j]),L=k.useCallback(async()=>{j.setMessages([]),await b.newConversation()},[b,j]),_=k.useCallback(async P=>{b.activeConversationId===P&&j.setMessages([]),await b.deleteConversation(P)},[b,j]);k.useEffect(()=>{b.activeConversationId&&j.messages.length===0&&(C(!0),e.getMessages(b.activeConversationId).then(P=>{j.setMessages(P)}).catch(()=>{}).finally(()=>C(!1)))},[]);const B=k.useCallback(()=>{a(P=>!P)},[]),w=k.useCallback(P=>{a(P)},[]),z=k.useCallback(()=>{l(P=>!P),p(P=>null)},[]),E=k.useCallback(P=>{p(P),l(!0)},[]),R=k.useMemo(()=>{const P=new Set,O=[];for(const x of j.messages)if(x.role==="assistant"&&x.artifacts)for(const X of Or(x.artifacts)){const $=X.id||`${X.url}:${X.filename}`;P.has($)||(P.add($),O.push(X))}return O},[j.messages]),T=k.useCallback(async()=>{const P=b.activeConversationId;if(!P)return null;try{const O=await e.getMessages(P);j.setMessages(O);const x=O.findLast(X=>X.role==="assistant");return(x==null?void 0:x.id)??null}catch{return null}},[e,b.activeConversationId,j]),F=k.useCallback((P,O,x)=>{if(/^\d+$/.test(P)){e.feedback(P,O,x).catch(()=>{});return}T().then(X=>{X&&e.feedback(X,O,x).catch(()=>{})})},[e,T]),U=k.useCallback(P=>{if(/^\d+$/.test(P)){e.cancelFeedback(P).catch(()=>{});return}T().then(O=>{O&&e.cancelFeedback(O).catch(()=>{})})},[e,T]),V=k.useMemo(()=>({sdk:e,status:j.status,error:j.error,messages:j.messages,conversations:b.conversations,activeConversationId:b.activeConversationId,isThreadListOpen:s,isArtifactDrawerOpen:o,allArtifacts:R,activePreviewArtifact:u,activePanel:c,hasMore:b.hasMore,conversationsLoading:b.loading,messagesLoading:y,sendMessage:j.sendMessage,attachmentUploader:n??null,nosUpload:r??null,stop:j.stop,regenerate:j.regenerate,switchConversation:v,newConversation:L,deleteConversation:_,renameConversation:b.renameConversation,loadMoreConversations:b.loadMore,toggleThreadList:B,setThreadListOpen:w,toggleArtifactDrawer:z,openArtifactPreview:E,openPanel:S,closePanel:A,feedback:F,cancelFeedback:U,respondToInterrupt:j.respondToInterrupt}),[e,j.status,j.error,j.messages,j.sendMessage,j.stop,j.regenerate,j.respondToInterrupt,n,r,b.conversations,b.activeConversationId,b.renameConversation,b.hasMore,b.loadMore,b.loading,s,o,R,u,c,y,v,L,_,B,w,z,E,S,A,F,U]);return d.jsx(Br.Provider,{value:V,children:i})}const ce="https://ehr-web.netease.com/ehr-web/erh-super-agent",de={recently:`${ce}/recently.svg`,home:`${ce}/home.svg`,mergeWindow:`${ce}/merge_window.svg`,spiltWindow:`${ce}/spilt_window.svg`,close:`${ce}/close.svg`,message:`${ce}/message.svg`,messageCreate:`${ce}/message_create.svg`,customerService:`${ce}/customer_service.svg`,sendSolid:`${ce}/send_solid.svg`,capabilityIcons:[`${ce}/icon1.png`,`${ce}/icon2.png`,`${ce}/icon3.png`],triggerLogo:`${ce}/HRlogo.png`,logo:`${ce}/HRlogo2.png`,assistantAvatarGenerating:`${ce}/profile0.gif`,assistantAvatar:`${ce}/profile1.png`},pe={TRIGGER_SIZE:56,TRIGGER_RIGHT:20,TRIGGER_BOTTOM:80,DEFAULT_WIDTH:400,DEFAULT_HEIGHT:648,MIN_WIDTH:360,MAX_WIDTH:800,MAX_HEIGHT_RATIO:.95};function ya({defaultWidth:e=pe.DEFAULT_WIDTH,defaultHeight:t=pe.DEFAULT_HEIGHT,sidebarWidth:n=0}={}){const[r,i]=k.useState(e),[s,a]=k.useState({x:0,y:0}),[o,l]=k.useState(!1),[u,p]=k.useState(!1),[c,h]=k.useState(null),[f,m]=k.useState(()=>typeof window>"u"?{width:0,height:0}:{width:window.innerWidth,height:window.innerHeight}),y=k.useRef(!1),C=k.useRef(0),b=k.useRef(r),j=k.useRef(!1),S=k.useRef({x:0,y:0}),A=k.useRef({x:0,y:0}),N=k.useRef(!1),v=k.useRef(null);k.useEffect(()=>{const T=()=>m({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]),k.useEffect(()=>()=>{var T;(T=v.current)==null||T.call(v)},[]);const L=Math.floor(f.height*pe.MAX_HEIGHT_RATIO),_=Math.min(c||t,L),B=r+n;k.useEffect(()=>{if(!o){const T=f.width-B-20,F=f.height-_-20;a(U=>U.x===T&&U.y===F?U:{x:T,y:F})}},[o,B,_,f]);const w=k.useCallback(T=>{if(u||T.target.closest("button, input, textarea"))return;j.current=!0,N.current=!1,S.current={x:T.clientX,y:T.clientY},A.current={...s};const F=P=>{if(!j.current)return;const O=P.clientX-S.current.x,x=P.clientY-S.current.y;(Math.abs(O)>3||Math.abs(x)>3)&&(N.current=!0),N.current&&(l(!0),a({x:Math.max(-200,Math.min(A.current.x+O,window.innerWidth-100)),y:Math.max(0,Math.min(A.current.y+x,window.innerHeight-48))}))},U=()=>{j.current=!1,V()},V=()=>{document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",U),v.current=null};document.addEventListener("mousemove",F),document.addEventListener("mouseup",U),v.current=V},[u,s]),z=k.useCallback(T=>{T.preventDefault(),T.stopPropagation(),y.current=!0,C.current=T.clientX,b.current=r;const F=s.x+r,U=s.y,V=x=>{if(!y.current)return;const X=x.clientX-C.current;let $=b.current-X;if($>pe.MAX_WIDTH){y.current=!1,p(!0),O();return}$=Math.max(pe.MIN_WIDTH,$),i($),a({x:F-$,y:U})},P=()=>{y.current=!1,O()},O=()=>{document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",P),v.current=null};document.addEventListener("mousemove",V),document.addEventListener("mouseup",P),v.current=O},[r,s]),E=k.useCallback(()=>{u&&i(e),p(T=>!T)},[u,e]),R=k.useCallback(()=>{p(!1),i(e),l(!1),h(null)},[e]);return{width:r,position:s,hasCustomPosition:o,isMaximized:u,lockedHeight:c,viewport:f,defaultHeight:t,totalWidth:B,windowHeight:_,startWindowDrag:w,startResize:z,toggleMaximize:E,setIsMaximized:p,setLockedHeight:h,setHasCustomPosition:l,reset:R}}function ka(e){const{enabled:t,contentSelector:n,defaultHeight:r,onHeightChange:i}=e,s=k.useRef(null);return k.useEffect(()=>{if(!t||!s.current)return;const o=s.current.querySelector(n);if(!o)return;const l=()=>{const c=s.current;if(!c)return;const h=c.querySelector(n);if(!h)return;const f=c.offsetHeight-h.clientHeight,m=h.scrollHeight+f,y=Math.floor(window.innerHeight*pe.MAX_HEIGHT_RATIO),C=Math.max(r,Math.min(m,y));i(b=>b===C?b:C)};l();const u=new ResizeObserver(()=>l());Array.from(o.children).forEach(c=>u.observe(c));const p=new MutationObserver(()=>{Array.from(o.children).forEach(c=>u.observe(c)),l()});return p.observe(o,{childList:!0,subtree:!0,characterData:!0}),()=>{u.disconnect(),p.disconnect()}},[t,n,r,i]),s}function va(e,t){const n=pe.TRIGGER_SIZE;return{x:Math.max(8,Math.min(e,window.innerWidth-n-8)),y:Math.max(8,Math.min(t,window.innerHeight-n-8))}}function $r({isOpen:e,onClick:t,triggerLogo:n}){const[r,i]=k.useState(null),s=k.useRef(!1),a=k.useRef(!1),o=k.useRef({x:0,y:0}),l=k.useRef({x:0,y:0}),u=k.useRef(null);k.useEffect(()=>()=>{var f;(f=u.current)==null||f.call(u)},[]);const p=k.useCallback(f=>{if(f.button!==0)return;s.current=!0,a.current=!1,o.current={x:f.clientX,y:f.clientY};const m=f.currentTarget.getBoundingClientRect();l.current={x:m.left,y:m.top};const y=b=>{if(!s.current)return;const j=b.clientX-o.current.x,S=b.clientY-o.current.y;(Math.abs(j)>4||Math.abs(S)>4)&&(a.current=!0),a.current&&i(va(l.current.x+j,l.current.y+S))},C=()=>{s.current=!1,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",C),u.current=null};document.addEventListener("mousemove",y),document.addEventListener("mouseup",C),u.current=C},[]),c=k.useCallback(()=>{if(a.current){a.current=!1;return}t()},[t]),h=r?{left:r.x,top:r.y,width:pe.TRIGGER_SIZE,height:pe.TRIGGER_SIZE}:{right:pe.TRIGGER_RIGHT,bottom:pe.TRIGGER_BOTTOM,width:pe.TRIGGER_SIZE,height:pe.TRIGGER_SIZE};return d.jsx("button",{type:"button",className:`fixed z-[10000] flex items-center justify-center border-none bg-transparent p-0 transition-transform duration-200 ease-out hover:scale-[1.08] active:scale-95 ${e?"pointer-events-none scale-50 opacity-0":"opacity-100"}`,style:h,onMouseDown:p,onClick:c,"aria-label":"打开 AI 助手",title:"AI 助手",children:d.jsx("img",{src:n||de.triggerLogo,alt:"AI 助手",className:"block h-full w-full",draggable:!1})})}function nt({tooltip:e,onClick:t,children:n}){return d.jsx("button",{type:"button",className:"sa-tip relative flex h-7 w-7 items-center justify-center rounded-md text-[#666] transition-colors hover:bg-white active:bg-[#F5F5F5]","data-tooltip":e,"aria-label":e,onClick:t,children:n})}function Hr({onClose:e,onToggleThreadList:t,isMaximized:n=!1,onToggleMaximize:r,showHome:i=!1,onHome:s,showClose:a=!0,artifactCount:o=0,onToggleArtifactDrawer:l}){return d.jsxs("div",{className:"relative z-20 flex h-9 shrink-0 select-none items-center justify-between px-[15px]",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(nt,{tooltip:"历史记录",onClick:t,children:d.jsx("img",{src:de.recently,alt:"",width:20,height:20})}),i&&s&&d.jsx(nt,{tooltip:"回到首页",onClick:s,children:d.jsx("img",{src:de.home,alt:"",width:20,height:20})})]}),d.jsxs("div",{className:"flex items-center gap-2.5",children:[o>0&&l&&d.jsx(nt,{tooltip:"会话产物",onClick:l,children:d.jsxs("span",{className:"relative flex items-center gap-1",children:[d.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[d.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),d.jsx("polyline",{points:"14 2 14 8 20 8"})]}),o>0&&d.jsx("span",{className:"absolute -right-2 -top-1.5 min-w-[14px] rounded-full bg-[var(--sa-primary)] px-0.5 text-center text-[9px] font-medium leading-[14px] text-white",children:o>99?"99+":o})]})}),r&&d.jsx(nt,{tooltip:n?"小窗":"大窗",onClick:r,children:d.jsx("img",{src:n?de.spiltWindow:de.mergeWindow,alt:"",width:20,height:20})}),a&&d.jsx(nt,{tooltip:"关闭",onClick:e,children:d.jsx("img",{src:de.close,alt:"",width:20,height:20})})]})]})}const rt=e=>String(e).padStart(2,"0");function Ca(e){if(!e)return"";const t=new Date(e);return isNaN(t.getTime())?"":`${t.getFullYear()}-${rt(t.getMonth()+1)}-${rt(t.getDate())} ${rt(t.getHours())}:${rt(t.getMinutes())}:${rt(t.getSeconds())}`}function Ur(e){const t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),r=n-6*864e5,i=[],s=[],a=[];for(const l of e){const u=new Date(l.updateTime).getTime();u>=n?i.push(l):u>=r?s.push(l):a.push(l)}const o=[];return i.length&&o.push({label:"今天",items:i}),s.length&&o.push({label:"最近 7 天",items:s}),a.length&&o.push({label:"更早",items:a}),o}function Zt({width:e}){const{conversations:t,activeConversationId:n,switchConversation:r,newConversation:i,deleteConversation:s,renameConversation:a,hasMore:o,loadMoreConversations:l,conversationsLoading:u}=Te(),[p,c]=k.useState(null),[h,f]=k.useState(""),[m,y]=k.useState(null),C=k.useRef(null),b=k.useCallback((N,v)=>{c(N),f(v??"")},[]),j=k.useCallback(N=>{h.trim()&&a(N,h.trim()),c(null)},[h,a]),S=k.useCallback(()=>{const N=C.current;!N||!o||N.scrollHeight-N.scrollTop-N.clientHeight<50&&l()},[o,l]),A=k.useMemo(()=>Ur(t),[t]);return d.jsxs("div",{className:"relative z-[5] flex h-full shrink-0 flex-col overflow-visible border-r border-[#ECECEC] bg-[#FAFAFA] p-3 animate-sa-history-in",style:{width:e??200},children:[d.jsxs("button",{type:"button",className:"sa-new-chat mb-4 flex h-8 w-full shrink-0 items-center justify-center gap-2 rounded-md text-[14px] font-medium transition-colors",onClick:i,children:[d.jsx("img",{src:de.messageCreate,alt:"",width:18,height:18}),d.jsx("span",{className:"sa-new-chat-text whitespace-nowrap",children:"新建对话"})]}),d.jsxs("div",{className:"px-1 pb-2.5",children:[d.jsx("div",{className:"mb-1 text-[14px] font-semibold text-[#333]",children:"历史对话"}),d.jsx("div",{className:"text-[11px] text-[#999]",children:"展示最近的会话记录"})]}),d.jsxs("div",{ref:C,className:"flex-1 overflow-y-auto",onScroll:S,children:[u&&t.length===0&&d.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:"加载中..."}),!u&&t.length===0&&d.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:"暂无记录"}),A.map(N=>d.jsxs("div",{className:"mb-1",children:[d.jsx("div",{className:"px-1 pb-1 pt-2 text-[11px] text-[#A0A0A0]",children:N.label}),N.items.map(v=>d.jsx("div",{className:`group relative mb-0.5 flex h-8 w-full cursor-pointer items-center gap-1 rounded-md px-0.5 text-[13px] transition-colors ${v.sessionId===n?"bg-[#E8F1FE]":"hover:bg-[#E8F1FE]"}`,onClick:()=>{p!==v.sessionId&&r(v.sessionId)},onMouseEnter:L=>{if(p===v.sessionId)return;const _=L.currentTarget.getBoundingClientRect();y({text:v.title||"新会话",x:_.right+8,y:_.top+_.height/2})},onMouseLeave:()=>y(null),children:p===v.sessionId?d.jsx("input",{className:"w-full rounded border border-[var(--sa-primary)] bg-white px-1.5 py-0.5 text-[12px] outline-none",value:h,onChange:L=>f(L.target.value),onBlur:()=>j(v.sessionId),onKeyDown:L=>{L.key==="Enter"&&j(v.sessionId),L.key==="Escape"&&c(null)},onClick:L=>L.stopPropagation(),autoFocus:!0}):d.jsxs(d.Fragment,{children:[d.jsx("img",{src:de.message,alt:"",width:16,height:16,className:"shrink-0 opacity-60"}),d.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-[#333]",children:v.title||"新会话"}),d.jsxs("span",{className:"hidden shrink-0 items-center gap-0.5 group-hover:flex",children:[d.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded text-[#999] hover:bg-white/70 hover:text-[var(--sa-primary)]",onClick:L=>{L.stopPropagation(),b(v.sessionId,v.title)},title:"重命名",children:d.jsx("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"})})}),d.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded text-[#999] hover:bg-white/70 hover:text-[#ef4444]",onClick:L=>{L.stopPropagation(),s(v.sessionId)},title:"删除",children:d.jsx("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})})})]})]})},v.sessionId))]},N.label)),u&&t.length>0&&d.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:o?"加载更多...":"加载中..."}),!u&&o&&d.jsx("div",{className:"px-0.5 py-2 text-center text-[11px] text-[#C0C0C0]",children:"向下滚动加载更多"})]}),m&&d.jsx("div",{className:"pointer-events-none fixed z-[10001] whitespace-nowrap rounded border border-[#E8E8E8] bg-white px-2.5 py-1.5 text-[12px] leading-[1.4] text-[#333] shadow-[0_2px_8px_rgba(0,0,0,0.12)]",style:{left:m.x,top:m.y,transform:"translateY(-50%)"},children:m.text})]})}function Vr(e){const t=k.useRef(null),n=k.useRef(!1),r=k.useRef(0),i=k.useCallback(()=>{const a=t.current;if(!a)return;const{scrollTop:o,scrollHeight:l,clientHeight:u}=a,p=l-o-u<40;o<r.current&&!p&&(n.current=!0),p&&(n.current=!1),r.current=o},[]);k.useEffect(()=>{const a=t.current;if(a)return a.addEventListener("scroll",i,{passive:!0}),()=>a.removeEventListener("scroll",i)},[i]),k.useEffect(()=>{if(n.current)return;const a=t.current;a&&requestAnimationFrame(()=>{a.scrollTop=a.scrollHeight})},e);const s=k.useCallback(()=>{n.current=!1;const a=t.current;a&&(a.scrollTop=a.scrollHeight)},[]);return{containerRef:t,scrollToBottom:s}}function Sa(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ja=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ea=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ia={};function Pn(e,t){return(Ia.jsx?Ea:ja).test(e)}const Ta=/[ \t\n\f\r]/g;function za(e){return typeof e=="object"?e.type==="text"?Rn(e.value):!1:Rn(e)}function Rn(e){return e.replace(Ta,"")===""}class pt{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}pt.prototype.normal={};pt.prototype.property={};pt.prototype.space=void 0;function qr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new pt(n,r,t)}function en(e){return e.toLowerCase()}class xe{constructor(t,n){this.attribute=n,this.property=t}}xe.prototype.attribute="";xe.prototype.booleanish=!1;xe.prototype.boolean=!1;xe.prototype.commaOrSpaceSeparated=!1;xe.prototype.commaSeparated=!1;xe.prototype.defined=!1;xe.prototype.mustUseProperty=!1;xe.prototype.number=!1;xe.prototype.overloadedBoolean=!1;xe.prototype.property="";xe.prototype.spaceSeparated=!1;xe.prototype.space=void 0;let Aa=0;const G=Ue(),oe=Ue(),tn=Ue(),D=Ue(),re=Ue(),$e=Ue(),we=Ue();function Ue(){return 2**++Aa}const nn=Object.freeze(Object.defineProperty({__proto__:null,boolean:G,booleanish:oe,commaOrSpaceSeparated:we,commaSeparated:$e,number:D,overloadedBoolean:tn,spaceSeparated:re},Symbol.toStringTag,{value:"Module"})),Ft=Object.keys(nn);class fn extends xe{constructor(t,n,r,i){let s=-1;if(super(t,n),Fn(this,"space",i),typeof r=="number")for(;++s<Ft.length;){const a=Ft[s];Fn(this,Ft[s],(r&nn[a])===nn[a])}}}fn.prototype.defined=!0;function Fn(e,t,n){n&&(e[t]=n)}function Ge(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new fn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[en(r)]=r,n[en(s.attribute)]=r}return new pt(t,n,e.space)}const Wr=Ge({properties:{ariaActiveDescendant:null,ariaAtomic:oe,ariaAutoComplete:null,ariaBusy:oe,ariaChecked:oe,ariaColCount:D,ariaColIndex:D,ariaColSpan:D,ariaControls:re,ariaCurrent:null,ariaDescribedBy:re,ariaDetails:null,ariaDisabled:oe,ariaDropEffect:re,ariaErrorMessage:null,ariaExpanded:oe,ariaFlowTo:re,ariaGrabbed:oe,ariaHasPopup:null,ariaHidden:oe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:re,ariaLevel:D,ariaLive:null,ariaModal:oe,ariaMultiLine:oe,ariaMultiSelectable:oe,ariaOrientation:null,ariaOwns:re,ariaPlaceholder:null,ariaPosInSet:D,ariaPressed:oe,ariaReadOnly:oe,ariaRelevant:null,ariaRequired:oe,ariaRoleDescription:re,ariaRowCount:D,ariaRowIndex:D,ariaRowSpan:D,ariaSelected:oe,ariaSetSize:D,ariaSort:null,ariaValueMax:D,ariaValueMin:D,ariaValueNow:D,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Yr(e,t){return t in e?e[t]:t}function Gr(e,t){return Yr(e,t.toLowerCase())}const Na=Ge({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$e,acceptCharset:re,accessKey:re,action:null,allow:null,allowFullScreen:G,allowPaymentRequest:G,allowUserMedia:G,alpha:G,alt:null,as:null,async:G,autoCapitalize:null,autoComplete:re,autoFocus:G,autoPlay:G,blocking:re,capture:null,charSet:null,checked:G,cite:null,className:re,closedBy:null,colorSpace:null,cols:D,colSpan:D,command:null,commandFor:null,content:null,contentEditable:oe,controls:G,controlsList:re,coords:D|$e,crossOrigin:null,data:null,dateTime:null,decoding:null,default:G,defer:G,dir:null,dirName:null,disabled:G,download:tn,draggable:oe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:G,formTarget:null,headers:re,height:D,hidden:tn,high:D,href:null,hrefLang:null,htmlFor:re,httpEquiv:re,id:null,imageSizes:null,imageSrcSet:null,inert:G,inputMode:null,integrity:null,is:null,isMap:G,itemId:null,itemProp:re,itemRef:re,itemScope:G,itemType:re,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:G,low:D,manifest:null,max:null,maxLength:D,media:null,method:null,min:null,minLength:D,multiple:G,muted:G,name:null,nonce:null,noModule:G,noValidate:G,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:G,optimum:D,pattern:null,ping:re,placeholder:null,playsInline:G,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:G,referrerPolicy:null,rel:re,required:G,reversed:G,rows:D,rowSpan:D,sandbox:re,scope:null,scoped:G,seamless:G,selected:G,shadowRootClonable:G,shadowRootCustomElementRegistry:G,shadowRootDelegatesFocus:G,shadowRootMode:null,shadowRootSerializable:G,shape:null,size:D,sizes:null,slot:null,span:D,spellCheck:oe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:D,step:null,style:null,tabIndex:D,target:null,title:null,translate:null,type:null,typeMustMatch:G,useMap:null,value:oe,width:D,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:re,axis:null,background:null,bgColor:null,border:D,borderColor:null,bottomMargin:D,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:G,declare:G,event:null,face:null,frame:null,frameBorder:null,hSpace:D,leftMargin:D,link:null,longDesc:null,lowSrc:null,marginHeight:D,marginWidth:D,noResize:G,noHref:G,noShade:G,noWrap:G,object:null,profile:null,prompt:null,rev:null,rightMargin:D,rules:null,scheme:null,scrolling:oe,standby:null,summary:null,text:null,topMargin:D,valueType:null,version:null,vAlign:null,vLink:null,vSpace:D,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:G,disablePictureInPicture:G,disableRemotePlayback:G,exportParts:$e,part:re,prefix:null,property:null,results:D,security:null,unselectable:null},space:"html",transform:Gr}),La=Ge({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:we,accentHeight:D,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:D,amplitude:D,arabicForm:null,ascent:D,attributeName:null,attributeType:null,azimuth:D,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:D,by:null,calcMode:null,capHeight:D,className:re,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:D,diffuseConstant:D,direction:null,display:null,dur:null,divisor:D,dominantBaseline:null,download:G,dx:null,dy:null,edgeMode:null,editable:null,elevation:D,enableBackground:null,end:null,event:null,exponent:D,externalResourcesRequired:null,fill:null,fillOpacity:D,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:$e,g2:$e,glyphName:$e,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:D,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:D,horizOriginX:D,horizOriginY:D,id:null,ideographic:D,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:D,k:D,k1:D,k2:D,k3:D,k4:D,kernelMatrix:we,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:D,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:D,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:D,overlineThickness:D,paintOrder:null,panose1:null,path:null,pathLength:D,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:re,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:D,pointsAtY:D,pointsAtZ:D,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:we,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:we,rev:we,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:we,requiredFeatures:we,requiredFonts:we,requiredFormats:we,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:D,specularExponent:D,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:D,strikethroughThickness:D,string:null,stroke:null,strokeDashArray:we,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:D,strokeOpacity:D,strokeWidth:null,style:null,surfaceScale:D,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:we,tabIndex:D,tableValues:null,target:null,targetX:D,targetY:D,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:we,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:D,underlineThickness:D,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:D,values:null,vAlphabetic:D,vMathematical:D,vectorEffect:null,vHanging:D,vIdeographic:D,version:null,vertAdvY:D,vertOriginX:D,vertOriginY:D,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:D,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Yr}),Xr=Ge({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Kr=Ge({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Gr}),Qr=Ge({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Da={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Ma=/[A-Z]/g,_n=/-[a-z]/g,Pa=/^data[-\w.:]+$/i;function Ra(e,t){const n=en(t);let r=t,i=xe;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Pa.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(_n,_a);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!_n.test(s)){let a=s.replace(Ma,Fa);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=fn}return new i(r,t)}function Fa(e){return"-"+e.toLowerCase()}function _a(e){return e.charAt(1).toUpperCase()}const Oa=qr([Wr,Na,Xr,Kr,Qr],"html"),hn=qr([Wr,La,Xr,Kr,Qr],"svg");function Ba(e){return e.join(" ").trim()}var gn={},On=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,$a=/\n/g,Ha=/^\s*/,Ua=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Va=/^:\s*/,qa=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Wa=/^[;\s]*/,Ya=/^\s+|\s+$/g,Ga=`
2
- `,Bn="/",$n="*",Be="",Xa="comment",Ka="declaration";function Qa(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var y=m.match($a);y&&(n+=y.length);var C=m.lastIndexOf(Ga);r=~C?m.length-C:r+m.length}function s(){var m={line:n,column:r};return function(y){return y.position=new a(m),u(),y}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(m){var y=new Error(t.source+":"+n+":"+r+": "+m);if(y.reason=m,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(m){var y=m.exec(e);if(y){var C=y[0];return i(C),e=e.slice(C.length),y}}function u(){l(Ha)}function p(m){var y;for(m=m||[];y=c();)y!==!1&&m.push(y);return m}function c(){var m=s();if(!(Bn!=e.charAt(0)||$n!=e.charAt(1))){for(var y=2;Be!=e.charAt(y)&&($n!=e.charAt(y)||Bn!=e.charAt(y+1));)++y;if(y+=2,Be===e.charAt(y-1))return o("End of comment missing");var C=e.slice(2,y-2);return r+=2,i(C),e=e.slice(y),r+=2,m({type:Xa,comment:C})}}function h(){var m=s(),y=l(Ua);if(y){if(c(),!l(Va))return o("property missing ':'");var C=l(qa),b=m({type:Ka,property:Hn(y[0].replace(On,Be)),value:C?Hn(C[0].replace(On,Be)):Be});return l(Wa),b}}function f(){var m=[];p(m);for(var y;y=h();)y!==!1&&(m.push(y),p(m));return m}return u(),f()}function Hn(e){return e?e.replace(Ya,Be):Be}var Ja=Qa,Za=Me.commonjsGlobal&&Me.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gn,"__esModule",{value:!0});gn.default=ts;const es=Za(Ja);function ts(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,es.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:a,value:o}=s;i?t(a,o,s):o&&(n=n||{},n[a]=o)}),n}var Et={};Object.defineProperty(Et,"__esModule",{value:!0});Et.camelCase=void 0;var ns=/^--[a-zA-Z0-9_-]+$/,rs=/-([a-z])/g,is=/^[^-]+$/,as=/^-(webkit|moz|ms|o|khtml)-/,ss=/^-(ms)-/,os=function(e){return!e||is.test(e)||ns.test(e)},ls=function(e,t){return t.toUpperCase()},Un=function(e,t){return"".concat(t,"-")},us=function(e,t){return t===void 0&&(t={}),os(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(ss,Un):e=e.replace(as,Un),e.replace(rs,ls))};Et.camelCase=us;var cs=Me.commonjsGlobal&&Me.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ps=cs(gn),ds=Et;function rn(e,t){var n={};return!e||typeof e!="string"||(0,ps.default)(e,function(r,i){r&&i&&(n[(0,ds.camelCase)(r,t)]=i)}),n}rn.default=rn;var fs=rn;const hs=Me.getDefaultExportFromCjs(fs),Jr=Zr("end"),mn=Zr("start");function Zr(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function gs(e){const t=mn(e),n=Jr(e);if(t&&n)return{start:t,end:n}}function st(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Vn(e.position):"start"in e||"end"in e?Vn(e):"line"in e||"column"in e?an(e):""}function an(e){return qn(e&&e.line)+":"+qn(e&&e.column)}function Vn(e){return an(e&&e.start)+"-"+an(e&&e.end)}function qn(e){return e&&typeof e=="number"?e:1}class he extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=st(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}he.prototype.file="";he.prototype.name="";he.prototype.reason="";he.prototype.message="";he.prototype.stack="";he.prototype.column=void 0;he.prototype.line=void 0;he.prototype.ancestors=void 0;he.prototype.cause=void 0;he.prototype.fatal=void 0;he.prototype.place=void 0;he.prototype.ruleId=void 0;he.prototype.source=void 0;const xn={}.hasOwnProperty,ms=new Map,xs=/[A-Z]/g,bs=new Set(["table","tbody","thead","tfoot","tr"]),ws=new Set(["td","th"]),ei="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ys(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Ts(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Is(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?hn:Oa,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=ti(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function ti(e,t,n){if(t.type==="element")return ks(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return vs(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Ss(e,t,n);if(t.type==="mdxjsEsm")return Cs(e,t);if(t.type==="root")return js(e,t,n);if(t.type==="text")return Es(e,t)}function ks(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=hn,e.schema=i),e.ancestors.push(t);const s=ri(e,t.tagName,!1),a=zs(e,t);let o=wn(e,t);return bs.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!za(l):!0})),ni(e,a,s,t),bn(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function vs(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ut(e,t.position)}function Cs(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ut(e,t.position)}function Ss(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=hn,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:ri(e,t.name,!0),a=As(e,t),o=wn(e,t);return ni(e,a,s,t),bn(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function js(e,t,n){const r={};return bn(r,wn(e,t)),e.create(t,e.Fragment,r,n)}function Es(e,t){return t.value}function ni(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function bn(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Is(e,t,n){return r;function r(i,s,a,o){const u=Array.isArray(a.children)?n:t;return o?u(s,a,o):u(s,a)}}function Ts(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),l=mn(r);return t(i,s,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function zs(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&xn.call(t.properties,i)){const s=Ns(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&ws.has(t.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function As(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else ut(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else ut(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function wn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:ms;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const u=i.get(l)||0;a=l+"-"+u,i.set(l,u+1)}}const o=ti(e,s,a);o!==void 0&&n.push(o)}return n}function Ns(e,t,n){const r=Ra(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Sa(n):Ba(n)),r.property==="style"){let i=typeof n=="object"?n:Ls(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Ds(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Da[r.property]||r.property:r.attribute,n]}}function Ls(e,t){try{return hs(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new he("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=ei+"#cannot-parse-style-attribute",i}}function ri(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const o=Pn(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=Pn(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return xn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ut(e)}function ut(e,t){const n=new he("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=ei+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Ds(e){const t={};let n;for(n in e)xn.call(e,n)&&(t[Ms(n)]=e[n]);return t}function Ms(e){let t=e.replace(xs,Ps);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Ps(e){return"-"+e.toLowerCase()}const _t={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Rs={};function yn(e,t){const n=Rs,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ii(e,r,i)}function ii(e,t,n){if(Fs(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Wn(e.children,t,n)}return Array.isArray(e)?Wn(e,t,n):""}function Wn(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=ii(e[i],t,n);return r.join("")}function Fs(e){return!!(e&&typeof e=="object")}const Yn=document.createElement("i");function kn(e){const t="&"+e+";";Yn.innerHTML=t;const n=Yn.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ye(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function ve(e,t){return e.length>0?(ye(e,e.length,0,t),e):t}const Gn={}.hasOwnProperty;function ai(e){const t={};let n=-1;for(;++n<e.length;)_s(t,e[n]);return t}function _s(e,t){let n;for(n in t){const i=(Gn.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){Gn.call(i,a)||(i[a]=[]);const o=s[a];Os(i[a],Array.isArray(o)?o:o?[o]:[])}}}function Os(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ye(e,0,0,r)}function si(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Se(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ge=Pe(/[A-Za-z]/),fe=Pe(/[\dA-Za-z]/),Bs=Pe(/[#-'*+\--9=?A-Z^-~]/);function vt(e){return e!==null&&(e<32||e===127)}const sn=Pe(/\d/),$s=Pe(/[\dA-Fa-f]/),Hs=Pe(/[!-/:-@[-`{-~]/);function H(e){return e!==null&&e<-2}function ie(e){return e!==null&&(e<0||e===32)}function Q(e){return e===-2||e===-1||e===32}const It=Pe(new RegExp("\\p{P}|\\p{S}","u")),He=Pe(/\s/);function Pe(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Xe(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&fe(e.charCodeAt(n+1))&&fe(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Z(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return Q(l)?(e.enter(n),o(l)):t(l)}function o(l){return Q(l)&&s++<i?(e.consume(l),o):(e.exit(n),t(l))}}const Us={tokenize:Vs};function Vs(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Z(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return H(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const qs={tokenize:Ws},Xn={tokenize:Ys};function Ws(e){const t=this,n=[];let r=0,i,s,a;return o;function o(S){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,l,u)(S)}return u(S)}function l(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&j();const A=t.events.length;let N=A,v;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){v=t.events[N][1].end;break}b(r);let L=A;for(;L<t.events.length;)t.events[L][1].end={...v},L++;return ye(t.events,N+1,0,t.events.slice(A)),t.events.length=L,u(S)}return o(S)}function u(S){if(r===n.length){if(!i)return h(S);if(i.currentConstruct&&i.currentConstruct.concrete)return m(S);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Xn,p,c)(S)}function p(S){return i&&j(),b(r),h(S)}function c(S){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,m(S)}function h(S){return t.containerState={},e.attempt(Xn,f,m)(S)}function f(S){return r++,n.push([t.currentConstruct,t.containerState]),h(S)}function m(S){if(S===null){i&&j(),b(0),e.consume(S);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),y(S)}function y(S){if(S===null){C(e.exit("chunkFlow"),!0),b(0),e.consume(S);return}return H(S)?(e.consume(S),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(S),y)}function C(S,A){const N=t.sliceStream(S);if(A&&N.push(null),S.previous=s,s&&(s.next=S),s=S,i.defineSkip(S.start),i.write(N),t.parser.lazy[S.start.line]){let v=i.events.length;for(;v--;)if(i.events[v][1].start.offset<a&&(!i.events[v][1].end||i.events[v][1].end.offset>a))return;const L=t.events.length;let _=L,B,w;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(B){w=t.events[_][1].end;break}B=!0}for(b(r),v=L;v<t.events.length;)t.events[v][1].end={...w},v++;ye(t.events,_+1,0,t.events.slice(L)),t.events.length=v}}function b(S){let A=n.length;for(;A-- >S;){const N=n[A];t.containerState=N[1],N[0].exit.call(t,e)}n.length=S}function j(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Ys(e,t,n){return Z(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ye(e){if(e===null||ie(e)||He(e))return 1;if(It(e))return 2}function Tt(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const on={name:"attention",resolveAll:Gs,tokenize:Xs};function Gs(e,t){let n=-1,r,i,s,a,o,l,u,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},h={...e[n][1].start};Kn(c,-l),Kn(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=ve(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ve(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),u=ve(u,Tt(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ve(u,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,u=ve(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,ye(e,r-1,n-r+3,u),n=r+u.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Xs(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ye(r);let s;return a;function a(l){return s=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===s)return e.consume(l),o;const u=e.exit("attentionSequence"),p=Ye(l),c=!p||p===2&&i||n.includes(l),h=!i||i===2&&p||n.includes(r);return u._open=!!(s===42?c:c&&(i||!h)),u._close=!!(s===42?h:h&&(p||!c)),t(l)}}function Kn(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ks={name:"autolink",tokenize:Qs};function Qs(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(f){return ge(f)?(e.consume(f),a):f===64?n(f):u(f)}function a(f){return f===43||f===45||f===46||fe(f)?(r=1,o(f)):u(f)}function o(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||fe(f))&&r++<32?(e.consume(f),o):(r=0,u(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||vt(f)?n(f):(e.consume(f),l)}function u(f){return f===64?(e.consume(f),p):Bs(f)?(e.consume(f),u):n(f)}function p(f){return fe(f)?c(f):n(f)}function c(f){return f===46?(e.consume(f),r=0,p):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||fe(f))&&r++<63){const m=f===45?h:c;return e.consume(f),m}return n(f)}}const dt={partial:!0,tokenize:Js};function Js(e,t,n){return r;function r(s){return Q(s)?Z(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||H(s)?t(s):n(s)}}const oi={continuation:{tokenize:eo},exit:to,name:"blockQuote",tokenize:Zs};function Zs(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return Q(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function eo(e,t,n){const r=this;return i;function i(a){return Q(a)?Z(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(oi,t,n)(a)}}function to(e){e.exit("blockQuote")}const li={name:"characterEscape",tokenize:no};function no(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return Hs(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const ui={name:"characterReference",tokenize:ro};function ro(e,t,n){const r=this;let i=0,s,a;return o;function o(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,a=fe,p(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=$s,p):(e.enter("characterReferenceValue"),s=7,a=sn,p(c))}function p(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return a===fe&&!kn(r.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(c)&&i++<s?(e.consume(c),p):n(c)}}const Qn={partial:!0,tokenize:ao},Jn={concrete:!0,name:"codeFenced",tokenize:io};function io(e,t,n){const r=this,i={partial:!0,tokenize:N};let s=0,a=0,o;return l;function l(v){return u(v)}function u(v){const L=r.events[r.events.length-1];return s=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,o=v,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(v)}function p(v){return v===o?(a++,e.consume(v),p):a<3?n(v):(e.exit("codeFencedFenceSequence"),Q(v)?Z(e,c,"whitespace")(v):c(v))}function c(v){return v===null||H(v)?(e.exit("codeFencedFence"),r.interrupt?t(v):e.check(Qn,y,A)(v)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===null||H(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(v)):Q(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Z(e,f,"whitespace")(v)):v===96&&v===o?n(v):(e.consume(v),h)}function f(v){return v===null||H(v)?c(v):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||H(v)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(v)):v===96&&v===o?n(v):(e.consume(v),m)}function y(v){return e.attempt(i,A,C)(v)}function C(v){return e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),b}function b(v){return s>0&&Q(v)?Z(e,j,"linePrefix",s+1)(v):j(v)}function j(v){return v===null||H(v)?e.check(Qn,y,A)(v):(e.enter("codeFlowValue"),S(v))}function S(v){return v===null||H(v)?(e.exit("codeFlowValue"),j(v)):(e.consume(v),S)}function A(v){return e.exit("codeFenced"),t(v)}function N(v,L,_){let B=0;return w;function w(F){return v.enter("lineEnding"),v.consume(F),v.exit("lineEnding"),z}function z(F){return v.enter("codeFencedFence"),Q(F)?Z(v,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):E(F)}function E(F){return F===o?(v.enter("codeFencedFenceSequence"),R(F)):_(F)}function R(F){return F===o?(B++,v.consume(F),R):B>=a?(v.exit("codeFencedFenceSequence"),Q(F)?Z(v,T,"whitespace")(F):T(F)):_(F)}function T(F){return F===null||H(F)?(v.exit("codeFencedFence"),L(F)):_(F)}}}function ao(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Ot={name:"codeIndented",tokenize:oo},so={partial:!0,tokenize:lo};function oo(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Z(e,s,"linePrefix",5)(u)}function s(u){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):H(u)?e.attempt(so,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||H(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function lo(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):H(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Z(e,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):H(a)?i(a):n(a)}}const uo={name:"codeText",previous:po,resolve:co,tokenize:fo};function co(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function po(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function fo(e,t,n){let r=0,i,s;return a;function a(c){return e.enter("codeText"),e.enter("codeTextSequence"),o(c)}function o(c){return c===96?(e.consume(c),r++,o):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(s=e.enter("codeTextSequence"),i=0,p(c)):H(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||H(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function p(c){return c===96?(e.consume(c),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(s.type="codeTextData",u(c))}}class ho{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&it(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),it(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),it(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);it(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);it(this.left,n.reverse())}}}function it(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ci(e){const t={};let n=-1,r,i,s,a,o,l,u;const p=new ho(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,go(p,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=p.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},o=p.slice(i,n),o.unshift(r),p.splice(i,n-i+1,o))}}return ye(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!u}function go(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,l=[],u={};let p,c,h=-1,f=n,m=0,y=0;const C=[y];for(;f;){for(;e.get(++i)[1]!==f;);s.push(i),f._tokenizer||(p=r.sliceStream(f),f.next||p.push(null),c&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(p),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),c=f,f=f.next}for(f=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(y=h+1,C.push(y),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):C.pop(),h=C.length;h--;){const b=o.slice(C[h],C[h+1]),j=s.pop();l.push([j,j+b.length-1]),e.splice(j,2,b)}for(l.reverse(),h=-1;++h<l.length;)u[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return u}const mo={resolve:bo,tokenize:wo},xo={partial:!0,tokenize:yo};function bo(e){return ci(e),e}function wo(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):H(o)?e.check(xo,a,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function yo(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Z(e,s,"linePrefix")}function s(a){if(a===null||H(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function pi(e,t,n,r,i,s,a,o,l){const u=l||Number.POSITIVE_INFINITY;let p=0;return c;function c(b){return b===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(b),e.exit(s),h):b===null||b===32||b===41||vt(b)?n(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),y(b))}function h(b){return b===62?(e.enter(s),e.consume(b),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===62?(e.exit("chunkString"),e.exit(o),h(b)):b===null||b===60||H(b)?n(b):(e.consume(b),b===92?m:f)}function m(b){return b===60||b===62||b===92?(e.consume(b),f):f(b)}function y(b){return!p&&(b===null||b===41||ie(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(b)):p<u&&b===40?(e.consume(b),p++,y):b===41?(e.consume(b),p--,y):b===null||b===32||b===40||vt(b)?n(b):(e.consume(b),b===92?C:y)}function C(b){return b===40||b===41||b===92?(e.consume(b),y):y(b)}}function di(e,t,n,r,i,s){const a=this;let o=0,l;return u;function u(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(s),p}function p(f){return o>999||f===null||f===91||f===93&&!l||f===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):H(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===null||f===91||f===93||H(f)||o++>999?(e.exit("chunkString"),p(f)):(e.consume(f),l||(l=!Q(f)),f===92?h:c)}function h(f){return f===91||f===92||f===93?(e.consume(f),o++,c):c(f)}}function fi(e,t,n,r,i,s){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),u(h))}function u(h){return h===a?(e.exit(s),l(a)):h===null?n(h):H(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Z(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(h))}function p(h){return h===a||h===null||H(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?c:p)}function c(h){return h===a||h===92?(e.consume(h),p):p(h)}}function ot(e,t){let n;return r;function r(i){return H(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Q(i)?Z(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ko={name:"definition",tokenize:Co},vo={partial:!0,tokenize:So};function Co(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),a(f)}function a(f){return di.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function o(f){return i=Se(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return ie(f)?ot(e,u)(f):u(f)}function u(f){return pi(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function p(f){return e.attempt(vo,c,c)(f)}function c(f){return Q(f)?Z(e,h,"whitespace")(f):h(f)}function h(f){return f===null||H(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function So(e,t,n){return r;function r(o){return ie(o)?ot(e,i)(o):n(o)}function i(o){return fi(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return Q(o)?Z(e,a,"whitespace")(o):a(o)}function a(o){return o===null||H(o)?t(o):n(o)}}const jo={name:"hardBreakEscape",tokenize:Eo};function Eo(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return H(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Io={name:"headingAtx",resolve:To,tokenize:zo};function To(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ye(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function zo(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),s(p)}function s(p){return e.enter("atxHeadingSequence"),a(p)}function a(p){return p===35&&r++<6?(e.consume(p),a):p===null||ie(p)?(e.exit("atxHeadingSequence"),o(p)):n(p)}function o(p){return p===35?(e.enter("atxHeadingSequence"),l(p)):p===null||H(p)?(e.exit("atxHeading"),t(p)):Q(p)?Z(e,o,"whitespace")(p):(e.enter("atxHeadingText"),u(p))}function l(p){return p===35?(e.consume(p),l):(e.exit("atxHeadingSequence"),o(p))}function u(p){return p===null||p===35||ie(p)?(e.exit("atxHeadingText"),o(p)):(e.consume(p),u)}}const Ao=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Zn=["pre","script","style","textarea"],No={concrete:!0,name:"htmlFlow",resolveTo:Mo,tokenize:Po},Lo={partial:!0,tokenize:Fo},Do={partial:!0,tokenize:Ro};function Mo(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Po(e,t,n){const r=this;let i,s,a,o,l;return u;function u(g){return p(g)}function p(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),h):g===47?(e.consume(g),s=!0,y):g===63?(e.consume(g),i=3,r.interrupt?t:x):ge(g)?(e.consume(g),a=String.fromCharCode(g),C):n(g)}function h(g){return g===45?(e.consume(g),i=2,f):g===91?(e.consume(g),i=5,o=0,m):ge(g)?(e.consume(g),i=4,r.interrupt?t:x):n(g)}function f(g){return g===45?(e.consume(g),r.interrupt?t:x):n(g)}function m(g){const W="CDATA[";return g===W.charCodeAt(o++)?(e.consume(g),o===W.length?r.interrupt?t:E:m):n(g)}function y(g){return ge(g)?(e.consume(g),a=String.fromCharCode(g),C):n(g)}function C(g){if(g===null||g===47||g===62||ie(g)){const W=g===47,te=a.toLowerCase();return!W&&!s&&Zn.includes(te)?(i=1,r.interrupt?t(g):E(g)):Ao.includes(a.toLowerCase())?(i=6,W?(e.consume(g),b):r.interrupt?t(g):E(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):s?j(g):S(g))}return g===45||fe(g)?(e.consume(g),a+=String.fromCharCode(g),C):n(g)}function b(g){return g===62?(e.consume(g),r.interrupt?t:E):n(g)}function j(g){return Q(g)?(e.consume(g),j):w(g)}function S(g){return g===47?(e.consume(g),w):g===58||g===95||ge(g)?(e.consume(g),A):Q(g)?(e.consume(g),S):w(g)}function A(g){return g===45||g===46||g===58||g===95||fe(g)?(e.consume(g),A):N(g)}function N(g){return g===61?(e.consume(g),v):Q(g)?(e.consume(g),N):S(g)}function v(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),l=g,L):Q(g)?(e.consume(g),v):_(g)}function L(g){return g===l?(e.consume(g),l=null,B):g===null||H(g)?n(g):(e.consume(g),L)}function _(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||ie(g)?N(g):(e.consume(g),_)}function B(g){return g===47||g===62||Q(g)?S(g):n(g)}function w(g){return g===62?(e.consume(g),z):n(g)}function z(g){return g===null||H(g)?E(g):Q(g)?(e.consume(g),z):n(g)}function E(g){return g===45&&i===2?(e.consume(g),U):g===60&&i===1?(e.consume(g),V):g===62&&i===4?(e.consume(g),X):g===63&&i===3?(e.consume(g),x):g===93&&i===5?(e.consume(g),O):H(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Lo,$,R)(g)):g===null||H(g)?(e.exit("htmlFlowData"),R(g)):(e.consume(g),E)}function R(g){return e.check(Do,T,$)(g)}function T(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),F}function F(g){return g===null||H(g)?R(g):(e.enter("htmlFlowData"),E(g))}function U(g){return g===45?(e.consume(g),x):E(g)}function V(g){return g===47?(e.consume(g),a="",P):E(g)}function P(g){if(g===62){const W=a.toLowerCase();return Zn.includes(W)?(e.consume(g),X):E(g)}return ge(g)&&a.length<8?(e.consume(g),a+=String.fromCharCode(g),P):E(g)}function O(g){return g===93?(e.consume(g),x):E(g)}function x(g){return g===62?(e.consume(g),X):g===45&&i===2?(e.consume(g),x):E(g)}function X(g){return g===null||H(g)?(e.exit("htmlFlowData"),$(g)):(e.consume(g),X)}function $(g){return e.exit("htmlFlow"),t(g)}}function Ro(e,t,n){const r=this;return i;function i(a){return H(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Fo(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(dt,t,n)}}const _o={name:"htmlText",tokenize:Oo};function Oo(e,t,n){const r=this;let i,s,a;return o;function o(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),l}function l(x){return x===33?(e.consume(x),u):x===47?(e.consume(x),N):x===63?(e.consume(x),S):ge(x)?(e.consume(x),_):n(x)}function u(x){return x===45?(e.consume(x),p):x===91?(e.consume(x),s=0,m):ge(x)?(e.consume(x),j):n(x)}function p(x){return x===45?(e.consume(x),f):n(x)}function c(x){return x===null?n(x):x===45?(e.consume(x),h):H(x)?(a=c,V(x)):(e.consume(x),c)}function h(x){return x===45?(e.consume(x),f):c(x)}function f(x){return x===62?U(x):x===45?h(x):c(x)}function m(x){const X="CDATA[";return x===X.charCodeAt(s++)?(e.consume(x),s===X.length?y:m):n(x)}function y(x){return x===null?n(x):x===93?(e.consume(x),C):H(x)?(a=y,V(x)):(e.consume(x),y)}function C(x){return x===93?(e.consume(x),b):y(x)}function b(x){return x===62?U(x):x===93?(e.consume(x),b):y(x)}function j(x){return x===null||x===62?U(x):H(x)?(a=j,V(x)):(e.consume(x),j)}function S(x){return x===null?n(x):x===63?(e.consume(x),A):H(x)?(a=S,V(x)):(e.consume(x),S)}function A(x){return x===62?U(x):S(x)}function N(x){return ge(x)?(e.consume(x),v):n(x)}function v(x){return x===45||fe(x)?(e.consume(x),v):L(x)}function L(x){return H(x)?(a=L,V(x)):Q(x)?(e.consume(x),L):U(x)}function _(x){return x===45||fe(x)?(e.consume(x),_):x===47||x===62||ie(x)?B(x):n(x)}function B(x){return x===47?(e.consume(x),U):x===58||x===95||ge(x)?(e.consume(x),w):H(x)?(a=B,V(x)):Q(x)?(e.consume(x),B):U(x)}function w(x){return x===45||x===46||x===58||x===95||fe(x)?(e.consume(x),w):z(x)}function z(x){return x===61?(e.consume(x),E):H(x)?(a=z,V(x)):Q(x)?(e.consume(x),z):B(x)}function E(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),i=x,R):H(x)?(a=E,V(x)):Q(x)?(e.consume(x),E):(e.consume(x),T)}function R(x){return x===i?(e.consume(x),i=void 0,F):x===null?n(x):H(x)?(a=R,V(x)):(e.consume(x),R)}function T(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||ie(x)?B(x):(e.consume(x),T)}function F(x){return x===47||x===62||ie(x)?B(x):n(x)}function U(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}function V(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),P}function P(x){return Q(x)?Z(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):O(x)}function O(x){return e.enter("htmlTextData"),a(x)}}const vn={name:"labelEnd",resolveAll:Uo,resolveTo:Vo,tokenize:qo},Bo={tokenize:Wo},$o={tokenize:Yo},Ho={tokenize:Go};function Uo(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&ye(e,0,e.length,n),e}function Vo(e,t){let n=e.length,r=0,i,s,a,o;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},p={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",l,t],["enter",u,t]],o=ve(o,e.slice(s+1,s+r+3)),o=ve(o,[["enter",p,t]]),o=ve(o,Tt(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),o=ve(o,[["exit",p,t],e[a-2],e[a-1],["exit",u,t]]),o=ve(o,e.slice(a+1)),o=ve(o,[["exit",l,t]]),ye(e,s,e.length,o),e}function qo(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(h){return s?s._inactive?c(h):(a=r.parser.defined.includes(Se(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(Bo,p,a?p:c)(h):h===91?e.attempt($o,p,a?u:c)(h):a?p(h):c(h)}function u(h){return e.attempt(Ho,p,c)(h)}function p(h){return t(h)}function c(h){return s._balanced=!0,n(h)}}function Wo(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return ie(c)?ot(e,s)(c):s(c)}function s(c){return c===41?p(c):pi(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function a(c){return ie(c)?ot(e,l)(c):p(c)}function o(c){return n(c)}function l(c){return c===34||c===39||c===40?fi(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):p(c)}function u(c){return ie(c)?ot(e,p)(c):p(c)}function p(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function Yo(e,t,n){const r=this;return i;function i(o){return di.call(r,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(Se(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function Go(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const Xo={name:"labelStartImage",resolveAll:vn.resolveAll,tokenize:Ko};function Ko(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),s}function s(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Qo={name:"labelStartLink",resolveAll:vn.resolveAll,tokenize:Jo};function Jo(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Bt={name:"lineEnding",tokenize:Zo};function Zo(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Z(e,t,"linePrefix")}}const wt={name:"thematicBreak",tokenize:el};function el(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||H(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),Q(u)?Z(e,o,"whitespace")(u):o(u))}}const me={continuation:{tokenize:il},exit:sl,name:"list",tokenize:rl},tl={partial:!0,tokenize:ol},nl={partial:!0,tokenize:al};function rl(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(f){const m=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:sn(f)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(wt,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return sn(f)&&++a<10?(e.consume(f),l):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(dt,r.interrupt?n:p,e.attempt(tl,h,c))}function p(f){return r.containerState.initialBlankLine=!0,s++,h(f)}function c(f){return Q(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function il(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(dt,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Z(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!Q(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(nl,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Z(e,e.attempt(me,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function al(e,t,n){const r=this;return Z(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function sl(e){e.exit(this.containerState.type)}function ol(e,t,n){const r=this;return Z(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!Q(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const er={name:"setextUnderline",resolveTo:ll,tokenize:ul};function ll(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function ul(e,t,n){const r=this;let i;return s;function s(u){let p=r.events.length,c;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){c=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),Q(u)?Z(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||H(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const cl={tokenize:pl};function pl(e){const t=this,n=e.attempt(dt,r,e.attempt(this.parser.constructs.flowInitial,i,Z(e,e.attempt(this.parser.constructs.flow,i,e.attempt(mo,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const dl={resolveAll:gi()},fl=hi("string"),hl=hi("text");function hi(e){return{resolveAll:gi(e==="text"?gl:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(p){return u(p)?s(p):o(p)}function o(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),l}function l(p){return u(p)?(n.exit("data"),s(p)):(n.consume(p),l)}function u(p){if(p===null)return!0;const c=i[p];let h=-1;if(c)for(;++h<c.length;){const f=c[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function gi(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function gl(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,a=-1,o=0,l;for(;s--;){const u=i[s];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(u===-2)l=!0,o++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const ml={42:me,43:me,45:me,48:me,49:me,50:me,51:me,52:me,53:me,54:me,55:me,56:me,57:me,62:oi},xl={91:ko},bl={[-2]:Ot,[-1]:Ot,32:Ot},wl={35:Io,42:wt,45:[er,wt],60:No,61:er,95:wt,96:Jn,126:Jn},yl={38:ui,92:li},kl={[-5]:Bt,[-4]:Bt,[-3]:Bt,33:Xo,38:ui,42:on,60:[Ks,_o],91:Qo,92:[jo,li],93:vn,95:on,96:uo},vl={null:[on,dl]},Cl={null:[42,95]},Sl={null:[]},jl=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Cl,contentInitial:xl,disable:Sl,document:ml,flow:wl,flowInitial:bl,insideSpan:vl,string:yl,text:kl},Symbol.toStringTag,{value:"Module"}));function El(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const l={attempt:L(N),check:L(v),consume:j,enter:S,exit:A,interrupt:L(v,{interrupt:!0})},u={code:null,containerState:{},defineSkip:y,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:c};let p=t.tokenize.call(u,l);return t.resolveAll&&s.push(t),u;function c(z){return a=ve(a,z),C(),a[a.length-1]!==null?[]:(_(t,0),u.events=Tt(s,u.events,u),u.events)}function h(z,E){return Tl(f(z),E)}function f(z){return Il(a,z)}function m(){const{_bufferIndex:z,_index:E,line:R,column:T,offset:F}=r;return{_bufferIndex:z,_index:E,line:R,column:T,offset:F}}function y(z){i[z.line]=z.column,w()}function C(){let z;for(;r._index<a.length;){const E=a[r._index];if(typeof E=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<E.length;)b(E.charCodeAt(r._bufferIndex));else b(E)}}function b(z){p=p(z)}function j(z){H(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,w()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=z}function S(z,E){const R=E||{};return R.type=z,R.start=m(),u.events.push(["enter",R,u]),o.push(R),R}function A(z){const E=o.pop();return E.end=m(),u.events.push(["exit",E,u]),E}function N(z,E){_(z,E.from)}function v(z,E){E.restore()}function L(z,E){return R;function R(T,F,U){let V,P,O,x;return Array.isArray(T)?$(T):"tokenize"in T?$([T]):X(T);function X(ee){return ue;function ue(ae){const q=ae!==null&&ee[ae],se=ae!==null&&ee.null,le=[...Array.isArray(q)?q:q?[q]:[],...Array.isArray(se)?se:se?[se]:[]];return $(le)(ae)}}function $(ee){return V=ee,P=0,ee.length===0?U:g(ee[P])}function g(ee){return ue;function ue(ae){return x=B(),O=ee,ee.partial||(u.currentConstruct=ee),ee.name&&u.parser.constructs.disable.null.includes(ee.name)?te():ee.tokenize.call(E?Object.assign(Object.create(u),E):u,l,W,te)(ae)}}function W(ee){return z(O,x),F}function te(ee){return x.restore(),++P<V.length?g(V[P]):U}}}function _(z,E){z.resolveAll&&!s.includes(z)&&s.push(z),z.resolve&&ye(u.events,E,u.events.length-E,z.resolve(u.events.slice(E),u)),z.resolveTo&&(u.events=z.resolveTo(u.events,u))}function B(){const z=m(),E=u.previous,R=u.currentConstruct,T=u.events.length,F=Array.from(o);return{from:T,restore:U};function U(){r=z,u.previous=E,u.currentConstruct=R,u.events.length=T,o=F,w()}}function w(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Il(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function Tl(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),ba=require("react-dom/client"),p=require("react/jsx-runtime"),Me=require("./nosUploader-CgVOa1Lz.cjs");function Rr(e){const{sdk:t,sessionId:n,onSessionCreated:r,onRoundStart:i,onStreamStart:s,onStreamEnd:a,onError:o,onMessageSend:l}=e,[u,d]=k.useState([]),[c,h]=k.useState("ready"),[f,m]=k.useState(null),y=k.useRef(new Map),C=k.useRef(new Map),b=k.useRef(n),j=k.useRef(!0),S=k.useRef(u);b.current=n,j.current=u.length===0,S.current=u;const A=k.useCallback((E,F)=>{if(E===b.current)d(T=>{const M=C.current.get(E)??T,U=F(M);return C.current.set(E,U),U});else{const T=C.current.get(E)??[];C.current.set(E,F(T))}},[]),L=k.useCallback((E,F)=>{const T=y.current.get(E);T!=null&&T.stopTimer&&(clearTimeout(T.stopTimer),T.stopTimer=null),y.current.delete(E),C.current.delete(E),E===b.current&&h(F)},[]);k.useEffect(()=>{const E=n?y.current.get(n):void 0;h(E!=null&&E.busy?"streaming":"ready")},[n]);const v=k.useCallback((E,F)=>{var X;const T=b.current;if(T&&((X=y.current.get(T))!=null&&X.busy))return;l==null||l(E);const M={id:`user_${Date.now()}`,role:"user",parts:[...(F??[]).map($=>({type:"attachment",attachment:$})),{type:"text",content:E}],timestamp:Date.now()},U=`assistant_${Date.now()}`,V={id:U,role:"assistant",parts:[],timestamp:Date.now()},P=j.current,O=S.current;d($=>[...$,M,V]),T&&C.current.set(T,[...O,M,V]),h("submitted"),m(null);const x=$=>{let g="",W="",te=[],ee=!1;C.current.has($)||C.current.set($,[...O,M,V]);const ue={abortController:null,busy:!0,stopTimer:null};y.current.set($,ue);const ae=()=>{const q=[...te];if(g){const se=q.findIndex(le=>le.type==="thinking");se>=0?q[se]={type:"thinking",content:g}:q.unshift({type:"thinking",content:g})}if(W){const se=q[q.length-1];(se==null?void 0:se.type)==="text"?q[q.length-1]={type:"text",content:W}:q.push({type:"text",content:W})}A($,se=>se.map(le=>le.id===U?{...le,parts:q}:le))};ue.abortController=t.chat({sessionId:$,message:E,attachments:F&&F.length>0?F:void 0,stream:!0,onMessage:q=>{switch(ee||(ee=!0,$===b.current&&h("streaming")),q.type){case"session.start":q.roundId&&(i==null||i(q.roundId));break;case"thinking":g+=q.content;break;case"ai":W+=q.content;break;case"tool_call":W&&(te.push({type:"text",content:W}),W=""),te.push({type:"tool_call",toolName:q.toolName,toolCallId:q.toolCallId,args:q.args??"{}"});break;case"tool_result":W&&(te.push({type:"text",content:W}),W=""),te.push({type:"tool_result",toolName:q.toolName??"",toolCallId:q.toolCallId,content:q.content,artifacts:q.artifacts,renderMode:q.renderMode,html:q.html,markdown:q.markdown});break;case"interrupt":W&&(te.push({type:"text",content:W}),W=""),q.interrupt&&te.push({type:"interrupt",interrupt:q.interrupt,resolved:!1}),ae(),L($,"ready");return;case"stop":q.content&&(W=q.content),ae();return}ae()},onDone:q=>{if((W||te.length>0||g)&&ae(),q.artifacts&&q.artifacts.length>0){const le=q.artifacts;A($,Ee=>Ee.map(be=>be.id===U?{...be,artifacts:le}:be))}const se=()=>{L($,"ready"),a==null||a(q.sessionId||$)};if(P){const le=E.slice(0,30),Ee=q.sessionId||$;t.renameConversation(Ee,le).catch(()=>{}).finally(se)}else se()},onError:q=>{te.push({type:"error",content:q.message}),ae(),$===b.current&&(m(q),h("error")),o==null||o(q),L($,"error")}}),s==null||s($)};T?x(T):t.createSession().then($=>{b.current==null&&(b.current=$,r==null||r($)),x($)}).catch($=>{b.current==null&&(m($ instanceof Error?$:new Error(String($))),h("error")),o==null||o($ instanceof Error?$:new Error(String($)))})},[t,r,s,a,o,l,A,L]),N=k.useCallback(()=>{const E=b.current;if(!E)return;const F=y.current.get(E);F!=null&&F.busy&&(F.stopTimer&&clearTimeout(F.stopTimer),F.stopTimer=setTimeout(()=>{var T;F.stopTimer=null,(T=F.abortController)==null||T.abort(),L(E,"ready")},8e3),t.stopGeneration(E).catch(()=>{}))},[t,L]),_=k.useCallback(()=>{var U;const E=b.current;if(E&&((U=y.current.get(E))!=null&&U.busy))return;const F=u.findLastIndex(V=>V.role==="user");if(F<0)return;const T=u[F].parts.filter(V=>V.type==="text").map(V=>V.content).join(""),M=u[F].parts.filter(V=>V.type==="attachment").map(V=>V.attachment);d(V=>V.slice(0,F)),v(T,M.length>0?M:void 0)},[u,v]),B=k.useCallback((E,F)=>{var $;const T=b.current;if(!T||($=y.current.get(T))!=null&&$.busy)return;A(T,g=>g.map(W=>({...W,parts:W.parts.map(te=>te.type==="interrupt"&&te.interrupt.interruptId===E?{...te,resolved:!0,response:F}:te)})));const M={abortController:null,busy:!0,stopTimer:null};y.current.set(T,M);const U=new AbortController;M.abortController=U;let V=0;A(T,g=>g.length>0&&g[g.length-1].role==="assistant"?(V=g[g.length-1].parts.length,g):(V=0,[...g,{id:`assistant_${Date.now()}`,role:"assistant",parts:[],timestamp:Date.now()}])),h("streaming");let P="",O="",x=[];const X=()=>{const g=[...x];if(P){const W=g.findIndex(te=>te.type==="thinking");W>=0?g[W]={type:"thinking",content:P}:g.unshift({type:"thinking",content:P})}if(O){const W=g[g.length-1];(W==null?void 0:W.type)==="text"?g[g.length-1]={type:"text",content:O}:g.push({type:"text",content:O})}A(T,W=>{const te=W.findLastIndex(ee=>ee.role==="assistant");return te<0?W:W.map((ee,ue)=>ue===te?{...ee,parts:[...ee.parts.slice(0,V),...g]}:ee)})};t.respondInterrupt(E,T,F,g=>{let W=!1;switch(g.type){case"thinking":P+=g.content;break;case"ai":O+=g.content;break;case"tool_call":O&&(x.push({type:"text",content:O}),O=""),x.push({type:"tool_call",toolName:g.toolName,toolCallId:g.toolCallId,args:g.args??"{}"});break;case"tool_result":O&&(x.push({type:"text",content:O}),O=""),x.push({type:"tool_result",toolName:g.toolName??"",toolCallId:g.toolCallId,content:g.content,artifacts:g.artifacts,renderMode:g.renderMode,html:g.html,markdown:g.markdown});break;case"interrupt":O&&(x.push({type:"text",content:O}),O=""),g.interrupt&&x.push({type:"interrupt",interrupt:g.interrupt,resolved:!1}),W=!0;break;case"stop":g.content&&(O=g.content),a==null||a(T),W=!0;break;case"done":if(g.artifacts&&g.artifacts.length>0){const te=g.artifacts;A(T,ee=>{const ue=ee.findLastIndex(ae=>ae.role==="assistant");return ue<0?ee:ee.map((ae,q)=>q===ue?{...ae,artifacts:te}:ae)})}a==null||a(T),W=!0;break}X(),W&&L(T,"ready")},g=>{x.push({type:"error",content:g.message}),X(),T===b.current&&(m(g),h("error")),o==null||o(g),L(T,"error")},U.signal).catch(g=>{if((g==null?void 0:g.name)==="AbortError"){L(T,"ready");return}T===b.current&&(m(g instanceof Error?g:new Error(String(g))),h("error")),o==null||o(g instanceof Error?g:new Error(String(g))),L(T,"error")})},[t,o,a,A,L]),w=k.useCallback((E,F)=>{b.current=E;const T=F??C.current.get(E)??[];C.current.set(E,T),d(T)},[]),z=k.useCallback(E=>y.current.has(E)?C.current.get(E)??null:null,[]);return k.useEffect(()=>{var F;if(!n||c!=="ready"||(F=y.current.get(n))!=null&&F.busy)return;const E=Me.popPendingChat();E&&E.sessionId===n&&v(E.message)},[n,c]),{messages:u,status:c,error:f,sendMessage:v,stop:N,regenerate:_,setMessages:d,showSession:w,getLiveMessages:z,respondToInterrupt:B}}const Pr="sa_active_conversation",Pt=20;function Mn(e){try{return localStorage.getItem(`${Pr}_${e}`)}catch{return null}}function wa(e,t){try{const n=`${Pr}_${e}`;t?localStorage.setItem(n,t):localStorage.removeItem(n)}catch{}}function Fr(e){const{sdk:t,onConversationChange:n}=e,r=t.botId,[i,s]=k.useState([]),[a,o]=k.useState(()=>Mn(r)),[l,u]=k.useState(!1),[d,c]=k.useState(!0),h=k.useRef(!0),f=k.useRef(1),m=k.useRef(!1);k.useEffect(()=>()=>{h.current=!1},[]);const y=k.useCallback(N=>{o(N),wa(r,N),N&&(n==null||n(N))},[r,n]),C=k.useCallback(async()=>{if(!m.current){m.current=!0,u(!0);try{f.current=1;const N=await t.listConversations({page:1,size:Pt});if(!h.current)return;s(N.items),c(N.items.length<N.total);const _=Mn(r);_&&!N.items.find(B=>B.sessionId===_)&&y(null)}catch{}finally{m.current=!1,h.current&&u(!1)}}},[t,y]),b=k.useCallback(async()=>{if(!(m.current||!d)){m.current=!0,u(!0);try{const N=f.current+1,_=await t.listConversations({page:N,size:Pt});if(!h.current)return;f.current=N,s(w=>{const z=new Set(w.map(F=>F.sessionId)),E=_.items.filter(F=>!z.has(F.sessionId));return[...w,...E]});const B=f.current*Pt;c(B<_.total)}catch{}finally{m.current=!1,h.current&&u(!1)}}},[t,d]),j=k.useCallback(async(N,_)=>(y(N),(_==null?void 0:_.fetchHistory)===!1?[]:await t.getMessages(N)),[t,y]),S=k.useCallback(async()=>{try{const N=await t.createSession(),_=new Date().toISOString();s(B=>[{sessionId:N,botId:0,title:"新对话",createTime:_,updateTime:_},...B]),y(N)}catch{y(null)}},[t,y]),A=k.useCallback(async N=>{s(_=>_.filter(B=>B.sessionId!==N)),a===N&&y(null);try{await t.deleteConversation(N)}catch{}},[t,a,y]),L=k.useCallback(async(N,_)=>{await t.renameConversation(N,_),s(B=>B.map(w=>w.sessionId===N?{...w,title:_}:w))},[t]),{enabled:v=!0}=e;return k.useEffect(()=>{v&&C()},[v,C]),{conversations:i,activeConversationId:a,loading:l,hasMore:d,loadConversations:C,loadMore:b,switchConversation:j,newConversation:S,deleteConversation:A,renameConversation:L,setActiveConversationId:y}}function _r(e){return!e&&e!==0?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Or(e){return e==="pdf"?"PDF":e==="docx"?"DOC":e==="html"?"HTM":e==="md"?"MD":e.slice(0,3).toUpperCase()||"FILE"}function ya(e,t){var i;const n=(e||"").toLowerCase();if(n.includes("html"))return"html";if(n.includes("markdown"))return"md";if(n.includes("pdf"))return"pdf";if(n.includes("wordprocessingml")||n==="application/msword")return"docx";const r=((i=(t||"").split(".").pop())==null?void 0:i.toLowerCase())??"";return r==="htm"||r==="html"?"html":r==="md"||r==="markdown"?"md":r==="pdf"?"pdf":r==="doc"||r==="docx"?"docx":r}function Br(e){if(!e)return[];const t=[];for(const n of e)if(n.type==="file"&&n.data){const r=n.data.name??n.data.filename??"",i=n.data.mime??n.data.mime_type??n.data.mimeType;t.push({id:n.data.id??"",type:n.data.fileType??n.data.type??ya(i,r),filename:r,url:n.data.url??"",mime:i,size:n.data.size,summary:n.data.summary})}return t}async function kt(e){try{const t=await fetch(e.url);if(!t.ok)throw new Error(`HTTP ${t.status}`);const n=await t.blob(),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=e.filename,document.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(r),4e3)}catch{const t=document.createElement("a");t.href=e.url,t.download=e.filename,t.target="_blank",document.body.appendChild(t),t.click(),t.remove()}}const $r=k.createContext(null);function Te(){const e=k.useContext($r);if(!e)throw new Error("useChatContext must be used within ChatProvider");return e}function Jt({sdk:e,hooks:t,attachmentUploader:n,nosUpload:r,children:i}){const[s,a]=k.useState(!1),[o,l]=k.useState(!1),[u,d]=k.useState(null),[c,h]=k.useState(null),[f,m]=k.useState(!1),[y,C]=k.useState(!1);k.useEffect(()=>{e.getToken().then(()=>{m(!0)}).catch(()=>{m(!0)})},[e]);const b=Fr({sdk:e,onConversationChange:t==null?void 0:t.onConversationChange,enabled:f}),j=Rr({sdk:e,sessionId:b.activeConversationId,onSessionCreated:P=>{b.setActiveConversationId(P)},onStreamStart:t==null?void 0:t.onStreamStart,onStreamEnd:P=>{var O;(O=t==null?void 0:t.onStreamEnd)==null||O.call(t,P),b.loadConversations()},onError:t==null?void 0:t.onError,onMessageSend:t==null?void 0:t.onMessageSend}),S=k.useCallback(P=>{if(P.type==="link"){window.open(P.url,P.target??"_blank","noopener");return}h(P)},[]),A=k.useCallback(()=>h(null),[]),L=k.useRef(0),v=k.useCallback(async P=>{h(null);const O=++L.current;if(j.getLiveMessages(P)){await b.switchConversation(P,{fetchHistory:!1}),j.showSession(P),C(!1);return}C(!0);try{const x=await b.switchConversation(P);if(L.current!==O)return;j.showSession(P,x)}finally{L.current===O&&C(!1)}},[b,j]),N=k.useCallback(async()=>{h(null),j.setMessages([]),await b.newConversation()},[b,j]),_=k.useCallback(async P=>{b.activeConversationId===P&&j.setMessages([]),await b.deleteConversation(P)},[b,j]);k.useEffect(()=>{b.activeConversationId&&j.messages.length===0&&(C(!0),e.getMessages(b.activeConversationId).then(P=>{j.setMessages(P)}).catch(()=>{}).finally(()=>C(!1)))},[]);const B=k.useCallback(()=>{a(P=>!P)},[]),w=k.useCallback(P=>{a(P)},[]),z=k.useCallback(()=>{l(P=>!P),d(P=>null)},[]),E=k.useCallback(P=>{d(P),l(!0)},[]),F=k.useMemo(()=>{const P=new Set,O=[];for(const x of j.messages)if(x.role==="assistant"&&x.artifacts)for(const X of Br(x.artifacts)){const $=X.id||`${X.url}:${X.filename}`;P.has($)||(P.add($),O.push(X))}return O},[j.messages]),T=k.useCallback(async()=>{const P=b.activeConversationId;if(!P)return null;try{const O=await e.getMessages(P);j.setMessages(O);const x=O.findLast(X=>X.role==="assistant");return(x==null?void 0:x.id)??null}catch{return null}},[e,b.activeConversationId,j]),M=k.useCallback((P,O,x)=>{if(/^\d+$/.test(P)){e.feedback(P,O,x).catch(()=>{});return}T().then(X=>{X&&e.feedback(X,O,x).catch(()=>{})})},[e,T]),U=k.useCallback(P=>{if(/^\d+$/.test(P)){e.cancelFeedback(P).catch(()=>{});return}T().then(O=>{O&&e.cancelFeedback(O).catch(()=>{})})},[e,T]),V=k.useMemo(()=>({sdk:e,status:j.status,error:j.error,messages:j.messages,conversations:b.conversations,activeConversationId:b.activeConversationId,isThreadListOpen:s,isArtifactDrawerOpen:o,allArtifacts:F,activePreviewArtifact:u,activePanel:c,hasMore:b.hasMore,conversationsLoading:b.loading,messagesLoading:y,sendMessage:j.sendMessage,attachmentUploader:n??null,nosUpload:r??null,stop:j.stop,regenerate:j.regenerate,switchConversation:v,newConversation:N,deleteConversation:_,renameConversation:b.renameConversation,loadMoreConversations:b.loadMore,toggleThreadList:B,setThreadListOpen:w,toggleArtifactDrawer:z,openArtifactPreview:E,openPanel:S,closePanel:A,feedback:M,cancelFeedback:U,respondToInterrupt:j.respondToInterrupt}),[e,j.status,j.error,j.messages,j.sendMessage,j.stop,j.regenerate,j.respondToInterrupt,n,r,b.conversations,b.activeConversationId,b.renameConversation,b.hasMore,b.loadMore,b.loading,s,o,F,u,c,y,v,N,_,B,w,z,E,S,A,M,U]);return p.jsx($r.Provider,{value:V,children:i})}const ce="https://ehr-web.netease.com/ehr-web/erh-super-agent",pe={recently:`${ce}/recently.svg`,home:`${ce}/home.svg`,mergeWindow:`${ce}/merge_window.svg`,spiltWindow:`${ce}/spilt_window.svg`,close:`${ce}/close.svg`,message:`${ce}/message.svg`,messageCreate:`${ce}/message_create.svg`,customerService:`${ce}/customer_service.svg`,sendSolid:`${ce}/send_solid.svg`,capabilityIcons:[`${ce}/icon1.png`,`${ce}/icon2.png`,`${ce}/icon3.png`],triggerLogo:`${ce}/HRlogo.png`,logo:`${ce}/HRlogo2.png`,assistantAvatarGenerating:`${ce}/profile0.gif`,assistantAvatar:`${ce}/profile1.png`},de={TRIGGER_SIZE:56,TRIGGER_RIGHT:20,TRIGGER_BOTTOM:80,DEFAULT_WIDTH:400,DEFAULT_HEIGHT:648,MIN_WIDTH:360,MAX_WIDTH:800,MAX_HEIGHT_RATIO:.95};function ka({defaultWidth:e=de.DEFAULT_WIDTH,defaultHeight:t=de.DEFAULT_HEIGHT,sidebarWidth:n=0}={}){const[r,i]=k.useState(e),[s,a]=k.useState({x:0,y:0}),[o,l]=k.useState(!1),[u,d]=k.useState(!1),[c,h]=k.useState(null),[f,m]=k.useState(()=>typeof window>"u"?{width:0,height:0}:{width:window.innerWidth,height:window.innerHeight}),y=k.useRef(!1),C=k.useRef(0),b=k.useRef(r),j=k.useRef(!1),S=k.useRef({x:0,y:0}),A=k.useRef({x:0,y:0}),L=k.useRef(!1),v=k.useRef(null);k.useEffect(()=>{const T=()=>m({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]),k.useEffect(()=>()=>{var T;(T=v.current)==null||T.call(v)},[]);const N=Math.floor(f.height*de.MAX_HEIGHT_RATIO),_=Math.min(c||t,N),B=r+n;k.useEffect(()=>{if(!o){const T=f.width-B-20,M=f.height-_-20;a(U=>U.x===T&&U.y===M?U:{x:T,y:M})}},[o,B,_,f]);const w=k.useCallback(T=>{if(u||T.target.closest("button, input, textarea"))return;j.current=!0,L.current=!1,S.current={x:T.clientX,y:T.clientY},A.current={...s};const M=P=>{if(!j.current)return;const O=P.clientX-S.current.x,x=P.clientY-S.current.y;(Math.abs(O)>3||Math.abs(x)>3)&&(L.current=!0),L.current&&(l(!0),a({x:Math.max(-200,Math.min(A.current.x+O,window.innerWidth-100)),y:Math.max(0,Math.min(A.current.y+x,window.innerHeight-48))}))},U=()=>{j.current=!1,V()},V=()=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",U),v.current=null};document.addEventListener("mousemove",M),document.addEventListener("mouseup",U),v.current=V},[u,s]),z=k.useCallback(T=>{T.preventDefault(),T.stopPropagation(),y.current=!0,C.current=T.clientX,b.current=r;const M=s.x+r,U=s.y,V=x=>{if(!y.current)return;const X=x.clientX-C.current;let $=b.current-X;if($>de.MAX_WIDTH){y.current=!1,d(!0),O();return}$=Math.max(de.MIN_WIDTH,$),i($),a({x:M-$,y:U})},P=()=>{y.current=!1,O()},O=()=>{document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",P),v.current=null};document.addEventListener("mousemove",V),document.addEventListener("mouseup",P),v.current=O},[r,s]),E=k.useCallback(()=>{u&&i(e),d(T=>!T)},[u,e]),F=k.useCallback(()=>{d(!1),i(e),l(!1),h(null)},[e]);return{width:r,position:s,hasCustomPosition:o,isMaximized:u,lockedHeight:c,viewport:f,defaultHeight:t,totalWidth:B,windowHeight:_,startWindowDrag:w,startResize:z,toggleMaximize:E,setIsMaximized:d,setLockedHeight:h,setHasCustomPosition:l,reset:F}}function va(e){const{enabled:t,contentSelector:n,defaultHeight:r,onHeightChange:i}=e,s=k.useRef(null);return k.useEffect(()=>{if(!t||!s.current)return;const o=s.current.querySelector(n);if(!o)return;const l=()=>{const c=s.current;if(!c)return;const h=c.querySelector(n);if(!h)return;const f=c.offsetHeight-h.clientHeight,m=h.scrollHeight+f,y=Math.floor(window.innerHeight*de.MAX_HEIGHT_RATIO),C=Math.max(r,Math.min(m,y));i(b=>b===C?b:C)};l();const u=new ResizeObserver(()=>l());Array.from(o.children).forEach(c=>u.observe(c));const d=new MutationObserver(()=>{Array.from(o.children).forEach(c=>u.observe(c)),l()});return d.observe(o,{childList:!0,subtree:!0,characterData:!0}),()=>{u.disconnect(),d.disconnect()}},[t,n,r,i]),s}function Ca(e,t){const n=de.TRIGGER_SIZE;return{x:Math.max(8,Math.min(e,window.innerWidth-n-8)),y:Math.max(8,Math.min(t,window.innerHeight-n-8))}}function Hr({isOpen:e,onClick:t,triggerLogo:n}){const[r,i]=k.useState(null),s=k.useRef(!1),a=k.useRef(!1),o=k.useRef({x:0,y:0}),l=k.useRef({x:0,y:0}),u=k.useRef(null);k.useEffect(()=>()=>{var f;(f=u.current)==null||f.call(u)},[]);const d=k.useCallback(f=>{if(f.button!==0)return;s.current=!0,a.current=!1,o.current={x:f.clientX,y:f.clientY};const m=f.currentTarget.getBoundingClientRect();l.current={x:m.left,y:m.top};const y=b=>{if(!s.current)return;const j=b.clientX-o.current.x,S=b.clientY-o.current.y;(Math.abs(j)>4||Math.abs(S)>4)&&(a.current=!0),a.current&&i(Ca(l.current.x+j,l.current.y+S))},C=()=>{s.current=!1,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",C),u.current=null};document.addEventListener("mousemove",y),document.addEventListener("mouseup",C),u.current=C},[]),c=k.useCallback(()=>{if(a.current){a.current=!1;return}t()},[t]),h=r?{left:r.x,top:r.y,width:de.TRIGGER_SIZE,height:de.TRIGGER_SIZE}:{right:de.TRIGGER_RIGHT,bottom:de.TRIGGER_BOTTOM,width:de.TRIGGER_SIZE,height:de.TRIGGER_SIZE};return p.jsx("button",{type:"button",className:`fixed z-[10000] flex items-center justify-center border-none bg-transparent p-0 transition-transform duration-200 ease-out hover:scale-[1.08] active:scale-95 ${e?"pointer-events-none scale-50 opacity-0":"opacity-100"}`,style:h,onMouseDown:d,onClick:c,"aria-label":"打开 AI 助手",title:"AI 助手",children:p.jsx("img",{src:n||pe.triggerLogo,alt:"AI 助手",className:"block h-full w-full",draggable:!1})})}function nt({tooltip:e,onClick:t,children:n}){return p.jsx("button",{type:"button",className:"sa-tip relative flex h-7 w-7 items-center justify-center rounded-md text-[#666] transition-colors hover:bg-white active:bg-[#F5F5F5]","data-tooltip":e,"aria-label":e,onClick:t,children:n})}function Ur({onClose:e,onToggleThreadList:t,isMaximized:n=!1,onToggleMaximize:r,showHome:i=!1,onHome:s,showClose:a=!0,artifactCount:o=0,onToggleArtifactDrawer:l,panelTitle:u}){return p.jsxs("div",{className:"relative z-20 flex h-9 shrink-0 select-none items-center px-[15px]",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(nt,{tooltip:"历史记录",onClick:t,children:p.jsx("img",{src:pe.recently,alt:"",width:20,height:20})}),i&&s&&p.jsx(nt,{tooltip:u?"返回聊天":"回到首页",onClick:s,children:p.jsx("img",{src:pe.home,alt:"",width:20,height:20})})]}),u&&p.jsx("div",{className:"pointer-events-none absolute inset-x-0 flex justify-center",children:p.jsx("span",{className:"max-w-[50%] truncate text-[15px] font-semibold text-[#18181b]",children:u})}),p.jsxs("div",{className:"ml-auto flex items-center gap-2.5",children:[o>0&&l&&p.jsx(nt,{tooltip:"会话产物",onClick:l,children:p.jsxs("span",{className:"relative flex items-center gap-1",children:[p.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[p.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),p.jsx("polyline",{points:"14 2 14 8 20 8"})]}),o>0&&p.jsx("span",{className:"absolute -right-2 -top-1.5 min-w-[14px] rounded-full bg-[var(--sa-primary)] px-0.5 text-center text-[9px] font-medium leading-[14px] text-white",children:o>99?"99+":o})]})}),r&&p.jsx(nt,{tooltip:n?"小窗":"大窗",onClick:r,children:p.jsx("img",{src:n?pe.spiltWindow:pe.mergeWindow,alt:"",width:20,height:20})}),a&&p.jsx(nt,{tooltip:"关闭",onClick:e,children:p.jsx("img",{src:pe.close,alt:"",width:20,height:20})})]})]})}const rt=e=>String(e).padStart(2,"0");function Sa(e){if(!e)return"";const t=new Date(e);return isNaN(t.getTime())?"":`${t.getFullYear()}-${rt(t.getMonth()+1)}-${rt(t.getDate())} ${rt(t.getHours())}:${rt(t.getMinutes())}:${rt(t.getSeconds())}`}function Vr(e){const t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),r=n-6*864e5,i=[],s=[],a=[];for(const l of e){const u=new Date(l.updateTime).getTime();u>=n?i.push(l):u>=r?s.push(l):a.push(l)}const o=[];return i.length&&o.push({label:"今天",items:i}),s.length&&o.push({label:"最近 7 天",items:s}),a.length&&o.push({label:"更早",items:a}),o}function Zt({width:e}){const{conversations:t,activeConversationId:n,switchConversation:r,newConversation:i,deleteConversation:s,renameConversation:a,hasMore:o,loadMoreConversations:l,conversationsLoading:u}=Te(),[d,c]=k.useState(null),[h,f]=k.useState(""),[m,y]=k.useState(null),C=k.useRef(null),b=k.useCallback((L,v)=>{c(L),f(v??"")},[]),j=k.useCallback(L=>{h.trim()&&a(L,h.trim()),c(null)},[h,a]),S=k.useCallback(()=>{const L=C.current;!L||!o||L.scrollHeight-L.scrollTop-L.clientHeight<50&&l()},[o,l]),A=k.useMemo(()=>Vr(t),[t]);return p.jsxs("div",{className:"relative z-[5] flex h-full shrink-0 flex-col overflow-visible border-r border-[#ECECEC] bg-[#FAFAFA] p-3 animate-sa-history-in",style:{width:e??200},children:[p.jsxs("button",{type:"button",className:"sa-new-chat mb-4 flex h-8 w-full shrink-0 items-center justify-center gap-2 rounded-md text-[14px] font-medium transition-colors",onClick:i,children:[p.jsx("img",{src:pe.messageCreate,alt:"",width:18,height:18}),p.jsx("span",{className:"sa-new-chat-text whitespace-nowrap",children:"新建对话"})]}),p.jsxs("div",{className:"px-1 pb-2.5",children:[p.jsx("div",{className:"mb-1 text-[14px] font-semibold text-[#333]",children:"历史对话"}),p.jsx("div",{className:"text-[11px] text-[#999]",children:"展示最近的会话记录"})]}),p.jsxs("div",{ref:C,className:"flex-1 overflow-y-auto",onScroll:S,children:[u&&t.length===0&&p.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:"加载中..."}),!u&&t.length===0&&p.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:"暂无记录"}),A.map(L=>p.jsxs("div",{className:"mb-1",children:[p.jsx("div",{className:"px-1 pb-1 pt-2 text-[11px] text-[#A0A0A0]",children:L.label}),L.items.map(v=>p.jsx("div",{className:`group relative mb-0.5 flex h-8 w-full cursor-pointer items-center gap-1 rounded-md px-0.5 text-[13px] transition-colors ${v.sessionId===n?"bg-[#E8F1FE]":"hover:bg-[#E8F1FE]"}`,onClick:()=>{d!==v.sessionId&&r(v.sessionId)},onMouseEnter:N=>{if(d===v.sessionId)return;const _=N.currentTarget.getBoundingClientRect();y({text:v.title||"新会话",x:_.right+8,y:_.top+_.height/2})},onMouseLeave:()=>y(null),children:d===v.sessionId?p.jsx("input",{className:"w-full rounded border border-[var(--sa-primary)] bg-white px-1.5 py-0.5 text-[12px] outline-none",value:h,onChange:N=>f(N.target.value),onBlur:()=>j(v.sessionId),onKeyDown:N=>{N.key==="Enter"&&j(v.sessionId),N.key==="Escape"&&c(null)},onClick:N=>N.stopPropagation(),autoFocus:!0}):p.jsxs(p.Fragment,{children:[p.jsx("img",{src:pe.message,alt:"",width:16,height:16,className:"shrink-0 opacity-60"}),p.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-[#333]",children:v.title||"新会话"}),p.jsxs("span",{className:"hidden shrink-0 items-center gap-0.5 group-hover:flex",children:[p.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded text-[#999] hover:bg-white/70 hover:text-[var(--sa-primary)]",onClick:N=>{N.stopPropagation(),b(v.sessionId,v.title)},title:"重命名",children:p.jsx("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"})})}),p.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded text-[#999] hover:bg-white/70 hover:text-[#ef4444]",onClick:N=>{N.stopPropagation(),s(v.sessionId)},title:"删除",children:p.jsx("svg",{width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})})})]})]})},v.sessionId))]},L.label)),u&&t.length>0&&p.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:o?"加载更多...":"加载中..."}),!u&&o&&p.jsx("div",{className:"px-0.5 py-2 text-center text-[11px] text-[#C0C0C0]",children:"向下滚动加载更多"})]}),m&&p.jsx("div",{className:"pointer-events-none fixed z-[10001] whitespace-nowrap rounded border border-[#E8E8E8] bg-white px-2.5 py-1.5 text-[12px] leading-[1.4] text-[#333] shadow-[0_2px_8px_rgba(0,0,0,0.12)]",style:{left:m.x,top:m.y,transform:"translateY(-50%)"},children:m.text})]})}function qr(e){const t=k.useRef(null),n=k.useRef(!1),r=k.useRef(0),i=k.useCallback(()=>{const a=t.current;if(!a)return;const{scrollTop:o,scrollHeight:l,clientHeight:u}=a,d=l-o-u<40;o<r.current&&!d&&(n.current=!0),d&&(n.current=!1),r.current=o},[]);k.useEffect(()=>{const a=t.current;if(a)return a.addEventListener("scroll",i,{passive:!0}),()=>a.removeEventListener("scroll",i)},[i]),k.useEffect(()=>{if(n.current)return;const a=t.current;a&&requestAnimationFrame(()=>{a.scrollTop=a.scrollHeight})},e);const s=k.useCallback(()=>{n.current=!1;const a=t.current;a&&(a.scrollTop=a.scrollHeight)},[]);return{containerRef:t,scrollToBottom:s}}function ja(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ea=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ia=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ta={};function Rn(e,t){return(Ta.jsx?Ia:Ea).test(e)}const za=/[ \t\n\f\r]/g;function Aa(e){return typeof e=="object"?e.type==="text"?Pn(e.value):!1:Pn(e)}function Pn(e){return e.replace(za,"")===""}class dt{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}dt.prototype.normal={};dt.prototype.property={};dt.prototype.space=void 0;function Wr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new dt(n,r,t)}function en(e){return e.toLowerCase()}class xe{constructor(t,n){this.attribute=n,this.property=t}}xe.prototype.attribute="";xe.prototype.booleanish=!1;xe.prototype.boolean=!1;xe.prototype.commaOrSpaceSeparated=!1;xe.prototype.commaSeparated=!1;xe.prototype.defined=!1;xe.prototype.mustUseProperty=!1;xe.prototype.number=!1;xe.prototype.overloadedBoolean=!1;xe.prototype.property="";xe.prototype.spaceSeparated=!1;xe.prototype.space=void 0;let Na=0;const G=Ue(),oe=Ue(),tn=Ue(),D=Ue(),re=Ue(),$e=Ue(),ye=Ue();function Ue(){return 2**++Na}const nn=Object.freeze(Object.defineProperty({__proto__:null,boolean:G,booleanish:oe,commaOrSpaceSeparated:ye,commaSeparated:$e,number:D,overloadedBoolean:tn,spaceSeparated:re},Symbol.toStringTag,{value:"Module"})),Ft=Object.keys(nn);class fn extends xe{constructor(t,n,r,i){let s=-1;if(super(t,n),Fn(this,"space",i),typeof r=="number")for(;++s<Ft.length;){const a=Ft[s];Fn(this,Ft[s],(r&nn[a])===nn[a])}}}fn.prototype.defined=!0;function Fn(e,t,n){n&&(e[t]=n)}function Ge(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new fn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[en(r)]=r,n[en(s.attribute)]=r}return new dt(t,n,e.space)}const Yr=Ge({properties:{ariaActiveDescendant:null,ariaAtomic:oe,ariaAutoComplete:null,ariaBusy:oe,ariaChecked:oe,ariaColCount:D,ariaColIndex:D,ariaColSpan:D,ariaControls:re,ariaCurrent:null,ariaDescribedBy:re,ariaDetails:null,ariaDisabled:oe,ariaDropEffect:re,ariaErrorMessage:null,ariaExpanded:oe,ariaFlowTo:re,ariaGrabbed:oe,ariaHasPopup:null,ariaHidden:oe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:re,ariaLevel:D,ariaLive:null,ariaModal:oe,ariaMultiLine:oe,ariaMultiSelectable:oe,ariaOrientation:null,ariaOwns:re,ariaPlaceholder:null,ariaPosInSet:D,ariaPressed:oe,ariaReadOnly:oe,ariaRelevant:null,ariaRequired:oe,ariaRoleDescription:re,ariaRowCount:D,ariaRowIndex:D,ariaRowSpan:D,ariaSelected:oe,ariaSetSize:D,ariaSort:null,ariaValueMax:D,ariaValueMin:D,ariaValueNow:D,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Gr(e,t){return t in e?e[t]:t}function Xr(e,t){return Gr(e,t.toLowerCase())}const La=Ge({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$e,acceptCharset:re,accessKey:re,action:null,allow:null,allowFullScreen:G,allowPaymentRequest:G,allowUserMedia:G,alpha:G,alt:null,as:null,async:G,autoCapitalize:null,autoComplete:re,autoFocus:G,autoPlay:G,blocking:re,capture:null,charSet:null,checked:G,cite:null,className:re,closedBy:null,colorSpace:null,cols:D,colSpan:D,command:null,commandFor:null,content:null,contentEditable:oe,controls:G,controlsList:re,coords:D|$e,crossOrigin:null,data:null,dateTime:null,decoding:null,default:G,defer:G,dir:null,dirName:null,disabled:G,download:tn,draggable:oe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:G,formTarget:null,headers:re,height:D,hidden:tn,high:D,href:null,hrefLang:null,htmlFor:re,httpEquiv:re,id:null,imageSizes:null,imageSrcSet:null,inert:G,inputMode:null,integrity:null,is:null,isMap:G,itemId:null,itemProp:re,itemRef:re,itemScope:G,itemType:re,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:G,low:D,manifest:null,max:null,maxLength:D,media:null,method:null,min:null,minLength:D,multiple:G,muted:G,name:null,nonce:null,noModule:G,noValidate:G,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:G,optimum:D,pattern:null,ping:re,placeholder:null,playsInline:G,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:G,referrerPolicy:null,rel:re,required:G,reversed:G,rows:D,rowSpan:D,sandbox:re,scope:null,scoped:G,seamless:G,selected:G,shadowRootClonable:G,shadowRootCustomElementRegistry:G,shadowRootDelegatesFocus:G,shadowRootMode:null,shadowRootSerializable:G,shape:null,size:D,sizes:null,slot:null,span:D,spellCheck:oe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:D,step:null,style:null,tabIndex:D,target:null,title:null,translate:null,type:null,typeMustMatch:G,useMap:null,value:oe,width:D,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:re,axis:null,background:null,bgColor:null,border:D,borderColor:null,bottomMargin:D,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:G,declare:G,event:null,face:null,frame:null,frameBorder:null,hSpace:D,leftMargin:D,link:null,longDesc:null,lowSrc:null,marginHeight:D,marginWidth:D,noResize:G,noHref:G,noShade:G,noWrap:G,object:null,profile:null,prompt:null,rev:null,rightMargin:D,rules:null,scheme:null,scrolling:oe,standby:null,summary:null,text:null,topMargin:D,valueType:null,version:null,vAlign:null,vLink:null,vSpace:D,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:G,disablePictureInPicture:G,disableRemotePlayback:G,exportParts:$e,part:re,prefix:null,property:null,results:D,security:null,unselectable:null},space:"html",transform:Xr}),Da=Ge({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ye,accentHeight:D,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:D,amplitude:D,arabicForm:null,ascent:D,attributeName:null,attributeType:null,azimuth:D,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:D,by:null,calcMode:null,capHeight:D,className:re,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:D,diffuseConstant:D,direction:null,display:null,dur:null,divisor:D,dominantBaseline:null,download:G,dx:null,dy:null,edgeMode:null,editable:null,elevation:D,enableBackground:null,end:null,event:null,exponent:D,externalResourcesRequired:null,fill:null,fillOpacity:D,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:$e,g2:$e,glyphName:$e,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:D,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:D,horizOriginX:D,horizOriginY:D,id:null,ideographic:D,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:D,k:D,k1:D,k2:D,k3:D,k4:D,kernelMatrix:ye,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:D,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:D,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:D,overlineThickness:D,paintOrder:null,panose1:null,path:null,pathLength:D,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:re,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:D,pointsAtY:D,pointsAtZ:D,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ye,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ye,rev:ye,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ye,requiredFeatures:ye,requiredFonts:ye,requiredFormats:ye,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:D,specularExponent:D,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:D,strikethroughThickness:D,string:null,stroke:null,strokeDashArray:ye,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:D,strokeOpacity:D,strokeWidth:null,style:null,surfaceScale:D,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ye,tabIndex:D,tableValues:null,target:null,targetX:D,targetY:D,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ye,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:D,underlineThickness:D,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:D,values:null,vAlphabetic:D,vMathematical:D,vectorEffect:null,vHanging:D,vIdeographic:D,version:null,vertAdvY:D,vertOriginX:D,vertOriginY:D,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:D,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Gr}),Kr=Ge({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Qr=Ge({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Xr}),Jr=Ge({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Ma={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Ra=/[A-Z]/g,_n=/-[a-z]/g,Pa=/^data[-\w.:]+$/i;function Fa(e,t){const n=en(t);let r=t,i=xe;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Pa.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(_n,Oa);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!_n.test(s)){let a=s.replace(Ra,_a);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=fn}return new i(r,t)}function _a(e){return"-"+e.toLowerCase()}function Oa(e){return e.charAt(1).toUpperCase()}const Ba=Wr([Yr,La,Kr,Qr,Jr],"html"),hn=Wr([Yr,Da,Kr,Qr,Jr],"svg");function $a(e){return e.join(" ").trim()}var gn={},On=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ha=/\n/g,Ua=/^\s*/,Va=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,qa=/^:\s*/,Wa=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ya=/^[;\s]*/,Ga=/^\s+|\s+$/g,Xa=`
2
+ `,Bn="/",$n="*",Be="",Ka="comment",Qa="declaration";function Ja(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var y=m.match(Ha);y&&(n+=y.length);var C=m.lastIndexOf(Xa);r=~C?m.length-C:r+m.length}function s(){var m={line:n,column:r};return function(y){return y.position=new a(m),u(),y}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(m){var y=new Error(t.source+":"+n+":"+r+": "+m);if(y.reason=m,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(m){var y=m.exec(e);if(y){var C=y[0];return i(C),e=e.slice(C.length),y}}function u(){l(Ua)}function d(m){var y;for(m=m||[];y=c();)y!==!1&&m.push(y);return m}function c(){var m=s();if(!(Bn!=e.charAt(0)||$n!=e.charAt(1))){for(var y=2;Be!=e.charAt(y)&&($n!=e.charAt(y)||Bn!=e.charAt(y+1));)++y;if(y+=2,Be===e.charAt(y-1))return o("End of comment missing");var C=e.slice(2,y-2);return r+=2,i(C),e=e.slice(y),r+=2,m({type:Ka,comment:C})}}function h(){var m=s(),y=l(Va);if(y){if(c(),!l(qa))return o("property missing ':'");var C=l(Wa),b=m({type:Qa,property:Hn(y[0].replace(On,Be)),value:C?Hn(C[0].replace(On,Be)):Be});return l(Ya),b}}function f(){var m=[];d(m);for(var y;y=h();)y!==!1&&(m.push(y),d(m));return m}return u(),f()}function Hn(e){return e?e.replace(Ga,Be):Be}var Za=Ja,es=Me.commonjsGlobal&&Me.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gn,"__esModule",{value:!0});gn.default=ns;const ts=es(Za);function ns(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,ts.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:a,value:o}=s;i?t(a,o,s):o&&(n=n||{},n[a]=o)}),n}var Et={};Object.defineProperty(Et,"__esModule",{value:!0});Et.camelCase=void 0;var rs=/^--[a-zA-Z0-9_-]+$/,is=/-([a-z])/g,as=/^[^-]+$/,ss=/^-(webkit|moz|ms|o|khtml)-/,os=/^-(ms)-/,ls=function(e){return!e||as.test(e)||rs.test(e)},us=function(e,t){return t.toUpperCase()},Un=function(e,t){return"".concat(t,"-")},cs=function(e,t){return t===void 0&&(t={}),ls(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(os,Un):e=e.replace(ss,Un),e.replace(is,us))};Et.camelCase=cs;var ds=Me.commonjsGlobal&&Me.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ps=ds(gn),fs=Et;function rn(e,t){var n={};return!e||typeof e!="string"||(0,ps.default)(e,function(r,i){r&&i&&(n[(0,fs.camelCase)(r,t)]=i)}),n}rn.default=rn;var hs=rn;const gs=Me.getDefaultExportFromCjs(hs),Zr=ei("end"),mn=ei("start");function ei(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ms(e){const t=mn(e),n=Zr(e);if(t&&n)return{start:t,end:n}}function st(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Vn(e.position):"start"in e||"end"in e?Vn(e):"line"in e||"column"in e?an(e):""}function an(e){return qn(e&&e.line)+":"+qn(e&&e.column)}function Vn(e){return an(e&&e.start)+"-"+an(e&&e.end)}function qn(e){return e&&typeof e=="number"?e:1}class he extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=st(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}he.prototype.file="";he.prototype.name="";he.prototype.reason="";he.prototype.message="";he.prototype.stack="";he.prototype.column=void 0;he.prototype.line=void 0;he.prototype.ancestors=void 0;he.prototype.cause=void 0;he.prototype.fatal=void 0;he.prototype.place=void 0;he.prototype.ruleId=void 0;he.prototype.source=void 0;const xn={}.hasOwnProperty,xs=new Map,bs=/[A-Z]/g,ws=new Set(["table","tbody","thead","tfoot","tr"]),ys=new Set(["td","th"]),ti="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ks(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=zs(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ts(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?hn:Ba,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=ni(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function ni(e,t,n){if(t.type==="element")return vs(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Cs(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return js(e,t,n);if(t.type==="mdxjsEsm")return Ss(e,t);if(t.type==="root")return Es(e,t,n);if(t.type==="text")return Is(e,t)}function vs(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=hn,e.schema=i),e.ancestors.push(t);const s=ii(e,t.tagName,!1),a=As(e,t);let o=wn(e,t);return ws.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!Aa(l):!0})),ri(e,a,s,t),bn(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function Cs(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ut(e,t.position)}function Ss(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ut(e,t.position)}function js(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=hn,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:ii(e,t.name,!0),a=Ns(e,t),o=wn(e,t);return ri(e,a,s,t),bn(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function Es(e,t,n){const r={};return bn(r,wn(e,t)),e.create(t,e.Fragment,r,n)}function Is(e,t){return t.value}function ri(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function bn(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ts(e,t,n){return r;function r(i,s,a,o){const u=Array.isArray(a.children)?n:t;return o?u(s,a,o):u(s,a)}}function zs(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),l=mn(r);return t(i,s,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function As(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&xn.call(t.properties,i)){const s=Ls(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&ys.has(t.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Ns(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else ut(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else ut(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function wn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:xs;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const u=i.get(l)||0;a=l+"-"+u,i.set(l,u+1)}}const o=ni(e,s,a);o!==void 0&&n.push(o)}return n}function Ls(e,t,n){const r=Fa(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ja(n):$a(n)),r.property==="style"){let i=typeof n=="object"?n:Ds(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Ms(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Ma[r.property]||r.property:r.attribute,n]}}function Ds(e,t){try{return gs(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new he("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=ti+"#cannot-parse-style-attribute",i}}function ii(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const o=Rn(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=Rn(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return xn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ut(e)}function ut(e,t){const n=new he("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=ti+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Ms(e){const t={};let n;for(n in e)xn.call(e,n)&&(t[Rs(n)]=e[n]);return t}function Rs(e){let t=e.replace(bs,Ps);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Ps(e){return"-"+e.toLowerCase()}const _t={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Fs={};function yn(e,t){const n=Fs,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ai(e,r,i)}function ai(e,t,n){if(_s(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Wn(e.children,t,n)}return Array.isArray(e)?Wn(e,t,n):""}function Wn(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=ai(e[i],t,n);return r.join("")}function _s(e){return!!(e&&typeof e=="object")}const Yn=document.createElement("i");function kn(e){const t="&"+e+";";Yn.innerHTML=t;const n=Yn.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ke(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function Ce(e,t){return e.length>0?(ke(e,e.length,0,t),e):t}const Gn={}.hasOwnProperty;function si(e){const t={};let n=-1;for(;++n<e.length;)Os(t,e[n]);return t}function Os(e,t){let n;for(n in t){const i=(Gn.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){Gn.call(i,a)||(i[a]=[]);const o=s[a];Bs(i[a],Array.isArray(o)?o:o?[o]:[])}}}function Bs(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ke(e,0,0,r)}function oi(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function je(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ge=Re(/[A-Za-z]/),fe=Re(/[\dA-Za-z]/),$s=Re(/[#-'*+\--9=?A-Z^-~]/);function vt(e){return e!==null&&(e<32||e===127)}const sn=Re(/\d/),Hs=Re(/[\dA-Fa-f]/),Us=Re(/[!-/:-@[-`{-~]/);function H(e){return e!==null&&e<-2}function ie(e){return e!==null&&(e<0||e===32)}function Q(e){return e===-2||e===-1||e===32}const It=Re(new RegExp("\\p{P}|\\p{S}","u")),He=Re(/\s/);function Re(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Xe(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&fe(e.charCodeAt(n+1))&&fe(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Z(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return Q(l)?(e.enter(n),o(l)):t(l)}function o(l){return Q(l)&&s++<i?(e.consume(l),o):(e.exit(n),t(l))}}const Vs={tokenize:qs};function qs(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Z(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return H(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const Ws={tokenize:Ys},Xn={tokenize:Gs};function Ys(e){const t=this,n=[];let r=0,i,s,a;return o;function o(S){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,l,u)(S)}return u(S)}function l(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&j();const A=t.events.length;let L=A,v;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){v=t.events[L][1].end;break}b(r);let N=A;for(;N<t.events.length;)t.events[N][1].end={...v},N++;return ke(t.events,L+1,0,t.events.slice(A)),t.events.length=N,u(S)}return o(S)}function u(S){if(r===n.length){if(!i)return h(S);if(i.currentConstruct&&i.currentConstruct.concrete)return m(S);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Xn,d,c)(S)}function d(S){return i&&j(),b(r),h(S)}function c(S){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,m(S)}function h(S){return t.containerState={},e.attempt(Xn,f,m)(S)}function f(S){return r++,n.push([t.currentConstruct,t.containerState]),h(S)}function m(S){if(S===null){i&&j(),b(0),e.consume(S);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),y(S)}function y(S){if(S===null){C(e.exit("chunkFlow"),!0),b(0),e.consume(S);return}return H(S)?(e.consume(S),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(S),y)}function C(S,A){const L=t.sliceStream(S);if(A&&L.push(null),S.previous=s,s&&(s.next=S),s=S,i.defineSkip(S.start),i.write(L),t.parser.lazy[S.start.line]){let v=i.events.length;for(;v--;)if(i.events[v][1].start.offset<a&&(!i.events[v][1].end||i.events[v][1].end.offset>a))return;const N=t.events.length;let _=N,B,w;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(B){w=t.events[_][1].end;break}B=!0}for(b(r),v=N;v<t.events.length;)t.events[v][1].end={...w},v++;ke(t.events,_+1,0,t.events.slice(N)),t.events.length=v}}function b(S){let A=n.length;for(;A-- >S;){const L=n[A];t.containerState=L[1],L[0].exit.call(t,e)}n.length=S}function j(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Gs(e,t,n){return Z(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ye(e){if(e===null||ie(e)||He(e))return 1;if(It(e))return 2}function Tt(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const on={name:"attention",resolveAll:Xs,tokenize:Ks};function Xs(e,t){let n=-1,r,i,s,a,o,l,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},h={...e[n][1].start};Kn(c,-l),Kn(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Ce(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Ce(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),u=Ce(u,Tt(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Ce(u,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Ce(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ke(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Ks(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ye(r);let s;return a;function a(l){return s=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===s)return e.consume(l),o;const u=e.exit("attentionSequence"),d=Ye(l),c=!d||d===2&&i||n.includes(l),h=!i||i===2&&d||n.includes(r);return u._open=!!(s===42?c:c&&(i||!h)),u._close=!!(s===42?h:h&&(d||!c)),t(l)}}function Kn(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Qs={name:"autolink",tokenize:Js};function Js(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(f){return ge(f)?(e.consume(f),a):f===64?n(f):u(f)}function a(f){return f===43||f===45||f===46||fe(f)?(r=1,o(f)):u(f)}function o(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||fe(f))&&r++<32?(e.consume(f),o):(r=0,u(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||vt(f)?n(f):(e.consume(f),l)}function u(f){return f===64?(e.consume(f),d):$s(f)?(e.consume(f),u):n(f)}function d(f){return fe(f)?c(f):n(f)}function c(f){return f===46?(e.consume(f),r=0,d):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||fe(f))&&r++<63){const m=f===45?h:c;return e.consume(f),m}return n(f)}}const pt={partial:!0,tokenize:Zs};function Zs(e,t,n){return r;function r(s){return Q(s)?Z(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||H(s)?t(s):n(s)}}const li={continuation:{tokenize:to},exit:no,name:"blockQuote",tokenize:eo};function eo(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return Q(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function to(e,t,n){const r=this;return i;function i(a){return Q(a)?Z(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(li,t,n)(a)}}function no(e){e.exit("blockQuote")}const ui={name:"characterEscape",tokenize:ro};function ro(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return Us(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const ci={name:"characterReference",tokenize:io};function io(e,t,n){const r=this;let i=0,s,a;return o;function o(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,a=fe,d(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=Hs,d):(e.enter("characterReferenceValue"),s=7,a=sn,d(c))}function d(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return a===fe&&!kn(r.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(c)&&i++<s?(e.consume(c),d):n(c)}}const Qn={partial:!0,tokenize:so},Jn={concrete:!0,name:"codeFenced",tokenize:ao};function ao(e,t,n){const r=this,i={partial:!0,tokenize:L};let s=0,a=0,o;return l;function l(v){return u(v)}function u(v){const N=r.events[r.events.length-1];return s=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,o=v,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(v)}function d(v){return v===o?(a++,e.consume(v),d):a<3?n(v):(e.exit("codeFencedFenceSequence"),Q(v)?Z(e,c,"whitespace")(v):c(v))}function c(v){return v===null||H(v)?(e.exit("codeFencedFence"),r.interrupt?t(v):e.check(Qn,y,A)(v)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===null||H(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(v)):Q(v)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Z(e,f,"whitespace")(v)):v===96&&v===o?n(v):(e.consume(v),h)}function f(v){return v===null||H(v)?c(v):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||H(v)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(v)):v===96&&v===o?n(v):(e.consume(v),m)}function y(v){return e.attempt(i,A,C)(v)}function C(v){return e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),b}function b(v){return s>0&&Q(v)?Z(e,j,"linePrefix",s+1)(v):j(v)}function j(v){return v===null||H(v)?e.check(Qn,y,A)(v):(e.enter("codeFlowValue"),S(v))}function S(v){return v===null||H(v)?(e.exit("codeFlowValue"),j(v)):(e.consume(v),S)}function A(v){return e.exit("codeFenced"),t(v)}function L(v,N,_){let B=0;return w;function w(M){return v.enter("lineEnding"),v.consume(M),v.exit("lineEnding"),z}function z(M){return v.enter("codeFencedFence"),Q(M)?Z(v,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):E(M)}function E(M){return M===o?(v.enter("codeFencedFenceSequence"),F(M)):_(M)}function F(M){return M===o?(B++,v.consume(M),F):B>=a?(v.exit("codeFencedFenceSequence"),Q(M)?Z(v,T,"whitespace")(M):T(M)):_(M)}function T(M){return M===null||H(M)?(v.exit("codeFencedFence"),N(M)):_(M)}}}function so(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Ot={name:"codeIndented",tokenize:lo},oo={partial:!0,tokenize:uo};function lo(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Z(e,s,"linePrefix",5)(u)}function s(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):H(u)?e.attempt(oo,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||H(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function uo(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):H(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Z(e,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):H(a)?i(a):n(a)}}const co={name:"codeText",previous:fo,resolve:po,tokenize:ho};function po(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function fo(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ho(e,t,n){let r=0,i,s;return a;function a(c){return e.enter("codeText"),e.enter("codeTextSequence"),o(c)}function o(c){return c===96?(e.consume(c),r++,o):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(s=e.enter("codeTextSequence"),i=0,d(c)):H(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||H(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function d(c){return c===96?(e.consume(c),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(s.type="codeTextData",u(c))}}class go{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&it(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),it(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),it(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);it(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);it(this.left,n.reverse())}}}function it(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function di(e){const t={};let n=-1,r,i,s,a,o,l,u;const d=new go(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,mo(d,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=d.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},o=d.slice(i,n),o.unshift(r),d.splice(i,n-i+1,o))}}return ke(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function mo(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,l=[],u={};let d,c,h=-1,f=n,m=0,y=0;const C=[y];for(;f;){for(;e.get(++i)[1]!==f;);s.push(i),f._tokenizer||(d=r.sliceStream(f),f.next||d.push(null),c&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),c=f,f=f.next}for(f=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(y=h+1,C.push(y),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):C.pop(),h=C.length;h--;){const b=o.slice(C[h],C[h+1]),j=s.pop();l.push([j,j+b.length-1]),e.splice(j,2,b)}for(l.reverse(),h=-1;++h<l.length;)u[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return u}const xo={resolve:wo,tokenize:yo},bo={partial:!0,tokenize:ko};function wo(e){return di(e),e}function yo(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):H(o)?e.check(bo,a,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function ko(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Z(e,s,"linePrefix")}function s(a){if(a===null||H(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function pi(e,t,n,r,i,s,a,o,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return c;function c(b){return b===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(b),e.exit(s),h):b===null||b===32||b===41||vt(b)?n(b):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),y(b))}function h(b){return b===62?(e.enter(s),e.consume(b),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===62?(e.exit("chunkString"),e.exit(o),h(b)):b===null||b===60||H(b)?n(b):(e.consume(b),b===92?m:f)}function m(b){return b===60||b===62||b===92?(e.consume(b),f):f(b)}function y(b){return!d&&(b===null||b===41||ie(b))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(b)):d<u&&b===40?(e.consume(b),d++,y):b===41?(e.consume(b),d--,y):b===null||b===32||b===40||vt(b)?n(b):(e.consume(b),b===92?C:y)}function C(b){return b===40||b===41||b===92?(e.consume(b),y):y(b)}}function fi(e,t,n,r,i,s){const a=this;let o=0,l;return u;function u(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(s),d}function d(f){return o>999||f===null||f===91||f===93&&!l||f===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):H(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===null||f===91||f===93||H(f)||o++>999?(e.exit("chunkString"),d(f)):(e.consume(f),l||(l=!Q(f)),f===92?h:c)}function h(f){return f===91||f===92||f===93?(e.consume(f),o++,c):c(f)}}function hi(e,t,n,r,i,s){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),u(h))}function u(h){return h===a?(e.exit(s),l(a)):h===null?n(h):H(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Z(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||H(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?c:d)}function c(h){return h===a||h===92?(e.consume(h),d):d(h)}}function ot(e,t){let n;return r;function r(i){return H(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Q(i)?Z(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const vo={name:"definition",tokenize:So},Co={partial:!0,tokenize:jo};function So(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),a(f)}function a(f){return fi.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function o(f){return i=je(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return ie(f)?ot(e,u)(f):u(f)}function u(f){return pi(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(Co,c,c)(f)}function c(f){return Q(f)?Z(e,h,"whitespace")(f):h(f)}function h(f){return f===null||H(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function jo(e,t,n){return r;function r(o){return ie(o)?ot(e,i)(o):n(o)}function i(o){return hi(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return Q(o)?Z(e,a,"whitespace")(o):a(o)}function a(o){return o===null||H(o)?t(o):n(o)}}const Eo={name:"hardBreakEscape",tokenize:Io};function Io(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return H(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const To={name:"headingAtx",resolve:zo,tokenize:Ao};function zo(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ke(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Ao(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||ie(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||H(d)?(e.exit("atxHeading"),t(d)):Q(d)?Z(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||ie(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const No=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Zn=["pre","script","style","textarea"],Lo={concrete:!0,name:"htmlFlow",resolveTo:Ro,tokenize:Po},Do={partial:!0,tokenize:_o},Mo={partial:!0,tokenize:Fo};function Ro(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Po(e,t,n){const r=this;let i,s,a,o,l;return u;function u(g){return d(g)}function d(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),h):g===47?(e.consume(g),s=!0,y):g===63?(e.consume(g),i=3,r.interrupt?t:x):ge(g)?(e.consume(g),a=String.fromCharCode(g),C):n(g)}function h(g){return g===45?(e.consume(g),i=2,f):g===91?(e.consume(g),i=5,o=0,m):ge(g)?(e.consume(g),i=4,r.interrupt?t:x):n(g)}function f(g){return g===45?(e.consume(g),r.interrupt?t:x):n(g)}function m(g){const W="CDATA[";return g===W.charCodeAt(o++)?(e.consume(g),o===W.length?r.interrupt?t:E:m):n(g)}function y(g){return ge(g)?(e.consume(g),a=String.fromCharCode(g),C):n(g)}function C(g){if(g===null||g===47||g===62||ie(g)){const W=g===47,te=a.toLowerCase();return!W&&!s&&Zn.includes(te)?(i=1,r.interrupt?t(g):E(g)):No.includes(a.toLowerCase())?(i=6,W?(e.consume(g),b):r.interrupt?t(g):E(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):s?j(g):S(g))}return g===45||fe(g)?(e.consume(g),a+=String.fromCharCode(g),C):n(g)}function b(g){return g===62?(e.consume(g),r.interrupt?t:E):n(g)}function j(g){return Q(g)?(e.consume(g),j):w(g)}function S(g){return g===47?(e.consume(g),w):g===58||g===95||ge(g)?(e.consume(g),A):Q(g)?(e.consume(g),S):w(g)}function A(g){return g===45||g===46||g===58||g===95||fe(g)?(e.consume(g),A):L(g)}function L(g){return g===61?(e.consume(g),v):Q(g)?(e.consume(g),L):S(g)}function v(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),l=g,N):Q(g)?(e.consume(g),v):_(g)}function N(g){return g===l?(e.consume(g),l=null,B):g===null||H(g)?n(g):(e.consume(g),N)}function _(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||ie(g)?L(g):(e.consume(g),_)}function B(g){return g===47||g===62||Q(g)?S(g):n(g)}function w(g){return g===62?(e.consume(g),z):n(g)}function z(g){return g===null||H(g)?E(g):Q(g)?(e.consume(g),z):n(g)}function E(g){return g===45&&i===2?(e.consume(g),U):g===60&&i===1?(e.consume(g),V):g===62&&i===4?(e.consume(g),X):g===63&&i===3?(e.consume(g),x):g===93&&i===5?(e.consume(g),O):H(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Do,$,F)(g)):g===null||H(g)?(e.exit("htmlFlowData"),F(g)):(e.consume(g),E)}function F(g){return e.check(Mo,T,$)(g)}function T(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),M}function M(g){return g===null||H(g)?F(g):(e.enter("htmlFlowData"),E(g))}function U(g){return g===45?(e.consume(g),x):E(g)}function V(g){return g===47?(e.consume(g),a="",P):E(g)}function P(g){if(g===62){const W=a.toLowerCase();return Zn.includes(W)?(e.consume(g),X):E(g)}return ge(g)&&a.length<8?(e.consume(g),a+=String.fromCharCode(g),P):E(g)}function O(g){return g===93?(e.consume(g),x):E(g)}function x(g){return g===62?(e.consume(g),X):g===45&&i===2?(e.consume(g),x):E(g)}function X(g){return g===null||H(g)?(e.exit("htmlFlowData"),$(g)):(e.consume(g),X)}function $(g){return e.exit("htmlFlow"),t(g)}}function Fo(e,t,n){const r=this;return i;function i(a){return H(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function _o(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(pt,t,n)}}const Oo={name:"htmlText",tokenize:Bo};function Bo(e,t,n){const r=this;let i,s,a;return o;function o(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),l}function l(x){return x===33?(e.consume(x),u):x===47?(e.consume(x),L):x===63?(e.consume(x),S):ge(x)?(e.consume(x),_):n(x)}function u(x){return x===45?(e.consume(x),d):x===91?(e.consume(x),s=0,m):ge(x)?(e.consume(x),j):n(x)}function d(x){return x===45?(e.consume(x),f):n(x)}function c(x){return x===null?n(x):x===45?(e.consume(x),h):H(x)?(a=c,V(x)):(e.consume(x),c)}function h(x){return x===45?(e.consume(x),f):c(x)}function f(x){return x===62?U(x):x===45?h(x):c(x)}function m(x){const X="CDATA[";return x===X.charCodeAt(s++)?(e.consume(x),s===X.length?y:m):n(x)}function y(x){return x===null?n(x):x===93?(e.consume(x),C):H(x)?(a=y,V(x)):(e.consume(x),y)}function C(x){return x===93?(e.consume(x),b):y(x)}function b(x){return x===62?U(x):x===93?(e.consume(x),b):y(x)}function j(x){return x===null||x===62?U(x):H(x)?(a=j,V(x)):(e.consume(x),j)}function S(x){return x===null?n(x):x===63?(e.consume(x),A):H(x)?(a=S,V(x)):(e.consume(x),S)}function A(x){return x===62?U(x):S(x)}function L(x){return ge(x)?(e.consume(x),v):n(x)}function v(x){return x===45||fe(x)?(e.consume(x),v):N(x)}function N(x){return H(x)?(a=N,V(x)):Q(x)?(e.consume(x),N):U(x)}function _(x){return x===45||fe(x)?(e.consume(x),_):x===47||x===62||ie(x)?B(x):n(x)}function B(x){return x===47?(e.consume(x),U):x===58||x===95||ge(x)?(e.consume(x),w):H(x)?(a=B,V(x)):Q(x)?(e.consume(x),B):U(x)}function w(x){return x===45||x===46||x===58||x===95||fe(x)?(e.consume(x),w):z(x)}function z(x){return x===61?(e.consume(x),E):H(x)?(a=z,V(x)):Q(x)?(e.consume(x),z):B(x)}function E(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),i=x,F):H(x)?(a=E,V(x)):Q(x)?(e.consume(x),E):(e.consume(x),T)}function F(x){return x===i?(e.consume(x),i=void 0,M):x===null?n(x):H(x)?(a=F,V(x)):(e.consume(x),F)}function T(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||ie(x)?B(x):(e.consume(x),T)}function M(x){return x===47||x===62||ie(x)?B(x):n(x)}function U(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}function V(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),P}function P(x){return Q(x)?Z(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):O(x)}function O(x){return e.enter("htmlTextData"),a(x)}}const vn={name:"labelEnd",resolveAll:Vo,resolveTo:qo,tokenize:Wo},$o={tokenize:Yo},Ho={tokenize:Go},Uo={tokenize:Xo};function Vo(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&ke(e,0,e.length,n),e}function qo(e,t){let n=e.length,r=0,i,s,a,o;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},d={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",l,t],["enter",u,t]],o=Ce(o,e.slice(s+1,s+r+3)),o=Ce(o,[["enter",d,t]]),o=Ce(o,Tt(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),o=Ce(o,[["exit",d,t],e[a-2],e[a-1],["exit",u,t]]),o=Ce(o,e.slice(a+1)),o=Ce(o,[["exit",l,t]]),ke(e,s,e.length,o),e}function Wo(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(h){return s?s._inactive?c(h):(a=r.parser.defined.includes(je(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt($o,d,a?d:c)(h):h===91?e.attempt(Ho,d,a?u:c)(h):a?d(h):c(h)}function u(h){return e.attempt(Uo,d,c)(h)}function d(h){return t(h)}function c(h){return s._balanced=!0,n(h)}}function Yo(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return ie(c)?ot(e,s)(c):s(c)}function s(c){return c===41?d(c):pi(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function a(c){return ie(c)?ot(e,l)(c):d(c)}function o(c){return n(c)}function l(c){return c===34||c===39||c===40?hi(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):d(c)}function u(c){return ie(c)?ot(e,d)(c):d(c)}function d(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function Go(e,t,n){const r=this;return i;function i(o){return fi.call(r,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(je(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function Xo(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const Ko={name:"labelStartImage",resolveAll:vn.resolveAll,tokenize:Qo};function Qo(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),s}function s(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Jo={name:"labelStartLink",resolveAll:vn.resolveAll,tokenize:Zo};function Zo(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Bt={name:"lineEnding",tokenize:el};function el(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Z(e,t,"linePrefix")}}const wt={name:"thematicBreak",tokenize:tl};function tl(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||H(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),Q(u)?Z(e,o,"whitespace")(u):o(u))}}const me={continuation:{tokenize:al},exit:ol,name:"list",tokenize:il},nl={partial:!0,tokenize:ll},rl={partial:!0,tokenize:sl};function il(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(f){const m=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:sn(f)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(wt,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return sn(f)&&++a<10?(e.consume(f),l):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(pt,r.interrupt?n:d,e.attempt(nl,h,c))}function d(f){return r.containerState.initialBlankLine=!0,s++,h(f)}function c(f){return Q(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function al(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(pt,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Z(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!Q(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(rl,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Z(e,e.attempt(me,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function sl(e,t,n){const r=this;return Z(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function ol(e){e.exit(this.containerState.type)}function ll(e,t,n){const r=this;return Z(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!Q(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const er={name:"setextUnderline",resolveTo:ul,tokenize:cl};function ul(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function cl(e,t,n){const r=this;let i;return s;function s(u){let d=r.events.length,c;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){c=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),Q(u)?Z(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||H(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const dl={tokenize:pl};function pl(e){const t=this,n=e.attempt(pt,r,e.attempt(this.parser.constructs.flowInitial,i,Z(e,e.attempt(this.parser.constructs.flow,i,e.attempt(xo,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const fl={resolveAll:mi()},hl=gi("string"),gl=gi("text");function gi(e){return{resolveAll:mi(e==="text"?ml:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(d){return u(d)?s(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const c=i[d];let h=-1;if(c)for(;++h<c.length;){const f=c[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function mi(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function ml(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,a=-1,o=0,l;for(;s--;){const u=i[s];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(u===-2)l=!0,o++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const xl={42:me,43:me,45:me,48:me,49:me,50:me,51:me,52:me,53:me,54:me,55:me,56:me,57:me,62:li},bl={91:vo},wl={[-2]:Ot,[-1]:Ot,32:Ot},yl={35:To,42:wt,45:[er,wt],60:Lo,61:er,95:wt,96:Jn,126:Jn},kl={38:ci,92:ui},vl={[-5]:Bt,[-4]:Bt,[-3]:Bt,33:Ko,38:ci,42:on,60:[Qs,Oo],91:Jo,92:[Eo,ui],93:vn,95:on,96:co},Cl={null:[on,fl]},Sl={null:[42,95]},jl={null:[]},El=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Sl,contentInitial:bl,disable:jl,document:xl,flow:yl,flowInitial:wl,insideSpan:Cl,string:kl,text:vl},Symbol.toStringTag,{value:"Module"}));function Il(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const l={attempt:N(L),check:N(v),consume:j,enter:S,exit:A,interrupt:N(v,{interrupt:!0})},u={code:null,containerState:{},defineSkip:y,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:c};let d=t.tokenize.call(u,l);return t.resolveAll&&s.push(t),u;function c(z){return a=Ce(a,z),C(),a[a.length-1]!==null?[]:(_(t,0),u.events=Tt(s,u.events,u),u.events)}function h(z,E){return zl(f(z),E)}function f(z){return Tl(a,z)}function m(){const{_bufferIndex:z,_index:E,line:F,column:T,offset:M}=r;return{_bufferIndex:z,_index:E,line:F,column:T,offset:M}}function y(z){i[z.line]=z.column,w()}function C(){let z;for(;r._index<a.length;){const E=a[r._index];if(typeof E=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<E.length;)b(E.charCodeAt(r._bufferIndex));else b(E)}}function b(z){d=d(z)}function j(z){H(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,w()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=z}function S(z,E){const F=E||{};return F.type=z,F.start=m(),u.events.push(["enter",F,u]),o.push(F),F}function A(z){const E=o.pop();return E.end=m(),u.events.push(["exit",E,u]),E}function L(z,E){_(z,E.from)}function v(z,E){E.restore()}function N(z,E){return F;function F(T,M,U){let V,P,O,x;return Array.isArray(T)?$(T):"tokenize"in T?$([T]):X(T);function X(ee){return ue;function ue(ae){const q=ae!==null&&ee[ae],se=ae!==null&&ee.null,le=[...Array.isArray(q)?q:q?[q]:[],...Array.isArray(se)?se:se?[se]:[]];return $(le)(ae)}}function $(ee){return V=ee,P=0,ee.length===0?U:g(ee[P])}function g(ee){return ue;function ue(ae){return x=B(),O=ee,ee.partial||(u.currentConstruct=ee),ee.name&&u.parser.constructs.disable.null.includes(ee.name)?te():ee.tokenize.call(E?Object.assign(Object.create(u),E):u,l,W,te)(ae)}}function W(ee){return z(O,x),M}function te(ee){return x.restore(),++P<V.length?g(V[P]):U}}}function _(z,E){z.resolveAll&&!s.includes(z)&&s.push(z),z.resolve&&ke(u.events,E,u.events.length-E,z.resolve(u.events.slice(E),u)),z.resolveTo&&(u.events=z.resolveTo(u.events,u))}function B(){const z=m(),E=u.previous,F=u.currentConstruct,T=u.events.length,M=Array.from(o);return{from:T,restore:U};function U(){r=z,u.previous=E,u.currentConstruct=F,u.events.length=T,o=M,w()}}function w(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Tl(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function zl(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
3
3
  `;break}case-3:{a=`\r
4
- `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function zl(e){const r={constructs:ai([jl,...(e||{}).extensions||[]]),content:i(Us),defined:[],document:i(qs),flow:i(cl),lazy:{},string:i(fl),text:i(hl)};return r;function i(s){return a;function a(o){return El(r,s,o)}}}function Al(e){for(;!ci(e););return e}const tr=/[\0\t\n\r]/g;function Nl(){let e=1,t="",n=!0,r;return i;function i(s,a,o){const l=[];let u,p,c,h,f;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),c=0,t="",n&&(s.charCodeAt(0)===65279&&c++,n=void 0);c<s.length;){if(tr.lastIndex=c,u=tr.exec(s),h=u&&u.index!==void 0?u.index:s.length,f=s.charCodeAt(h),!u){t=s.slice(c);break}if(f===10&&c===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<h&&(l.push(s.slice(c,h)),e+=h-c),f){case 0:{l.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,l.push(-2);e++<p;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=h+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Ll=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Dl(e){return e.replace(Ll,Ml)}function Ml(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return si(n.slice(s?2:1),s?16:10)}return kn(n)||e}const mi={}.hasOwnProperty;function Pl(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Rl(n)(Al(zl(n).document().write(Nl()(e,t,!0))))}function Rl(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Je),autolinkProtocol:B,autolinkEmail:B,atxHeading:s(Ke),blockQuote:s(se),characterEscape:B,characterReference:B,codeFenced:s(le),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(le,a),codeText:s(je,a),codeTextData:B,data:B,codeFlowValue:B,definition:s(Ee),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Lt),hardBreakEscape:s(Qe),hardBreakTrailing:s(Qe),htmlFlow:s(Re,a),htmlFlowData:B,htmlText:s(Re,a),htmlTextData:B,image:s(Dt),label:a,link:s(Je),listItem:s(ke),listItemValue:h,listOrdered:s(Ze,c),listUnordered:s(Ze),paragraph:s(ht),reference:g,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Ke),strong:s(Mt),thematicBreak:s(Pt)},exit:{atxHeading:l(),atxHeadingSequence:N,autolink:l(),autolinkEmail:q,autolinkProtocol:ae,blockQuote:l(),characterEscapeValue:w,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:ee,characterReference:ue,codeFenced:l(C),codeFencedFence:y,codeFencedFenceInfo:f,codeFencedFenceMeta:m,codeFlowValue:w,codeIndented:l(b),codeText:l(F),codeTextData:w,data:w,definition:l(),definitionDestinationString:A,definitionLabelString:j,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(E),hardBreakTrailing:l(E),htmlFlow:l(R),htmlFlowData:w,htmlText:l(T),htmlTextData:w,image:l(V),label:O,labelText:P,lineEnding:z,link:l(U),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:W,resourceDestinationString:x,resourceTitleString:X,resource:$,setextHeading:l(_),setextHeadingLineSequence:L,setextHeadingText:v,strong:l(),thematicBreak:l()}};xi(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(I){let M={type:"root",children:[]};const Y={stack:[M],tokenStack:[],config:t,enter:o,exit:u,buffer:a,resume:p,data:n},K=[];let ne=-1;for(;++ne<I.length;)if(I[ne][1].type==="listOrdered"||I[ne][1].type==="listUnordered")if(I[ne][0]==="enter")K.push(ne);else{const Ce=K.pop();ne=i(I,Ce,ne)}for(ne=-1;++ne<I.length;){const Ce=t[I[ne][0]];mi.call(Ce,I[ne][1].type)&&Ce[I[ne][1].type].call(Object.assign({sliceSerialize:I[ne][2].sliceSerialize},Y),I[ne][1])}if(Y.tokenStack.length>0){const Ce=Y.tokenStack[Y.tokenStack.length-1];(Ce[1]||nr).call(Y,void 0,Ce[0])}for(M.position={start:De(I.length>0?I[0][1].start:{line:1,column:1,offset:0}),end:De(I.length>0?I[I.length-2][1].end:{line:1,column:1,offset:0})},ne=-1;++ne<t.transforms.length;)M=t.transforms[ne](M)||M;return M}function i(I,M,Y){let K=M-1,ne=-1,Ce=!1,Fe,Ae,et,tt;for(;++K<=Y;){const be=I[K];switch(be[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{be[0]==="enter"?ne++:ne--,tt=void 0;break}case"lineEndingBlank":{be[0]==="enter"&&(Fe&&!tt&&!ne&&!et&&(et=K),tt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:tt=void 0}if(!ne&&be[0]==="enter"&&be[1].type==="listItemPrefix"||ne===-1&&be[0]==="exit"&&(be[1].type==="listUnordered"||be[1].type==="listOrdered")){if(Fe){let qe=K;for(Ae=void 0;qe--;){const Ne=I[qe];if(Ne[1].type==="lineEnding"||Ne[1].type==="lineEndingBlank"){if(Ne[0]==="exit")continue;Ae&&(I[Ae][1].type="lineEndingBlank",Ce=!0),Ne[1].type="lineEnding",Ae=qe}else if(!(Ne[1].type==="linePrefix"||Ne[1].type==="blockQuotePrefix"||Ne[1].type==="blockQuotePrefixWhitespace"||Ne[1].type==="blockQuoteMarker"||Ne[1].type==="listItemIndent"))break}et&&(!Ae||et<Ae)&&(Fe._spread=!0),Fe.end=Object.assign({},Ae?I[Ae][1].start:be[1].end),I.splice(Ae||K,0,["exit",Fe,be[2]]),K++,Y++}if(be[1].type==="listItemPrefix"){const qe={type:"listItem",_spread:!1,start:Object.assign({},be[1].start),end:void 0};Fe=qe,I.splice(K,0,["enter",qe,be[2]]),K++,Y++,et=void 0,tt=!0}}}return I[M][1]._spread=Ce,Y}function s(I,M){return Y;function Y(K){o.call(this,I(K),K),M&&M.call(this,K)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(I,M,Y){this.stack[this.stack.length-1].children.push(I),this.stack.push(I),this.tokenStack.push([M,Y||void 0]),I.position={start:De(M.start),end:void 0}}function l(I){return M;function M(Y){I&&I.call(this,Y),u.call(this,Y)}}function u(I,M){const Y=this.stack.pop(),K=this.tokenStack.pop();if(K)K[0].type!==I.type&&(M?M.call(this,I,K[0]):(K[1]||nr).call(this,I,K[0]));else throw new Error("Cannot close `"+I.type+"` ("+st({start:I.start,end:I.end})+"): it’s not open");Y.position.end=De(I.end)}function p(){return yn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(I){if(this.data.expectingFirstListItemValue){const M=this.stack[this.stack.length-2];M.start=Number.parseInt(this.sliceSerialize(I),10),this.data.expectingFirstListItemValue=void 0}}function f(){const I=this.resume(),M=this.stack[this.stack.length-1];M.lang=I}function m(){const I=this.resume(),M=this.stack[this.stack.length-1];M.meta=I}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const I=this.resume(),M=this.stack[this.stack.length-1];M.value=I.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const I=this.resume(),M=this.stack[this.stack.length-1];M.value=I.replace(/(\r?\n|\r)$/g,"")}function j(I){const M=this.resume(),Y=this.stack[this.stack.length-1];Y.label=M,Y.identifier=Se(this.sliceSerialize(I)).toLowerCase()}function S(){const I=this.resume(),M=this.stack[this.stack.length-1];M.title=I}function A(){const I=this.resume(),M=this.stack[this.stack.length-1];M.url=I}function N(I){const M=this.stack[this.stack.length-1];if(!M.depth){const Y=this.sliceSerialize(I).length;M.depth=Y}}function v(){this.data.setextHeadingSlurpLineEnding=!0}function L(I){const M=this.stack[this.stack.length-1];M.depth=this.sliceSerialize(I).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function B(I){const Y=this.stack[this.stack.length-1].children;let K=Y[Y.length-1];(!K||K.type!=="text")&&(K=Ve(),K.position={start:De(I.start),end:void 0},Y.push(K)),this.stack.push(K)}function w(I){const M=this.stack.pop();M.value+=this.sliceSerialize(I),M.position.end=De(I.end)}function z(I){const M=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Y=M.children[M.children.length-1];Y.position.end=De(I.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(M.type)&&(B.call(this,I),w.call(this,I))}function E(){this.data.atHardBreak=!0}function R(){const I=this.resume(),M=this.stack[this.stack.length-1];M.value=I}function T(){const I=this.resume(),M=this.stack[this.stack.length-1];M.value=I}function F(){const I=this.resume(),M=this.stack[this.stack.length-1];M.value=I}function U(){const I=this.stack[this.stack.length-1];if(this.data.inReference){const M=this.data.referenceType||"shortcut";I.type+="Reference",I.referenceType=M,delete I.url,delete I.title}else delete I.identifier,delete I.label;this.data.referenceType=void 0}function V(){const I=this.stack[this.stack.length-1];if(this.data.inReference){const M=this.data.referenceType||"shortcut";I.type+="Reference",I.referenceType=M,delete I.url,delete I.title}else delete I.identifier,delete I.label;this.data.referenceType=void 0}function P(I){const M=this.sliceSerialize(I),Y=this.stack[this.stack.length-2];Y.label=Dl(M),Y.identifier=Se(M).toLowerCase()}function O(){const I=this.stack[this.stack.length-1],M=this.resume(),Y=this.stack[this.stack.length-1];if(this.data.inReference=!0,Y.type==="link"){const K=I.children;Y.children=K}else Y.alt=M}function x(){const I=this.resume(),M=this.stack[this.stack.length-1];M.url=I}function X(){const I=this.resume(),M=this.stack[this.stack.length-1];M.title=I}function $(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function W(I){const M=this.resume(),Y=this.stack[this.stack.length-1];Y.label=M,Y.identifier=Se(this.sliceSerialize(I)).toLowerCase(),this.data.referenceType="full"}function te(I){this.data.characterReferenceType=I.type}function ee(I){const M=this.sliceSerialize(I),Y=this.data.characterReferenceType;let K;Y?(K=si(M,Y==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):K=kn(M);const ne=this.stack[this.stack.length-1];ne.value+=K}function ue(I){const M=this.stack.pop();M.position.end=De(I.end)}function ae(I){w.call(this,I);const M=this.stack[this.stack.length-1];M.url=this.sliceSerialize(I)}function q(I){w.call(this,I);const M=this.stack[this.stack.length-1];M.url="mailto:"+this.sliceSerialize(I)}function se(){return{type:"blockquote",children:[]}}function le(){return{type:"code",lang:null,meta:null,value:""}}function je(){return{type:"inlineCode",value:""}}function Ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Lt(){return{type:"emphasis",children:[]}}function Ke(){return{type:"heading",depth:0,children:[]}}function Qe(){return{type:"break"}}function Re(){return{type:"html",value:""}}function Dt(){return{type:"image",title:null,url:"",alt:null}}function Je(){return{type:"link",title:null,url:"",children:[]}}function Ze(I){return{type:"list",ordered:I.type==="listOrdered",start:null,spread:I._spread,children:[]}}function ke(I){return{type:"listItem",spread:I._spread,checked:null,children:[]}}function ht(){return{type:"paragraph",children:[]}}function Mt(){return{type:"strong",children:[]}}function Ve(){return{type:"text",value:""}}function Pt(){return{type:"thematicBreak"}}}function De(e){return{line:e.line,column:e.column,offset:e.offset}}function xi(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?xi(e,r):Fl(e,r)}}function Fl(e,t){let n;for(n in t)if(mi.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function nr(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+st({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+st({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+st({start:t.start,end:t.end})+") is still open")}function _l(e){const t=this;t.parser=n;function n(r){return Pl(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Ol(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Bl(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
5
- `}]}function $l(e,t){const n=t.value?t.value+`
6
- `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function Hl(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ul(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vl(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Xe(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function ql(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Wl(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function bi(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function Yl(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return bi(e,t);const i={src:Xe(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function Gl(e,t){const n={src:Xe(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Xl(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Kl(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return bi(e,t);const i={href:Xe(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Ql(e,t){const n={href:Xe(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Jl(e,t,n){const r=e.all(t),i=n?Zl(n):wi(t),s={},a=[];if(typeof t.checked=="boolean"){const p=r[0];let c;p&&p.type==="element"&&p.tagName==="p"?c=p:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const p=r[o];(i||o!==0||p.type!=="element"||p.tagName!=="p")&&a.push({type:"text",value:`
7
- `}),p.type==="element"&&p.tagName==="p"&&!i?a.push(...p.children):a.push(p)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
8
- `});const u={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,u),e.applyData(t,u)}function Zl(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=wi(n[r])}return t}function wi(e){const t=e.spread;return t??e.children.length>1}function eu(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function tu(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nu(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function ru(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iu(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=mn(t.children[1]),l=Jr(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function au(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let l=-1;const u=[];for(;++l<o;){const c=t.children[l],h={},f=a?a[l]:void 0;f&&(h.align=f);let m={type:"element",tagName:s,properties:h,children:[]};c&&(m.children=e.all(c),e.patch(c,m),m=e.applyData(c,m)),u.push(m)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,p),e.applyData(t,p)}function su(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const rr=9,ir=32;function ou(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(ar(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(ar(t.slice(i),i>0,!1)),s.join("")}function ar(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===rr||s===ir;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===rr||s===ir;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function lu(e,t){const n={type:"text",value:ou(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function uu(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const cu={blockquote:Ol,break:Bl,code:$l,delete:Hl,emphasis:Ul,footnoteReference:Vl,heading:ql,html:Wl,imageReference:Yl,image:Gl,inlineCode:Xl,linkReference:Kl,link:Ql,listItem:Jl,list:eu,paragraph:tu,root:nu,strong:ru,table:iu,tableCell:su,tableRow:au,text:lu,thematicBreak:uu,toml:gt,yaml:gt,definition:gt,footnoteDefinition:gt};function gt(){}const yi=-1,zt=0,lt=1,Ct=2,Cn=3,Sn=4,jn=5,En=6,ki=7,vi=8,{defineProperty:pu}=Object,Ci=typeof self=="object"?self:globalThis,sr=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Ci[e](t)},du=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case zt:case yi:return n(a,i);case lt:{const o=n([],i);for(const l of a)o.push(r(l));return o}case Ct:{const o=n({},i);for(const[l,u]of a){const p=r(l),c=r(u);p==="__proto__"?pu(o,p,{value:c,configurable:!0,enumerable:!0,writable:!0}):o[p]=c}return o}case Cn:return n(new Date(a),i);case Sn:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case jn:{const o=n(new Map,i);for(const[l,u]of a)o.set(r(l),r(u));return o}case En:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case ki:{const{name:o,message:l}=a;return n(typeof Ci[o]=="function"?sr(o,l):new Error(l),i)}case vi:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}case"-0":return-0}return n(sr(s,a),i)};return r},or=e=>du(new Map,e)(0),Oe="",{toString:fu}={},{keys:hu,is:gu}=Object,at=e=>{const t=typeof e;if(t!=="object"||!e)return[zt,t];const n=fu.call(e).slice(8,-1);switch(n){case"Array":return[lt,Oe];case"Object":return[Ct,Oe];case"Date":return[Cn,Oe];case"RegExp":return[Sn,Oe];case"Map":return[jn,Oe];case"Set":return[En,Oe];case"DataView":return[lt,n]}return n.includes("Array")?[lt,n]:e instanceof Error?[ki,e.name||"Error"]:[Ct,n]},mt=([e,t])=>e===zt&&(t==="function"||t==="symbol"),mu=(e,t,n,r)=>{const i=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},s=a=>{if(n.has(a))return n.get(a);let[o,l]=at(a);switch(o){case zt:{let p=a;switch(l){case"bigint":o=vi,p=a.toString();break;case"number":if(!a&&gu(a,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);p=null;break;case"undefined":return i([yi],a)}return i([o,p],a)}case lt:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),i([l,[...h]],a)}const p=[],c=i([o,p],a);for(const h of a)p.push(s(h));return c}case Ct:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const p=[],c=i([o,p],a);for(const h of hu(a))(e||!mt(at(a[h])))&&p.push([s(h),s(a[h])]);return c}case Cn:return i([o,isNaN(a.getTime())?Oe:a.toISOString()],a);case Sn:{const{source:p,flags:c}=a;return i([o,{source:p,flags:c}],a)}case jn:{const p=[],c=i([o,p],a);for(const[h,f]of a)(e||!(mt(at(h))||mt(at(f))))&&p.push([s(h),s(f)]);return c}case En:{const p=[],c=i([o,p],a);for(const h of a)(e||!mt(at(h)))&&p.push(s(h));return c}}const{message:u}=a;return i([o,{name:l,message:u}],a)};return s},lr=(e,{json:t,lossy:n}={})=>{const r=[];return mu(!(t||n),!!t,new Map,r)(e),r},St=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?or(lr(e,t)):structuredClone(e):(e,t)=>or(lr(e,t));function xu(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function bu(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function wu(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||xu,r=e.options.footnoteBackLabel||bu,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const p=e.all(u),c=String(u.identifier).toUpperCase(),h=Xe(c.toLowerCase());let f=0;const m=[],y=e.footnoteCounts.get(c);for(;y!==void 0&&++f<=y;){m.length>0&&m.push({type:"text",value:" "});let j=typeof n=="string"?n:n(l,f);typeof j=="string"&&(j={type:"text",value:j}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const C=p[p.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const j=C.children[C.children.length-1];j&&j.type==="text"?j.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...m)}else p.push(...m);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(p,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...St(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
4
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function Al(e){const r={constructs:si([El,...(e||{}).extensions||[]]),content:i(Vs),defined:[],document:i(Ws),flow:i(dl),lazy:{},string:i(hl),text:i(gl)};return r;function i(s){return a;function a(o){return Il(r,s,o)}}}function Nl(e){for(;!di(e););return e}const tr=/[\0\t\n\r]/g;function Ll(){let e=1,t="",n=!0,r;return i;function i(s,a,o){const l=[];let u,d,c,h,f;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),c=0,t="",n&&(s.charCodeAt(0)===65279&&c++,n=void 0);c<s.length;){if(tr.lastIndex=c,u=tr.exec(s),h=u&&u.index!==void 0?u.index:s.length,f=s.charCodeAt(h),!u){t=s.slice(c);break}if(f===10&&c===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<h&&(l.push(s.slice(c,h)),e+=h-c),f){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=h+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Dl=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ml(e){return e.replace(Dl,Rl)}function Rl(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return oi(n.slice(s?2:1),s?16:10)}return kn(n)||e}const xi={}.hasOwnProperty;function Pl(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Fl(n)(Nl(Al(n).document().write(Ll()(e,t,!0))))}function Fl(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Je),autolinkProtocol:B,autolinkEmail:B,atxHeading:s(Ke),blockQuote:s(se),characterEscape:B,characterReference:B,codeFenced:s(le),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(le,a),codeText:s(Ee,a),codeTextData:B,data:B,codeFlowValue:B,definition:s(be),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Lt),hardBreakEscape:s(Qe),hardBreakTrailing:s(Qe),htmlFlow:s(Pe,a),htmlFlowData:B,htmlText:s(Pe,a),htmlTextData:B,image:s(Dt),label:a,link:s(Je),listItem:s(ve),listItemValue:h,listOrdered:s(Ze,c),listUnordered:s(Ze),paragraph:s(ht),reference:g,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Ke),strong:s(Mt),thematicBreak:s(Rt)},exit:{atxHeading:l(),atxHeadingSequence:L,autolink:l(),autolinkEmail:q,autolinkProtocol:ae,blockQuote:l(),characterEscapeValue:w,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:ee,characterReference:ue,codeFenced:l(C),codeFencedFence:y,codeFencedFenceInfo:f,codeFencedFenceMeta:m,codeFlowValue:w,codeIndented:l(b),codeText:l(M),codeTextData:w,data:w,definition:l(),definitionDestinationString:A,definitionLabelString:j,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(E),hardBreakTrailing:l(E),htmlFlow:l(F),htmlFlowData:w,htmlText:l(T),htmlTextData:w,image:l(V),label:O,labelText:P,lineEnding:z,link:l(U),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:W,resourceDestinationString:x,resourceTitleString:X,resource:$,setextHeading:l(_),setextHeadingLineSequence:N,setextHeadingText:v,strong:l(),thematicBreak:l()}};bi(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(I){let R={type:"root",children:[]};const Y={stack:[R],tokenStack:[],config:t,enter:o,exit:u,buffer:a,resume:d,data:n},K=[];let ne=-1;for(;++ne<I.length;)if(I[ne][1].type==="listOrdered"||I[ne][1].type==="listUnordered")if(I[ne][0]==="enter")K.push(ne);else{const Se=K.pop();ne=i(I,Se,ne)}for(ne=-1;++ne<I.length;){const Se=t[I[ne][0]];xi.call(Se,I[ne][1].type)&&Se[I[ne][1].type].call(Object.assign({sliceSerialize:I[ne][2].sliceSerialize},Y),I[ne][1])}if(Y.tokenStack.length>0){const Se=Y.tokenStack[Y.tokenStack.length-1];(Se[1]||nr).call(Y,void 0,Se[0])}for(R.position={start:De(I.length>0?I[0][1].start:{line:1,column:1,offset:0}),end:De(I.length>0?I[I.length-2][1].end:{line:1,column:1,offset:0})},ne=-1;++ne<t.transforms.length;)R=t.transforms[ne](R)||R;return R}function i(I,R,Y){let K=R-1,ne=-1,Se=!1,Fe,Ae,et,tt;for(;++K<=Y;){const we=I[K];switch(we[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{we[0]==="enter"?ne++:ne--,tt=void 0;break}case"lineEndingBlank":{we[0]==="enter"&&(Fe&&!tt&&!ne&&!et&&(et=K),tt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:tt=void 0}if(!ne&&we[0]==="enter"&&we[1].type==="listItemPrefix"||ne===-1&&we[0]==="exit"&&(we[1].type==="listUnordered"||we[1].type==="listOrdered")){if(Fe){let qe=K;for(Ae=void 0;qe--;){const Ne=I[qe];if(Ne[1].type==="lineEnding"||Ne[1].type==="lineEndingBlank"){if(Ne[0]==="exit")continue;Ae&&(I[Ae][1].type="lineEndingBlank",Se=!0),Ne[1].type="lineEnding",Ae=qe}else if(!(Ne[1].type==="linePrefix"||Ne[1].type==="blockQuotePrefix"||Ne[1].type==="blockQuotePrefixWhitespace"||Ne[1].type==="blockQuoteMarker"||Ne[1].type==="listItemIndent"))break}et&&(!Ae||et<Ae)&&(Fe._spread=!0),Fe.end=Object.assign({},Ae?I[Ae][1].start:we[1].end),I.splice(Ae||K,0,["exit",Fe,we[2]]),K++,Y++}if(we[1].type==="listItemPrefix"){const qe={type:"listItem",_spread:!1,start:Object.assign({},we[1].start),end:void 0};Fe=qe,I.splice(K,0,["enter",qe,we[2]]),K++,Y++,et=void 0,tt=!0}}}return I[R][1]._spread=Se,Y}function s(I,R){return Y;function Y(K){o.call(this,I(K),K),R&&R.call(this,K)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(I,R,Y){this.stack[this.stack.length-1].children.push(I),this.stack.push(I),this.tokenStack.push([R,Y||void 0]),I.position={start:De(R.start),end:void 0}}function l(I){return R;function R(Y){I&&I.call(this,Y),u.call(this,Y)}}function u(I,R){const Y=this.stack.pop(),K=this.tokenStack.pop();if(K)K[0].type!==I.type&&(R?R.call(this,I,K[0]):(K[1]||nr).call(this,I,K[0]));else throw new Error("Cannot close `"+I.type+"` ("+st({start:I.start,end:I.end})+"): it’s not open");Y.position.end=De(I.end)}function d(){return yn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(I){if(this.data.expectingFirstListItemValue){const R=this.stack[this.stack.length-2];R.start=Number.parseInt(this.sliceSerialize(I),10),this.data.expectingFirstListItemValue=void 0}}function f(){const I=this.resume(),R=this.stack[this.stack.length-1];R.lang=I}function m(){const I=this.resume(),R=this.stack[this.stack.length-1];R.meta=I}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const I=this.resume(),R=this.stack[this.stack.length-1];R.value=I.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const I=this.resume(),R=this.stack[this.stack.length-1];R.value=I.replace(/(\r?\n|\r)$/g,"")}function j(I){const R=this.resume(),Y=this.stack[this.stack.length-1];Y.label=R,Y.identifier=je(this.sliceSerialize(I)).toLowerCase()}function S(){const I=this.resume(),R=this.stack[this.stack.length-1];R.title=I}function A(){const I=this.resume(),R=this.stack[this.stack.length-1];R.url=I}function L(I){const R=this.stack[this.stack.length-1];if(!R.depth){const Y=this.sliceSerialize(I).length;R.depth=Y}}function v(){this.data.setextHeadingSlurpLineEnding=!0}function N(I){const R=this.stack[this.stack.length-1];R.depth=this.sliceSerialize(I).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function B(I){const Y=this.stack[this.stack.length-1].children;let K=Y[Y.length-1];(!K||K.type!=="text")&&(K=Ve(),K.position={start:De(I.start),end:void 0},Y.push(K)),this.stack.push(K)}function w(I){const R=this.stack.pop();R.value+=this.sliceSerialize(I),R.position.end=De(I.end)}function z(I){const R=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Y=R.children[R.children.length-1];Y.position.end=De(I.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(R.type)&&(B.call(this,I),w.call(this,I))}function E(){this.data.atHardBreak=!0}function F(){const I=this.resume(),R=this.stack[this.stack.length-1];R.value=I}function T(){const I=this.resume(),R=this.stack[this.stack.length-1];R.value=I}function M(){const I=this.resume(),R=this.stack[this.stack.length-1];R.value=I}function U(){const I=this.stack[this.stack.length-1];if(this.data.inReference){const R=this.data.referenceType||"shortcut";I.type+="Reference",I.referenceType=R,delete I.url,delete I.title}else delete I.identifier,delete I.label;this.data.referenceType=void 0}function V(){const I=this.stack[this.stack.length-1];if(this.data.inReference){const R=this.data.referenceType||"shortcut";I.type+="Reference",I.referenceType=R,delete I.url,delete I.title}else delete I.identifier,delete I.label;this.data.referenceType=void 0}function P(I){const R=this.sliceSerialize(I),Y=this.stack[this.stack.length-2];Y.label=Ml(R),Y.identifier=je(R).toLowerCase()}function O(){const I=this.stack[this.stack.length-1],R=this.resume(),Y=this.stack[this.stack.length-1];if(this.data.inReference=!0,Y.type==="link"){const K=I.children;Y.children=K}else Y.alt=R}function x(){const I=this.resume(),R=this.stack[this.stack.length-1];R.url=I}function X(){const I=this.resume(),R=this.stack[this.stack.length-1];R.title=I}function $(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function W(I){const R=this.resume(),Y=this.stack[this.stack.length-1];Y.label=R,Y.identifier=je(this.sliceSerialize(I)).toLowerCase(),this.data.referenceType="full"}function te(I){this.data.characterReferenceType=I.type}function ee(I){const R=this.sliceSerialize(I),Y=this.data.characterReferenceType;let K;Y?(K=oi(R,Y==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):K=kn(R);const ne=this.stack[this.stack.length-1];ne.value+=K}function ue(I){const R=this.stack.pop();R.position.end=De(I.end)}function ae(I){w.call(this,I);const R=this.stack[this.stack.length-1];R.url=this.sliceSerialize(I)}function q(I){w.call(this,I);const R=this.stack[this.stack.length-1];R.url="mailto:"+this.sliceSerialize(I)}function se(){return{type:"blockquote",children:[]}}function le(){return{type:"code",lang:null,meta:null,value:""}}function Ee(){return{type:"inlineCode",value:""}}function be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Lt(){return{type:"emphasis",children:[]}}function Ke(){return{type:"heading",depth:0,children:[]}}function Qe(){return{type:"break"}}function Pe(){return{type:"html",value:""}}function Dt(){return{type:"image",title:null,url:"",alt:null}}function Je(){return{type:"link",title:null,url:"",children:[]}}function Ze(I){return{type:"list",ordered:I.type==="listOrdered",start:null,spread:I._spread,children:[]}}function ve(I){return{type:"listItem",spread:I._spread,checked:null,children:[]}}function ht(){return{type:"paragraph",children:[]}}function Mt(){return{type:"strong",children:[]}}function Ve(){return{type:"text",value:""}}function Rt(){return{type:"thematicBreak"}}}function De(e){return{line:e.line,column:e.column,offset:e.offset}}function bi(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?bi(e,r):_l(e,r)}}function _l(e,t){let n;for(n in t)if(xi.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function nr(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+st({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+st({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+st({start:t.start,end:t.end})+") is still open")}function Ol(e){const t=this;t.parser=n;function n(r){return Pl(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Bl(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function $l(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
5
+ `}]}function Hl(e,t){const n=t.value?t.value+`
6
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function Ul(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vl(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ql(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Xe(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function Wl(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yl(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function wi(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function Gl(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return wi(e,t);const i={src:Xe(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function Xl(e,t){const n={src:Xe(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Kl(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Ql(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return wi(e,t);const i={href:Xe(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Jl(e,t){const n={href:Xe(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Zl(e,t,n){const r=e.all(t),i=n?eu(n):yi(t),s={},a=[];if(typeof t.checked=="boolean"){const d=r[0];let c;d&&d.type==="element"&&d.tagName==="p"?c=d:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
7
+ `}),d.type==="element"&&d.tagName==="p"&&!i?a.push(...d.children):a.push(d)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
8
+ `});const u={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,u),e.applyData(t,u)}function eu(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=yi(n[r])}return t}function yi(e){const t=e.spread;return t??e.children.length>1}function tu(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function nu(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ru(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function iu(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function au(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=mn(t.children[1]),l=Zr(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function su(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let l=-1;const u=[];for(;++l<o;){const c=t.children[l],h={},f=a?a[l]:void 0;f&&(h.align=f);let m={type:"element",tagName:s,properties:h,children:[]};c&&(m.children=e.all(c),e.patch(c,m),m=e.applyData(c,m)),u.push(m)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function ou(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const rr=9,ir=32;function lu(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(ar(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(ar(t.slice(i),i>0,!1)),s.join("")}function ar(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===rr||s===ir;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===rr||s===ir;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function uu(e,t){const n={type:"text",value:lu(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function cu(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const du={blockquote:Bl,break:$l,code:Hl,delete:Ul,emphasis:Vl,footnoteReference:ql,heading:Wl,html:Yl,imageReference:Gl,image:Xl,inlineCode:Kl,linkReference:Ql,link:Jl,listItem:Zl,list:tu,paragraph:nu,root:ru,strong:iu,table:au,tableCell:ou,tableRow:su,text:uu,thematicBreak:cu,toml:gt,yaml:gt,definition:gt,footnoteDefinition:gt};function gt(){}const ki=-1,zt=0,lt=1,Ct=2,Cn=3,Sn=4,jn=5,En=6,vi=7,Ci=8,{defineProperty:pu}=Object,Si=typeof self=="object"?self:globalThis,sr=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Si[e](t)},fu=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case zt:case ki:return n(a,i);case lt:{const o=n([],i);for(const l of a)o.push(r(l));return o}case Ct:{const o=n({},i);for(const[l,u]of a){const d=r(l),c=r(u);d==="__proto__"?pu(o,d,{value:c,configurable:!0,enumerable:!0,writable:!0}):o[d]=c}return o}case Cn:return n(new Date(a),i);case Sn:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case jn:{const o=n(new Map,i);for(const[l,u]of a)o.set(r(l),r(u));return o}case En:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case vi:{const{name:o,message:l}=a;return n(typeof Si[o]=="function"?sr(o,l):new Error(l),i)}case Ci:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}case"-0":return-0}return n(sr(s,a),i)};return r},or=e=>fu(new Map,e)(0),Oe="",{toString:hu}={},{keys:gu,is:mu}=Object,at=e=>{const t=typeof e;if(t!=="object"||!e)return[zt,t];const n=hu.call(e).slice(8,-1);switch(n){case"Array":return[lt,Oe];case"Object":return[Ct,Oe];case"Date":return[Cn,Oe];case"RegExp":return[Sn,Oe];case"Map":return[jn,Oe];case"Set":return[En,Oe];case"DataView":return[lt,n]}return n.includes("Array")?[lt,n]:e instanceof Error?[vi,e.name||"Error"]:[Ct,n]},mt=([e,t])=>e===zt&&(t==="function"||t==="symbol"),xu=(e,t,n,r)=>{const i=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},s=a=>{if(n.has(a))return n.get(a);let[o,l]=at(a);switch(o){case zt:{let d=a;switch(l){case"bigint":o=Ci,d=a.toString();break;case"number":if(!a&&mu(a,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return i([ki],a)}return i([o,d],a)}case lt:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),i([l,[...h]],a)}const d=[],c=i([o,d],a);for(const h of a)d.push(s(h));return c}case Ct:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const d=[],c=i([o,d],a);for(const h of gu(a))(e||!mt(at(a[h])))&&d.push([s(h),s(a[h])]);return c}case Cn:return i([o,isNaN(a.getTime())?Oe:a.toISOString()],a);case Sn:{const{source:d,flags:c}=a;return i([o,{source:d,flags:c}],a)}case jn:{const d=[],c=i([o,d],a);for(const[h,f]of a)(e||!(mt(at(h))||mt(at(f))))&&d.push([s(h),s(f)]);return c}case En:{const d=[],c=i([o,d],a);for(const h of a)(e||!mt(at(h)))&&d.push(s(h));return c}}const{message:u}=a;return i([o,{name:l,message:u}],a)};return s},lr=(e,{json:t,lossy:n}={})=>{const r=[];return xu(!(t||n),!!t,new Map,r)(e),r},St=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?or(lr(e,t)):structuredClone(e):(e,t)=>or(lr(e,t));function bu(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function wu(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function yu(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||bu,r=e.options.footnoteBackLabel||wu,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const d=e.all(u),c=String(u.identifier).toUpperCase(),h=Xe(c.toLowerCase());let f=0;const m=[],y=e.footnoteCounts.get(c);for(;y!==void 0&&++f<=y;){m.length>0&&m.push({type:"text",value:" "});let j=typeof n=="string"?n:n(l,f);typeof j=="string"&&(j={type:"text",value:j}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const C=d[d.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const j=C.children[C.children.length-1];j&&j.type==="text"?j.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...m)}else d.push(...m);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...St(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
9
9
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
10
- `}]}}const At=function(e){if(e==null)return Cu;if(typeof e=="function")return Nt(e);if(typeof e=="object")return Array.isArray(e)?yu(e):ku(e);if(typeof e=="string")return vu(e);throw new Error("Expected function, string, or object as test")};function yu(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=At(e[n]);return Nt(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function ku(e){const t=e;return Nt(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function vu(e){return Nt(t);function t(n){return n&&n.type===e}}function Nt(e){return t;function t(n,r,i){return!!(Su(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Cu(){return!0}function Su(e){return e!==null&&typeof e=="object"&&"type"in e}const Si=[],ju=!0,ln=!1,Eu="skip";function ji(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=At(i),a=r?-1:1;o(e,void 0,[])();function o(l,u,p){const c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){const f=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=Si,m,y,C;if((!t||s(l,u,p[p.length-1]||void 0))&&(f=Iu(n(l,p)),f[0]===ln))return f;if("children"in l&&l.children){const b=l;if(b.children&&f[0]!==Eu)for(y=(r?b.children.length:-1)+a,C=p.concat(b);y>-1&&y<b.children.length;){const j=b.children[y];if(m=o(j,y,C)(),m[0]===ln)return m;y=typeof m[1]=="number"?m[1]:y+a}}return f}}}function Iu(e){return Array.isArray(e)?e:typeof e=="number"?[ju,e]:e==null?Si:[e]}function In(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),ji(e,s,o,i);function o(l,u){const p=u[u.length-1],c=p?p.children.indexOf(l):void 0;return a(l,c,p)}}const un={}.hasOwnProperty,Tu={};function zu(e,t){const n=t||Tu,r=new Map,i=new Map,s=new Map,a={...cu,...n.handlers},o={all:u,applyData:Nu,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:l,options:n,patch:Au,wrap:Du};return In(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const c=p.type==="definition"?r:i,h=String(p.identifier).toUpperCase();c.has(h)||c.set(h,p)}}),o;function l(p,c){const h=p.type,f=o.handlers[h];if(un.call(o.handlers,h)&&f)return f(o,p,c);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in p){const{children:y,...C}=p,b=St(C);return b.children=o.all(p),b}return St(p)}return(o.options.unknownHandler||Lu)(o,p,c)}function u(p){const c=[];if("children"in p){const h=p.children;let f=-1;for(;++f<h.length;){const m=o.one(h[f],p);if(m){if(f&&h[f-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=ur(m.value)),!Array.isArray(m)&&m.type==="element")){const y=m.children[0];y&&y.type==="text"&&(y.value=ur(y.value))}Array.isArray(m)?c.push(...m):c.push(m)}}}return c}}function Au(e,t){e.position&&(t.position=gs(e))}function Nu(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,St(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Lu(e,t){const n=t.data||{},r="value"in t&&!(un.call(n,"hProperties")||un.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Du(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
10
+ `}]}}const At=function(e){if(e==null)return Su;if(typeof e=="function")return Nt(e);if(typeof e=="object")return Array.isArray(e)?ku(e):vu(e);if(typeof e=="string")return Cu(e);throw new Error("Expected function, string, or object as test")};function ku(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=At(e[n]);return Nt(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function vu(e){const t=e;return Nt(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function Cu(e){return Nt(t);function t(n){return n&&n.type===e}}function Nt(e){return t;function t(n,r,i){return!!(ju(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Su(){return!0}function ju(e){return e!==null&&typeof e=="object"&&"type"in e}const ji=[],Eu=!0,ln=!1,Iu="skip";function Ei(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=At(i),a=r?-1:1;o(e,void 0,[])();function o(l,u,d){const c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){const f=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=ji,m,y,C;if((!t||s(l,u,d[d.length-1]||void 0))&&(f=Tu(n(l,d)),f[0]===ln))return f;if("children"in l&&l.children){const b=l;if(b.children&&f[0]!==Iu)for(y=(r?b.children.length:-1)+a,C=d.concat(b);y>-1&&y<b.children.length;){const j=b.children[y];if(m=o(j,y,C)(),m[0]===ln)return m;y=typeof m[1]=="number"?m[1]:y+a}}return f}}}function Tu(e){return Array.isArray(e)?e:typeof e=="number"?[Eu,e]:e==null?ji:[e]}function In(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),Ei(e,s,o,i);function o(l,u){const d=u[u.length-1],c=d?d.children.indexOf(l):void 0;return a(l,c,d)}}const un={}.hasOwnProperty,zu={};function Au(e,t){const n=t||zu,r=new Map,i=new Map,s=new Map,a={...du,...n.handlers},o={all:u,applyData:Lu,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:l,options:n,patch:Nu,wrap:Mu};return In(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const c=d.type==="definition"?r:i,h=String(d.identifier).toUpperCase();c.has(h)||c.set(h,d)}}),o;function l(d,c){const h=d.type,f=o.handlers[h];if(un.call(o.handlers,h)&&f)return f(o,d,c);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in d){const{children:y,...C}=d,b=St(C);return b.children=o.all(d),b}return St(d)}return(o.options.unknownHandler||Du)(o,d,c)}function u(d){const c=[];if("children"in d){const h=d.children;let f=-1;for(;++f<h.length;){const m=o.one(h[f],d);if(m){if(f&&h[f-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=ur(m.value)),!Array.isArray(m)&&m.type==="element")){const y=m.children[0];y&&y.type==="text"&&(y.value=ur(y.value))}Array.isArray(m)?c.push(...m):c.push(m)}}}return c}}function Nu(e,t){e.position&&(t.position=ms(e))}function Lu(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,St(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Du(e,t){const n=t.data||{},r="value"in t&&!(un.call(n,"hProperties")||un.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Mu(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
11
11
  `});++r<e.length;)r&&n.push({type:"text",value:`
12
12
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
13
- `}),n}function ur(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function cr(e,t){const n=zu(e,t),r=n.one(e,void 0),i=wu(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
14
- `},i),s}function Mu(e,t){return e&&"run"in e?async function(n,r){const i=cr(n,{file:r,...t});await e.run(i,r)}:function(n,r){return cr(n,{file:r,...e||t})}}function pr(e){if(e)throw e}var yt=Object.prototype.hasOwnProperty,Ei=Object.prototype.toString,dr=Object.defineProperty,fr=Object.getOwnPropertyDescriptor,hr=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Ei.call(t)==="[object Array]"},gr=function(t){if(!t||Ei.call(t)!=="[object Object]")return!1;var n=yt.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&yt.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||yt.call(t,i)},mr=function(t,n){dr&&n.name==="__proto__"?dr(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},xr=function(t,n){if(n==="__proto__")if(yt.call(t,n)){if(fr)return fr(t,n).value}else return;return t[n]},Pu=function e(){var t,n,r,i,s,a,o=arguments[0],l=1,u=arguments.length,p=!1;for(typeof o=="boolean"&&(p=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=xr(o,n),i=xr(t,n),o!==i&&(p&&i&&(gr(i)||(s=hr(i)))?(s?(s=!1,a=r&&hr(r)?r:[]):a=r&&gr(r)?r:{},mr(o,{name:n,newValue:e(p,a,i)})):typeof i<"u"&&mr(o,{name:n,newValue:i}));return o};const $t=Me.getDefaultExportFromCjs(Pu);function cn(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ru(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(l,...u){const p=e[++s];let c=-1;if(l){a(l);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,p?Fu(p,o)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Fu(e,t){let n;return r;function r(...a){const o=e.length>a.length;let l;o&&a.push(i);try{l=e.apply(this,a)}catch(u){const p=u;if(o&&n)throw p;return i(p)}o||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}const Ie={basename:_u,dirname:Ou,extname:Bu,join:$u,sep:"/"};function _u(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ft(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Ou(e){if(ft(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Bu(e){ft(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function $u(...e){let t=-1,n;for(;++t<e.length;)ft(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Hu(n)}function Hu(e){ft(e);const t=e.codePointAt(0)===47;let n=Uu(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Uu(e,t){let n="",r=0,i=-1,s=0,a=-1,o,l;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function ft(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Vu={cwd:qu};function qu(){return"/"}function pn(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Wu(e){if(typeof e=="string")e=new URL(e);else if(!pn(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Yu(e)}function Yu(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Ht=["history","path","basename","stem","extname","dirname"];class Ii{constructor(t){let n;t?pn(t)?n={path:t}:typeof t=="string"||Gu(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Vu.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ht.length;){const s=Ht[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Ht.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ie.basename(this.path):void 0}set basename(t){Vt(t,"basename"),Ut(t,"basename"),this.path=Ie.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ie.dirname(this.path):void 0}set dirname(t){br(this.basename,"dirname"),this.path=Ie.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ie.extname(this.path):void 0}set extname(t){if(Ut(t,"extname"),br(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ie.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){pn(t)&&(t=Wu(t)),Vt(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ie.basename(this.path,this.extname):void 0}set stem(t){Vt(t,"stem"),Ut(t,"stem"),this.path=Ie.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new he(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ut(e,t){if(e&&e.includes(Ie.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ie.sep+"`")}function Vt(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function br(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Gu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Xu=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},Ku={}.hasOwnProperty;class Tn extends Xu{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Ru()}copy(){const t=new Tn;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data($t(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Yt("data",this.frozen),this.namespace[t]=n,this):Ku.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Yt("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=xt(t),r=this.parser||this.Parser;return qt("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),qt("process",this.parser||this.Parser),Wt("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=xt(t),l=r.parse(o);r.run(l,o,function(p,c,h){if(p||!c||!h)return u(p);const f=c,m=r.stringify(f,h);Zu(m)?h.value=m:h.result=m,u(p,h)});function u(p,c){p||!c?a(p):s?s(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),qt("processSync",this.parser||this.Parser),Wt("processSync",this.compiler||this.Compiler),this.process(t,i),yr("processSync","process",n),r;function i(s,a){n=!0,pr(s),r=a}}run(t,n,r){wr(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const l=xt(n);i.run(t,l,u);function u(p,c,h){const f=c||t;p?o(p):a?a(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),yr("runSync","run",r),i;function s(a,o){pr(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=xt(n),i=this.compiler||this.Compiler;return Wt("stringify",i),wr(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Yt("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[p,...c]=u;l(p,c)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(i.settings=$t(!0,i.settings,u.settings))}function o(u){let p=-1;if(u!=null)if(Array.isArray(u))for(;++p<u.length;){const c=u[p];s(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,p){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===u){h=c;break}if(h===-1)r.push([u,...p]);else if(p.length>0){let[f,...m]=p;const y=r[h][1];cn(y)&&cn(f)&&(f=$t(!0,y,f)),r[h]=[u,f,...m]}}}}const Qu=new Tn().freeze();function qt(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Wt(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Yt(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function wr(e){if(!cn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function yr(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function xt(e){return Ju(e)?e:new Ii(e)}function Ju(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Zu(e){return typeof e=="string"||ec(e)}function ec(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const tc="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",kr=[],vr={allowDangerousHtml:!0},nc=/^(https?|ircs?|mailto|xmpp)$/i,rc=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Ti(e){const t=ic(e),n=ac(e);return sc(t.runSync(t.parse(n),n),e)}function ic(e){const t=e.rehypePlugins||kr,n=e.remarkPlugins||kr,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...vr}:vr;return Qu().use(_l).use(n).use(Mu,r).use(t)}function ac(e){const t=e.children||"",n=new Ii;return typeof t=="string"&&(n.value=t),n}function sc(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||oc;for(const p of rc)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+tc+p.id,void 0);return In(e,u),ys(e,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function u(p,c,h){if(p.type==="raw"&&h&&typeof c=="number")return a?h.children.splice(c,1):h.children[c]={type:"text",value:p.value},c;if(p.type==="element"){let f;for(f in _t)if(Object.hasOwn(_t,f)&&Object.hasOwn(p.properties,f)){const m=p.properties[f],y=_t[f];(y===null||y.includes(p.tagName))&&(p.properties[f]=l(String(m||""),f,p))}}if(p.type==="element"){let f=n?!n.includes(p.tagName):s?s.includes(p.tagName):!1;if(!f&&r&&typeof c=="number"&&(f=!r(p,c,h)),f&&h&&typeof c=="number")return o&&p.children?h.children.splice(c,1,...p.children):h.children.splice(c,1),c}}}function oc(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||nc.test(e.slice(0,t))?e:""}function Cr(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function lc(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function uc(e,t,n){const i=At((n||{}).ignore||[]),s=cc(t);let a=-1;for(;++a<s.length;)ji(e,"text",o);function o(u,p){let c=-1,h;for(;++c<p.length;){const f=p[c],m=h?h.children:void 0;if(i(f,m?m.indexOf(f):void 0,h))return;h=f}if(h)return l(u,p)}function l(u,p){const c=p[p.length-1],h=s[a][0],f=s[a][1];let m=0;const C=c.children.indexOf(u);let b=!1,j=[];h.lastIndex=0;let S=h.exec(u.value);for(;S;){const A=S.index,N={index:S.index,input:S.input,stack:[...p,u]};let v=f(...S,N);if(typeof v=="string"&&(v=v.length>0?{type:"text",value:v}:void 0),v===!1?h.lastIndex=A+1:(m!==A&&j.push({type:"text",value:u.value.slice(m,A)}),Array.isArray(v)?j.push(...v):v&&j.push(v),m=A+S[0].length,b=!0),!h.global)break;S=h.exec(u.value)}return b?(m<u.value.length&&j.push({type:"text",value:u.value.slice(m)}),c.children.splice(C,1,...j)):j=[u],C+j.length}}function cc(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([pc(i[0]),dc(i[1])])}return t}function pc(e){return typeof e=="string"?new RegExp(lc(e),"g"):e}function dc(e){return typeof e=="function"?e:function(){return e}}const Gt="phrasing",Xt=["autolink","link","image","label"];function fc(){return{transforms:[yc],enter:{literalAutolink:gc,literalAutolinkEmail:Kt,literalAutolinkHttp:Kt,literalAutolinkWww:Kt},exit:{literalAutolink:wc,literalAutolinkEmail:bc,literalAutolinkHttp:mc,literalAutolinkWww:xc}}}function hc(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Gt,notInConstruct:Xt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Gt,notInConstruct:Xt},{character:":",before:"[ps]",after:"\\/",inConstruct:Gt,notInConstruct:Xt}]}}function gc(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Kt(e){this.config.enter.autolinkProtocol.call(this,e)}function mc(e){this.config.exit.autolinkProtocol.call(this,e)}function xc(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function bc(e){this.config.exit.autolinkEmail.call(this,e)}function wc(e){this.exit(e)}function yc(e){uc(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,kc],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),vc]],{ignore:["link","linkReference"]})}function kc(e,t,n,r,i){let s="";if(!zi(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!Cc(n)))return!1;const a=Sc(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:s+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function vc(e,t,n,r){return!zi(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Cc(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Sc(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Cr(e,"(");let s=Cr(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function zi(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||He(n)||It(n))&&(!t||n!==47)}Ai.peek=Dc;function jc(){this.buffer()}function Ec(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Ic(){this.buffer()}function Tc(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function zc(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Se(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ac(e){this.exit(e)}function Nc(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Se(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Lc(e){this.exit(e)}function Dc(){return"["}function Ai(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function Mc(){return{enter:{gfmFootnoteCallString:jc,gfmFootnoteCall:Ec,gfmFootnoteDefinitionLabelString:Ic,gfmFootnoteDefinition:Tc},exit:{gfmFootnoteCallString:zc,gfmFootnoteCall:Ac,gfmFootnoteDefinitionLabelString:Nc,gfmFootnoteDefinition:Lc}}}function Pc(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ai},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let l=o.move("[^");const u=s.enter("footnoteDefinition"),p=s.enter("label");return l+=o.move(s.safe(s.associationId(r),{before:l,after:"]"})),p(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?`
15
- `:" ")+s.indentLines(s.containerFlow(r,o.current()),t?Ni:Rc))),u(),l}}function Rc(e,t,n){return t===0?e:Ni(e,t,n)}function Ni(e,t,n){return(n?"":" ")+e}const Fc=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Li.peek=Hc;function _c(){return{canContainEols:["delete"],enter:{strikethrough:Bc},exit:{strikethrough:$c}}}function Oc(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Fc}],handlers:{delete:Li}}}function Bc(e){this.enter({type:"delete",children:[]},e)}function $c(e){this.exit(e)}function Li(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function Hc(){return"~"}function Uc(e){return e.length}function Vc(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Uc,s=[],a=[],o=[],l=[];let u=0,p=-1;for(;++p<e.length;){const y=[],C=[];let b=-1;for(e[p].length>u&&(u=e[p].length);++b<e[p].length;){const j=qc(e[p][b]);if(n.alignDelimiters!==!1){const S=i(j);C[b]=S,(l[b]===void 0||S>l[b])&&(l[b]=S)}y.push(j)}a[p]=y,o[p]=C}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)s[c]=Sr(r[c]);else{const y=Sr(r);for(;++c<u;)s[c]=y}c=-1;const h=[],f=[];for(;++c<u;){const y=s[c];let C="",b="";y===99?(C=":",b=":"):y===108?C=":":y===114&&(b=":");let j=n.alignDelimiters===!1?1:Math.max(1,l[c]-C.length-b.length);const S=C+"-".repeat(j)+b;n.alignDelimiters!==!1&&(j=C.length+j+b.length,j>l[c]&&(l[c]=j),f[c]=j),h[c]=S}a.splice(1,0,h),o.splice(1,0,f),p=-1;const m=[];for(;++p<a.length;){const y=a[p],C=o[p];c=-1;const b=[];for(;++c<u;){const j=y[c]||"";let S="",A="";if(n.alignDelimiters!==!1){const N=l[c]-(C[c]||0),v=s[c];v===114?S=" ".repeat(N):v===99?N%2?(S=" ".repeat(N/2+.5),A=" ".repeat(N/2-.5)):(S=" ".repeat(N/2),A=S):A=" ".repeat(N)}n.delimiterStart!==!1&&!c&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&j==="")&&(n.delimiterStart!==!1||c)&&b.push(" "),n.alignDelimiters!==!1&&b.push(S),b.push(j),n.alignDelimiters!==!1&&b.push(A),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&b.push("|")}m.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return m.join(`
16
- `)}function qc(e){return e==null?"":String(e)}function Sr(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Wc(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),Yc);return i(),a}function Yc(e,t,n){return">"+(n?"":" ")+e}function Gc(e,t){return jr(e,t.inConstruct,!0)&&!jr(e,t.notInConstruct,!1)}function jr(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Er(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
17
- `&&Gc(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
18
- `}function Xc(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+t.length,r=n.indexOf(t,i);return a}function Kc(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Qc(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Jc(e,t,n,r){const i=Qc(n),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(Kc(e,n)){const c=n.enter("codeIndented"),h=n.indentLines(s,Zc);return c(),h}const o=n.createTracker(r),l=i.repeat(Math.max(Xc(s,i)+1,3)),u=n.enter("codeFenced");let p=o.move(l);if(e.lang){const c=n.enter(`codeFencedLang${a}`);p+=o.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...o.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${a}`);p+=o.move(" "),p+=o.move(n.safe(e.meta,{before:p,after:`
19
- `,encode:["`"],...o.current()})),c()}return p+=o.move(`
20
- `),s&&(p+=o.move(s+`
21
- `)),p+=o.move(l),u(),p}function Zc(e,t,n){return(n?"":" ")+e}function zn(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function ep(e,t,n,r){const i=zn(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
22
- `,...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),a(),u}function tp(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ct(e){return"&#x"+e.toString(16).toUpperCase()+";"}function jt(e,t,n){const r=Ye(e),i=Ye(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Di.peek=np;function Di(e,t,n,r){const i=tp(n),s=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=l.charCodeAt(0),p=jt(r.before.charCodeAt(r.before.length-1),u,i);p.inside&&(l=ct(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=jt(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+ct(c));const f=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:p.outside},o+l+f}function np(e,t,n){return n.options.emphasis||"*"}function rp(e,t){let n=!1;return In(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ln}),!!((!e.depth||e.depth<3)&&yn(e)&&(t.options.setext||n))}function ip(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(rp(e,n)){const p=n.enter("headingSetext"),c=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
13
+ `}),n}function ur(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function cr(e,t){const n=Au(e,t),r=n.one(e,void 0),i=yu(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
14
+ `},i),s}function Ru(e,t){return e&&"run"in e?async function(n,r){const i=cr(n,{file:r,...t});await e.run(i,r)}:function(n,r){return cr(n,{file:r,...e||t})}}function dr(e){if(e)throw e}var yt=Object.prototype.hasOwnProperty,Ii=Object.prototype.toString,pr=Object.defineProperty,fr=Object.getOwnPropertyDescriptor,hr=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Ii.call(t)==="[object Array]"},gr=function(t){if(!t||Ii.call(t)!=="[object Object]")return!1;var n=yt.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&yt.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||yt.call(t,i)},mr=function(t,n){pr&&n.name==="__proto__"?pr(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},xr=function(t,n){if(n==="__proto__")if(yt.call(t,n)){if(fr)return fr(t,n).value}else return;return t[n]},Pu=function e(){var t,n,r,i,s,a,o=arguments[0],l=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=xr(o,n),i=xr(t,n),o!==i&&(d&&i&&(gr(i)||(s=hr(i)))?(s?(s=!1,a=r&&hr(r)?r:[]):a=r&&gr(r)?r:{},mr(o,{name:n,newValue:e(d,a,i)})):typeof i<"u"&&mr(o,{name:n,newValue:i}));return o};const $t=Me.getDefaultExportFromCjs(Pu);function cn(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Fu(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(l,...u){const d=e[++s];let c=-1;if(l){a(l);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,d?_u(d,o)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function _u(e,t){let n;return r;function r(...a){const o=e.length>a.length;let l;o&&a.push(i);try{l=e.apply(this,a)}catch(u){const d=u;if(o&&n)throw d;return i(d)}o||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}const Ie={basename:Ou,dirname:Bu,extname:$u,join:Hu,sep:"/"};function Ou(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ft(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Bu(e){if(ft(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function $u(e){ft(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Hu(...e){let t=-1,n;for(;++t<e.length;)ft(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Uu(n)}function Uu(e){ft(e);const t=e.codePointAt(0)===47;let n=Vu(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Vu(e,t){let n="",r=0,i=-1,s=0,a=-1,o,l;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function ft(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const qu={cwd:Wu};function Wu(){return"/"}function dn(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Yu(e){if(typeof e=="string")e=new URL(e);else if(!dn(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Gu(e)}function Gu(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Ht=["history","path","basename","stem","extname","dirname"];class Ti{constructor(t){let n;t?dn(t)?n={path:t}:typeof t=="string"||Xu(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":qu.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ht.length;){const s=Ht[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Ht.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ie.basename(this.path):void 0}set basename(t){Vt(t,"basename"),Ut(t,"basename"),this.path=Ie.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ie.dirname(this.path):void 0}set dirname(t){br(this.basename,"dirname"),this.path=Ie.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ie.extname(this.path):void 0}set extname(t){if(Ut(t,"extname"),br(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ie.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){dn(t)&&(t=Yu(t)),Vt(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ie.basename(this.path,this.extname):void 0}set stem(t){Vt(t,"stem"),Ut(t,"stem"),this.path=Ie.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new he(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ut(e,t){if(e&&e.includes(Ie.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ie.sep+"`")}function Vt(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function br(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Xu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ku=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},Qu={}.hasOwnProperty;class Tn extends Ku{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Fu()}copy(){const t=new Tn;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data($t(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Yt("data",this.frozen),this.namespace[t]=n,this):Qu.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Yt("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=xt(t),r=this.parser||this.Parser;return qt("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),qt("process",this.parser||this.Parser),Wt("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=xt(t),l=r.parse(o);r.run(l,o,function(d,c,h){if(d||!c||!h)return u(d);const f=c,m=r.stringify(f,h);ec(m)?h.value=m:h.result=m,u(d,h)});function u(d,c){d||!c?a(d):s?s(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),qt("processSync",this.parser||this.Parser),Wt("processSync",this.compiler||this.Compiler),this.process(t,i),yr("processSync","process",n),r;function i(s,a){n=!0,dr(s),r=a}}run(t,n,r){wr(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const l=xt(n);i.run(t,l,u);function u(d,c,h){const f=c||t;d?o(d):a?a(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),yr("runSync","run",r),i;function s(a,o){dr(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=xt(n),i=this.compiler||this.Compiler;return Wt("stringify",i),wr(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Yt("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...c]=u;l(d,c)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(i.settings=$t(!0,i.settings,u.settings))}function o(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const c=u[d];s(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,d){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===u){h=c;break}if(h===-1)r.push([u,...d]);else if(d.length>0){let[f,...m]=d;const y=r[h][1];cn(y)&&cn(f)&&(f=$t(!0,y,f)),r[h]=[u,f,...m]}}}}const Ju=new Tn().freeze();function qt(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Wt(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Yt(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function wr(e){if(!cn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function yr(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function xt(e){return Zu(e)?e:new Ti(e)}function Zu(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ec(e){return typeof e=="string"||tc(e)}function tc(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nc="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",kr=[],vr={allowDangerousHtml:!0},rc=/^(https?|ircs?|mailto|xmpp)$/i,ic=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function zi(e){const t=ac(e),n=sc(e);return oc(t.runSync(t.parse(n),n),e)}function ac(e){const t=e.rehypePlugins||kr,n=e.remarkPlugins||kr,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...vr}:vr;return Ju().use(Ol).use(n).use(Ru,r).use(t)}function sc(e){const t=e.children||"",n=new Ti;return typeof t=="string"&&(n.value=t),n}function oc(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||lc;for(const d of ic)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+nc+d.id,void 0);return In(e,u),ks(e,{Fragment:p.Fragment,components:i,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function u(d,c,h){if(d.type==="raw"&&h&&typeof c=="number")return a?h.children.splice(c,1):h.children[c]={type:"text",value:d.value},c;if(d.type==="element"){let f;for(f in _t)if(Object.hasOwn(_t,f)&&Object.hasOwn(d.properties,f)){const m=d.properties[f],y=_t[f];(y===null||y.includes(d.tagName))&&(d.properties[f]=l(String(m||""),f,d))}}if(d.type==="element"){let f=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!f&&r&&typeof c=="number"&&(f=!r(d,c,h)),f&&h&&typeof c=="number")return o&&d.children?h.children.splice(c,1,...d.children):h.children.splice(c,1),c}}}function lc(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||rc.test(e.slice(0,t))?e:""}function Cr(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function uc(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function cc(e,t,n){const i=At((n||{}).ignore||[]),s=dc(t);let a=-1;for(;++a<s.length;)Ei(e,"text",o);function o(u,d){let c=-1,h;for(;++c<d.length;){const f=d[c],m=h?h.children:void 0;if(i(f,m?m.indexOf(f):void 0,h))return;h=f}if(h)return l(u,d)}function l(u,d){const c=d[d.length-1],h=s[a][0],f=s[a][1];let m=0;const C=c.children.indexOf(u);let b=!1,j=[];h.lastIndex=0;let S=h.exec(u.value);for(;S;){const A=S.index,L={index:S.index,input:S.input,stack:[...d,u]};let v=f(...S,L);if(typeof v=="string"&&(v=v.length>0?{type:"text",value:v}:void 0),v===!1?h.lastIndex=A+1:(m!==A&&j.push({type:"text",value:u.value.slice(m,A)}),Array.isArray(v)?j.push(...v):v&&j.push(v),m=A+S[0].length,b=!0),!h.global)break;S=h.exec(u.value)}return b?(m<u.value.length&&j.push({type:"text",value:u.value.slice(m)}),c.children.splice(C,1,...j)):j=[u],C+j.length}}function dc(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([pc(i[0]),fc(i[1])])}return t}function pc(e){return typeof e=="string"?new RegExp(uc(e),"g"):e}function fc(e){return typeof e=="function"?e:function(){return e}}const Gt="phrasing",Xt=["autolink","link","image","label"];function hc(){return{transforms:[kc],enter:{literalAutolink:mc,literalAutolinkEmail:Kt,literalAutolinkHttp:Kt,literalAutolinkWww:Kt},exit:{literalAutolink:yc,literalAutolinkEmail:wc,literalAutolinkHttp:xc,literalAutolinkWww:bc}}}function gc(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Gt,notInConstruct:Xt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Gt,notInConstruct:Xt},{character:":",before:"[ps]",after:"\\/",inConstruct:Gt,notInConstruct:Xt}]}}function mc(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Kt(e){this.config.enter.autolinkProtocol.call(this,e)}function xc(e){this.config.exit.autolinkProtocol.call(this,e)}function bc(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function wc(e){this.config.exit.autolinkEmail.call(this,e)}function yc(e){this.exit(e)}function kc(e){cc(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,vc],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Cc]],{ignore:["link","linkReference"]})}function vc(e,t,n,r,i){let s="";if(!Ai(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!Sc(n)))return!1;const a=jc(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:s+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function Cc(e,t,n,r){return!Ai(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Sc(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function jc(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Cr(e,"(");let s=Cr(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Ai(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||He(n)||It(n))&&(!t||n!==47)}Ni.peek=Mc;function Ec(){this.buffer()}function Ic(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Tc(){this.buffer()}function zc(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Ac(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=je(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Nc(e){this.exit(e)}function Lc(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=je(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Dc(e){this.exit(e)}function Mc(){return"["}function Ni(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function Rc(){return{enter:{gfmFootnoteCallString:Ec,gfmFootnoteCall:Ic,gfmFootnoteDefinitionLabelString:Tc,gfmFootnoteDefinition:zc},exit:{gfmFootnoteCallString:Ac,gfmFootnoteCall:Nc,gfmFootnoteDefinitionLabelString:Lc,gfmFootnoteDefinition:Dc}}}function Pc(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ni},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let l=o.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return l+=o.move(s.safe(s.associationId(r),{before:l,after:"]"})),d(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?`
15
+ `:" ")+s.indentLines(s.containerFlow(r,o.current()),t?Li:Fc))),u(),l}}function Fc(e,t,n){return t===0?e:Li(e,t,n)}function Li(e,t,n){return(n?"":" ")+e}const _c=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Di.peek=Uc;function Oc(){return{canContainEols:["delete"],enter:{strikethrough:$c},exit:{strikethrough:Hc}}}function Bc(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:_c}],handlers:{delete:Di}}}function $c(e){this.enter({type:"delete",children:[]},e)}function Hc(e){this.exit(e)}function Di(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function Uc(){return"~"}function Vc(e){return e.length}function qc(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Vc,s=[],a=[],o=[],l=[];let u=0,d=-1;for(;++d<e.length;){const y=[],C=[];let b=-1;for(e[d].length>u&&(u=e[d].length);++b<e[d].length;){const j=Wc(e[d][b]);if(n.alignDelimiters!==!1){const S=i(j);C[b]=S,(l[b]===void 0||S>l[b])&&(l[b]=S)}y.push(j)}a[d]=y,o[d]=C}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)s[c]=Sr(r[c]);else{const y=Sr(r);for(;++c<u;)s[c]=y}c=-1;const h=[],f=[];for(;++c<u;){const y=s[c];let C="",b="";y===99?(C=":",b=":"):y===108?C=":":y===114&&(b=":");let j=n.alignDelimiters===!1?1:Math.max(1,l[c]-C.length-b.length);const S=C+"-".repeat(j)+b;n.alignDelimiters!==!1&&(j=C.length+j+b.length,j>l[c]&&(l[c]=j),f[c]=j),h[c]=S}a.splice(1,0,h),o.splice(1,0,f),d=-1;const m=[];for(;++d<a.length;){const y=a[d],C=o[d];c=-1;const b=[];for(;++c<u;){const j=y[c]||"";let S="",A="";if(n.alignDelimiters!==!1){const L=l[c]-(C[c]||0),v=s[c];v===114?S=" ".repeat(L):v===99?L%2?(S=" ".repeat(L/2+.5),A=" ".repeat(L/2-.5)):(S=" ".repeat(L/2),A=S):A=" ".repeat(L)}n.delimiterStart!==!1&&!c&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&j==="")&&(n.delimiterStart!==!1||c)&&b.push(" "),n.alignDelimiters!==!1&&b.push(S),b.push(j),n.alignDelimiters!==!1&&b.push(A),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&b.push("|")}m.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return m.join(`
16
+ `)}function Wc(e){return e==null?"":String(e)}function Sr(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Yc(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),Gc);return i(),a}function Gc(e,t,n){return">"+(n?"":" ")+e}function Xc(e,t){return jr(e,t.inConstruct,!0)&&!jr(e,t.notInConstruct,!1)}function jr(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Er(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
17
+ `&&Xc(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
18
+ `}function Kc(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+t.length,r=n.indexOf(t,i);return a}function Qc(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Jc(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Zc(e,t,n,r){const i=Jc(n),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(Qc(e,n)){const c=n.enter("codeIndented"),h=n.indentLines(s,ed);return c(),h}const o=n.createTracker(r),l=i.repeat(Math.max(Kc(s,i)+1,3)),u=n.enter("codeFenced");let d=o.move(l);if(e.lang){const c=n.enter(`codeFencedLang${a}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${a}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:`
19
+ `,encode:["`"],...o.current()})),c()}return d+=o.move(`
20
+ `),s&&(d+=o.move(s+`
21
+ `)),d+=o.move(l),u(),d}function ed(e,t,n){return(n?"":" ")+e}function zn(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function td(e,t,n,r){const i=zn(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
22
+ `,...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),a(),u}function nd(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ct(e){return"&#x"+e.toString(16).toUpperCase()+";"}function jt(e,t,n){const r=Ye(e),i=Ye(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Mi.peek=rd;function Mi(e,t,n,r){const i=nd(n),s=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=l.charCodeAt(0),d=jt(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(l=ct(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=jt(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+ct(c));const f=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+l+f}function rd(e,t,n){return n.options.emphasis||"*"}function id(e,t){let n=!1;return In(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ln}),!!((!e.depth||e.depth<3)&&yn(e)&&(t.options.setext||n))}function ad(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(id(e,n)){const d=n.enter("headingSetext"),c=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
23
23
  `,after:`
24
- `});return c(),p(),h+`
24
+ `});return c(),d(),h+`
25
25
  `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
26
26
  `))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),l=n.enter("phrasing");s.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
27
- `,...s.current()});return/^[\t ]/.test(u)&&(u=ct(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),l(),o(),u}Mi.peek=ap;function Mi(e){return e.value||""}function ap(){return"<"}Pi.peek=sp;function Pi(e,t,n,r){const i=zn(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),u+=l.move(")"),a(),u}function sp(){return"!"}Ri.peek=op;function Ri(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const u=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=p,s(),i==="full"||!u||u!==c?l+=o.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function op(){return"!"}Fi.peek=lp;function Fi(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],o=n.compilePattern(a);let l;if(a.atBreak)for(;l=o.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function lp(){return"`"}function _i(e,t){const n=yn(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Oi.peek=up;function Oi(e,t,n,r){const i=zn(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(_i(e,n)){const p=n.stack;n.stack=[],o=n.enter("autolink");let c=a.move("<");return c+=a.move(n.containerPhrasing(e,{before:c,after:">",...a.current()})),c+=a.move(">"),o(),n.stack=p,c}o=n.enter("link"),l=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),l()),u+=a.move(")"),o(),u}function up(e,t,n){return _i(e,n)?"<":"["}Bi.peek=cp;function Bi(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=p,s(),i==="full"||!u||u!==c?l+=o.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function cp(){return"["}function An(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function pp(e){const t=An(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function dp(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function $i(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function fp(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?dp(n):An(n);const o=e.ordered?a==="."?")":".":pp(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),$i(n)===a&&p){let c=-1;for(;++c<e.children.length;){const h=e.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=o),n.bulletCurrent=a;const u=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),u}function hp(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function gp(e,t,n,r){const i=hp(n);let s=n.bulletCurrent||An(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(a-s.length)),o.shift(a);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),p);return l(),u;function p(c,h,f){return h?(f?"":" ".repeat(a))+c:(f?s:s+" ".repeat(a-s.length))+c}}function mp(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}const xp=At(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function bp(e,t,n,r){return(e.children.some(function(a){return xp(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function wp(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Hi.peek=yp;function Hi(e,t,n,r){const i=wp(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=l.charCodeAt(0),p=jt(r.before.charCodeAt(r.before.length-1),u,i);p.inside&&(l=ct(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=jt(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+ct(c));const f=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:p.outside},o+l+f}function yp(e,t,n){return n.options.strong||"*"}function kp(e,t,n,r){return n.safe(e.value,r)}function vp(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Cp(e,t,n){const r=($i(n)+(n.options.ruleSpaces?" ":"")).repeat(vp(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Ui={blockquote:Wc,break:Er,code:Jc,definition:ep,emphasis:Di,hardBreak:Er,heading:ip,html:Mi,image:Pi,imageReference:Ri,inlineCode:Fi,link:Oi,linkReference:Bi,list:fp,listItem:gp,paragraph:mp,root:bp,strong:Hi,text:kp,thematicBreak:Cp};function Sp(){return{enter:{table:jp,tableData:Ir,tableHeader:Ir,tableRow:Ip},exit:{codeText:Tp,table:Ep,tableData:Qt,tableHeader:Qt,tableRow:Qt}}}function jp(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Ep(e){this.exit(e),this.data.inTable=void 0}function Ip(e){this.enter({type:"tableRow",children:[]},e)}function Qt(e){this.exit(e)}function Ir(e){this.enter({type:"tableCell",children:[]},e)}function Tp(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,zp));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function zp(e,t){return t==="|"?t:e}function Ap(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
28
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:l,tableRow:o}};function a(f,m,y,C){return u(p(f,y,C),f.align)}function o(f,m,y,C){const b=c(f,y,C),j=u([b]);return j.slice(0,j.indexOf(`
29
- `))}function l(f,m,y,C){const b=y.enter("tableCell"),j=y.enter("phrasing"),S=y.containerPhrasing(f,{...C,before:s,after:s});return j(),b(),S}function u(f,m){return Vc(f,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function p(f,m,y){const C=f.children;let b=-1;const j=[],S=m.enter("table");for(;++b<C.length;)j[b]=c(C[b],m,y);return S(),j}function c(f,m,y){const C=f.children;let b=-1;const j=[],S=m.enter("tableRow");for(;++b<C.length;)j[b]=l(C[b],f,m,y);return S(),j}function h(f,m,y){let C=Ui.inlineCode(f,m,y);return y.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function Np(){return{exit:{taskListCheckValueChecked:Tr,taskListCheckValueUnchecked:Tr,paragraph:Dp}}}function Lp(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Mp}}}function Tr(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Dp(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Mp(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(a);let l=Ui.listItem(e,t,n,{...r,...o.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(p){return p+a}}function Pp(){return[fc(),Mc(),_c(),Sp(),Np()]}function Rp(e){return{extensions:[hc(),Pc(e),Oc(),Ap(e),Lp()]}}const Fp={tokenize:Up,partial:!0},Vi={tokenize:Vp,partial:!0},qi={tokenize:qp,partial:!0},Wi={tokenize:Wp,partial:!0},_p={tokenize:Yp,partial:!0},Yi={name:"wwwAutolink",tokenize:$p,previous:Xi},Gi={name:"protocolAutolink",tokenize:Hp,previous:Ki},Le={name:"emailAutolink",tokenize:Bp,previous:Qi},ze={};function Op(){return{text:ze}}let _e=48;for(;_e<123;)ze[_e]=Le,_e++,_e===58?_e=65:_e===91&&(_e=97);ze[43]=Le;ze[45]=Le;ze[46]=Le;ze[95]=Le;ze[72]=[Le,Gi];ze[104]=[Le,Gi];ze[87]=[Le,Yi];ze[119]=[Le,Yi];function Bp(e,t,n){const r=this;let i,s;return a;function a(c){return!dn(c)||!Qi.call(r,r.previous)||Nn(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(c))}function o(c){return dn(c)?(e.consume(c),o):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(_p,p,u)(c):c===45||c===95||fe(c)?(s=!0,e.consume(c),l):p(c)}function u(c){return e.consume(c),i=!0,l}function p(c){return s&&i&&ge(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function $p(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Xi.call(r,r.previous)||Nn(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Fp,e.attempt(Vi,e.attempt(qi,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Hp(e,t,n){const r=this;let i="",s=!1;return a;function a(c){return(c===72||c===104)&&Ki.call(r,r.previous)&&!Nn(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),o):n(c)}function o(c){if(ge(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),o;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),s?u:(s=!0,l)):n(c)}function u(c){return c===null||vt(c)||ie(c)||He(c)||It(c)?n(c):e.attempt(Vi,e.attempt(qi,p),n)(c)}function p(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function Up(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function Vp(e,t,n){let r,i,s;return a;function a(u){return u===46||u===95?e.check(Wi,l,o)(u):u===null||ie(u)||He(u)||u!==45&&It(u)?l(u):(s=!0,e.consume(u),a)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function l(u){return i||r||!s?n(u):t(u)}}function qp(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(Wi,t,s)(a):a===null||ie(a)||He(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function Wp(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),s):o===93?(e.consume(o),i):o===60||o===null||ie(o)||He(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||ie(o)||He(o)?t(o):r(o)}function s(o){return ge(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):ge(o)?(e.consume(o),a):n(o)}}function Yp(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return fe(s)?n(s):t(s)}}function Xi(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ie(e)}function Ki(e){return!ge(e)}function Qi(e){return!(e===47||dn(e))}function dn(e){return e===43||e===45||e===46||e===95||fe(e)}function Nn(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Gp={tokenize:nd,partial:!0};function Xp(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Zp,continuation:{tokenize:ed},exit:td}},text:{91:{name:"gfmFootnoteCall",tokenize:Jp},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Kp,resolveTo:Qp}}}}function Kp(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const u=Se(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function Qp(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function Jp(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(s>999||c===93&&!a||c===null||c===91||ie(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Se(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return ie(c)||(a=!0),s++,e.consume(c),c===92?p:u}function p(c){return c===91||c===92||c===93?(e.consume(c),s++,u):u(c)}}function Zp(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(m)}function p(m){if(a>999||m===93&&!o||m===null||m===91||ie(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return s=Se(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ie(m)||(o=!0),a++,e.consume(m),m===92?c:p}function c(m){return m===91||m===92||m===93?(e.consume(m),a++,p):p(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(s)||i.push(s),Z(e,f,"gfmFootnoteDefinitionWhitespace")):n(m)}function f(m){return t(m)}}function ed(e,t,n){return e.check(dt,t,e.attempt(Gp,t,n))}function td(e){e.exit("gfmFootnoteDefinition")}function nd(e,t,n){const r=this;return Z(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function rd(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let u=l;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[l][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[l][1].end)},c={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[l][1].start)},h=[["enter",p,o],["enter",a[u][1],o],["exit",a[u][1],o],["enter",c,o]],f=o.parser.constructs.insideSpan.null;f&&ye(h,h.length,0,Tt(f,a.slice(u+1,l),o)),ye(h,h.length,0,[["exit",c,o],["enter",a[l][1],o],["exit",a[l][1],o],["exit",p,o]]),ye(a,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function s(a,o,l){const u=this.previous,p=this.events;let c=0;return h;function h(m){return u===126&&p[p.length-1][1].type!=="characterEscape"?l(m):(a.enter("strikethroughSequenceTemporary"),f(m))}function f(m){const y=Ye(u);if(m===126)return c>1?l(m):(a.consume(m),c++,f);if(c<2&&!n)return l(m);const C=a.exit("strikethroughSequenceTemporary"),b=Ye(m);return C._open=!b||b===2&&!!y,C._close=!y||y===2&&!!b,o(m)}}}class id{constructor(){this.map=[]}add(t,n,r){ad(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function ad(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function sd(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function od(){return{flow:{null:{name:"table",tokenize:ld,resolveAll:ud}}}}function ld(e,t,n){const r=this;let i=0,s=0,a;return o;function o(w){let z=r.events.length-1;for(;z>-1;){const T=r.events[z][1].type;if(T==="lineEnding"||T==="linePrefix")z--;else break}const E=z>-1?r.events[z][1].type:null,R=E==="tableHead"||E==="tableRow"?v:l;return R===v&&r.parser.lazy[r.now().line]?n(w):R(w)}function l(w){return e.enter("tableHead"),e.enter("tableRow"),u(w)}function u(w){return w===124||(a=!0,s+=1),p(w)}function p(w){return w===null?n(w):H(w)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),f):n(w):Q(w)?Z(e,p,"whitespace")(w):(s+=1,a&&(a=!1,i+=1),w===124?(e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),a=!0,p):(e.enter("data"),c(w)))}function c(w){return w===null||w===124||ie(w)?(e.exit("data"),p(w)):(e.consume(w),w===92?h:c)}function h(w){return w===92||w===124?(e.consume(w),c):c(w)}function f(w){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(w):(e.enter("tableDelimiterRow"),a=!1,Q(w)?Z(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):m(w))}function m(w){return w===45||w===58?C(w):w===124?(a=!0,e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),y):N(w)}function y(w){return Q(w)?Z(e,C,"whitespace")(w):C(w)}function C(w){return w===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(w),e.exit("tableDelimiterMarker"),b):w===45?(s+=1,b(w)):w===null||H(w)?A(w):N(w)}function b(w){return w===45?(e.enter("tableDelimiterFiller"),j(w)):N(w)}function j(w){return w===45?(e.consume(w),j):w===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(w),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(w))}function S(w){return Q(w)?Z(e,A,"whitespace")(w):A(w)}function A(w){return w===124?m(w):w===null||H(w)?!a||i!==s?N(w):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(w)):N(w)}function N(w){return n(w)}function v(w){return e.enter("tableRow"),L(w)}function L(w){return w===124?(e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),L):w===null||H(w)?(e.exit("tableRow"),t(w)):Q(w)?Z(e,L,"whitespace")(w):(e.enter("data"),_(w))}function _(w){return w===null||w===124||ie(w)?(e.exit("data"),L(w)):(e.consume(w),w===92?B:_)}function B(w){return w===92||w===124?(e.consume(w),_):_(w)}}function ud(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,p,c;const h=new id;for(;++n<e.length;){const f=e[n],m=f[1];f[0]==="enter"?m.type==="tableHead"?(o=!1,l!==0&&(zr(h,t,l,u,p),p=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,c=void 0,s=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,p={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",p,t]])),i=m.type==="tableDelimiterRow"?2:p?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],c=bt(h,t,s,i,void 0,c),s=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],c=bt(h,t,s,i,void 0,c)),s=a,a=[s[1],n,0,0])):m.type==="tableHead"?(o=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,s[1]!==0?(a[0]=a[1],c=bt(h,t,s,i,n,c)):a[1]!==0&&(c=bt(h,t,a,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&zr(h,t,l,u,p),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=sd(t.events,n))}return e}function bt(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},We(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=We(t.events,n[1]);if(s={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=We(t.events,n[2]),p=We(t.events,n[3]),c={type:o,start:Object.assign({},u),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,y=n[3]-n[2]-1;e.add(m,y,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(s.end=Object.assign({},We(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function zr(e,t,n,r,i){const s=[],a=We(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function We(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const cd={name:"tasklistCheck",tokenize:dd};function pd(){return{text:{91:cd}}}function dd(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return ie(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return H(l)?t(l):Q(l)?e.check({tokenize:fd},t,n)(l):n(l)}}function fd(e,t,n){return Z(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function hd(e){return ai([Op(),Xp(),rd(e),od(),pd()])}const gd={};function Ji(e){const t=this,n=e||gd,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(hd(n)),s.push(Pp()),a.push(Rp(n))}function Zi({content:e}){return d.jsx("div",{className:"sa-text-part",children:d.jsx(Ti,{remarkPlugins:[Ji],children:e})})}const md="https://at.alicdn.com/t/c/font_5210396_pffyg5g21kn.js";let Ar=!1;function ea(e=md){if(Ar||typeof document>"u")return;Ar=!0;const t=e.split("?")[0].split("/").pop();if(t&&document.querySelector(`script[src*="${t}"]`))return;const n=document.createElement("script");n.src=e,document.head.appendChild(n)}ea();function J({name:e,size:t=16,color:n="currentColor",className:r,style:i}){return d.jsx("svg",{className:r,style:{width:t,height:t,fill:n,verticalAlign:"middle",...i},"aria-hidden":"true",children:d.jsx("use",{href:`#icon-${e}`})})}function ta({content:e}){const[t,n]=k.useState(!1);return d.jsxs("div",{className:"sa-thinking-part",onClick:()=>n(!t),children:[d.jsxs("div",{className:"sa-thinking-header",children:[d.jsx("span",{className:"sa-thinking-icon",children:d.jsx(J,{name:"brain",size:14})}),d.jsx("span",{className:"sa-thinking-label",children:"思考过程"}),d.jsx("span",{className:`sa-thinking-arrow ${t?"expanded":""}`,children:d.jsx(J,{name:"chevron-right",size:12})})]}),t&&d.jsx("div",{className:"sa-thinking-content",children:e})]})}function na({toolName:e,toolCallId:t,args:n}){const[r,i]=k.useState(!1),[s,a]=k.useState(!1);let o=n;try{o=JSON.stringify(JSON.parse(n),null,2)}catch{}const l=k.useCallback(()=>{var u;(u=navigator.clipboard)==null||u.writeText(o).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)}).catch(()=>{})},[o]);return d.jsxs("div",{className:"sa-tool-call-part",children:[d.jsxs("div",{className:"sa-tool-call-header",onClick:()=>i(!r),children:[d.jsx("span",{className:"sa-tool-icon",children:d.jsx(J,{name:"zap",size:14})}),d.jsxs("span",{className:"sa-tool-name",children:["调用工具: ",e]}),d.jsx("span",{className:`sa-thinking-arrow ${r?"expanded":""}`,children:d.jsx(J,{name:"chevron-right",size:12})})]}),r&&d.jsxs(d.Fragment,{children:[d.jsx("pre",{className:"sa-tool-args",children:o}),d.jsx("div",{className:"sa-tool-result-actions",children:d.jsxs("button",{className:"sa-action-btn",onClick:l,title:"复制",children:[d.jsx(J,{name:s?"circle-check":"copy",size:14})," ",s?"已复制":"复制"]})})]})]})}function Nr({text:e}){const[t,n]=k.useState(!1),r=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)}).catch(()=>{})};return d.jsxs("button",{className:"sa-action-btn",onClick:r,title:"复制",children:[d.jsx(J,{name:t?"circle-check":"copy",size:14})," ",t?"已复制":"复制"]})}function xd({html:e}){const[t,n]=k.useState(null);return k.useEffect(()=>{let r=!1;return Promise.resolve().then(()=>require("./purify.es-Dsdnkgrg.cjs")).then(i=>{r||n(i.default.sanitize(e,{FORCE_BODY:!0,ADD_ATTR:["target"]}))}),()=>{r=!0}},[e]),t===null?null:d.jsx("div",{className:"sa-tool-result-html-scroll",children:d.jsx("div",{className:"sa-tool-result-html sa-text-part",dangerouslySetInnerHTML:{__html:t}})})}function ra({toolName:e,content:t,renderMode:n,html:r}){let i=t;if(i)try{i=JSON.stringify(JSON.parse(i),null,2)}catch{}return d.jsxs("div",{className:"sa-tool-result-part",children:[d.jsxs("div",{className:"sa-tool-result-header",children:[d.jsx("span",{className:"sa-tool-icon",children:d.jsx(J,{name:"circle-check",size:14,color:"#10b981"})}),d.jsx("span",{className:"sa-tool-result-label",children:e||"工具返回"})]}),n==="html"&&r?d.jsxs(d.Fragment,{children:[d.jsx(xd,{html:r}),d.jsx("div",{className:"sa-tool-result-actions",children:d.jsx(Nr,{text:r})})]}):i?d.jsxs(d.Fragment,{children:[d.jsx("pre",{className:"sa-tool-result-content",children:i}),d.jsx("div",{className:"sa-tool-result-actions",children:d.jsx(Nr,{text:i})})]}):d.jsx("pre",{className:"sa-tool-result-content",children:"—"})]})}function ia({content:e,onRetry:t}){return d.jsxs("div",{className:"sa-error-part",children:[d.jsxs("div",{className:"sa-error-content",children:[d.jsx("span",{className:"sa-error-icon",children:d.jsx(J,{name:"triangle-alert",size:14})}),d.jsx("span",{children:e||"发生错误"})]}),t&&d.jsx("button",{className:"sa-error-retry",onClick:t,children:"重试"})]})}function aa(e){return e==null||Number.isNaN(e)?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function bd({attachment:e}){const t=d.jsxs(d.Fragment,{children:[d.jsx(J,{name:"file-text",size:14,color:"#6366f1"}),d.jsx("span",{className:"sa-attachment-chip-name",children:e.filename}),e.size!=null&&d.jsx("span",{className:"sa-attachment-chip-size",children:aa(e.size)})]});return e.url?d.jsx("a",{className:"sa-attachment-chip",href:e.url,target:"_blank",rel:"noreferrer",download:e.filename,title:`下载 ${e.filename}`,children:t}):d.jsx("span",{className:"sa-attachment-chip",title:e.filename,children:t})}function wd({interrupt:e,onRespond:t,disabled:n,answeredAction:r}){var o,l;const i=e.options,s=(typeof(i==null?void 0:i[0])=="string"?i[0]:(o=i==null?void 0:i[0])==null?void 0:o.label)||"确认",a=(typeof(i==null?void 0:i[1])=="string"?i[1]:(l=i==null?void 0:i[1])==null?void 0:l.label)||"取消";return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(J,{name:"circle-alert",size:16,color:"#f59e0b"}),d.jsx("span",{children:e.content})]}),d.jsxs("div",{className:"sa-interrupt-actions",children:[d.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-primary ${r==="confirm"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"confirm"}),children:[d.jsx(J,{name:"check",size:14})," ",s]}),d.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-secondary ${r==="cancel"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"cancel"}),children:[d.jsx(J,{name:"x",size:14})," ",a]})]}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function yd({interrupt:e,onRespond:t,disabled:n,answeredAction:r}){var u,p,c,h;const i=e.options,s=(typeof(i==null?void 0:i[0])=="string"?i[0]:(u=i==null?void 0:i[0])==null?void 0:u.label)||"批准",a=(typeof(i==null?void 0:i[1])=="string"?i[1]:(p=i==null?void 0:i[1])==null?void 0:p.label)||"拒绝",o=(typeof(i==null?void 0:i[2])=="string"?i[2]:(c=i==null?void 0:i[2])==null?void 0:c.label)||"跳过",l=((h=e.metadata)==null?void 0:h.showSkip)!==!1;return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(J,{name:"circle-alert",size:16,color:"#f59e0b"}),d.jsx("span",{children:e.content})]}),d.jsxs("div",{className:"sa-interrupt-actions",children:[d.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-primary ${r==="approve"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"approve"}),children:[d.jsx(J,{name:"check",size:14})," ",s]}),d.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-danger ${r==="reject"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"reject"}),children:[d.jsx(J,{name:"x",size:14})," ",a]}),l&&d.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-secondary ${r==="skip"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"skip"}),children:[d.jsx(J,{name:"chevron-right",size:14})," ",o]})]}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function kd(e){return typeof e=="string"?{value:e,label:e}:e}function vd({interrupt:e,onRespond:t,disabled:n,initialValue:r}){const i=(e.options??[]).map(kd);return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(J,{name:"list",size:16,color:"#6366f1"}),d.jsx("span",{children:e.content})]}),d.jsx("div",{className:"sa-interrupt-options",children:i.map(s=>{const a=r===s.value;return d.jsxs("button",{className:`sa-interrupt-option ${s.danger?"sa-interrupt-option-danger":""} ${a?"sa-interrupt-option-selected":""}`,disabled:n,onClick:()=>t({action:"select",value:s.value}),children:[d.jsx(J,{name:a?"circle-check":"circle",size:14}),s.icon&&d.jsx(J,{name:s.icon,size:14}),d.jsx("span",{children:s.label}),s.description&&d.jsx("span",{className:"sa-interrupt-option-desc",children:s.description})]},s.value)})}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function Cd(e){return typeof e=="string"?{value:e,label:e}:e}function Sd({interrupt:e,onRespond:t,disabled:n,initialValue:r}){const i=(e.options??[]).map(Cd),[s,a]=k.useState(()=>new Set(Array.isArray(r)?r:[])),o=l=>{n||a(u=>{const p=new Set(u);return p.has(l)?p.delete(l):p.add(l),p})};return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(J,{name:"list-checks",size:16,color:"#6366f1"}),d.jsx("span",{children:e.content})]}),d.jsx("div",{className:"sa-interrupt-options",children:i.map(l=>d.jsxs("button",{className:`sa-interrupt-option ${s.has(l.value)?"sa-interrupt-option-selected":""}`,disabled:n,onClick:()=>o(l.value),children:[d.jsx(J,{name:s.has(l.value)?"square-check":"square",size:14}),d.jsx("span",{children:l.label})]},l.value))}),!n&&d.jsx("div",{className:"sa-interrupt-actions",children:d.jsxs("button",{className:"sa-interrupt-btn sa-interrupt-btn-primary",disabled:s.size===0,onClick:()=>t({action:"submit",value:Array.from(s)}),children:[d.jsx(J,{name:"check",size:14})," 确认 (",s.size,")"]})}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function jd({interrupt:e,onRespond:t,disabled:n,initialValue:r}){const[i,s]=k.useState(r??""),a=e.inputType??"text",o=a==="textarea",l=()=>{n||e.required&&!i.trim()||t({action:"submit",value:i.trim()})};return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(J,{name:"text-cursor-input",size:16,color:"#6366f1"}),d.jsx("span",{children:e.content})]}),d.jsx("div",{className:"sa-interrupt-input-area",children:o?d.jsx("textarea",{className:"sa-interrupt-textarea",value:i,onChange:u=>s(u.target.value),placeholder:e.placeholder,maxLength:e.maxLength,rows:3,disabled:n}):d.jsx("input",{className:"sa-interrupt-input",type:a,value:i,onChange:u=>s(u.target.value),placeholder:e.placeholder,maxLength:e.maxLength,onKeyDown:u=>u.key==="Enter"&&l(),disabled:n})}),!n&&d.jsx("div",{className:"sa-interrupt-actions",children:d.jsxs("button",{className:"sa-interrupt-btn sa-interrupt-btn-primary",disabled:e.required?!i.trim():!1,onClick:l,children:[d.jsx(J,{name:"check",size:14})," 提交"]})}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function Ed({interrupt:e,onRespond:t,disabled:n,initialValue:r}){const i=e.fields??[],[s,a]=k.useState(()=>{const p={};for(const c of i)p[c.name]=(r==null?void 0:r[c.name])??c.defaultValue??"";return p}),o=(p,c)=>{n||a(h=>({...h,[p]:c}))},l=!n&&i.every(p=>!p.required||s[p.name]),u=()=>{l&&t({action:"submit",value:s})};return d.jsxs("div",{className:"sa-interrupt-card",children:[d.jsxs("div",{className:"sa-interrupt-content",children:[d.jsx(J,{name:"file-text",size:16,color:"#6366f1"}),d.jsx("span",{children:e.content})]}),d.jsx("div",{className:"sa-interrupt-form",children:i.map(p=>d.jsxs("div",{className:"sa-interrupt-form-field",children:[d.jsxs("label",{className:"sa-interrupt-form-label",children:[p.label,p.required&&d.jsx("span",{className:"sa-interrupt-form-required",children:"*"})]}),Id(p,s[p.name],c=>o(p.name,c),n)]},p.name))}),!n&&d.jsxs("div",{className:"sa-interrupt-actions",children:[d.jsxs("button",{className:"sa-interrupt-btn sa-interrupt-btn-primary",disabled:!l,onClick:u,children:[d.jsx(J,{name:"check",size:14})," 提交"]}),d.jsx("button",{className:"sa-interrupt-btn sa-interrupt-btn-secondary",onClick:()=>t({action:"cancel"}),children:"取消"})]}),n&&d.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function Lr(e){return typeof e=="string"?{value:e,label:e}:e}function Id(e,t,n,r){switch(e.type){case"textarea":return d.jsx("textarea",{className:"sa-interrupt-textarea",value:t,onChange:i=>n(i.target.value),placeholder:e.placeholder,rows:3,disabled:r});case"select":{const i=(e.options??[]).map(Lr);return d.jsxs("select",{className:"sa-interrupt-select",value:t,onChange:s=>n(s.target.value),disabled:r,children:[d.jsx("option",{value:"",children:"请选择"}),i.map(s=>d.jsx("option",{value:s.value,children:s.label},s.value))]})}case"multiSelect":{const i=(e.options??[]).map(Lr),s=Array.isArray(t)?t:[],a=o=>{r||n(s.includes(o)?s.filter(l=>l!==o):[...s,o])};return d.jsx("div",{className:"sa-interrupt-options",children:i.map(o=>d.jsx("button",{type:"button",className:`sa-interrupt-option ${s.includes(o.value)?"sa-interrupt-option-selected":""}`,disabled:r,onClick:()=>a(o.value),children:o.label},o.value))})}case"password":return d.jsx("input",{className:"sa-interrupt-input",type:"password",value:t,onChange:i=>n(i.target.value),placeholder:e.placeholder,disabled:r});default:return d.jsx("input",{className:"sa-interrupt-input",type:e.type==="number"?"number":e.type==="date"?"date":"text",value:t,onChange:i=>n(i.target.value),placeholder:e.placeholder,disabled:r})}}function sa({interrupt:e,resolved:t,response:n,onRespond:r}){const i=t,s=n==null?void 0:n.value;switch(e.interruptType){case"confirm":return d.jsx(wd,{interrupt:e,onRespond:r,disabled:i,answeredAction:n==null?void 0:n.action});case"approve":return d.jsx(yd,{interrupt:e,onRespond:r,disabled:i,answeredAction:n==null?void 0:n.action});case"select":return d.jsx(vd,{interrupt:e,onRespond:r,disabled:i,initialValue:s});case"multiSelect":return d.jsx(Sd,{interrupt:e,onRespond:r,disabled:i,initialValue:s});case"input":return d.jsx(jd,{interrupt:e,onRespond:r,disabled:i,initialValue:s});case"form":return d.jsx(Ed,{interrupt:e,onRespond:r,disabled:i,initialValue:s});default:return d.jsxs("div",{className:"sa-interrupt-unknown",children:["未知的交互类型: ",e.interruptType]})}}function Td({files:e,artifactPreview:t}){const{openArtifactPreview:n}=Te();return e.length===0?null:d.jsx("ul",{className:"sa-artifact-file-list",role:"list",children:e.map((r,i)=>d.jsxs("li",{className:"sa-artifact-file-card",onClick:t?()=>n(r):void 0,onKeyDown:t?s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),n(r))}:void 0,tabIndex:t?0:void 0,role:t?"button":void 0,"aria-label":t?`预览 ${r.filename}`:void 0,style:t?{cursor:"pointer"}:void 0,children:[d.jsx("div",{className:"sa-artifact-file-icon",children:d.jsx("span",{className:"sa-artifact-chip-type",children:_r(r.type)})}),d.jsxs("div",{className:"sa-artifact-file-info",children:[d.jsx("span",{className:"sa-artifact-file-name",children:r.filename}),r.size!=null&&d.jsx("span",{className:"sa-artifact-file-size",children:Fr(r.size)})]}),t&&d.jsx("button",{className:"sa-artifact-file-download",title:"下载","aria-label":`下载 ${r.filename}`,onClick:s=>{s.stopPropagation(),kt(r)},children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})})})]},r.id||`art-${i}`))})}const zd=[{value:1,label:"事实错误"},{value:2,label:"逻辑问题"},{value:3,label:"不相关"},{value:4,label:"信息过时"},{value:5,label:"冗长啰嗦"},{value:6,label:"难以理解"}];function oa({message:e,onCopy:t,onRegenerate:n,onFeedback:r}){const{status:i,cancelFeedback:s}=Te(),[a,o]=k.useState(null),[l,u]=k.useState(!1),[p,c]=k.useState(!1),h=k.useRef(null),f=k.useCallback(()=>{t(),u(!0),setTimeout(()=>u(!1),2e3)},[t]),m=k.useCallback(()=>{a==="like"?(o(null),s(e.id)):(o("like"),c(!1),r==null||r(e.id,"like"))},[a,e.id,r,s]),y=k.useCallback(()=>{a==="dislike"?(o(null),c(!1),s(e.id)):c(!0)},[a,e.id,s]),C=k.useCallback((j,S)=>{o("dislike"),c(!1),r==null||r(e.id,"dislike",{reason:j,remark:(S==null?void 0:S.trim())||void 0})},[e.id,r]),b=k.useCallback(()=>{c(!1)},[]);return k.useEffect(()=>{if(!p)return;const j=A=>{h.current&&!h.current.contains(A.target)&&c(!1)},S=A=>{A.key==="Escape"&&c(!1)};return document.addEventListener("mousedown",j),document.addEventListener("keydown",S),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",S)}},[p]),i!=="ready"&&i!=="error"?null:d.jsxs("div",{className:"sa-action-bar",children:[d.jsxs("button",{className:"sa-action-btn",onClick:f,title:"复制",children:[d.jsx(J,{name:l?"circle-check":"copy",size:14})," ",l?"已复制":"复制"]}),n&&d.jsxs("button",{className:"sa-action-btn",onClick:n,title:"重新生成",children:[d.jsx(J,{name:"refresh-cw",size:14})," 重新生成"]}),r&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"sa-action-divider"}),d.jsx("button",{className:`sa-action-btn ${a==="like"?"sa-action-btn-active":""}`,onClick:m,title:"有用","aria-label":"点赞",children:d.jsx(J,{name:"thumbs-up",size:14})}),d.jsx("button",{className:`sa-action-btn ${a==="dislike"?"sa-action-btn-active":""}`,onClick:y,title:"无用","aria-label":"踩","aria-expanded":p,"aria-haspopup":"dialog",children:d.jsx(J,{name:"thumbs-down",size:14})})]}),p&&d.jsx("div",{ref:h,children:d.jsx(Ad,{onSubmit:C,onCancel:b})})]})}function Ad({onSubmit:e,onCancel:t}){const[n,r]=k.useState(void 0),[i,s]=k.useState("");return d.jsxs("div",{className:"sa-dislike-panel",children:[d.jsx("div",{className:"sa-dislike-panel-title",children:"请选择不满意的原因(可选)"}),d.jsx("div",{className:"sa-dislike-reasons",children:zd.map(a=>d.jsx("button",{className:`sa-dislike-reason-btn ${n===a.value?"active":""}`,onClick:()=>r(n===a.value?void 0:a.value),children:a.label},a.value))}),d.jsx("textarea",{className:"sa-dislike-remark",placeholder:"补充描述(选填,≤500 字)",maxLength:500,value:i,onChange:a=>s(a.target.value),rows:2}),d.jsxs("div",{className:"sa-dislike-actions",children:[d.jsx("button",{className:"sa-dislike-submit",onClick:()=>e(n,i||void 0),children:"提交"}),d.jsx("button",{className:"sa-dislike-cancel",onClick:t,children:"取消"})]})]})}const Nd=/^(https?:\/\/|data:|blob:|\/\/|\/|\.\/|\.\.\/)/;function Dr({src:e,alt:t}){return e?Nd.test(e)?d.jsx("img",{src:e,alt:t??"",className:"sa-msg-avatar",draggable:!1}):d.jsx("span",{className:"sa-msg-avatar sa-msg-avatar-text",children:e}):null}function la({message:e,isStreaming:t,isLast:n,slots:r,avatar:i,artifactPreview:s,showTimestamp:a}){const{regenerate:o,feedback:l,respondToInterrupt:u}=Te(),p=k.useCallback(()=>{var N;const A=e.parts.filter(v=>v.type==="text").map(v=>v.content).join(`
30
- `);(N=navigator.clipboard)==null||N.writeText(A).catch(()=>{})},[e]),c=e.role==="user",h=r.Message;if(h)return d.jsx(h,{message:e,isStreaming:t,isLast:n,avatar:i,slots:r,onCopy:p,onRegenerate:o,onFeedback:l,showTimestamp:a});const f=r.TextPart??Zi,m=r.ThinkingPart??ta,y=r.ToolCallPart??na,C=r.ToolResultPart??ra,b=r.ErrorPart??ia,j=r.ActionBar??oa,S=!c&&e.parts.some(A=>A.type==="text"&&A.content);return d.jsxs("div",{className:`sa-message ${c?"sa-message-user":"sa-message-assistant"}`,children:[!c&&d.jsx(Dr,{src:(i==null?void 0:i.assistant)||(t&&n?de.assistantAvatarGenerating:de.assistantAvatar),alt:"AI"}),d.jsxs("div",{className:"sa-message-content",children:[a&&d.jsx("span",{className:`sa-message-time ${c?"sa-message-time-right":""}`,children:Ca(e.timestamp)}),d.jsxs("div",{className:"sa-message-body",children:[e.parts.map((A,N)=>{switch(A.type){case"text":return d.jsx(f,{content:A.content},N);case"attachment":return d.jsx(bd,{attachment:A.attachment},N);case"thinking":return d.jsx(m,{content:A.content},N);case"tool_call":return d.jsx(y,{toolName:A.toolName,toolCallId:A.toolCallId,args:A.args},N);case"tool_result":return d.jsx(C,{toolName:A.toolName,toolCallId:A.toolCallId,content:A.content,artifacts:A.artifacts,renderMode:A.renderMode,html:A.html,artifactPreview:s},N);case"error":return d.jsx(b,{content:A.content,onRetry:o},N);case"interrupt":return d.jsx(sa,{interrupt:A.interrupt,resolved:A.resolved??!1,response:A.response,onRespond:v=>u(A.interrupt.interruptId,v)},N);default:return null}}),t&&n&&!c&&!S&&d.jsx("span",{className:"sa-thinking-indicator",children:"思考中…"}),!c&&e.artifacts&&e.artifacts.length>0&&d.jsx(Td,{files:Or(e.artifacts),artifactPreview:s}),!c&&!t&&S&&d.jsx(j,{message:e,onCopy:p,onRegenerate:n?o:void 0,onFeedback:l})]})]}),c&&(i==null?void 0:i.user)&&d.jsx(Dr,{src:i.user,alt:"用户"})]})}function ua({message:e,suggestedPrompts:t,onPromptClick:n,capabilities:r,quickLinks:i,logo:s,openPanel:a}){const o=l=>{if(l.onClick){l.onClick();return}const u=l.action;if(!u){l.prompt&&n(l.prompt);return}a==null||a(u.type==="link"?u:{...u,title:u.title??l.label})};return d.jsxs("div",{className:"flex flex-col gap-8 py-2",children:[d.jsxs("div",{className:"flex flex-col items-center gap-1 opacity-0 animate-sa-home-fade-in",children:[d.jsx("img",{src:s||de.logo,alt:"AI 助手",className:"block max-w-16 shrink-0 animate-sa-logo-float",draggable:!1}),d.jsx("h3",{className:"sa-shimmer-text m-0 mb-1 text-[18px] font-bold leading-[1.3] text-[#333] animate-sa-title-shimmer",children:e||"你好!有什么可以帮你的?"})]}),r&&r.length>0&&d.jsx("div",{className:"flex flex-col items-start gap-4 opacity-0 animate-sa-home-fade-in",style:{animationDelay:"150ms"},children:r.map(l=>d.jsxs("div",{className:"inline-flex w-full max-w-full min-w-0 items-center gap-[7px]",children:[l.icon&&d.jsx("img",{src:l.icon,alt:"",className:"h-[18px] w-[18px] shrink-0 object-contain",draggable:!1}),d.jsx("span",{className:"shrink-0 text-[14px] leading-[1.4] text-[#333]",children:l.label}),l.desc&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"h-[13px] w-px shrink-0 bg-[#DCDCDC]"}),d.jsx("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-[14px] leading-[1.4] text-[#9A9A9A]",children:l.desc})]})]},l.label))}),t&&t.length>0&&d.jsx("div",{className:"flex flex-col items-start gap-3",children:t.map((l,u)=>d.jsxs("button",{type:"button",className:"sa-chip inline-flex h-7 items-center gap-1 rounded-md px-3 text-[14px] leading-none text-[#333] opacity-0 transition-colors animate-sa-chip-in",style:{animationDelay:`${300+u*130}ms`},onClick:()=>n(l),children:[d.jsx("span",{className:"sa-chip-text overflow-hidden text-ellipsis whitespace-nowrap",children:l}),d.jsx("svg",{width:13,height:13,viewBox:"0 0 14 14",fill:"none",className:"shrink-0 text-[#9A9A9A]","aria-hidden":"true",children:d.jsx("path",{d:"M5 3L9 7L5 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]},`${l}-${u}`))}),i&&i.length>0&&d.jsxs("div",{className:"opacity-0 animate-sa-home-fade-in",style:{animationDelay:"420ms"},children:[d.jsx("div",{className:"mb-3 text-[14px] leading-none text-[#A0A0A0]",children:"快速查看"}),d.jsx("div",{className:"flex flex-wrap items-center gap-[22px]",children:i.map(l=>d.jsxs("button",{type:"button",className:"inline-flex items-center gap-[7px] rounded-md px-1 py-1 transition-colors hover:bg-[#F5F5F5]",onClick:()=>o(l),children:[l.icon&&d.jsx("span",{className:"flex h-[18px] w-[18px] shrink-0 items-center justify-center opacity-70",children:d.jsx("img",{src:l.icon,alt:"",width:18,height:18,draggable:!1})}),d.jsx("span",{className:"text-[14px] leading-none text-[#333] transition-colors hover:text-[#1881F0]",children:l.label})]},l.label))})]})]})}function Ln({slots:e,welcomeMessage:t,suggestedPrompts:n,avatar:r,artifactPreview:i,capabilities:s,quickLinks:a,logo:o,showTimestamp:l}){const{messages:u,status:p,sendMessage:c,openPanel:h}=Te(),{containerRef:f}=Vr([u]),m=p==="streaming",y=e.WelcomeScreen??ua,C=e.AppendContainer;return u.length===0?d.jsxs("div",{className:"sa-thread",ref:f,children:[d.jsx(y,{message:t,suggestedPrompts:n,onPromptClick:c,capabilities:s,quickLinks:a,logo:o,openPanel:h}),C&&d.jsx(C,{openPanel:h})]}):d.jsx("div",{className:"sa-thread",ref:f,children:u.map((b,j)=>d.jsx(la,{message:b,isStreaming:m,isLast:j===u.length-1,slots:e,avatar:r,artifactPreview:i,showTimestamp:l},b.id))})}function Ld({items:e,activeIndex:t,onSelect:n}){const r=k.useRef(null);return k.useEffect(()=>{var s;const i=(s=r.current)==null?void 0:s.children[t];i==null||i.scrollIntoView({block:"nearest"})},[t]),e.length===0?d.jsx("div",{className:"sa-slash-menu",children:d.jsx("div",{className:"sa-slash-menu-empty",children:"没有匹配的技能"})}):d.jsx("div",{className:"sa-slash-menu",ref:r,children:e.map((i,s)=>d.jsxs("div",{className:`sa-slash-menu-item${s===t?" sa-slash-menu-item--active":""}`,onMouseDown:a=>{a.preventDefault(),n(i)},children:[d.jsxs("span",{className:"sa-slash-menu-item-name",children:["/",i.name]}),(i.displayName||i.description)&&d.jsx("span",{className:"sa-slash-menu-item-desc",children:i.displayName||i.description})]},i.code))})}function Dd({sdk:e,input:t,onSelect:n}){const[r,i]=k.useState([]),[s,a]=k.useState(!1),[o,l]=k.useState(0),u=k.useRef(!1);k.useEffect(()=>{u.current||(u.current=!0,e.listSkills().then(i).catch(()=>i([])))},[e]);const p=/^\/\S*$/.test(t);k.useEffect(()=>{a(p)},[p]),k.useEffect(()=>{p&&l(0)},[t,p]);const c=t.startsWith("/")?t.slice(1).toLowerCase():"",h=k.useMemo(()=>r.filter(S=>!c||S.code.toLowerCase().includes(c)||S.name.toLowerCase().includes(c)||S.displayName&&S.displayName.toLowerCase().includes(c)),[r,c]),f=k.useRef(s),m=k.useRef(h),y=k.useRef(o),C=k.useRef(n);f.current=s,m.current=h,y.current=o,C.current=n;const b=k.useCallback(S=>{if(!f.current||m.current.length===0)return!1;switch(S.key){case"ArrowDown":return S.preventDefault(),l(A=>(A+1)%m.current.length),!0;case"ArrowUp":return S.preventDefault(),l(A=>(A-1+m.current.length)%m.current.length),!0;case"Enter":case"Tab":return S.preventDefault(),C.current(m.current[y.current]),a(!1),!0;case"Escape":return S.preventDefault(),a(!1),!0;default:return!1}},[]),j=k.useCallback(()=>a(!1),[]);return{isOpen:s,items:h,activeIndex:o,handleKeyDown:b,close:j}}const Md=10,Pd=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent);function Rd({size:e=16}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}function Dn(){const{status:e,sendMessage:t,stop:n,sdk:r,attachmentUploader:i,nosUpload:s}=Te(),[a,o]=k.useState(""),[l,u]=k.useState([]),p=k.useRef(null),c=k.useRef(null),h=!!i||!!s,f=e==="streaming"||e==="submitted",m=l.filter(w=>w.attachment),y=l.some(w=>!w.attachment&&w.status==="uploading"),C=!!a.trim()||l.length>0||f,b=!f&&!y&&(a.trim().length>0||m.length>0),j=k.useCallback(w=>{o(`/${w.name} `),setTimeout(()=>{const z=p.current;z&&(z.focus(),z.selectionStart=z.selectionEnd=z.value.length)},0)},[]),S=Dd({sdk:r,input:a,onSelect:j}),A=k.useCallback(w=>{const z=Array.from(w.target.files??[]);if(w.target.value="",!h||z.length===0)return;const E=Md-l.length,R=z.slice(0,Math.max(0,E));if(R.length===0)return;const T=R.map(F=>({key:`${F.name}_${F.size}_${Date.now()}_${Math.random().toString(36).slice(2,6)}`,file:F,status:"uploading"}));u(F=>[...F,...T]);for(const{key:F,file:U}of T)(i||Me.createNosUploader({baseURL:s.baseURL,headers:s.headers,trunkSize:s.trunkSize,onProgress:P=>u(O=>O.map(x=>x.key===F?{...x,percent:P}:x))}))(U).then(P=>{u(O=>O.map(x=>x.key===F?{...x,attachment:{...P,filename:P.filename||U.name,size:P.size??U.size,mime:P.mime??U.type}}:x))}).catch(P=>{u(O=>O.map(x=>x.key===F?{...x,status:"error",errorMsg:P instanceof Error?P.message:String(P)}:x))})},[i,s,l]),N=k.useCallback(w=>{u(z=>z.filter(E=>E.key!==w))},[]),v=k.useCallback(()=>{if(!b)return;const w=a.trim(),z=m.map(E=>E.attachment);t(w,z.length>0?z:void 0),o(""),u([]),p.current&&(p.current.style.height="auto")},[b,a,m,t]),L=k.useCallback(w=>{S.handleKeyDown(w)||w.key==="Enter"&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),v())},[v,S.handleKeyDown]),_=k.useCallback(w=>{o(w.target.value);const z=w.target;z.style.height="auto",z.style.height=Math.min(z.scrollHeight,90)+"px"},[]),B=k.useCallback(()=>{var w;f||(w=p.current)==null||w.focus()},[f]);return d.jsxs("div",{className:"relative z-[2] shrink-0 px-[15px] pb-2.5",children:[S.isOpen&&d.jsx(Ld,{items:S.items,activeIndex:S.activeIndex,onSelect:j}),l.length>0&&d.jsx("div",{className:"sa-attachment-tray mb-1.5",onClick:w=>w.stopPropagation(),children:l.map(w=>d.jsxs("span",{className:`sa-attachment-tray-chip ${w.status==="error"?"sa-attachment-tray-chip-error":""}`,title:w.status==="error"?`上传失败:${w.errorMsg??""}`:w.file.name,children:[d.jsx(J,{name:"file-text",size:13,color:w.status==="error"?"#ef4444":"#6366f1"}),d.jsx("span",{className:"sa-attachment-tray-chip-name",children:w.file.name}),d.jsx("span",{className:"sa-attachment-tray-chip-size",children:w.attachment?aa(w.file.size):w.status==="error"?"失败":w.percent!=null?`${Math.min(99,Math.round(w.percent))}%`:"上传中…"}),d.jsx("button",{type:"button",className:"sa-attachment-tray-chip-remove","aria-label":`移除附件 ${w.file.name}`,onClick:()=>N(w.key),children:"✕"})]},w.key))}),d.jsxs("form",{className:`sa-input-form relative flex min-h-[70px] cursor-text flex-col gap-1 rounded-[5px] p-2 ${C?"sa-input-form-active":""} ${f?"sa-input-form-streaming":""}`,onClick:B,onSubmit:w=>{w.preventDefault(),v()},children:[d.jsx("textarea",{ref:p,className:"sa-input-field min-h-[34px] w-full resize-none border-none bg-transparent p-0 text-[14px] leading-[1.5] text-[#333] outline-none placeholder:text-[#B8B8B8]",value:a,onChange:_,onKeyDown:L,placeholder:f?"回答生成中,请稍候…":"发消息或创建任务... /使用技能",rows:1,disabled:f}),d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[h&&!f&&d.jsx("button",{type:"button",className:"sa-attach-btn mr-auto","aria-label":"添加附件",title:"添加附件",onClick:()=>{var w;return(w=c.current)==null?void 0:w.click()},children:d.jsx(Rd,{size:15})}),d.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:A,"aria-label":"选择附件"}),!f&&d.jsxs("span",{className:"sa-send-hint","aria-hidden":"true",children:[d.jsx("kbd",{className:"sa-send-kbd",children:Pd?"⌘":"Ctrl"}),d.jsx("span",{children:"+"}),d.jsx("kbd",{className:"sa-send-kbd",children:"Enter"}),d.jsx("span",{children:"发送"})]}),f?d.jsx("button",{type:"button",className:"sa-send-btn sa-send-btn-active","aria-label":"停止生成",title:"停止生成",onClick:n,children:d.jsx("span",{className:"sa-stop-icon"})}):d.jsx("button",{type:"submit",className:`sa-send-btn ${b?"sa-send-btn-active":""}`,"aria-label":"发送",title:"发送",disabled:!b,children:d.jsx("img",{src:de.sendSolid,alt:"发送",width:14,height:14,draggable:!1})})]})]}),d.jsx("div",{className:"mt-3 text-center text-[11px] leading-none text-[#B8B8B8]",children:"所有内容均由AI生成仅供参考"})]})}function Fd({artifact:e}){const[t,n]=k.useState(null),[r,i]=k.useState(null),[s,a]=k.useState(!0),[o,l]=k.useState(null);return k.useEffect(()=>{let u=!1;a(!0),l(null),n(null),i(null);async function p(){try{if(e.type==="pdf"){u||a(!1);return}if(e.type==="md"){const c=await fetch(e.url);if(!c.ok)throw new Error(`HTTP ${c.status}`);const h=await c.text();u||(i(h),a(!1));return}if(e.type==="html"){const c=await fetch(e.url);if(!c.ok)throw new Error(`HTTP ${c.status}`);const h=await c.text(),f=(await Promise.resolve().then(()=>require("./purify.es-Dsdnkgrg.cjs"))).default;u||(n(f.sanitize(h,{FORCE_BODY:!0,ADD_ATTR:["target"]})),a(!1));return}if(e.type==="docx"){const c=await fetch(e.url);if(!c.ok)throw new Error(`HTTP ${c.status}`);const h=await c.arrayBuffer(),m=await(await Promise.resolve().then(()=>require("./mammoth.browser-ClkRBm1A.cjs")).then(C=>C.mammoth_browser)).convertToHtml({arrayBuffer:h}),y=(await Promise.resolve().then(()=>require("./purify.es-Dsdnkgrg.cjs"))).default;u||(n(y.sanitize(m.value,{FORCE_BODY:!0,ADD_ATTR:["target"]})),a(!1));return}u||(a(!1),l(`不支持预览「${e.type}」类型`))}catch(c){u||(a(!1),l(c instanceof Error?c.message:"加载失败"))}}return p(),()=>{u=!0}},[e]),s?d.jsx("div",{className:"sa-drawer-preview-loading",children:"加载中"}):o?d.jsxs("div",{className:"sa-drawer-preview-error",children:[o,d.jsx("button",{className:"sa-drawer-btn-sm",onClick:()=>void kt(e),children:"下载查看"})]}):e.type==="pdf"?d.jsx("iframe",{src:e.url,title:e.filename,className:"sa-drawer-preview-iframe",sandbox:"allow-scripts"}):r!==null?d.jsx("div",{className:"sa-drawer-preview-html-scroll",children:d.jsx("div",{className:"sa-drawer-preview-html sa-text-part",children:d.jsx(Ti,{remarkPlugins:[Ji],children:r})})}):t!==null?d.jsx("div",{className:"sa-drawer-preview-html-scroll",children:d.jsx("div",{className:"sa-drawer-preview-html sa-text-part",dangerouslySetInnerHTML:{__html:t}})}):null}function _d({artifacts:e,initialArtifact:t,onClose:n}){const[r,i]=k.useState(t?{mode:"preview",artifact:t}:{mode:"list"}),[s,a]=k.useState(!1),o=k.useRef(null),[l,u]=k.useState(340),p=k.useRef(null);k.useEffect(()=>{t&&(o.current&&(clearTimeout(o.current),o.current=null,a(!1)),i({mode:"preview",artifact:t}))},[t]);const c=k.useCallback(()=>{a(!0),o.current=setTimeout(()=>{o.current=null,n()},240)},[n]);k.useEffect(()=>()=>{var y;o.current&&clearTimeout(o.current),(y=p.current)==null||y.call(p)},[]);const h=k.useCallback(y=>{i({mode:"preview",artifact:y})},[]),f=k.useCallback(()=>{i({mode:"list"})},[]);k.useEffect(()=>{const y=C=>{C.key==="Escape"&&c()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[c]);const m=k.useCallback(y=>{y.preventDefault();const C=y.clientX,b=l,j=A=>{const N=C-A.clientX;u(Math.max(240,Math.min(window.innerWidth*.7,b+N)))},S=()=>{document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",S),document.body.style.cursor="",document.body.style.userSelect="",p.current=null};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",j),document.addEventListener("mouseup",S),p.current=S},[l]);return d.jsxs("div",{className:`sa-artifact-drawer ${s?"sa-drawer-closing":""}`,style:{width:l},children:[d.jsx("div",{className:"sa-drawer-resize-handle",onMouseDown:m}),d.jsxs("div",{className:"sa-artifact-drawer-header",children:[r.mode==="preview"?d.jsxs(d.Fragment,{children:[d.jsx("button",{className:"sa-drawer-btn",onClick:f,title:"返回列表","aria-label":"返回列表",children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M15 18l-6-6 6-6"})})}),d.jsx("span",{className:"sa-artifact-drawer-title",children:r.artifact.filename})]}):d.jsxs(d.Fragment,{children:[d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{flexShrink:0},children:[d.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),d.jsx("polyline",{points:"14 2 14 8 20 8"})]}),d.jsx("span",{className:"sa-artifact-drawer-title",children:"会话产物"})]}),d.jsx("div",{style:{flex:1}}),r.mode==="preview"&&d.jsx("button",{className:"sa-drawer-btn",onClick:()=>void kt(r.artifact),title:"下载","aria-label":"下载",children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})})}),d.jsx("button",{className:"sa-drawer-btn",onClick:c,title:"关闭","aria-label":"关闭",children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),d.jsx("div",{className:"sa-artifact-drawer-body",children:r.mode==="list"?e.length===0?d.jsx("div",{className:"sa-drawer-empty",children:"暂无产物"}):d.jsx("ul",{className:"sa-drawer-file-list",role:"list",children:e.map((y,C)=>d.jsxs("li",{className:"sa-drawer-file-card",onClick:()=>h(y),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),h(y))},tabIndex:0,role:"button","aria-label":`预览 ${y.filename}`,children:[d.jsx("div",{className:"sa-drawer-file-icon",children:d.jsx("span",{className:"sa-artifact-chip-type",children:_r(y.type)})}),d.jsxs("div",{className:"sa-drawer-file-info",children:[d.jsx("span",{className:"sa-drawer-file-name",children:y.filename}),d.jsx("span",{className:"sa-drawer-file-size",children:Fr(y.size)})]}),d.jsx("button",{className:"sa-drawer-btn",title:"下载","aria-label":`下载 ${y.filename}`,onClick:b=>{b.stopPropagation(),kt(y)},children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})})})]},y.id||`artifact-${C}`))}):d.jsx("div",{className:"sa-drawer-view-enter",children:d.jsx(Fd,{artifact:r.artifact})})})]})}function ca({page:e,onBack:t,centered:n}){k.useEffect(()=>{const i=s=>{s.key==="Escape"&&t()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[t]);const r=k.isValidElement(e.component)?k.cloneElement(e.component,{close:t}):k.createElement(e.component,{close:t});return d.jsxs("div",{className:`sa-page-overlay ${n?"sa-page-overlay-centered":""}`,children:[d.jsxs("div",{className:"sa-page-overlay-bar",children:[d.jsx("button",{className:"sa-drawer-btn",onClick:t,title:"返回","aria-label":"返回",children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("path",{d:"M15 18l-6-6 6-6"})})}),e.title&&d.jsx("span",{className:"sa-page-overlay-title",children:e.title})]}),d.jsx("div",{className:"sa-page-overlay-body",children:r})]})}const Od="mx-auto w-full max-w-[800px]";function pa({contentClassName:e,centered:t,composerClassName:n,thread:r,composer:i,artifactPreview:s}){const{activePanel:a,closePanel:o,messagesLoading:l,isArtifactDrawerOpen:u,allArtifacts:p,activePreviewArtifact:c,toggleArtifactDrawer:h}=Te();if(a)return d.jsx(ca,{page:a,onBack:o,centered:t});const f=t?Od:"";return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:`${e} ${f}`,children:[l?d.jsxs("div",{className:"sa-messages-loading",children:[d.jsx("span",{className:"sa-loading-spinner"}),"加载对话..."]}):r,s&&u&&d.jsx(_d,{artifacts:p,initialArtifact:c,onClose:h})]}),n?d.jsx("div",{className:`${n} ${f}`,children:i}):i]})}function Bd({isOpen:e,onClose:t,title:n,slots:r,welcomeMessage:i,suggestedPrompts:s,avatar:a,artifactPreview:o,capabilities:l,quickLinks:u,logo:p,defaultWidth:c,defaultHeight:h,showTimestamp:f}){const{status:m,sendMessage:y,stop:C,toggleThreadList:b,setThreadListOpen:j,isThreadListOpen:S,toggleArtifactDrawer:A,allArtifacts:N,activePanel:v,closePanel:L,messages:_,messagesLoading:B,conversations:w,activeConversationId:z,switchConversation:E,newConversation:R,deleteConversation:T,renameConversation:F,hasMore:U,loadMoreConversations:V}=Te(),{width:P,position:O,hasCustomPosition:x,isMaximized:X,totalWidth:$,windowHeight:g,startWindowDrag:W,startResize:te,toggleMaximize:ee,reset:ue,setLockedHeight:ae}=ya({defaultWidth:c??pe.DEFAULT_WIDTH,defaultHeight:h??pe.DEFAULT_HEIGHT,sidebarWidth:0}),q=k.useRef(null),se=k.useRef(null),le=!B&&_.length===0,je=!B&&_.length>0,Ee=!!v;k.useEffect(()=>{e||(ue(),L())},[e,ue,L]),k.useEffect(()=>{j(X?q.current??!0:se.current??!1)},[X,j]),k.useEffect(()=>{je||ae(null)},[je,ae]);const Lt=ka({enabled:e&&je&&!X&&!Ee,contentSelector:".sa-panel-content",defaultHeight:h??pe.DEFAULT_HEIGHT,onHeightChange:ae});if(!e)return null;const Ke=r.Header,Qe=r.Composer,Re=r.ThreadList,Dt=()=>{const K=!S;b(),X?q.current=K:se.current=K},Je=200,Ze=S&&!X,ke="var(--sa-radius, 16px)",ht=Ze?`0px ${ke} ${ke} 0px`:`${ke} ${ke} ${ke} ${ke}`,Mt=x?O.x:window.innerWidth-$-20,Ve=Math.min(Je,Math.max(0,Mt-1)),Pt=x?{width:`${$}px`,height:`${g}px`,left:`${O.x}px`,top:`${O.y}px`}:{width:`${$}px`,height:`${g}px`,right:"20px",bottom:"20px"},I={title:n,onClose:t,onToggleThreadList:Dt,isMaximized:X,onToggleMaximize:ee,showHome:je&&!Ee,onHome:R,artifactCount:Ee||!o?0:N.length,onToggleArtifactDrawer:Ee||!o?void 0:A},M={conversations:w,activeSessionId:z,onSwitch:E,onNew:R,onDelete:T,onRename:F,hasMore:U,onLoadMore:V},Y=d.jsxs("div",{className:`relative flex min-w-0 flex-col bg-white ${X?"flex-1":"h-full shrink-0"}`,style:X?void 0:{width:`${P}px`,borderRadius:ht,overflow:"hidden"},children:[le&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"sa-home-gradient pointer-events-none absolute inset-x-0 top-0 z-0 h-[238px] opacity-10"}),d.jsx("div",{className:"sa-home-gradient-fade pointer-events-none absolute inset-x-0 top-0 z-[1] h-[238px]"})]}),d.jsx("div",{className:`relative z-20 ${le||X?"":"bg-white"} ${X?"cursor-default":"cursor-grab active:cursor-grabbing"}`,onMouseDown:X?void 0:W,children:Ke?d.jsx(Ke,{...I}):d.jsx(Hr,{...I})}),d.jsx(pa,{contentClassName:`sa-panel-content relative z-[2] ${le?"sa-home-view":""}`,centered:X,composerClassName:"shrink-0",artifactPreview:o,thread:d.jsx(Ln,{slots:r,welcomeMessage:i,suggestedPrompts:s,avatar:a,artifactPreview:o,capabilities:l,quickLinks:u,logo:p,showTimestamp:f}),composer:Qe?d.jsx(Qe,{status:m,onSend:y,onStop:C}):d.jsx(Dn,{})})]});return X?d.jsx("div",{className:"fixed inset-0 z-[var(--sa-z-index,9999)] flex animate-sa-fade-in flex-col justify-end bg-black/30",children:d.jsxs("div",{className:"flex h-[calc(100%_-_48px)] w-full animate-sa-slide-up-full flex-row overflow-hidden bg-[#F5F5F5] shadow-[0_-12px_48px_rgba(0,0,0,0.25)]",style:{borderRadius:"var(--sa-radius, 16px) var(--sa-radius, 16px) 0px 0px"},children:[S&&(Re?d.jsx(Re,{...M}):d.jsx(Zt,{width:220})),Y]})}):d.jsxs("div",{ref:Lt,className:"fixed z-[var(--sa-z-index,9999)] flex animate-sa-window-in flex-row overflow-visible border border-[#DADADA] bg-white ",style:{...Pt,borderRadius:ht},children:[d.jsx("div",{className:"sa-resize-handle absolute bottom-0 left-[-3px] top-0 z-20 w-[6px] cursor-col-resize",onMouseDown:K=>te(K)}),Ze&&(Re?d.jsx("div",{className:"absolute -top-px -bottom-px -left-px z-10 overflow-hidden border border-r-0 border-[#DADADA] bg-[#FAFAFA] ",style:{width:Ve,transform:`translateX(-${Ve}px)`,borderRadius:`${ke} 0px 0px ${ke}`},children:d.jsx(Re,{...M})}):d.jsx("div",{className:"absolute -top-px -bottom-px -left-px z-10 overflow-hidden border border-r-0 border-[#DADADA] bg-[#FAFAFA] ",style:{width:Ve,transform:`translateX(-${Ve}px)`,borderRadius:`${ke} 0px 0px ${ke}`},children:d.jsx(Zt,{width:Je})})),Y]})}const $d=()=>{};function Hd({conversations:e,activeSessionId:t,onSwitch:n,onNew:r,onDelete:i,onRename:s,isCollapsed:a,onToggleCollapse:o,hasMore:l,onLoadMore:u,conversationsLoading:p}){const[c,h]=k.useState(null),[f,m]=k.useState(null),[y,C]=k.useState(""),[b,j]=k.useState(null),S=k.useRef(null);k.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]);const A=k.useCallback((w,z)=>{z.stopPropagation(),c===w?(i(w),h(null)):(h(w),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>h(null),3e3))},[c,i]),N=k.useCallback((w,z,E)=>{E.stopPropagation(),m(w),C(z??"")},[]),v=k.useCallback(w=>{y.trim()&&s(w,y.trim()),m(null)},[y,s]),L=k.useRef(null),_=k.useCallback(()=>{const w=L.current;!w||!l||!u||w.scrollHeight-w.scrollTop-w.clientHeight<50&&u()},[l,u]),B=k.useMemo(()=>Ur(e),[e]);return a?d.jsxs("div",{className:"flex w-12 shrink-0 flex-col items-center gap-1 border-r border-[#ECECEC] bg-[#FAFAFA] py-3",children:[d.jsx("button",{type:"button",className:"sa-tip relative flex h-7 w-7 items-center justify-center rounded-md text-[#666] transition-colors hover:bg-white","data-tooltip":"展开",onClick:o,children:d.jsx(J,{name:"panel-left",size:18})}),d.jsx("button",{type:"button",className:"sa-tip relative flex h-7 w-7 items-center justify-center rounded-md text-[#666] transition-colors hover:bg-white","data-tooltip":"新建对话",onClick:()=>{r(),o()},children:d.jsx("img",{src:de.messageCreate,alt:"",width:18,height:18})})]}):d.jsxs("div",{className:"relative flex w-[220px] shrink-0 flex-col border-r border-[#ECECEC] bg-[#FAFAFA] p-3",children:[d.jsxs("div",{className:"mb-4 flex shrink-0 items-center gap-1.5",children:[d.jsxs("button",{type:"button",className:"sa-new-chat flex h-8 flex-1 items-center justify-center gap-2 rounded-md text-[14px] font-medium transition-colors",onClick:r,children:[d.jsx("img",{src:de.messageCreate,alt:"",width:18,height:18}),d.jsx("span",{className:"sa-new-chat-text whitespace-nowrap",children:"新建对话"})]}),d.jsx("button",{type:"button",className:"sa-tip relative flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-[#666] transition-colors hover:bg-white","data-tooltip":"收起侧边栏",onClick:o,children:d.jsx(J,{name:"panel-left-close",size:16})})]}),d.jsxs("div",{className:"px-1 pb-2.5",children:[d.jsx("div",{className:"mb-1 text-[14px] font-semibold text-[#333]",children:"历史对话"}),d.jsx("div",{className:"text-[11px] text-[#999]",children:"展示最近的会话记录"})]}),d.jsxs("div",{ref:L,className:"flex-1 overflow-y-auto",onScroll:_,children:[p&&e.length===0&&d.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:"加载中..."}),!p&&e.length===0&&d.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:"暂无记录"}),B.map(w=>d.jsxs("div",{className:"mb-1",children:[d.jsx("div",{className:"px-1 pb-1 pt-2 text-[11px] text-[#A0A0A0]",children:w.label}),w.items.map(z=>{const E=z.sessionId===t,R=c===z.sessionId;return d.jsx("div",{className:`group relative mb-0.5 flex h-8 w-full cursor-pointer items-center gap-1 rounded-md px-0.5 text-[13px] transition-colors ${E?"bg-[#E8F1FE]":"hover:bg-[#E8F1FE]"}`,onClick:()=>{f!==z.sessionId&&n(z.sessionId)},onMouseEnter:T=>{if(f===z.sessionId)return;const F=T.currentTarget.getBoundingClientRect();j({text:z.title||"新会话",x:F.right+8,y:F.top+F.height/2})},onMouseLeave:()=>j(null),children:f===z.sessionId?d.jsx("input",{className:"w-full rounded border border-[var(--sa-primary)] bg-white px-1.5 py-0.5 text-[12px] outline-none",value:y,onChange:T=>C(T.target.value),onBlur:()=>v(z.sessionId),onKeyDown:T=>{T.key==="Enter"&&v(z.sessionId),T.key==="Escape"&&m(null)},onClick:T=>T.stopPropagation(),autoFocus:!0}):d.jsxs(d.Fragment,{children:[d.jsx("img",{src:de.message,alt:"",width:16,height:16,className:"shrink-0 opacity-60"}),d.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-[#333]",children:z.title||"新会话"}),d.jsxs("span",{className:"hidden shrink-0 items-center gap-0.5 group-hover:flex",children:[d.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded text-[#999] hover:bg-white/70 hover:text-[var(--sa-primary)]",onClick:T=>N(z.sessionId,z.title,T),title:"重命名",children:d.jsx(J,{name:"pen",size:12})}),d.jsx("button",{type:"button",className:`flex h-5 w-5 items-center justify-center rounded ${R?"bg-[#fee2e2] text-[#ef4444]":"text-[#999] hover:bg-white/70 hover:text-[#ef4444]"}`,onClick:T=>A(z.sessionId,T),title:R?"确认删除":"删除",children:d.jsx(J,{name:R?"x":"trash2",size:12})})]})]})},z.sessionId)})]},w.label)),l&&d.jsx("div",{className:"px-0.5 py-2 text-center text-[11px] text-[#C0C0C0]",children:"向下滚动加载更多"})]}),b&&d.jsx("div",{className:"pointer-events-none fixed z-[10001] whitespace-nowrap rounded border border-[#E8E8E8] bg-white px-2.5 py-1.5 text-[12px] leading-[1.4] text-[#333] shadow-[0_2px_8px_rgba(0,0,0,0.12)]",style:{left:b.x,top:b.y,transform:"translateY(-50%)"},children:b.text})]})}function da({title:e,slots:t,welcomeMessage:n,suggestedPrompts:r,capabilities:i,quickLinks:s,logo:a,sidebarDefaultOpen:o=!0,onClose:l,avatar:u,artifactPreview:p,showTimestamp:c}){const{status:h,sendMessage:f,stop:m,conversations:y,activeConversationId:C,switchConversation:b,newConversation:j,deleteConversation:S,renameConversation:A,toggleArtifactDrawer:N,allArtifacts:v,activePanel:L,closePanel:_,hasMore:B,loadMoreConversations:w,conversationsLoading:z}=Te(),[E,R]=k.useState(o),T=k.useCallback(()=>R(O=>!O),[]),F=!!L;k.useEffect(()=>()=>_(),[_]);const U=t.ThreadList,V=t.Composer,P=t.Header;return d.jsxs("div",{className:"sa-fullpage",children:[U?d.jsx("div",{className:`sa-fp-sidebar-wrapper ${E?"":"sa-fp-sidebar-wrapper-collapsed"}`,children:d.jsx(U,{conversations:y,activeSessionId:C,onSwitch:b,onNew:j,onDelete:S,onRename:A,hasMore:B,onLoadMore:w})}):d.jsx(Hd,{conversations:y,activeSessionId:C,onSwitch:b,onNew:j,onDelete:S,onRename:A,isCollapsed:!E,onToggleCollapse:T,hasMore:B,onLoadMore:w,conversationsLoading:z}),d.jsxs("div",{className:"sa-fp-main",children:[P?d.jsx(P,{title:e,onClose:l??$d,onToggleThreadList:T,artifactCount:F||!p?0:v.length,onToggleArtifactDrawer:F||!p?void 0:N}):d.jsxs("div",{className:"sa-fp-header",children:[d.jsx("div",{className:"sa-fp-header-title",children:e}),d.jsx("div",{className:"sa-fp-header-actions",children:!F&&p&&v.length>0&&d.jsxs("button",{className:"sa-fp-header-btn sa-header-btn-artifact",onClick:N,title:"会话产物",children:[d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[d.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),d.jsx("polyline",{points:"14 2 14 8 20 8"})]}),d.jsx("span",{children:"产物"})]})})]}),d.jsx(pa,{contentClassName:"sa-fp-content-row",artifactPreview:p,thread:d.jsx(Ln,{slots:t,welcomeMessage:n,suggestedPrompts:r,capabilities:i,quickLinks:s,logo:a,avatar:u,artifactPreview:p,showTimestamp:c}),composer:V?d.jsx(V,{status:h,onSend:f,onStop:m}):d.jsx(Dn,{})})]})]})}function fa(e){const{sdk:t,mode:n="floating",slots:r={},hooks:i={},welcomeMessage:s,suggestedPrompts:a,title:o="AI Assistant",initialOpen:l=!1,onOpenChange:u,sidebarDefaultOpen:p,avatar:c,artifactPreview:h,capabilities:f,quickLinks:m,logo:y,triggerLogo:C,theme:b,showTimestamp:j,attachmentUploader:S,nosUpload:A}=e,[N,v]=k.useState(l);k.useEffect(()=>{v(l)},[l]);const L=k.useCallback(()=>{var z,E;const w=!N;v(w),u==null||u(w),w?(z=i.onOpen)==null||z.call(i):(E=i.onClose)==null||E.call(i)},[N,i,u]),_=k.useCallback(()=>{var w;v(!1),u==null||u(!1),(w=i.onClose)==null||w.call(i)},[i,u]),B=r.Trigger??$r;return n==="fullpage"?N?d.jsx(Jt,{sdk:t,hooks:i,attachmentUploader:S,nosUpload:A,children:d.jsx(da,{title:o,slots:r,welcomeMessage:s,suggestedPrompts:a,capabilities:f,quickLinks:m,logo:y,sidebarDefaultOpen:p,onClose:_,avatar:c,artifactPreview:h,showTimestamp:j})}):null:d.jsxs(Jt,{sdk:t,hooks:i,attachmentUploader:S,nosUpload:A,children:[d.jsx(B,{isOpen:N,onClick:L,triggerLogo:C}),d.jsx(Bd,{isOpen:N,onClose:_,title:o,slots:r,welcomeMessage:s,suggestedPrompts:a,avatar:c,artifactPreview:h,capabilities:f,quickLinks:m,logo:y,defaultWidth:b==null?void 0:b.panelWidth,defaultHeight:b==null?void 0:b.panelHeight,showTimestamp:j})]})}const ha=`
27
+ `,...s.current()});return/^[\t ]/.test(u)&&(u=ct(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),l(),o(),u}Ri.peek=sd;function Ri(e){return e.value||""}function sd(){return"<"}Pi.peek=od;function Pi(e,t,n,r){const i=zn(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),u+=l.move(")"),a(),u}function od(){return"!"}Fi.peek=ld;function Fi(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const u=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!u||u!==c?l+=o.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function ld(){return"!"}_i.peek=ud;function _i(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],o=n.compilePattern(a);let l;if(a.atBreak)for(;l=o.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function ud(){return"`"}function Oi(e,t){const n=yn(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Bi.peek=cd;function Bi(e,t,n,r){const i=zn(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(Oi(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let c=a.move("<");return c+=a.move(n.containerPhrasing(e,{before:c,after:">",...a.current()})),c+=a.move(">"),o(),n.stack=d,c}o=n.enter("link"),l=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),l()),u+=a.move(")"),o(),u}function cd(e,t,n){return Oi(e,n)?"<":"["}$i.peek=dd;function $i(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!u||u!==c?l+=o.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function dd(){return"["}function An(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function pd(e){const t=An(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function fd(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Hi(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function hd(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?fd(n):An(n);const o=e.ordered?a==="."?")":".":pd(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Hi(n)===a&&d){let c=-1;for(;++c<e.children.length;){const h=e.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=o),n.bulletCurrent=a;const u=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),u}function gd(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function md(e,t,n,r){const i=gd(n);let s=n.bulletCurrent||An(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(a-s.length)),o.shift(a);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),d);return l(),u;function d(c,h,f){return h?(f?"":" ".repeat(a))+c:(f?s:s+" ".repeat(a-s.length))+c}}function xd(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}const bd=At(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function wd(e,t,n,r){return(e.children.some(function(a){return bd(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function yd(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ui.peek=kd;function Ui(e,t,n,r){const i=yd(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=l.charCodeAt(0),d=jt(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(l=ct(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=jt(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+ct(c));const f=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+l+f}function kd(e,t,n){return n.options.strong||"*"}function vd(e,t,n,r){return n.safe(e.value,r)}function Cd(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Sd(e,t,n){const r=(Hi(n)+(n.options.ruleSpaces?" ":"")).repeat(Cd(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Vi={blockquote:Yc,break:Er,code:Zc,definition:td,emphasis:Mi,hardBreak:Er,heading:ad,html:Ri,image:Pi,imageReference:Fi,inlineCode:_i,link:Bi,linkReference:$i,list:hd,listItem:md,paragraph:xd,root:wd,strong:Ui,text:vd,thematicBreak:Sd};function jd(){return{enter:{table:Ed,tableData:Ir,tableHeader:Ir,tableRow:Td},exit:{codeText:zd,table:Id,tableData:Qt,tableHeader:Qt,tableRow:Qt}}}function Ed(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Id(e){this.exit(e),this.data.inTable=void 0}function Td(e){this.enter({type:"tableRow",children:[]},e)}function Qt(e){this.exit(e)}function Ir(e){this.enter({type:"tableCell",children:[]},e)}function zd(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Ad));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Ad(e,t){return t==="|"?t:e}function Nd(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
28
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:l,tableRow:o}};function a(f,m,y,C){return u(d(f,y,C),f.align)}function o(f,m,y,C){const b=c(f,y,C),j=u([b]);return j.slice(0,j.indexOf(`
29
+ `))}function l(f,m,y,C){const b=y.enter("tableCell"),j=y.enter("phrasing"),S=y.containerPhrasing(f,{...C,before:s,after:s});return j(),b(),S}function u(f,m){return qc(f,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function d(f,m,y){const C=f.children;let b=-1;const j=[],S=m.enter("table");for(;++b<C.length;)j[b]=c(C[b],m,y);return S(),j}function c(f,m,y){const C=f.children;let b=-1;const j=[],S=m.enter("tableRow");for(;++b<C.length;)j[b]=l(C[b],f,m,y);return S(),j}function h(f,m,y){let C=Vi.inlineCode(f,m,y);return y.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function Ld(){return{exit:{taskListCheckValueChecked:Tr,taskListCheckValueUnchecked:Tr,paragraph:Md}}}function Dd(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Rd}}}function Tr(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Md(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Rd(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(a);let l=Vi.listItem(e,t,n,{...r,...o.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(d){return d+a}}function Pd(){return[hc(),Rc(),Oc(),jd(),Ld()]}function Fd(e){return{extensions:[gc(),Pc(e),Bc(),Nd(e),Dd()]}}const _d={tokenize:Vd,partial:!0},qi={tokenize:qd,partial:!0},Wi={tokenize:Wd,partial:!0},Yi={tokenize:Yd,partial:!0},Od={tokenize:Gd,partial:!0},Gi={name:"wwwAutolink",tokenize:Hd,previous:Ki},Xi={name:"protocolAutolink",tokenize:Ud,previous:Qi},Le={name:"emailAutolink",tokenize:$d,previous:Ji},ze={};function Bd(){return{text:ze}}let _e=48;for(;_e<123;)ze[_e]=Le,_e++,_e===58?_e=65:_e===91&&(_e=97);ze[43]=Le;ze[45]=Le;ze[46]=Le;ze[95]=Le;ze[72]=[Le,Xi];ze[104]=[Le,Xi];ze[87]=[Le,Gi];ze[119]=[Le,Gi];function $d(e,t,n){const r=this;let i,s;return a;function a(c){return!pn(c)||!Ji.call(r,r.previous)||Nn(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(c))}function o(c){return pn(c)?(e.consume(c),o):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(Od,d,u)(c):c===45||c===95||fe(c)?(s=!0,e.consume(c),l):d(c)}function u(c){return e.consume(c),i=!0,l}function d(c){return s&&i&&ge(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function Hd(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Ki.call(r,r.previous)||Nn(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(_d,e.attempt(qi,e.attempt(Wi,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Ud(e,t,n){const r=this;let i="",s=!1;return a;function a(c){return(c===72||c===104)&&Qi.call(r,r.previous)&&!Nn(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),o):n(c)}function o(c){if(ge(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),o;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),s?u:(s=!0,l)):n(c)}function u(c){return c===null||vt(c)||ie(c)||He(c)||It(c)?n(c):e.attempt(qi,e.attempt(Wi,d),n)(c)}function d(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function Vd(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function qd(e,t,n){let r,i,s;return a;function a(u){return u===46||u===95?e.check(Yi,l,o)(u):u===null||ie(u)||He(u)||u!==45&&It(u)?l(u):(s=!0,e.consume(u),a)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function l(u){return i||r||!s?n(u):t(u)}}function Wd(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(Yi,t,s)(a):a===null||ie(a)||He(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function Yd(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),s):o===93?(e.consume(o),i):o===60||o===null||ie(o)||He(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||ie(o)||He(o)?t(o):r(o)}function s(o){return ge(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):ge(o)?(e.consume(o),a):n(o)}}function Gd(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return fe(s)?n(s):t(s)}}function Ki(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ie(e)}function Qi(e){return!ge(e)}function Ji(e){return!(e===47||pn(e))}function pn(e){return e===43||e===45||e===46||e===95||fe(e)}function Nn(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Xd={tokenize:rp,partial:!0};function Kd(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:ep,continuation:{tokenize:tp},exit:np}},text:{91:{name:"gfmFootnoteCall",tokenize:Zd},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Qd,resolveTo:Jd}}}}function Qd(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const u=je(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function Jd(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function Zd(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(s>999||c===93&&!a||c===null||c===91||ie(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(je(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return ie(c)||(a=!0),s++,e.consume(c),c===92?d:u}function d(c){return c===91||c===92||c===93?(e.consume(c),s++,u):u(c)}}function ep(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(a>999||m===93&&!o||m===null||m===91||ie(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return s=je(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ie(m)||(o=!0),a++,e.consume(m),m===92?c:d}function c(m){return m===91||m===92||m===93?(e.consume(m),a++,d):d(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(s)||i.push(s),Z(e,f,"gfmFootnoteDefinitionWhitespace")):n(m)}function f(m){return t(m)}}function tp(e,t,n){return e.check(pt,t,e.attempt(Xd,t,n))}function np(e){e.exit("gfmFootnoteDefinition")}function rp(e,t,n){const r=this;return Z(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function ip(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let u=l;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[l][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[l][1].end)},c={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[l][1].start)},h=[["enter",d,o],["enter",a[u][1],o],["exit",a[u][1],o],["enter",c,o]],f=o.parser.constructs.insideSpan.null;f&&ke(h,h.length,0,Tt(f,a.slice(u+1,l),o)),ke(h,h.length,0,[["exit",c,o],["enter",a[l][1],o],["exit",a[l][1],o],["exit",d,o]]),ke(a,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function s(a,o,l){const u=this.previous,d=this.events;let c=0;return h;function h(m){return u===126&&d[d.length-1][1].type!=="characterEscape"?l(m):(a.enter("strikethroughSequenceTemporary"),f(m))}function f(m){const y=Ye(u);if(m===126)return c>1?l(m):(a.consume(m),c++,f);if(c<2&&!n)return l(m);const C=a.exit("strikethroughSequenceTemporary"),b=Ye(m);return C._open=!b||b===2&&!!y,C._close=!y||y===2&&!!b,o(m)}}}class ap{constructor(){this.map=[]}add(t,n,r){sp(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function sp(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function op(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function lp(){return{flow:{null:{name:"table",tokenize:up,resolveAll:cp}}}}function up(e,t,n){const r=this;let i=0,s=0,a;return o;function o(w){let z=r.events.length-1;for(;z>-1;){const T=r.events[z][1].type;if(T==="lineEnding"||T==="linePrefix")z--;else break}const E=z>-1?r.events[z][1].type:null,F=E==="tableHead"||E==="tableRow"?v:l;return F===v&&r.parser.lazy[r.now().line]?n(w):F(w)}function l(w){return e.enter("tableHead"),e.enter("tableRow"),u(w)}function u(w){return w===124||(a=!0,s+=1),d(w)}function d(w){return w===null?n(w):H(w)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),f):n(w):Q(w)?Z(e,d,"whitespace")(w):(s+=1,a&&(a=!1,i+=1),w===124?(e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),c(w)))}function c(w){return w===null||w===124||ie(w)?(e.exit("data"),d(w)):(e.consume(w),w===92?h:c)}function h(w){return w===92||w===124?(e.consume(w),c):c(w)}function f(w){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(w):(e.enter("tableDelimiterRow"),a=!1,Q(w)?Z(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):m(w))}function m(w){return w===45||w===58?C(w):w===124?(a=!0,e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),y):L(w)}function y(w){return Q(w)?Z(e,C,"whitespace")(w):C(w)}function C(w){return w===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(w),e.exit("tableDelimiterMarker"),b):w===45?(s+=1,b(w)):w===null||H(w)?A(w):L(w)}function b(w){return w===45?(e.enter("tableDelimiterFiller"),j(w)):L(w)}function j(w){return w===45?(e.consume(w),j):w===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(w),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(w))}function S(w){return Q(w)?Z(e,A,"whitespace")(w):A(w)}function A(w){return w===124?m(w):w===null||H(w)?!a||i!==s?L(w):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(w)):L(w)}function L(w){return n(w)}function v(w){return e.enter("tableRow"),N(w)}function N(w){return w===124?(e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),N):w===null||H(w)?(e.exit("tableRow"),t(w)):Q(w)?Z(e,N,"whitespace")(w):(e.enter("data"),_(w))}function _(w){return w===null||w===124||ie(w)?(e.exit("data"),N(w)):(e.consume(w),w===92?B:_)}function B(w){return w===92||w===124?(e.consume(w),_):_(w)}}function cp(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,d,c;const h=new ap;for(;++n<e.length;){const f=e[n],m=f[1];f[0]==="enter"?m.type==="tableHead"?(o=!1,l!==0&&(zr(h,t,l,u,d),d=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,c=void 0,s=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",d,t]])),i=m.type==="tableDelimiterRow"?2:d?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],c=bt(h,t,s,i,void 0,c),s=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],c=bt(h,t,s,i,void 0,c)),s=a,a=[s[1],n,0,0])):m.type==="tableHead"?(o=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,s[1]!==0?(a[0]=a[1],c=bt(h,t,s,i,n,c)):a[1]!==0&&(c=bt(h,t,a,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&zr(h,t,l,u,d),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=op(t.events,n))}return e}function bt(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},We(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=We(t.events,n[1]);if(s={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=We(t.events,n[2]),d=We(t.events,n[3]),c={type:o,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,y=n[3]-n[2]-1;e.add(m,y,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(s.end=Object.assign({},We(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function zr(e,t,n,r,i){const s=[],a=We(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function We(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const dp={name:"tasklistCheck",tokenize:fp};function pp(){return{text:{91:dp}}}function fp(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return ie(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return H(l)?t(l):Q(l)?e.check({tokenize:hp},t,n)(l):n(l)}}function hp(e,t,n){return Z(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function gp(e){return si([Bd(),Kd(),ip(e),lp(),pp()])}const mp={};function Zi(e){const t=this,n=e||mp,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(gp(n)),s.push(Pd()),a.push(Fd(n))}function ea({content:e}){return p.jsx("div",{className:"sa-text-part",children:p.jsx(zi,{remarkPlugins:[Zi],children:e})})}const xp="https://at.alicdn.com/t/c/font_5210396_pffyg5g21kn.js";let Ar=!1;function ta(e=xp){if(Ar||typeof document>"u")return;Ar=!0;const t=e.split("?")[0].split("/").pop();if(t&&document.querySelector(`script[src*="${t}"]`))return;const n=document.createElement("script");n.src=e,document.head.appendChild(n)}ta();function J({name:e,size:t=16,color:n="currentColor",className:r,style:i}){return p.jsx("svg",{className:r,style:{width:t,height:t,fill:n,verticalAlign:"middle",...i},"aria-hidden":"true",children:p.jsx("use",{href:`#icon-${e}`})})}function na({content:e}){const[t,n]=k.useState(!1);return p.jsxs("div",{className:"sa-thinking-part",onClick:()=>n(!t),children:[p.jsxs("div",{className:"sa-thinking-header",children:[p.jsx("span",{className:"sa-thinking-icon",children:p.jsx(J,{name:"brain",size:14})}),p.jsx("span",{className:"sa-thinking-label",children:"思考过程"}),p.jsx("span",{className:`sa-thinking-arrow ${t?"expanded":""}`,children:p.jsx(J,{name:"chevron-right",size:12})})]}),t&&p.jsx("div",{className:"sa-thinking-content",children:e})]})}function ra({toolName:e,toolCallId:t,args:n}){const[r,i]=k.useState(!1),[s,a]=k.useState(!1);let o=n;try{o=JSON.stringify(JSON.parse(n),null,2)}catch{}const l=k.useCallback(()=>{var u;(u=navigator.clipboard)==null||u.writeText(o).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)}).catch(()=>{})},[o]);return p.jsxs("div",{className:"sa-tool-call-part",children:[p.jsxs("div",{className:"sa-tool-call-header",onClick:()=>i(!r),children:[p.jsx("span",{className:"sa-tool-icon",children:p.jsx(J,{name:"zap",size:14})}),p.jsxs("span",{className:"sa-tool-name",children:["调用工具: ",e]}),p.jsx("span",{className:`sa-thinking-arrow ${r?"expanded":""}`,children:p.jsx(J,{name:"chevron-right",size:12})})]}),r&&p.jsxs(p.Fragment,{children:[p.jsx("pre",{className:"sa-tool-args",children:o}),p.jsx("div",{className:"sa-tool-result-actions",children:p.jsxs("button",{className:"sa-action-btn",onClick:l,title:"复制",children:[p.jsx(J,{name:s?"circle-check":"copy",size:14})," ",s?"已复制":"复制"]})})]})]})}function Nr({text:e}){const[t,n]=k.useState(!1),r=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)}).catch(()=>{})};return p.jsxs("button",{className:"sa-action-btn",onClick:r,title:"复制",children:[p.jsx(J,{name:t?"circle-check":"copy",size:14})," ",t?"已复制":"复制"]})}function bp({html:e}){const[t,n]=k.useState(null);return k.useEffect(()=>{let r=!1;return Promise.resolve().then(()=>require("./purify.es-Dsdnkgrg.cjs")).then(i=>{r||n(i.default.sanitize(e,{FORCE_BODY:!0,ADD_ATTR:["target"]}))}),()=>{r=!0}},[e]),t===null?null:p.jsx("div",{className:"sa-tool-result-html-scroll",children:p.jsx("div",{className:"sa-tool-result-html sa-text-part",dangerouslySetInnerHTML:{__html:t}})})}function ia({toolName:e,content:t,renderMode:n,html:r}){let i=t;if(i)try{i=JSON.stringify(JSON.parse(i),null,2)}catch{}return p.jsxs("div",{className:"sa-tool-result-part",children:[p.jsxs("div",{className:"sa-tool-result-header",children:[p.jsx("span",{className:"sa-tool-icon",children:p.jsx(J,{name:"circle-check",size:14,color:"#10b981"})}),p.jsx("span",{className:"sa-tool-result-label",children:e||"工具返回"})]}),n==="html"&&r?p.jsxs(p.Fragment,{children:[p.jsx(bp,{html:r}),p.jsx("div",{className:"sa-tool-result-actions",children:p.jsx(Nr,{text:r})})]}):i?p.jsxs(p.Fragment,{children:[p.jsx("pre",{className:"sa-tool-result-content",children:i}),p.jsx("div",{className:"sa-tool-result-actions",children:p.jsx(Nr,{text:i})})]}):p.jsx("pre",{className:"sa-tool-result-content",children:"—"})]})}function aa({content:e,onRetry:t}){return p.jsxs("div",{className:"sa-error-part",children:[p.jsxs("div",{className:"sa-error-content",children:[p.jsx("span",{className:"sa-error-icon",children:p.jsx(J,{name:"triangle-alert",size:14})}),p.jsx("span",{children:e||"发生错误"})]}),t&&p.jsx("button",{className:"sa-error-retry",onClick:t,children:"重试"})]})}function sa(e){return e==null||Number.isNaN(e)?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function wp({attachment:e}){const t=p.jsxs(p.Fragment,{children:[p.jsx(J,{name:"file-text",size:14,color:"#6366f1"}),p.jsx("span",{className:"sa-attachment-chip-name",children:e.filename}),e.size!=null&&p.jsx("span",{className:"sa-attachment-chip-size",children:sa(e.size)})]});return e.url?p.jsx("a",{className:"sa-attachment-chip",href:e.url,target:"_blank",rel:"noreferrer",download:e.filename,title:`下载 ${e.filename}`,children:t}):p.jsx("span",{className:"sa-attachment-chip",title:e.filename,children:t})}function yp({interrupt:e,onRespond:t,disabled:n,answeredAction:r}){var o,l;const i=e.options,s=(typeof(i==null?void 0:i[0])=="string"?i[0]:(o=i==null?void 0:i[0])==null?void 0:o.label)||"确认",a=(typeof(i==null?void 0:i[1])=="string"?i[1]:(l=i==null?void 0:i[1])==null?void 0:l.label)||"取消";return p.jsxs("div",{className:"sa-interrupt-card",children:[p.jsxs("div",{className:"sa-interrupt-content",children:[p.jsx(J,{name:"circle-alert",size:16,color:"#f59e0b"}),p.jsx("span",{children:e.content})]}),p.jsxs("div",{className:"sa-interrupt-actions",children:[p.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-primary ${r==="confirm"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"confirm"}),children:[p.jsx(J,{name:"check",size:14})," ",s]}),p.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-secondary ${r==="cancel"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"cancel"}),children:[p.jsx(J,{name:"x",size:14})," ",a]})]}),n&&p.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function kp({interrupt:e,onRespond:t,disabled:n,answeredAction:r}){var u,d,c,h;const i=e.options,s=(typeof(i==null?void 0:i[0])=="string"?i[0]:(u=i==null?void 0:i[0])==null?void 0:u.label)||"批准",a=(typeof(i==null?void 0:i[1])=="string"?i[1]:(d=i==null?void 0:i[1])==null?void 0:d.label)||"拒绝",o=(typeof(i==null?void 0:i[2])=="string"?i[2]:(c=i==null?void 0:i[2])==null?void 0:c.label)||"跳过",l=((h=e.metadata)==null?void 0:h.showSkip)!==!1;return p.jsxs("div",{className:"sa-interrupt-card",children:[p.jsxs("div",{className:"sa-interrupt-content",children:[p.jsx(J,{name:"circle-alert",size:16,color:"#f59e0b"}),p.jsx("span",{children:e.content})]}),p.jsxs("div",{className:"sa-interrupt-actions",children:[p.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-primary ${r==="approve"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"approve"}),children:[p.jsx(J,{name:"check",size:14})," ",s]}),p.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-danger ${r==="reject"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"reject"}),children:[p.jsx(J,{name:"x",size:14})," ",a]}),l&&p.jsxs("button",{className:`sa-interrupt-btn sa-interrupt-btn-secondary ${r==="skip"?"sa-interrupt-btn-answered":""}`,disabled:n,onClick:()=>t({action:"skip"}),children:[p.jsx(J,{name:"chevron-right",size:14})," ",o]})]}),n&&p.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function vp(e){return typeof e=="string"?{value:e,label:e}:e}function Cp({interrupt:e,onRespond:t,disabled:n,initialValue:r}){const i=(e.options??[]).map(vp);return p.jsxs("div",{className:"sa-interrupt-card",children:[p.jsxs("div",{className:"sa-interrupt-content",children:[p.jsx(J,{name:"list",size:16,color:"#6366f1"}),p.jsx("span",{children:e.content})]}),p.jsx("div",{className:"sa-interrupt-options",children:i.map(s=>{const a=r===s.value;return p.jsxs("button",{className:`sa-interrupt-option ${s.danger?"sa-interrupt-option-danger":""} ${a?"sa-interrupt-option-selected":""}`,disabled:n,onClick:()=>t({action:"select",value:s.value}),children:[p.jsx(J,{name:a?"circle-check":"circle",size:14}),s.icon&&p.jsx(J,{name:s.icon,size:14}),p.jsx("span",{children:s.label}),s.description&&p.jsx("span",{className:"sa-interrupt-option-desc",children:s.description})]},s.value)})}),n&&p.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function Sp(e){return typeof e=="string"?{value:e,label:e}:e}function jp({interrupt:e,onRespond:t,disabled:n,initialValue:r}){const i=(e.options??[]).map(Sp),[s,a]=k.useState(()=>new Set(Array.isArray(r)?r:[])),o=l=>{n||a(u=>{const d=new Set(u);return d.has(l)?d.delete(l):d.add(l),d})};return p.jsxs("div",{className:"sa-interrupt-card",children:[p.jsxs("div",{className:"sa-interrupt-content",children:[p.jsx(J,{name:"list-checks",size:16,color:"#6366f1"}),p.jsx("span",{children:e.content})]}),p.jsx("div",{className:"sa-interrupt-options",children:i.map(l=>p.jsxs("button",{className:`sa-interrupt-option ${s.has(l.value)?"sa-interrupt-option-selected":""}`,disabled:n,onClick:()=>o(l.value),children:[p.jsx(J,{name:s.has(l.value)?"square-check":"square",size:14}),p.jsx("span",{children:l.label})]},l.value))}),!n&&p.jsx("div",{className:"sa-interrupt-actions",children:p.jsxs("button",{className:"sa-interrupt-btn sa-interrupt-btn-primary",disabled:s.size===0,onClick:()=>t({action:"submit",value:Array.from(s)}),children:[p.jsx(J,{name:"check",size:14})," 确认 (",s.size,")"]})}),n&&p.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function Ep({interrupt:e,onRespond:t,disabled:n,initialValue:r}){const[i,s]=k.useState(r??""),a=e.inputType??"text",o=a==="textarea",l=()=>{n||e.required&&!i.trim()||t({action:"submit",value:i.trim()})};return p.jsxs("div",{className:"sa-interrupt-card",children:[p.jsxs("div",{className:"sa-interrupt-content",children:[p.jsx(J,{name:"text-cursor-input",size:16,color:"#6366f1"}),p.jsx("span",{children:e.content})]}),p.jsx("div",{className:"sa-interrupt-input-area",children:o?p.jsx("textarea",{className:"sa-interrupt-textarea",value:i,onChange:u=>s(u.target.value),placeholder:e.placeholder,maxLength:e.maxLength,rows:3,disabled:n}):p.jsx("input",{className:"sa-interrupt-input",type:a,value:i,onChange:u=>s(u.target.value),placeholder:e.placeholder,maxLength:e.maxLength,onKeyDown:u=>u.key==="Enter"&&l(),disabled:n})}),!n&&p.jsx("div",{className:"sa-interrupt-actions",children:p.jsxs("button",{className:"sa-interrupt-btn sa-interrupt-btn-primary",disabled:e.required?!i.trim():!1,onClick:l,children:[p.jsx(J,{name:"check",size:14})," 提交"]})}),n&&p.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function Ip({interrupt:e,onRespond:t,disabled:n,initialValue:r}){const i=e.fields??[],[s,a]=k.useState(()=>{const d={};for(const c of i)d[c.name]=(r==null?void 0:r[c.name])??c.defaultValue??"";return d}),o=(d,c)=>{n||a(h=>({...h,[d]:c}))},l=!n&&i.every(d=>!d.required||s[d.name]),u=()=>{l&&t({action:"submit",value:s})};return p.jsxs("div",{className:"sa-interrupt-card",children:[p.jsxs("div",{className:"sa-interrupt-content",children:[p.jsx(J,{name:"file-text",size:16,color:"#6366f1"}),p.jsx("span",{children:e.content})]}),p.jsx("div",{className:"sa-interrupt-form",children:i.map(d=>p.jsxs("div",{className:"sa-interrupt-form-field",children:[p.jsxs("label",{className:"sa-interrupt-form-label",children:[d.label,d.required&&p.jsx("span",{className:"sa-interrupt-form-required",children:"*"})]}),Tp(d,s[d.name],c=>o(d.name,c),n)]},d.name))}),!n&&p.jsxs("div",{className:"sa-interrupt-actions",children:[p.jsxs("button",{className:"sa-interrupt-btn sa-interrupt-btn-primary",disabled:!l,onClick:u,children:[p.jsx(J,{name:"check",size:14})," 提交"]}),p.jsx("button",{className:"sa-interrupt-btn sa-interrupt-btn-secondary",onClick:()=>t({action:"cancel"}),children:"取消"})]}),n&&p.jsx("div",{className:"sa-interrupt-submitted",children:"已提交"})]})}function Lr(e){return typeof e=="string"?{value:e,label:e}:e}function Tp(e,t,n,r){switch(e.type){case"textarea":return p.jsx("textarea",{className:"sa-interrupt-textarea",value:t,onChange:i=>n(i.target.value),placeholder:e.placeholder,rows:3,disabled:r});case"select":{const i=(e.options??[]).map(Lr);return p.jsxs("select",{className:"sa-interrupt-select",value:t,onChange:s=>n(s.target.value),disabled:r,children:[p.jsx("option",{value:"",children:"请选择"}),i.map(s=>p.jsx("option",{value:s.value,children:s.label},s.value))]})}case"multiSelect":{const i=(e.options??[]).map(Lr),s=Array.isArray(t)?t:[],a=o=>{r||n(s.includes(o)?s.filter(l=>l!==o):[...s,o])};return p.jsx("div",{className:"sa-interrupt-options",children:i.map(o=>p.jsx("button",{type:"button",className:`sa-interrupt-option ${s.includes(o.value)?"sa-interrupt-option-selected":""}`,disabled:r,onClick:()=>a(o.value),children:o.label},o.value))})}case"password":return p.jsx("input",{className:"sa-interrupt-input",type:"password",value:t,onChange:i=>n(i.target.value),placeholder:e.placeholder,disabled:r});default:return p.jsx("input",{className:"sa-interrupt-input",type:e.type==="number"?"number":e.type==="date"?"date":"text",value:t,onChange:i=>n(i.target.value),placeholder:e.placeholder,disabled:r})}}function oa({interrupt:e,resolved:t,response:n,onRespond:r}){const i=t,s=n==null?void 0:n.value;switch(e.interruptType){case"confirm":return p.jsx(yp,{interrupt:e,onRespond:r,disabled:i,answeredAction:n==null?void 0:n.action});case"approve":return p.jsx(kp,{interrupt:e,onRespond:r,disabled:i,answeredAction:n==null?void 0:n.action});case"select":return p.jsx(Cp,{interrupt:e,onRespond:r,disabled:i,initialValue:s});case"multiSelect":return p.jsx(jp,{interrupt:e,onRespond:r,disabled:i,initialValue:s});case"input":return p.jsx(Ep,{interrupt:e,onRespond:r,disabled:i,initialValue:s});case"form":return p.jsx(Ip,{interrupt:e,onRespond:r,disabled:i,initialValue:s});default:return p.jsxs("div",{className:"sa-interrupt-unknown",children:["未知的交互类型: ",e.interruptType]})}}function zp({files:e,artifactPreview:t}){const{openArtifactPreview:n}=Te();return e.length===0?null:p.jsx("ul",{className:"sa-artifact-file-list",role:"list",children:e.map((r,i)=>p.jsxs("li",{className:"sa-artifact-file-card",onClick:t?()=>n(r):void 0,onKeyDown:t?s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),n(r))}:void 0,tabIndex:t?0:void 0,role:t?"button":void 0,"aria-label":t?`预览 ${r.filename}`:void 0,style:t?{cursor:"pointer"}:void 0,children:[p.jsx("div",{className:"sa-artifact-file-icon",children:p.jsx("span",{className:"sa-artifact-chip-type",children:Or(r.type)})}),p.jsxs("div",{className:"sa-artifact-file-info",children:[p.jsx("span",{className:"sa-artifact-file-name",children:r.filename}),r.size!=null&&p.jsx("span",{className:"sa-artifact-file-size",children:_r(r.size)})]}),t&&p.jsx("button",{className:"sa-artifact-file-download",title:"下载","aria-label":`下载 ${r.filename}`,onClick:s=>{s.stopPropagation(),kt(r)},children:p.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:p.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})})})]},r.id||`art-${i}`))})}const Ap=[{value:1,label:"事实错误"},{value:2,label:"逻辑问题"},{value:3,label:"不相关"},{value:4,label:"信息过时"},{value:5,label:"冗长啰嗦"},{value:6,label:"难以理解"}];function la({message:e,onCopy:t,onRegenerate:n,onFeedback:r}){const{status:i,cancelFeedback:s}=Te(),[a,o]=k.useState(null),[l,u]=k.useState(!1),[d,c]=k.useState(!1),h=k.useRef(null),f=k.useCallback(()=>{t(),u(!0),setTimeout(()=>u(!1),2e3)},[t]),m=k.useCallback(()=>{a==="like"?(o(null),s(e.id)):(o("like"),c(!1),r==null||r(e.id,"like"))},[a,e.id,r,s]),y=k.useCallback(()=>{a==="dislike"?(o(null),c(!1),s(e.id)):c(!0)},[a,e.id,s]),C=k.useCallback((j,S)=>{o("dislike"),c(!1),r==null||r(e.id,"dislike",{reason:j,remark:(S==null?void 0:S.trim())||void 0})},[e.id,r]),b=k.useCallback(()=>{c(!1)},[]);return k.useEffect(()=>{if(!d)return;const j=A=>{h.current&&!h.current.contains(A.target)&&c(!1)},S=A=>{A.key==="Escape"&&c(!1)};return document.addEventListener("mousedown",j),document.addEventListener("keydown",S),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",S)}},[d]),i!=="ready"&&i!=="error"?null:p.jsxs("div",{className:"sa-action-bar",children:[p.jsxs("button",{className:"sa-action-btn",onClick:f,title:"复制",children:[p.jsx(J,{name:l?"circle-check":"copy",size:14})," ",l?"已复制":"复制"]}),n&&p.jsxs("button",{className:"sa-action-btn",onClick:n,title:"重新生成",children:[p.jsx(J,{name:"refresh-cw",size:14})," 重新生成"]}),r&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"sa-action-divider"}),p.jsx("button",{className:`sa-action-btn ${a==="like"?"sa-action-btn-active":""}`,onClick:m,title:"有用","aria-label":"点赞",children:p.jsx(J,{name:"thumbs-up",size:14})}),p.jsx("button",{className:`sa-action-btn ${a==="dislike"?"sa-action-btn-active":""}`,onClick:y,title:"无用","aria-label":"踩","aria-expanded":d,"aria-haspopup":"dialog",children:p.jsx(J,{name:"thumbs-down",size:14})})]}),d&&p.jsx("div",{ref:h,children:p.jsx(Np,{onSubmit:C,onCancel:b})})]})}function Np({onSubmit:e,onCancel:t}){const[n,r]=k.useState(void 0),[i,s]=k.useState("");return p.jsxs("div",{className:"sa-dislike-panel",children:[p.jsx("div",{className:"sa-dislike-panel-title",children:"请选择不满意的原因(可选)"}),p.jsx("div",{className:"sa-dislike-reasons",children:Ap.map(a=>p.jsx("button",{className:`sa-dislike-reason-btn ${n===a.value?"active":""}`,onClick:()=>r(n===a.value?void 0:a.value),children:a.label},a.value))}),p.jsx("textarea",{className:"sa-dislike-remark",placeholder:"补充描述(选填,≤500 字)",maxLength:500,value:i,onChange:a=>s(a.target.value),rows:2}),p.jsxs("div",{className:"sa-dislike-actions",children:[p.jsx("button",{className:"sa-dislike-submit",onClick:()=>e(n,i||void 0),children:"提交"}),p.jsx("button",{className:"sa-dislike-cancel",onClick:t,children:"取消"})]})]})}const Lp=/^(https?:\/\/|data:|blob:|\/\/|\/|\.\/|\.\.\/)/;function Dr({src:e,alt:t}){return e?Lp.test(e)?p.jsx("img",{src:e,alt:t??"",className:"sa-msg-avatar",draggable:!1}):p.jsx("span",{className:"sa-msg-avatar sa-msg-avatar-text",children:e}):null}function ua({message:e,isStreaming:t,isLast:n,slots:r,avatar:i,artifactPreview:s,showTimestamp:a}){const{regenerate:o,feedback:l,respondToInterrupt:u}=Te(),d=k.useCallback(()=>{var L;const A=e.parts.filter(v=>v.type==="text").map(v=>v.content).join(`
30
+ `);(L=navigator.clipboard)==null||L.writeText(A).catch(()=>{})},[e]),c=e.role==="user",h=r.Message;if(h)return p.jsx(h,{message:e,isStreaming:t,isLast:n,avatar:i,slots:r,onCopy:d,onRegenerate:o,onFeedback:l,showTimestamp:a});const f=r.TextPart??ea,m=r.ThinkingPart??na,y=r.ToolCallPart??ra,C=r.ToolResultPart??ia,b=r.ErrorPart??aa,j=r.ActionBar??la,S=!c&&e.parts.some(A=>A.type==="text"&&A.content);return p.jsxs("div",{className:`sa-message ${c?"sa-message-user":"sa-message-assistant"}`,children:[!c&&p.jsx(Dr,{src:(i==null?void 0:i.assistant)||(t&&n?pe.assistantAvatarGenerating:pe.assistantAvatar),alt:"AI"}),p.jsxs("div",{className:"sa-message-content",children:[a&&p.jsx("span",{className:`sa-message-time ${c?"sa-message-time-right":""}`,children:Sa(e.timestamp)}),p.jsxs("div",{className:"sa-message-body",children:[e.parts.map((A,L)=>{switch(A.type){case"text":return p.jsx(f,{content:A.content},L);case"attachment":return p.jsx(wp,{attachment:A.attachment},L);case"thinking":return p.jsx(m,{content:A.content},L);case"tool_call":return p.jsx(y,{toolName:A.toolName,toolCallId:A.toolCallId,args:A.args},L);case"tool_result":return p.jsx(C,{toolName:A.toolName,toolCallId:A.toolCallId,content:A.content,artifacts:A.artifacts,renderMode:A.renderMode,html:A.html,artifactPreview:s},L);case"error":return p.jsx(b,{content:A.content,onRetry:o},L);case"interrupt":return p.jsx(oa,{interrupt:A.interrupt,resolved:A.resolved??!1,response:A.response,onRespond:v=>u(A.interrupt.interruptId,v)},L);default:return null}}),t&&n&&!c&&!S&&p.jsx("span",{className:"sa-thinking-indicator",children:"思考中…"}),!c&&e.artifacts&&e.artifacts.length>0&&p.jsx(zp,{files:Br(e.artifacts),artifactPreview:s}),!c&&!t&&S&&p.jsx(j,{message:e,onCopy:d,onRegenerate:n?o:void 0,onFeedback:l})]})]}),c&&(i==null?void 0:i.user)&&p.jsx(Dr,{src:i.user,alt:"用户"})]})}function ca({message:e,suggestedPrompts:t,onPromptClick:n,capabilities:r,quickLinks:i,logo:s,openPanel:a}){const o=l=>{if(l.onClick){l.onClick();return}const u=l.action;if(!u){l.prompt&&n(l.prompt);return}a==null||a(u.type==="link"?u:{...u,title:u.title??l.label})};return p.jsxs("div",{className:"flex flex-col gap-8 py-2",children:[p.jsxs("div",{className:"flex flex-col items-center gap-1 opacity-0 animate-sa-home-fade-in",children:[p.jsx("img",{src:s||pe.logo,alt:"AI 助手",className:"block max-w-16 shrink-0 animate-sa-logo-float",draggable:!1}),p.jsx("h3",{className:"sa-shimmer-text m-0 mb-1 text-[18px] font-bold leading-[1.3] text-[#333] animate-sa-title-shimmer",children:e||"你好!有什么可以帮你的?"})]}),r&&r.length>0&&p.jsx("div",{className:"flex flex-col items-start gap-4 opacity-0 animate-sa-home-fade-in",style:{animationDelay:"150ms"},children:r.map(l=>p.jsxs("div",{className:"inline-flex w-full max-w-full min-w-0 items-center gap-[7px]",children:[l.icon&&p.jsx("img",{src:l.icon,alt:"",className:"h-[18px] w-[18px] shrink-0 object-contain",draggable:!1}),p.jsx("span",{className:"shrink-0 text-[14px] leading-[1.4] text-[#333]",children:l.label}),l.desc&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"h-[13px] w-px shrink-0 bg-[#DCDCDC]"}),p.jsx("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-[14px] leading-[1.4] text-[#9A9A9A]",children:l.desc})]})]},l.label))}),t&&t.length>0&&p.jsx("div",{className:"flex flex-col items-start gap-3",children:t.map((l,u)=>p.jsxs("button",{type:"button",className:"sa-chip inline-flex h-7 items-center gap-1 rounded-md px-3 text-[14px] leading-none text-[#333] opacity-0 transition-colors animate-sa-chip-in",style:{animationDelay:`${300+u*130}ms`},onClick:()=>n(l),children:[p.jsx("span",{className:"sa-chip-text overflow-hidden text-ellipsis whitespace-nowrap",children:l}),p.jsx("svg",{width:13,height:13,viewBox:"0 0 14 14",fill:"none",className:"shrink-0 text-[#9A9A9A]","aria-hidden":"true",children:p.jsx("path",{d:"M5 3L9 7L5 11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]},`${l}-${u}`))}),i&&i.length>0&&p.jsxs("div",{className:"opacity-0 animate-sa-home-fade-in",style:{animationDelay:"420ms"},children:[p.jsx("div",{className:"mb-3 text-[14px] leading-none text-[#A0A0A0]",children:"快速查看"}),p.jsx("div",{className:"flex flex-wrap items-center gap-[22px]",children:i.map(l=>p.jsxs("button",{type:"button",className:"inline-flex items-center gap-[7px] rounded-md px-1 py-1 transition-colors hover:bg-[#F5F5F5]",onClick:()=>o(l),children:[l.icon&&p.jsx("span",{className:"flex h-[18px] w-[18px] shrink-0 items-center justify-center opacity-70",children:p.jsx("img",{src:l.icon,alt:"",width:18,height:18,draggable:!1})}),p.jsx("span",{className:"text-[14px] leading-none text-[#333] transition-colors hover:text-[#1881F0]",children:l.label})]},l.label))})]})]})}function Ln({slots:e,welcomeMessage:t,suggestedPrompts:n,avatar:r,artifactPreview:i,capabilities:s,quickLinks:a,logo:o,showTimestamp:l}){const{messages:u,status:d,sendMessage:c,openPanel:h}=Te(),{containerRef:f}=qr([u]),m=d==="streaming",y=e.WelcomeScreen??ca,C=e.AppendContainer;return u.length===0?p.jsxs("div",{className:"sa-thread",ref:f,children:[p.jsx(y,{message:t,suggestedPrompts:n,onPromptClick:c,capabilities:s,quickLinks:a,logo:o,openPanel:h}),C&&p.jsx(C,{openPanel:h})]}):p.jsx("div",{className:"sa-thread",ref:f,children:u.map((b,j)=>p.jsx(ua,{message:b,isStreaming:m,isLast:j===u.length-1,slots:e,avatar:r,artifactPreview:i,showTimestamp:l},b.id))})}function Dp({items:e,activeIndex:t,onSelect:n}){const r=k.useRef(null);return k.useEffect(()=>{var s;const i=(s=r.current)==null?void 0:s.children[t];i==null||i.scrollIntoView({block:"nearest"})},[t]),e.length===0?p.jsx("div",{className:"sa-slash-menu",children:p.jsx("div",{className:"sa-slash-menu-empty",children:"没有匹配的技能"})}):p.jsx("div",{className:"sa-slash-menu",ref:r,children:e.map((i,s)=>p.jsxs("div",{className:`sa-slash-menu-item${s===t?" sa-slash-menu-item--active":""}`,onMouseDown:a=>{a.preventDefault(),n(i)},children:[p.jsxs("span",{className:"sa-slash-menu-item-name",children:["/",i.name]}),(i.displayName||i.description)&&p.jsx("span",{className:"sa-slash-menu-item-desc",children:i.displayName||i.description})]},i.code))})}function Mp({sdk:e,input:t,onSelect:n}){const[r,i]=k.useState([]),[s,a]=k.useState(!1),[o,l]=k.useState(0),u=k.useRef(!1);k.useEffect(()=>{u.current||(u.current=!0,e.listSkills().then(i).catch(()=>i([])))},[e]);const d=/^\/\S*$/.test(t);k.useEffect(()=>{a(d)},[d]),k.useEffect(()=>{d&&l(0)},[t,d]);const c=t.startsWith("/")?t.slice(1).toLowerCase():"",h=k.useMemo(()=>r.filter(S=>!c||S.code.toLowerCase().includes(c)||S.name.toLowerCase().includes(c)||S.displayName&&S.displayName.toLowerCase().includes(c)),[r,c]),f=k.useRef(s),m=k.useRef(h),y=k.useRef(o),C=k.useRef(n);f.current=s,m.current=h,y.current=o,C.current=n;const b=k.useCallback(S=>{if(!f.current||m.current.length===0)return!1;switch(S.key){case"ArrowDown":return S.preventDefault(),l(A=>(A+1)%m.current.length),!0;case"ArrowUp":return S.preventDefault(),l(A=>(A-1+m.current.length)%m.current.length),!0;case"Enter":case"Tab":return S.preventDefault(),C.current(m.current[y.current]),a(!1),!0;case"Escape":return S.preventDefault(),a(!1),!0;default:return!1}},[]),j=k.useCallback(()=>a(!1),[]);return{isOpen:s,items:h,activeIndex:o,handleKeyDown:b,close:j}}const Rp=10,Pp=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent);function Fp({size:e=16}){return p.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}function Dn(){const{status:e,sendMessage:t,stop:n,sdk:r,attachmentUploader:i,nosUpload:s}=Te(),[a,o]=k.useState(""),[l,u]=k.useState([]),d=k.useRef(null),c=k.useRef(null),h=!!i||!!s,f=e==="streaming"||e==="submitted",m=l.filter(w=>w.attachment),y=l.some(w=>!w.attachment&&w.status==="uploading"),C=!!a.trim()||l.length>0||f,b=!f&&!y&&(a.trim().length>0||m.length>0),j=k.useCallback(w=>{o(`/${w.name} `),setTimeout(()=>{const z=d.current;z&&(z.focus(),z.selectionStart=z.selectionEnd=z.value.length)},0)},[]),S=Mp({sdk:r,input:a,onSelect:j}),A=k.useCallback(w=>{const z=Array.from(w.target.files??[]);if(w.target.value="",!h||z.length===0)return;const E=Rp-l.length,F=z.slice(0,Math.max(0,E));if(F.length===0)return;const T=F.map(M=>({key:`${M.name}_${M.size}_${Date.now()}_${Math.random().toString(36).slice(2,6)}`,file:M,status:"uploading"}));u(M=>[...M,...T]);for(const{key:M,file:U}of T)(i||Me.createNosUploader({baseURL:s.baseURL,headers:s.headers,trunkSize:s.trunkSize,onProgress:P=>u(O=>O.map(x=>x.key===M?{...x,percent:P}:x))}))(U).then(P=>{u(O=>O.map(x=>x.key===M?{...x,attachment:{...P,filename:P.filename||U.name,size:P.size??U.size,mime:P.mime??U.type}}:x))}).catch(P=>{u(O=>O.map(x=>x.key===M?{...x,status:"error",errorMsg:P instanceof Error?P.message:String(P)}:x))})},[i,s,l]),L=k.useCallback(w=>{u(z=>z.filter(E=>E.key!==w))},[]),v=k.useCallback(()=>{if(!b)return;const w=a.trim(),z=m.map(E=>E.attachment);t(w,z.length>0?z:void 0),o(""),u([]),d.current&&(d.current.style.height="auto")},[b,a,m,t]),N=k.useCallback(w=>{S.handleKeyDown(w)||w.key==="Enter"&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),v())},[v,S.handleKeyDown]),_=k.useCallback(w=>{o(w.target.value);const z=w.target;z.style.height="auto",z.style.height=Math.min(z.scrollHeight,90)+"px"},[]),B=k.useCallback(()=>{var w;f||(w=d.current)==null||w.focus()},[f]);return p.jsxs("div",{className:"relative z-[2] shrink-0 px-[15px] pb-2.5",children:[S.isOpen&&p.jsx(Dp,{items:S.items,activeIndex:S.activeIndex,onSelect:j}),l.length>0&&p.jsx("div",{className:"sa-attachment-tray mb-1.5",onClick:w=>w.stopPropagation(),children:l.map(w=>p.jsxs("span",{className:`sa-attachment-tray-chip ${w.status==="error"?"sa-attachment-tray-chip-error":""}`,title:w.status==="error"?`上传失败:${w.errorMsg??""}`:w.file.name,children:[p.jsx(J,{name:"file-text",size:13,color:w.status==="error"?"#ef4444":"#6366f1"}),p.jsx("span",{className:"sa-attachment-tray-chip-name",children:w.file.name}),p.jsx("span",{className:"sa-attachment-tray-chip-size",children:w.attachment?sa(w.file.size):w.status==="error"?"失败":w.percent!=null?`${Math.min(99,Math.round(w.percent))}%`:"上传中…"}),p.jsx("button",{type:"button",className:"sa-attachment-tray-chip-remove","aria-label":`移除附件 ${w.file.name}`,onClick:()=>L(w.key),children:"✕"})]},w.key))}),p.jsxs("form",{className:`sa-input-form relative flex min-h-[70px] cursor-text flex-col gap-1 rounded-[5px] p-2 ${C?"sa-input-form-active":""} ${f?"sa-input-form-streaming":""}`,onClick:B,onSubmit:w=>{w.preventDefault(),v()},children:[p.jsx("textarea",{ref:d,className:"sa-input-field min-h-[34px] w-full resize-none border-none bg-transparent p-0 text-[14px] leading-[1.5] text-[#333] outline-none placeholder:text-[#B8B8B8]",value:a,onChange:_,onKeyDown:N,placeholder:f?"回答生成中,请稍候…":"发消息或创建任务... /使用技能",rows:1,disabled:f}),p.jsxs("div",{className:"flex items-center justify-end gap-2",children:[h&&!f&&p.jsx("button",{type:"button",className:"sa-attach-btn mr-auto","aria-label":"添加附件",title:"添加附件",onClick:()=>{var w;return(w=c.current)==null?void 0:w.click()},children:p.jsx(Fp,{size:15})}),p.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:A,"aria-label":"选择附件"}),!f&&p.jsxs("span",{className:"sa-send-hint","aria-hidden":"true",children:[p.jsx("kbd",{className:"sa-send-kbd",children:Pp?"⌘":"Ctrl"}),p.jsx("span",{children:"+"}),p.jsx("kbd",{className:"sa-send-kbd",children:"Enter"}),p.jsx("span",{children:"发送"})]}),f?p.jsx("button",{type:"button",className:"sa-send-btn sa-send-btn-active","aria-label":"停止生成",title:"停止生成",onClick:n,children:p.jsx("span",{className:"sa-stop-icon"})}):p.jsx("button",{type:"submit",className:`sa-send-btn ${b?"sa-send-btn-active":""}`,"aria-label":"发送",title:"发送",disabled:!b,children:p.jsx("img",{src:pe.sendSolid,alt:"发送",width:14,height:14,draggable:!1})})]})]}),p.jsx("div",{className:"mt-3 text-center text-[11px] leading-none text-[#B8B8B8]",children:"所有内容均由AI生成仅供参考"})]})}function _p({artifact:e}){const[t,n]=k.useState(null),[r,i]=k.useState(null),[s,a]=k.useState(!0),[o,l]=k.useState(null);return k.useEffect(()=>{let u=!1;a(!0),l(null),n(null),i(null);async function d(){try{if(e.type==="pdf"){u||a(!1);return}if(e.type==="md"){const c=await fetch(e.url);if(!c.ok)throw new Error(`HTTP ${c.status}`);const h=await c.text();u||(i(h),a(!1));return}if(e.type==="html"){const c=await fetch(e.url);if(!c.ok)throw new Error(`HTTP ${c.status}`);const h=await c.text(),f=(await Promise.resolve().then(()=>require("./purify.es-Dsdnkgrg.cjs"))).default;u||(n(f.sanitize(h,{FORCE_BODY:!0,ADD_ATTR:["target"]})),a(!1));return}if(e.type==="docx"){const c=await fetch(e.url);if(!c.ok)throw new Error(`HTTP ${c.status}`);const h=await c.arrayBuffer(),m=await(await Promise.resolve().then(()=>require("./mammoth.browser-ClkRBm1A.cjs")).then(C=>C.mammoth_browser)).convertToHtml({arrayBuffer:h}),y=(await Promise.resolve().then(()=>require("./purify.es-Dsdnkgrg.cjs"))).default;u||(n(y.sanitize(m.value,{FORCE_BODY:!0,ADD_ATTR:["target"]})),a(!1));return}u||(a(!1),l(`不支持预览「${e.type}」类型`))}catch(c){u||(a(!1),l(c instanceof Error?c.message:"加载失败"))}}return d(),()=>{u=!0}},[e]),s?p.jsx("div",{className:"sa-drawer-preview-loading",children:"加载中"}):o?p.jsxs("div",{className:"sa-drawer-preview-error",children:[o,p.jsx("button",{className:"sa-drawer-btn-sm",onClick:()=>void kt(e),children:"下载查看"})]}):e.type==="pdf"?p.jsx("iframe",{src:e.url,title:e.filename,className:"sa-drawer-preview-iframe",sandbox:"allow-scripts"}):r!==null?p.jsx("div",{className:"sa-drawer-preview-html-scroll",children:p.jsx("div",{className:"sa-drawer-preview-html sa-text-part",children:p.jsx(zi,{remarkPlugins:[Zi],children:r})})}):t!==null?p.jsx("div",{className:"sa-drawer-preview-html-scroll",children:p.jsx("div",{className:"sa-drawer-preview-html sa-text-part",dangerouslySetInnerHTML:{__html:t}})}):null}function Op({artifacts:e,initialArtifact:t,onClose:n}){const[r,i]=k.useState(t?{mode:"preview",artifact:t}:{mode:"list"}),[s,a]=k.useState(!1),o=k.useRef(null),[l,u]=k.useState(340),d=k.useRef(null);k.useEffect(()=>{t&&(o.current&&(clearTimeout(o.current),o.current=null,a(!1)),i({mode:"preview",artifact:t}))},[t]);const c=k.useCallback(()=>{a(!0),o.current=setTimeout(()=>{o.current=null,n()},240)},[n]);k.useEffect(()=>()=>{var y;o.current&&clearTimeout(o.current),(y=d.current)==null||y.call(d)},[]);const h=k.useCallback(y=>{i({mode:"preview",artifact:y})},[]),f=k.useCallback(()=>{i({mode:"list"})},[]);k.useEffect(()=>{const y=C=>{C.key==="Escape"&&c()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[c]);const m=k.useCallback(y=>{y.preventDefault();const C=y.clientX,b=l,j=A=>{const L=C-A.clientX;u(Math.max(240,Math.min(window.innerWidth*.7,b+L)))},S=()=>{document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",S),document.body.style.cursor="",document.body.style.userSelect="",d.current=null};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",j),document.addEventListener("mouseup",S),d.current=S},[l]);return p.jsxs("div",{className:`sa-artifact-drawer ${s?"sa-drawer-closing":""}`,style:{width:l},children:[p.jsx("div",{className:"sa-drawer-resize-handle",onMouseDown:m}),p.jsxs("div",{className:"sa-artifact-drawer-header",children:[r.mode==="preview"?p.jsxs(p.Fragment,{children:[p.jsx("button",{className:"sa-drawer-btn",onClick:f,title:"返回列表","aria-label":"返回列表",children:p.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:p.jsx("path",{d:"M15 18l-6-6 6-6"})})}),p.jsx("span",{className:"sa-artifact-drawer-title",children:r.artifact.filename})]}):p.jsxs(p.Fragment,{children:[p.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{flexShrink:0},children:[p.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),p.jsx("polyline",{points:"14 2 14 8 20 8"})]}),p.jsx("span",{className:"sa-artifact-drawer-title",children:"会话产物"})]}),p.jsx("div",{style:{flex:1}}),r.mode==="preview"&&p.jsx("button",{className:"sa-drawer-btn",onClick:()=>void kt(r.artifact),title:"下载","aria-label":"下载",children:p.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:p.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})})}),p.jsx("button",{className:"sa-drawer-btn",onClick:c,title:"关闭","aria-label":"关闭",children:p.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:p.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),p.jsx("div",{className:"sa-artifact-drawer-body",children:r.mode==="list"?e.length===0?p.jsx("div",{className:"sa-drawer-empty",children:"暂无产物"}):p.jsx("ul",{className:"sa-drawer-file-list",role:"list",children:e.map((y,C)=>p.jsxs("li",{className:"sa-drawer-file-card",onClick:()=>h(y),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),h(y))},tabIndex:0,role:"button","aria-label":`预览 ${y.filename}`,children:[p.jsx("div",{className:"sa-drawer-file-icon",children:p.jsx("span",{className:"sa-artifact-chip-type",children:Or(y.type)})}),p.jsxs("div",{className:"sa-drawer-file-info",children:[p.jsx("span",{className:"sa-drawer-file-name",children:y.filename}),p.jsx("span",{className:"sa-drawer-file-size",children:_r(y.size)})]}),p.jsx("button",{className:"sa-drawer-btn",title:"下载","aria-label":`下载 ${y.filename}`,onClick:b=>{b.stopPropagation(),kt(y)},children:p.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:p.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})})})]},y.id||`artifact-${C}`))}):p.jsx("div",{className:"sa-drawer-view-enter",children:p.jsx(_p,{artifact:r.artifact})})})]})}function da({page:e,onBack:t,centered:n}){k.useEffect(()=>{const i=s=>{s.key==="Escape"&&t()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[t]);const r=k.isValidElement(e.component)?k.cloneElement(e.component,{close:t}):k.createElement(e.component,{close:t});return p.jsx("div",{className:`sa-page-overlay ${n?"sa-page-overlay-centered":""}`,children:p.jsx("div",{className:"sa-page-overlay-body",children:r})})}const Bp="mx-auto w-full max-w-[800px]";function pa({contentClassName:e,centered:t,composerClassName:n,thread:r,composer:i,artifactPreview:s}){const{activePanel:a,closePanel:o,messagesLoading:l,isArtifactDrawerOpen:u,allArtifacts:d,activePreviewArtifact:c,toggleArtifactDrawer:h}=Te();if(a)return p.jsx(da,{page:a,onBack:o,centered:t});const f=t?Bp:"";return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:`${e} ${f}`,children:[l?p.jsxs("div",{className:"sa-messages-loading",children:[p.jsx("span",{className:"sa-loading-spinner"}),"加载对话..."]}):r,s&&u&&p.jsx(Op,{artifacts:d,initialArtifact:c,onClose:h})]}),n?p.jsx("div",{className:`${n} ${f}`,children:i}):i]})}function $p({isOpen:e,onClose:t,title:n,slots:r,welcomeMessage:i,suggestedPrompts:s,avatar:a,artifactPreview:o,capabilities:l,quickLinks:u,logo:d,defaultWidth:c,defaultHeight:h,showTimestamp:f}){const{status:m,sendMessage:y,stop:C,toggleThreadList:b,setThreadListOpen:j,isThreadListOpen:S,toggleArtifactDrawer:A,allArtifacts:L,activePanel:v,closePanel:N,messages:_,messagesLoading:B,conversations:w,activeConversationId:z,switchConversation:E,newConversation:F,deleteConversation:T,renameConversation:M,hasMore:U,loadMoreConversations:V}=Te(),{width:P,position:O,hasCustomPosition:x,isMaximized:X,totalWidth:$,windowHeight:g,startWindowDrag:W,startResize:te,toggleMaximize:ee,reset:ue,setLockedHeight:ae}=ka({defaultWidth:c??de.DEFAULT_WIDTH,defaultHeight:h??de.DEFAULT_HEIGHT,sidebarWidth:0}),q=k.useRef(null),se=k.useRef(null),le=!B&&_.length===0,Ee=!B&&_.length>0,be=!!v;k.useEffect(()=>{e||(ue(),N())},[e,ue,N]),k.useEffect(()=>{j(X?q.current??!0:se.current??!1)},[X,j]),k.useEffect(()=>{Ee||ae(null)},[Ee,ae]);const Lt=va({enabled:e&&Ee&&!X&&!be,contentSelector:".sa-panel-content",defaultHeight:h??de.DEFAULT_HEIGHT,onHeightChange:ae});if(!e)return null;const Ke=r.Header,Qe=r.Composer,Pe=r.ThreadList,Dt=()=>{const K=!S;b(),X?q.current=K:se.current=K},Je=200,Ze=S&&!X,ve="var(--sa-radius, 16px)",ht=Ze?`0px ${ve} ${ve} 0px`:`${ve} ${ve} ${ve} ${ve}`,Mt=x?O.x:window.innerWidth-$-20,Ve=Math.min(Je,Math.max(0,Mt-1)),Rt=x?{width:`${$}px`,height:`${g}px`,left:`${O.x}px`,top:`${O.y}px`}:{width:`${$}px`,height:`${g}px`,right:"20px",bottom:"20px"},I={title:n,onClose:t,onToggleThreadList:Dt,isMaximized:X,onToggleMaximize:ee,showHome:Ee||be,onHome:be?N:F,panelTitle:be?v==null?void 0:v.title:void 0,artifactCount:be||!o?0:L.length,onToggleArtifactDrawer:be||!o?void 0:A},R={conversations:w,activeSessionId:z,onSwitch:E,onNew:F,onDelete:T,onRename:M,hasMore:U,onLoadMore:V},Y=p.jsxs("div",{className:`relative flex min-w-0 flex-col bg-white ${X?"flex-1":"h-full shrink-0"}`,style:X?void 0:{width:`${P}px`,borderRadius:ht,overflow:"hidden"},children:[le&&!be&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"sa-home-gradient pointer-events-none absolute inset-x-0 top-0 z-0 h-[238px] opacity-10"}),p.jsx("div",{className:"sa-home-gradient-fade pointer-events-none absolute inset-x-0 top-0 z-[1] h-[238px]"})]}),p.jsx("div",{className:`relative z-20 ${le||X?"":"bg-white"} ${X?"cursor-default":"cursor-grab active:cursor-grabbing"}`,onMouseDown:X?void 0:W,children:Ke?p.jsx(Ke,{...I}):p.jsx(Ur,{...I})}),p.jsx(pa,{contentClassName:`sa-panel-content relative z-[2] ${le?"sa-home-view":""}`,centered:X,composerClassName:"shrink-0",artifactPreview:o,thread:p.jsx(Ln,{slots:r,welcomeMessage:i,suggestedPrompts:s,avatar:a,artifactPreview:o,capabilities:l,quickLinks:u,logo:d,showTimestamp:f}),composer:Qe?p.jsx(Qe,{status:m,onSend:y,onStop:C}):p.jsx(Dn,{})})]});return X?p.jsx("div",{className:"fixed inset-0 z-[var(--sa-z-index,9999)] flex animate-sa-fade-in flex-col justify-end bg-black/30",children:p.jsxs("div",{className:"flex h-[calc(100%_-_48px)] w-full animate-sa-slide-up-full flex-row overflow-hidden bg-[#F5F5F5] shadow-[0_-12px_48px_rgba(0,0,0,0.25)]",style:{borderRadius:"var(--sa-radius, 16px) var(--sa-radius, 16px) 0px 0px"},children:[S&&(Pe?p.jsx(Pe,{...R}):p.jsx(Zt,{width:220})),Y]})}):p.jsxs("div",{ref:Lt,className:"fixed z-[var(--sa-z-index,9999)] flex animate-sa-window-in flex-row overflow-visible border border-[#DADADA] bg-white ",style:{...Rt,borderRadius:ht},children:[p.jsx("div",{className:"sa-resize-handle absolute bottom-0 left-[-3px] top-0 z-20 w-[6px] cursor-col-resize",onMouseDown:K=>te(K)}),Ze&&(Pe?p.jsx("div",{className:"absolute -top-px -bottom-px -left-px z-10 overflow-hidden border border-r-0 border-[#DADADA] bg-[#FAFAFA] ",style:{width:Ve,transform:`translateX(-${Ve}px)`,borderRadius:`${ve} 0px 0px ${ve}`},children:p.jsx(Pe,{...R})}):p.jsx("div",{className:"absolute -top-px -bottom-px -left-px z-10 overflow-hidden border border-r-0 border-[#DADADA] bg-[#FAFAFA] ",style:{width:Ve,transform:`translateX(-${Ve}px)`,borderRadius:`${ve} 0px 0px ${ve}`},children:p.jsx(Zt,{width:Je})})),Y]})}const Mr=()=>{};function Hp({conversations:e,activeSessionId:t,onSwitch:n,onNew:r,onDelete:i,onRename:s,isCollapsed:a,onToggleCollapse:o,hasMore:l,onLoadMore:u,conversationsLoading:d}){const[c,h]=k.useState(null),[f,m]=k.useState(null),[y,C]=k.useState(""),[b,j]=k.useState(null),S=k.useRef(null);k.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]);const A=k.useCallback((w,z)=>{z.stopPropagation(),c===w?(i(w),h(null)):(h(w),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>h(null),3e3))},[c,i]),L=k.useCallback((w,z,E)=>{E.stopPropagation(),m(w),C(z??"")},[]),v=k.useCallback(w=>{y.trim()&&s(w,y.trim()),m(null)},[y,s]),N=k.useRef(null),_=k.useCallback(()=>{const w=N.current;!w||!l||!u||w.scrollHeight-w.scrollTop-w.clientHeight<50&&u()},[l,u]),B=k.useMemo(()=>Vr(e),[e]);return a?p.jsxs("div",{className:"flex w-12 shrink-0 flex-col items-center gap-1 border-r border-[#ECECEC] bg-[#FAFAFA] py-3",children:[p.jsx("button",{type:"button",className:"sa-tip relative flex h-7 w-7 items-center justify-center rounded-md text-[#666] transition-colors hover:bg-white","data-tooltip":"展开",onClick:o,children:p.jsx(J,{name:"panel-left",size:18})}),p.jsx("button",{type:"button",className:"sa-tip relative flex h-7 w-7 items-center justify-center rounded-md text-[#666] transition-colors hover:bg-white","data-tooltip":"新建对话",onClick:()=>{r(),o()},children:p.jsx("img",{src:pe.messageCreate,alt:"",width:18,height:18})})]}):p.jsxs("div",{className:"relative flex w-[220px] shrink-0 flex-col border-r border-[#ECECEC] bg-[#FAFAFA] p-3",children:[p.jsxs("div",{className:"mb-4 flex shrink-0 items-center gap-1.5",children:[p.jsxs("button",{type:"button",className:"sa-new-chat flex h-8 flex-1 items-center justify-center gap-2 rounded-md text-[14px] font-medium transition-colors",onClick:r,children:[p.jsx("img",{src:pe.messageCreate,alt:"",width:18,height:18}),p.jsx("span",{className:"sa-new-chat-text whitespace-nowrap",children:"新建对话"})]}),p.jsx("button",{type:"button",className:"sa-tip relative flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-[#666] transition-colors hover:bg-white","data-tooltip":"收起侧边栏",onClick:o,children:p.jsx(J,{name:"panel-left-close",size:16})})]}),p.jsxs("div",{className:"px-1 pb-2.5",children:[p.jsx("div",{className:"mb-1 text-[14px] font-semibold text-[#333]",children:"历史对话"}),p.jsx("div",{className:"text-[11px] text-[#999]",children:"展示最近的会话记录"})]}),p.jsxs("div",{ref:N,className:"flex-1 overflow-y-auto",onScroll:_,children:[d&&e.length===0&&p.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:"加载中..."}),!d&&e.length===0&&p.jsx("div",{className:"px-0.5 py-2 text-[12px] text-[#999]",children:"暂无记录"}),B.map(w=>p.jsxs("div",{className:"mb-1",children:[p.jsx("div",{className:"px-1 pb-1 pt-2 text-[11px] text-[#A0A0A0]",children:w.label}),w.items.map(z=>{const E=z.sessionId===t,F=c===z.sessionId;return p.jsx("div",{className:`group relative mb-0.5 flex h-8 w-full cursor-pointer items-center gap-1 rounded-md px-0.5 text-[13px] transition-colors ${E?"bg-[#E8F1FE]":"hover:bg-[#E8F1FE]"}`,onClick:()=>{f!==z.sessionId&&n(z.sessionId)},onMouseEnter:T=>{if(f===z.sessionId)return;const M=T.currentTarget.getBoundingClientRect();j({text:z.title||"新会话",x:M.right+8,y:M.top+M.height/2})},onMouseLeave:()=>j(null),children:f===z.sessionId?p.jsx("input",{className:"w-full rounded border border-[var(--sa-primary)] bg-white px-1.5 py-0.5 text-[12px] outline-none",value:y,onChange:T=>C(T.target.value),onBlur:()=>v(z.sessionId),onKeyDown:T=>{T.key==="Enter"&&v(z.sessionId),T.key==="Escape"&&m(null)},onClick:T=>T.stopPropagation(),autoFocus:!0}):p.jsxs(p.Fragment,{children:[p.jsx("img",{src:pe.message,alt:"",width:16,height:16,className:"shrink-0 opacity-60"}),p.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-[#333]",children:z.title||"新会话"}),p.jsxs("span",{className:"hidden shrink-0 items-center gap-0.5 group-hover:flex",children:[p.jsx("button",{type:"button",className:"flex h-5 w-5 items-center justify-center rounded text-[#999] hover:bg-white/70 hover:text-[var(--sa-primary)]",onClick:T=>L(z.sessionId,z.title,T),title:"重命名",children:p.jsx(J,{name:"pen",size:12})}),p.jsx("button",{type:"button",className:`flex h-5 w-5 items-center justify-center rounded ${F?"bg-[#fee2e2] text-[#ef4444]":"text-[#999] hover:bg-white/70 hover:text-[#ef4444]"}`,onClick:T=>A(z.sessionId,T),title:F?"确认删除":"删除",children:p.jsx(J,{name:F?"x":"trash2",size:12})})]})]})},z.sessionId)})]},w.label)),l&&p.jsx("div",{className:"px-0.5 py-2 text-center text-[11px] text-[#C0C0C0]",children:"向下滚动加载更多"})]}),b&&p.jsx("div",{className:"pointer-events-none fixed z-[10001] whitespace-nowrap rounded border border-[#E8E8E8] bg-white px-2.5 py-1.5 text-[12px] leading-[1.4] text-[#333] shadow-[0_2px_8px_rgba(0,0,0,0.12)]",style:{left:b.x,top:b.y,transform:"translateY(-50%)"},children:b.text})]})}function fa({title:e,slots:t,welcomeMessage:n,suggestedPrompts:r,capabilities:i,quickLinks:s,logo:a,sidebarDefaultOpen:o=!0,onClose:l,avatar:u,artifactPreview:d,showTimestamp:c}){const{status:h,sendMessage:f,stop:m,conversations:y,activeConversationId:C,switchConversation:b,newConversation:j,deleteConversation:S,renameConversation:A,toggleArtifactDrawer:L,allArtifacts:v,activePanel:N,closePanel:_,hasMore:B,loadMoreConversations:w,conversationsLoading:z}=Te(),[E,F]=k.useState(o),T=k.useCallback(()=>F(O=>!O),[]),M=!!N;k.useEffect(()=>()=>_(),[_]);const U=t.ThreadList,V=t.Composer,P=t.Header;return p.jsxs("div",{className:"sa-fullpage",children:[U?p.jsx("div",{className:`sa-fp-sidebar-wrapper ${E?"":"sa-fp-sidebar-wrapper-collapsed"}`,children:p.jsx(U,{conversations:y,activeSessionId:C,onSwitch:b,onNew:j,onDelete:S,onRename:A,hasMore:B,onLoadMore:w})}):p.jsx(Hp,{conversations:y,activeSessionId:C,onSwitch:b,onNew:j,onDelete:S,onRename:A,isCollapsed:!E,onToggleCollapse:T,hasMore:B,onLoadMore:w,conversationsLoading:z}),p.jsxs("div",{className:"sa-fp-main",children:[P?p.jsx(P,{title:M?(N==null?void 0:N.title)??e:e,panelTitle:M?N==null?void 0:N.title:void 0,onClose:l??Mr,onToggleThreadList:T,showHome:M,onHome:M?_:Mr,artifactCount:M||!d?0:v.length,onToggleArtifactDrawer:M||!d?void 0:L}):p.jsxs("div",{className:"sa-fp-header",children:[p.jsx("div",{className:"sa-fp-header-title",children:M?(N==null?void 0:N.title)??e:e}),p.jsxs("div",{className:"sa-fp-header-actions",children:[M&&p.jsx("button",{className:"sa-fp-header-btn",onClick:_,title:"返回聊天","aria-label":"返回聊天",children:p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[p.jsx("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),p.jsx("polyline",{points:"9 22 9 12 15 12 15 22"})]})}),!M&&d&&v.length>0&&p.jsxs("button",{className:"sa-fp-header-btn sa-header-btn-artifact",onClick:L,title:"会话产物",children:[p.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[p.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),p.jsx("polyline",{points:"14 2 14 8 20 8"})]}),p.jsx("span",{children:"产物"})]})]})]}),p.jsx(pa,{contentClassName:"sa-fp-content-row",artifactPreview:d,thread:p.jsx(Ln,{slots:t,welcomeMessage:n,suggestedPrompts:r,capabilities:i,quickLinks:s,logo:a,avatar:u,artifactPreview:d,showTimestamp:c}),composer:V?p.jsx(V,{status:h,onSend:f,onStop:m}):p.jsx(Dn,{})})]})]})}function ha(e){const{sdk:t,mode:n="floating",slots:r={},hooks:i={},welcomeMessage:s,suggestedPrompts:a,title:o="AI Assistant",initialOpen:l=!1,onOpenChange:u,sidebarDefaultOpen:d,avatar:c,artifactPreview:h,capabilities:f,quickLinks:m,logo:y,triggerLogo:C,theme:b,showTimestamp:j,attachmentUploader:S,nosUpload:A}=e,[L,v]=k.useState(l);k.useEffect(()=>{v(l)},[l]);const N=k.useCallback(()=>{var z,E;const w=!L;v(w),u==null||u(w),w?(z=i.onOpen)==null||z.call(i):(E=i.onClose)==null||E.call(i)},[L,i,u]),_=k.useCallback(()=>{var w;v(!1),u==null||u(!1),(w=i.onClose)==null||w.call(i)},[i,u]),B=r.Trigger??Hr;return n==="fullpage"?L?p.jsx(Jt,{sdk:t,hooks:i,attachmentUploader:S,nosUpload:A,children:p.jsx(fa,{title:o,slots:r,welcomeMessage:s,suggestedPrompts:a,capabilities:f,quickLinks:m,logo:y,sidebarDefaultOpen:d,onClose:_,avatar:c,artifactPreview:h,showTimestamp:j})}):null:p.jsxs(Jt,{sdk:t,hooks:i,attachmentUploader:S,nosUpload:A,children:[p.jsx(B,{isOpen:L,onClick:N,triggerLogo:C}),p.jsx($p,{isOpen:L,onClose:_,title:o,slots:r,welcomeMessage:s,suggestedPrompts:a,avatar:c,artifactPreview:h,capabilities:f,quickLinks:m,logo:y,defaultWidth:b==null?void 0:b.panelWidth,defaultHeight:b==null?void 0:b.panelHeight,showTimestamp:j})]})}const ga=`
31
31
  [data-super-agent-widget] {
32
32
  --sa-primary-dark: color-mix(in srgb, var(--sa-primary) 82%, #000);
33
33
  --sa-primary-light: color-mix(in srgb, var(--sa-primary) 10%, #fff);
@@ -1219,7 +1219,7 @@
1219
1219
  .sa-fp-content-row { display: flex; flex: 1; min-height: 0; overflow: hidden; }
1220
1220
  .sa-fp-content-row .sa-thread { flex: 1; min-width: 0; transition: flex 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
1221
1221
 
1222
- /* ── Page overlay(面板级整屏页面:替换内容区 + 输入区,Header 保留) ── */
1222
+ /* ── Page overlay(面板级整屏页面:替换内容区 + 输入区,Header 保留;无返回栏,纯白底) ── */
1223
1223
  .sa-page-overlay {
1224
1224
  display: flex; flex-direction: column; flex: 1; min-height: 0;
1225
1225
  position: relative; z-index: 2; background: #fff; overflow: hidden;
@@ -1227,14 +1227,6 @@
1227
1227
  }
1228
1228
  /* 大窗态与内容区/输入区一致的 800px 居中 */
1229
1229
  .sa-page-overlay-centered { width: 100%; max-width: 800px; margin: 0 auto; }
1230
- .sa-page-overlay-bar {
1231
- display: flex; align-items: center; gap: 8px; flex-shrink: 0;
1232
- padding: 10px 14px; border-bottom: 1px solid var(--sa-border);
1233
- background: var(--sa-surface); color: var(--sa-text);
1234
- font-size: 15px; font-weight: 600;
1235
- }
1236
- .sa-page-overlay-back-label { font-size: 13px; font-weight: 400; }
1237
- .sa-page-overlay-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1238
1230
  /* 滚动归 SDK,业务页不写滚动容器 */
1239
1231
  .sa-page-overlay-body { flex: 1; min-height: 0; overflow-y: auto; }
1240
1232
  /* ── Artifact keyframes ── */
@@ -1269,5 +1261,5 @@
1269
1261
  from { opacity: 0; transform: translateY(10px); }
1270
1262
  to { opacity: 1; transform: translateY(0); }
1271
1263
  }
1272
- `,Ud='[data-super-agent-widget] .pointer-events-none{pointer-events:none}[data-super-agent-widget] .visible{visibility:visible}[data-super-agent-widget] .collapse{visibility:collapse}[data-super-agent-widget] .fixed{position:fixed}[data-super-agent-widget] .absolute{position:absolute}[data-super-agent-widget] .relative{position:relative}[data-super-agent-widget] .inset-0{top:0;right:0;bottom:0;left:0}[data-super-agent-widget] .inset-x-0{left:0;right:0}[data-super-agent-widget] .-bottom-px{bottom:-1px}[data-super-agent-widget] .-left-px{left:-1px}[data-super-agent-widget] .-right-2{right:-.5rem}[data-super-agent-widget] .-top-1\\.5{top:-.375rem}[data-super-agent-widget] .-top-px{top:-1px}[data-super-agent-widget] .bottom-0{bottom:0}[data-super-agent-widget] .left-\\[-3px\\]{left:-3px}[data-super-agent-widget] .top-0{top:0}[data-super-agent-widget] .z-0{z-index:0}[data-super-agent-widget] .z-10{z-index:10}[data-super-agent-widget] .z-20{z-index:20}[data-super-agent-widget] .z-\\[10000\\]{z-index:10000}[data-super-agent-widget] .z-\\[10001\\]{z-index:10001}[data-super-agent-widget] .z-\\[1\\]{z-index:1}[data-super-agent-widget] .z-\\[2\\]{z-index:2}[data-super-agent-widget] .z-\\[5\\]{z-index:5}[data-super-agent-widget] .z-\\[var\\(--sa-z-index\\,9999\\)\\]{z-index:var(--sa-z-index,9999)}[data-super-agent-widget] .m-0{margin:0}[data-super-agent-widget] .mx-auto{margin-left:auto;margin-right:auto}[data-super-agent-widget] .mb-0\\.5{margin-bottom:.125rem}[data-super-agent-widget] .mb-1{margin-bottom:.25rem}[data-super-agent-widget] .mb-1\\.5{margin-bottom:.375rem}[data-super-agent-widget] .mb-3{margin-bottom:.75rem}[data-super-agent-widget] .mb-4{margin-bottom:1rem}[data-super-agent-widget] .mr-auto{margin-right:auto}[data-super-agent-widget] .mt-3{margin-top:.75rem}[data-super-agent-widget] .block{display:block}[data-super-agent-widget] .inline{display:inline}[data-super-agent-widget] .flex{display:flex}[data-super-agent-widget] .inline-flex{display:inline-flex}[data-super-agent-widget] .table{display:table}[data-super-agent-widget] .hidden{display:none}[data-super-agent-widget] .h-5{height:1.25rem}[data-super-agent-widget] .h-7{height:1.75rem}[data-super-agent-widget] .h-8{height:2rem}[data-super-agent-widget] .h-9{height:2.25rem}[data-super-agent-widget] .h-\\[13px\\]{height:13px}[data-super-agent-widget] .h-\\[18px\\]{height:18px}[data-super-agent-widget] .h-\\[238px\\]{height:238px}[data-super-agent-widget] .h-\\[calc\\(100\\%_-_48px\\)\\]{height:calc(100% - 48px)}[data-super-agent-widget] .h-full{height:100%}[data-super-agent-widget] .min-h-\\[34px\\]{min-height:34px}[data-super-agent-widget] .min-h-\\[70px\\]{min-height:70px}[data-super-agent-widget] .w-12{width:3rem}[data-super-agent-widget] .w-5{width:1.25rem}[data-super-agent-widget] .w-7{width:1.75rem}[data-super-agent-widget] .w-\\[18px\\]{width:18px}[data-super-agent-widget] .w-\\[220px\\]{width:220px}[data-super-agent-widget] .w-\\[6px\\]{width:6px}[data-super-agent-widget] .w-full{width:100%}[data-super-agent-widget] .w-px{width:1px}[data-super-agent-widget] .min-w-0{min-width:0px}[data-super-agent-widget] .min-w-\\[14px\\]{min-width:14px}[data-super-agent-widget] .max-w-16{max-width:4rem}[data-super-agent-widget] .max-w-\\[800px\\]{max-width:800px}[data-super-agent-widget] .max-w-full{max-width:100%}[data-super-agent-widget] .flex-1{flex:1 1 0%}[data-super-agent-widget] .flex-shrink{flex-shrink:1}[data-super-agent-widget] .shrink-0{flex-shrink:0}[data-super-agent-widget] .border-collapse{border-collapse:collapse}[data-super-agent-widget] .scale-50{--tw-scale-x: .5;--tw-scale-y: .5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-super-agent-widget] .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-super-agent-widget] .cursor-col-resize{cursor:col-resize}[data-super-agent-widget] .cursor-default{cursor:default}[data-super-agent-widget] .cursor-grab{cursor:grab}[data-super-agent-widget] .cursor-pointer{cursor:pointer}[data-super-agent-widget] .cursor-text{cursor:text}[data-super-agent-widget] .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}[data-super-agent-widget] .resize-none{resize:none}[data-super-agent-widget] .resize{resize:both}[data-super-agent-widget] .flex-row{flex-direction:row}[data-super-agent-widget] .flex-col{flex-direction:column}[data-super-agent-widget] .flex-wrap{flex-wrap:wrap}[data-super-agent-widget] .items-start{align-items:flex-start}[data-super-agent-widget] .items-center{align-items:center}[data-super-agent-widget] .justify-end{justify-content:flex-end}[data-super-agent-widget] .justify-center{justify-content:center}[data-super-agent-widget] .justify-between{justify-content:space-between}[data-super-agent-widget] .gap-0\\.5{gap:.125rem}[data-super-agent-widget] .gap-1{gap:.25rem}[data-super-agent-widget] .gap-1\\.5{gap:.375rem}[data-super-agent-widget] .gap-2{gap:.5rem}[data-super-agent-widget] .gap-2\\.5{gap:.625rem}[data-super-agent-widget] .gap-3{gap:.75rem}[data-super-agent-widget] .gap-4{gap:1rem}[data-super-agent-widget] .gap-8{gap:2rem}[data-super-agent-widget] .gap-\\[22px\\]{gap:22px}[data-super-agent-widget] .gap-\\[7px\\]{gap:7px}[data-super-agent-widget] .overflow-hidden{overflow:hidden}[data-super-agent-widget] .overflow-visible{overflow:visible}[data-super-agent-widget] .overflow-y-auto{overflow-y:auto}[data-super-agent-widget] .text-ellipsis{text-overflow:ellipsis}[data-super-agent-widget] .whitespace-nowrap{white-space:nowrap}[data-super-agent-widget] .rounded{border-radius:.25rem}[data-super-agent-widget] .rounded-\\[5px\\]{border-radius:5px}[data-super-agent-widget] .rounded-full{border-radius:9999px}[data-super-agent-widget] .rounded-md{border-radius:.375rem}[data-super-agent-widget] .border{border-width:1px}[data-super-agent-widget] .border-r{border-right-width:1px}[data-super-agent-widget] .border-r-0{border-right-width:0px}[data-super-agent-widget] .border-none{border-style:none}[data-super-agent-widget] .border-\\[\\#DADADA\\]{--tw-border-opacity: 1;border-color:rgb(218 218 218 / var(--tw-border-opacity, 1))}[data-super-agent-widget] .border-\\[\\#E8E8E8\\]{--tw-border-opacity: 1;border-color:rgb(232 232 232 / var(--tw-border-opacity, 1))}[data-super-agent-widget] .border-\\[\\#ECECEC\\]{--tw-border-opacity: 1;border-color:rgb(236 236 236 / var(--tw-border-opacity, 1))}[data-super-agent-widget] .border-\\[var\\(--sa-primary\\)\\]{border-color:var(--sa-primary)}[data-super-agent-widget] .bg-\\[\\#DCDCDC\\]{--tw-bg-opacity: 1;background-color:rgb(220 220 220 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[\\#E8F1FE\\]{--tw-bg-opacity: 1;background-color:rgb(232 241 254 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[\\#F5F5F5\\]{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[\\#FAFAFA\\]{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[\\#fee2e2\\]{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[var\\(--sa-primary\\)\\]{background-color:var(--sa-primary)}[data-super-agent-widget] .bg-black\\/30{background-color:#0000004d}[data-super-agent-widget] .bg-transparent{background-color:transparent}[data-super-agent-widget] .bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .object-contain{-o-object-fit:contain;object-fit:contain}[data-super-agent-widget] .p-0{padding:0}[data-super-agent-widget] .p-2{padding:.5rem}[data-super-agent-widget] .p-3{padding:.75rem}[data-super-agent-widget] .px-0\\.5{padding-left:.125rem;padding-right:.125rem}[data-super-agent-widget] .px-1{padding-left:.25rem;padding-right:.25rem}[data-super-agent-widget] .px-1\\.5{padding-left:.375rem;padding-right:.375rem}[data-super-agent-widget] .px-2\\.5{padding-left:.625rem;padding-right:.625rem}[data-super-agent-widget] .px-3{padding-left:.75rem;padding-right:.75rem}[data-super-agent-widget] .px-\\[15px\\]{padding-left:15px;padding-right:15px}[data-super-agent-widget] .py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}[data-super-agent-widget] .py-1{padding-top:.25rem;padding-bottom:.25rem}[data-super-agent-widget] .py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}[data-super-agent-widget] .py-2{padding-top:.5rem;padding-bottom:.5rem}[data-super-agent-widget] .py-3{padding-top:.75rem;padding-bottom:.75rem}[data-super-agent-widget] .pb-1{padding-bottom:.25rem}[data-super-agent-widget] .pb-2\\.5{padding-bottom:.625rem}[data-super-agent-widget] .pt-2{padding-top:.5rem}[data-super-agent-widget] .text-left{text-align:left}[data-super-agent-widget] .text-center{text-align:center}[data-super-agent-widget] .text-\\[11px\\]{font-size:11px}[data-super-agent-widget] .text-\\[12px\\]{font-size:12px}[data-super-agent-widget] .text-\\[13px\\]{font-size:13px}[data-super-agent-widget] .text-\\[14px\\]{font-size:14px}[data-super-agent-widget] .text-\\[18px\\]{font-size:18px}[data-super-agent-widget] .text-\\[9px\\]{font-size:9px}[data-super-agent-widget] .font-bold{font-weight:700}[data-super-agent-widget] .font-medium{font-weight:500}[data-super-agent-widget] .font-semibold{font-weight:600}[data-super-agent-widget] .italic{font-style:italic}[data-super-agent-widget] .leading-\\[1\\.3\\]{line-height:1.3}[data-super-agent-widget] .leading-\\[1\\.4\\]{line-height:1.4}[data-super-agent-widget] .leading-\\[1\\.5\\]{line-height:1.5}[data-super-agent-widget] .leading-\\[14px\\]{line-height:14px}[data-super-agent-widget] .leading-none{line-height:1}[data-super-agent-widget] .text-\\[\\#333\\]{--tw-text-opacity: 1;color:rgb(51 51 51 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#666\\]{--tw-text-opacity: 1;color:rgb(102 102 102 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#999\\]{--tw-text-opacity: 1;color:rgb(153 153 153 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#9A9A9A\\]{--tw-text-opacity: 1;color:rgb(154 154 154 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#A0A0A0\\]{--tw-text-opacity: 1;color:rgb(160 160 160 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#B8B8B8\\]{--tw-text-opacity: 1;color:rgb(184 184 184 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#C0C0C0\\]{--tw-text-opacity: 1;color:rgb(192 192 192 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#ef4444\\]{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .underline{text-decoration-line:underline}[data-super-agent-widget] .antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}[data-super-agent-widget] .opacity-0{opacity:0}[data-super-agent-widget] .opacity-10{opacity:.1}[data-super-agent-widget] .opacity-100{opacity:1}[data-super-agent-widget] .opacity-60{opacity:.6}[data-super-agent-widget] .opacity-70{opacity:.7}[data-super-agent-widget] .shadow-\\[0_-12px_48px_rgba\\(0\\,0\\,0\\,0\\.25\\)\\]{--tw-shadow: 0 -12px 48px rgba(0,0,0,.25);--tw-shadow-colored: 0 -12px 48px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-super-agent-widget] .shadow-\\[0_2px_8px_rgba\\(0\\,0\\,0\\,0\\.12\\)\\]{--tw-shadow: 0 2px 8px rgba(0,0,0,.12);--tw-shadow-colored: 0 2px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-super-agent-widget] .outline-none{outline:2px solid transparent;outline-offset:2px}[data-super-agent-widget] .outline{outline-style:solid}[data-super-agent-widget] .blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-super-agent-widget] .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-super-agent-widget] .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-super-agent-widget] .transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-super-agent-widget] .transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-super-agent-widget] .duration-200{transition-duration:.2s}[data-super-agent-widget] .ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}[data-super-agent-widget] .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes sa-window-in{0%{opacity:0;transform:translateY(20px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes sa-slide-up-full{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes sa-home-fade-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes sa-chip-in{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes sa-logo-float{0%,to{transform:translateY(0)}50%{transform:translateY(-3px)}}@keyframes sa-title-shimmer{0%{background-position:100% 0}to{background-position:-100% 0}}@keyframes sa-history-in{0%{opacity:0;transform:translate(-10px)}to{opacity:1;transform:translate(0)}}[data-super-agent-widget] .animate-sa-window-in{animation:sa-window-in .3s cubic-bezier(.16,1,.3,1)}[data-super-agent-widget] .animate-sa-slide-up-full{animation:sa-slide-up-full .3s cubic-bezier(.16,1,.3,1)}[data-super-agent-widget] .animate-sa-fade-in{animation:sa-fade-in .2s ease}[data-super-agent-widget] .animate-sa-home-fade-in{animation:sa-home-fade-in .4s ease forwards}[data-super-agent-widget] .animate-sa-chip-in{animation:sa-chip-in .4s cubic-bezier(.22,1,.36,1) forwards}[data-super-agent-widget] .animate-sa-logo-float{animation:sa-logo-float 3s ease-in-out infinite}[data-super-agent-widget] .animate-sa-title-shimmer{animation:sa-title-shimmer 2.5s ease forwards}[data-super-agent-widget] .animate-sa-history-in{animation:sa-history-in .2s ease}[data-super-agent-widget] .sa-tip{position:relative}[data-super-agent-widget] .sa-tip:before,[data-super-agent-widget] .sa-tip:after{position:absolute;top:100%;left:50%;pointer-events:none;opacity:0;transition:opacity .15s ease;z-index:100}[data-super-agent-widget] .sa-tip:before{content:attr(data-tooltip);transform:translate(-50%);margin-top:6px;padding:4px 8px;background:#fff;color:#333;font-size:12px;line-height:1.4;white-space:nowrap;border-radius:4px;box-shadow:0 2px 8px #0000001f;border:1px solid #e8e8e8}[data-super-agent-widget] .sa-tip:after{content:"";transform:translate(-50%);margin-top:2px;border:4px solid transparent;border-bottom-color:#fff;filter:drop-shadow(0 -1px 1px rgba(0,0,0,.06))}[data-super-agent-widget] .sa-tip:hover:before,[data-super-agent-widget] .sa-tip:hover:after{opacity:1}[data-super-agent-widget] .sa-chip{background:linear-gradient(#fff,#fff) padding-box,linear-gradient(#e0e0e0,#e0e0e0) border-box;border:1px solid transparent}[data-super-agent-widget] .sa-chip:hover{background:linear-gradient(#fff,#fff) padding-box,linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7) border-box}[data-super-agent-widget] .sa-chip:hover .sa-chip-text{background:linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}[data-super-agent-widget] .sa-shimmer-text{background:linear-gradient(90deg,#333,#333 35%,#00d4ff 40%,#1881f0,#2b52ee,#d116ea,#ff2e7e 56%,#333 61%,#333);background-size:300% 100%;background-position:100% 0;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}[data-super-agent-widget] .sa-new-chat{background:linear-gradient(258deg,#ff2e7e1a -4%,#d116ea1a 16%,#2b52ee1a 53%,#1881f01a 81%,#00d4ff1a 106%)}[data-super-agent-widget] .sa-new-chat:hover{background:linear-gradient(258deg,#ff2e7e29 -4%,#d116ea29 16%,#2b52ee29 53%,#1881f029 81%,#00d4ff29 106%)}[data-super-agent-widget] .sa-new-chat .sa-new-chat-text{background:linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}[data-super-agent-widget] .sa-home-gradient{background:linear-gradient(239deg,#ff2e7e -3%,#d116ea 17%,#2b52ee 54%,#1881f0 82%,#00d4ff 107%)}[data-super-agent-widget] .sa-home-gradient-fade{background:linear-gradient(180deg,#fff0,#fff)}[data-super-agent-widget] .sa-home-view .sa-thread{background:transparent}[data-super-agent-widget] .sa-resize-handle:hover{background:color-mix(in srgb,var(--sa-primary) 30%,transparent)}[data-super-agent-widget] .sa-input-form{border:1px solid transparent;background-color:#fff;background-image:linear-gradient(#fff,#fff),linear-gradient(110deg,#03b5ff80,#285cff80 47%,#ff28a780);background-origin:border-box;background-clip:padding-box,border-box;transition:background .15s ease}[data-super-agent-widget] .sa-input-form-active,[data-super-agent-widget] .sa-input-form:focus-within{background-image:linear-gradient(#fff,#fff),linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7)}[data-super-agent-widget] .sa-input-form-streaming,[data-super-agent-widget] .sa-input-form-streaming:focus-within{background-image:linear-gradient(#f5f5f7,#f5f5f7),linear-gradient(#e5e7eb,#e5e7eb);cursor:not-allowed}[data-super-agent-widget] .sa-input-form-streaming .sa-input-field{cursor:not-allowed}[data-super-agent-widget] .sa-input-field:disabled::-moz-placeholder{color:#b8b8b8}[data-super-agent-widget] .sa-input-field:disabled::placeholder{color:#b8b8b8}[data-super-agent-widget] .sa-send-btn{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border:none;border-radius:9999px;background:linear-gradient(110deg,#03b5ff80,#285cff80 47%,#ff28a780);cursor:pointer;flex-shrink:0;transition:background .15s ease,opacity .15s ease}[data-super-agent-widget] .sa-send-btn-active,[data-super-agent-widget] .sa-input-form:focus-within .sa-send-btn{background:linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7)}[data-super-agent-widget] .sa-send-btn:hover{opacity:.9}[data-super-agent-widget] .sa-send-btn:active{opacity:.7}[data-super-agent-widget] .sa-send-btn img{display:block;width:14px;height:14px;filter:brightness(0) invert(1)}[data-super-agent-widget] .sa-stop-icon{display:block;width:8px;height:8px;border-radius:2px;background:#fff}[data-super-agent-widget] .sa-send-hint{display:flex;align-items:center;gap:3px;flex-shrink:0;font-size:11px;line-height:1;color:#9ca3af;-webkit-user-select:none;-moz-user-select:none;user-select:none}[data-super-agent-widget] .sa-send-kbd{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 4px;border:1px solid #e5e7eb;border-radius:4px;background:#f5f5f7;font-family:inherit;font-size:11px;line-height:1;color:#6b7280}[data-super-agent-widget] .sa-attach-btn{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border:none;border-radius:9999px;background:linear-gradient(110deg,#03b5ff80,#285cff80 47%,#ff28a780);color:#fff;cursor:pointer;flex-shrink:0;transition:background .15s ease,opacity .15s ease}[data-super-agent-widget] .sa-attach-btn:hover{background:linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7);opacity:.9}[data-super-agent-widget] .sa-attach-btn:active{opacity:.7}[data-super-agent-widget] .sa-attachment-tray{display:flex;flex-wrap:wrap;gap:6px;padding:2px 0}[data-super-agent-widget] .sa-attachment-tray-chip{display:inline-flex;align-items:center;gap:4px;max-width:220px;padding:4px 8px;border:1px solid rgba(40,92,255,.25);border-radius:6px;background:#285cff0d;font-size:12px;line-height:1;color:#333}[data-super-agent-widget] .sa-attachment-tray-chip-error{border-color:#ef444459;background:#ef44440f}[data-super-agent-widget] .sa-attachment-tray-chip-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}[data-super-agent-widget] .sa-attachment-tray-chip-size{color:#b8b8b8;flex-shrink:0}[data-super-agent-widget] .sa-attachment-tray-chip-remove{display:flex;align-items:center;justify-content:center;width:14px;height:14px;border:none;border-radius:9999px;background:transparent;color:#b8b8b8;font-size:10px;line-height:1;cursor:pointer;flex-shrink:0;padding:0}[data-super-agent-widget] .sa-attachment-tray-chip-remove:hover{background:#00000014;color:#666}[data-super-agent-widget] .sa-attachment-chip{display:inline-flex;align-items:center;gap:4px;max-width:240px;margin:2px 0;padding:5px 10px;border-radius:8px;background:#ffffff59;font-size:12px;line-height:1;color:inherit}[data-super-agent-widget] .sa-attachment-chip-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}[data-super-agent-widget] .sa-attachment-chip-size{color:#00000073;flex-shrink:0}[data-super-agent-widget] .placeholder\\:text-\\[\\#B8B8B8\\]::-moz-placeholder{--tw-text-opacity: 1;color:rgb(184 184 184 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .placeholder\\:text-\\[\\#B8B8B8\\]::placeholder{--tw-text-opacity: 1;color:rgb(184 184 184 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .hover\\:scale-\\[1\\.08\\]:hover{--tw-scale-x: 1.08;--tw-scale-y: 1.08;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-super-agent-widget] .hover\\:bg-\\[\\#E8F1FE\\]:hover{--tw-bg-opacity: 1;background-color:rgb(232 241 254 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .hover\\:bg-\\[\\#F5F5F5\\]:hover{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .hover\\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .hover\\:bg-white\\/70:hover{background-color:#ffffffb3}[data-super-agent-widget] .hover\\:text-\\[\\#1881F0\\]:hover{--tw-text-opacity: 1;color:rgb(24 129 240 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .hover\\:text-\\[\\#ef4444\\]:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .hover\\:text-\\[var\\(--sa-primary\\)\\]:hover{color:var(--sa-primary)}[data-super-agent-widget] .active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-super-agent-widget] .active\\:cursor-grabbing:active{cursor:grabbing}[data-super-agent-widget] .active\\:bg-\\[\\#F5F5F5\\]:active{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] :is(.group:hover .group-hover\\:flex){display:flex}',ga={primaryColor:"#6366f1",backgroundColor:"#ffffff",fontFamily:"system-ui, -apple-system, sans-serif",borderRadius:16,panelWidth:400,panelHeight:648,zIndex:9999};function Vd(e,t){const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16),s=1-t;return`#${Math.round(n*s).toString(16).padStart(2,"0")}${Math.round(r*s).toString(16).padStart(2,"0")}${Math.round(i*s).toString(16).padStart(2,"0")}`}function qd(e,t){const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return`#${Math.round(n+(255-n)*t).toString(16).padStart(2,"0")}${Math.round(r+(255-r)*t).toString(16).padStart(2,"0")}${Math.round(i+(255-i)*t).toString(16).padStart(2,"0")}`}function ma(e){const t={...ga,...e},n=t.primaryColor,r=t.backgroundColor;return[`--sa-primary: ${n}`,`--sa-bg: ${r}`,`--sa-font: ${t.fontFamily}`,`--sa-radius: ${t.borderRadius}px`,`--sa-panel-width: ${t.panelWidth}px`,`--sa-panel-height: ${t.panelHeight}px`,`--sa-z-index: ${t.zIndex}`,`--sa-primary-dark: ${Vd(n,.15)}`,`--sa-primary-light: ${qd(n,.9)}`,`--sa-surface: ${r}`,"--sa-border: #e5e7eb","--sa-hover: #f4f4f5","--sa-text: #374151","--sa-text-muted: #9ca3af","--sa-text-light: #6b7280"].join("; ")}function Wd(e,t){const n=typeof e=="string"?document.querySelector(e):e;if(!n)throw new Error(`Target element not found: ${e}`);const r=document.createElement("div");r.setAttribute("data-super-agent-widget","");const i=ma(t.theme??{});if(r.setAttribute("style",`${i}; height: 100%;`),n.appendChild(r),!document.getElementById("sa-widget-styles")){const l=document.createElement("style");l.id="sa-widget-styles",l.textContent=`${ha}
1273
- ${Ud}`,document.head.appendChild(l)}let s=xa.createRoot(r),a=!1;const o=l=>{s&&s.render(k.createElement(fa,{...t,initialOpen:l??a,onOpenChange:u=>{a=u}}))};return o(!1),{open(){a=!0,o(!0)},close(){a=!1,o(!1)},destroy(){s&&(s.unmount(),s=null),r.remove()}}}exports.ASSETS=de;exports.ActionBar=oa;exports.ChatProvider=Jt;exports.ChatWidget=fa;exports.Composer=Dn;exports.ErrorPart=ia;exports.FullpageLayout=da;exports.Header=Hr;exports.Icon=J;exports.InterruptCard=sa;exports.Message=la;exports.PageOverlay=ca;exports.TextPart=Zi;exports.ThinkingPart=ta;exports.Thread=Ln;exports.ThreadList=Zt;exports.ToolCallPart=na;exports.ToolResultPart=ra;exports.Trigger=$r;exports.WelcomeScreen=ua;exports.defaultTheme=ga;exports.ensureIconFont=ea;exports.mount=Wd;exports.themeToCSSVars=ma;exports.useAutoScroll=Vr;exports.useChat=Mr;exports.useChatContext=Te;exports.useConversations=Rr;exports.widgetStyles=ha;
1264
+ `,Up='[data-super-agent-widget] .pointer-events-none{pointer-events:none}[data-super-agent-widget] .visible{visibility:visible}[data-super-agent-widget] .collapse{visibility:collapse}[data-super-agent-widget] .fixed{position:fixed}[data-super-agent-widget] .absolute{position:absolute}[data-super-agent-widget] .relative{position:relative}[data-super-agent-widget] .inset-0{top:0;right:0;bottom:0;left:0}[data-super-agent-widget] .inset-x-0{left:0;right:0}[data-super-agent-widget] .-bottom-px{bottom:-1px}[data-super-agent-widget] .-left-px{left:-1px}[data-super-agent-widget] .-right-2{right:-.5rem}[data-super-agent-widget] .-top-1\\.5{top:-.375rem}[data-super-agent-widget] .-top-px{top:-1px}[data-super-agent-widget] .bottom-0{bottom:0}[data-super-agent-widget] .left-\\[-3px\\]{left:-3px}[data-super-agent-widget] .top-0{top:0}[data-super-agent-widget] .z-0{z-index:0}[data-super-agent-widget] .z-10{z-index:10}[data-super-agent-widget] .z-20{z-index:20}[data-super-agent-widget] .z-\\[10000\\]{z-index:10000}[data-super-agent-widget] .z-\\[10001\\]{z-index:10001}[data-super-agent-widget] .z-\\[1\\]{z-index:1}[data-super-agent-widget] .z-\\[2\\]{z-index:2}[data-super-agent-widget] .z-\\[5\\]{z-index:5}[data-super-agent-widget] .z-\\[var\\(--sa-z-index\\,9999\\)\\]{z-index:var(--sa-z-index,9999)}[data-super-agent-widget] .m-0{margin:0}[data-super-agent-widget] .mx-auto{margin-left:auto;margin-right:auto}[data-super-agent-widget] .mb-0\\.5{margin-bottom:.125rem}[data-super-agent-widget] .mb-1{margin-bottom:.25rem}[data-super-agent-widget] .mb-1\\.5{margin-bottom:.375rem}[data-super-agent-widget] .mb-3{margin-bottom:.75rem}[data-super-agent-widget] .mb-4{margin-bottom:1rem}[data-super-agent-widget] .ml-auto{margin-left:auto}[data-super-agent-widget] .mr-auto{margin-right:auto}[data-super-agent-widget] .mt-3{margin-top:.75rem}[data-super-agent-widget] .block{display:block}[data-super-agent-widget] .inline{display:inline}[data-super-agent-widget] .flex{display:flex}[data-super-agent-widget] .inline-flex{display:inline-flex}[data-super-agent-widget] .table{display:table}[data-super-agent-widget] .hidden{display:none}[data-super-agent-widget] .h-5{height:1.25rem}[data-super-agent-widget] .h-7{height:1.75rem}[data-super-agent-widget] .h-8{height:2rem}[data-super-agent-widget] .h-9{height:2.25rem}[data-super-agent-widget] .h-\\[13px\\]{height:13px}[data-super-agent-widget] .h-\\[18px\\]{height:18px}[data-super-agent-widget] .h-\\[238px\\]{height:238px}[data-super-agent-widget] .h-\\[calc\\(100\\%_-_48px\\)\\]{height:calc(100% - 48px)}[data-super-agent-widget] .h-full{height:100%}[data-super-agent-widget] .min-h-\\[34px\\]{min-height:34px}[data-super-agent-widget] .min-h-\\[70px\\]{min-height:70px}[data-super-agent-widget] .w-12{width:3rem}[data-super-agent-widget] .w-5{width:1.25rem}[data-super-agent-widget] .w-7{width:1.75rem}[data-super-agent-widget] .w-\\[18px\\]{width:18px}[data-super-agent-widget] .w-\\[220px\\]{width:220px}[data-super-agent-widget] .w-\\[6px\\]{width:6px}[data-super-agent-widget] .w-full{width:100%}[data-super-agent-widget] .w-px{width:1px}[data-super-agent-widget] .min-w-0{min-width:0px}[data-super-agent-widget] .min-w-\\[14px\\]{min-width:14px}[data-super-agent-widget] .max-w-16{max-width:4rem}[data-super-agent-widget] .max-w-\\[50\\%\\]{max-width:50%}[data-super-agent-widget] .max-w-\\[800px\\]{max-width:800px}[data-super-agent-widget] .max-w-full{max-width:100%}[data-super-agent-widget] .flex-1{flex:1 1 0%}[data-super-agent-widget] .flex-shrink{flex-shrink:1}[data-super-agent-widget] .shrink-0{flex-shrink:0}[data-super-agent-widget] .border-collapse{border-collapse:collapse}[data-super-agent-widget] .scale-50{--tw-scale-x: .5;--tw-scale-y: .5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-super-agent-widget] .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-super-agent-widget] .cursor-col-resize{cursor:col-resize}[data-super-agent-widget] .cursor-default{cursor:default}[data-super-agent-widget] .cursor-grab{cursor:grab}[data-super-agent-widget] .cursor-pointer{cursor:pointer}[data-super-agent-widget] .cursor-text{cursor:text}[data-super-agent-widget] .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}[data-super-agent-widget] .resize-none{resize:none}[data-super-agent-widget] .resize{resize:both}[data-super-agent-widget] .flex-row{flex-direction:row}[data-super-agent-widget] .flex-col{flex-direction:column}[data-super-agent-widget] .flex-wrap{flex-wrap:wrap}[data-super-agent-widget] .items-start{align-items:flex-start}[data-super-agent-widget] .items-center{align-items:center}[data-super-agent-widget] .justify-end{justify-content:flex-end}[data-super-agent-widget] .justify-center{justify-content:center}[data-super-agent-widget] .gap-0\\.5{gap:.125rem}[data-super-agent-widget] .gap-1{gap:.25rem}[data-super-agent-widget] .gap-1\\.5{gap:.375rem}[data-super-agent-widget] .gap-2{gap:.5rem}[data-super-agent-widget] .gap-2\\.5{gap:.625rem}[data-super-agent-widget] .gap-3{gap:.75rem}[data-super-agent-widget] .gap-4{gap:1rem}[data-super-agent-widget] .gap-8{gap:2rem}[data-super-agent-widget] .gap-\\[22px\\]{gap:22px}[data-super-agent-widget] .gap-\\[7px\\]{gap:7px}[data-super-agent-widget] .overflow-hidden{overflow:hidden}[data-super-agent-widget] .overflow-visible{overflow:visible}[data-super-agent-widget] .overflow-y-auto{overflow-y:auto}[data-super-agent-widget] .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[data-super-agent-widget] .text-ellipsis{text-overflow:ellipsis}[data-super-agent-widget] .whitespace-nowrap{white-space:nowrap}[data-super-agent-widget] .rounded{border-radius:.25rem}[data-super-agent-widget] .rounded-\\[5px\\]{border-radius:5px}[data-super-agent-widget] .rounded-full{border-radius:9999px}[data-super-agent-widget] .rounded-md{border-radius:.375rem}[data-super-agent-widget] .border{border-width:1px}[data-super-agent-widget] .border-r{border-right-width:1px}[data-super-agent-widget] .border-r-0{border-right-width:0px}[data-super-agent-widget] .border-none{border-style:none}[data-super-agent-widget] .border-\\[\\#DADADA\\]{--tw-border-opacity: 1;border-color:rgb(218 218 218 / var(--tw-border-opacity, 1))}[data-super-agent-widget] .border-\\[\\#E8E8E8\\]{--tw-border-opacity: 1;border-color:rgb(232 232 232 / var(--tw-border-opacity, 1))}[data-super-agent-widget] .border-\\[\\#ECECEC\\]{--tw-border-opacity: 1;border-color:rgb(236 236 236 / var(--tw-border-opacity, 1))}[data-super-agent-widget] .border-\\[var\\(--sa-primary\\)\\]{border-color:var(--sa-primary)}[data-super-agent-widget] .bg-\\[\\#DCDCDC\\]{--tw-bg-opacity: 1;background-color:rgb(220 220 220 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[\\#E8F1FE\\]{--tw-bg-opacity: 1;background-color:rgb(232 241 254 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[\\#F5F5F5\\]{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[\\#FAFAFA\\]{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[\\#fee2e2\\]{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .bg-\\[var\\(--sa-primary\\)\\]{background-color:var(--sa-primary)}[data-super-agent-widget] .bg-black\\/30{background-color:#0000004d}[data-super-agent-widget] .bg-transparent{background-color:transparent}[data-super-agent-widget] .bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .object-contain{-o-object-fit:contain;object-fit:contain}[data-super-agent-widget] .p-0{padding:0}[data-super-agent-widget] .p-2{padding:.5rem}[data-super-agent-widget] .p-3{padding:.75rem}[data-super-agent-widget] .px-0\\.5{padding-left:.125rem;padding-right:.125rem}[data-super-agent-widget] .px-1{padding-left:.25rem;padding-right:.25rem}[data-super-agent-widget] .px-1\\.5{padding-left:.375rem;padding-right:.375rem}[data-super-agent-widget] .px-2\\.5{padding-left:.625rem;padding-right:.625rem}[data-super-agent-widget] .px-3{padding-left:.75rem;padding-right:.75rem}[data-super-agent-widget] .px-\\[15px\\]{padding-left:15px;padding-right:15px}[data-super-agent-widget] .py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}[data-super-agent-widget] .py-1{padding-top:.25rem;padding-bottom:.25rem}[data-super-agent-widget] .py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}[data-super-agent-widget] .py-2{padding-top:.5rem;padding-bottom:.5rem}[data-super-agent-widget] .py-3{padding-top:.75rem;padding-bottom:.75rem}[data-super-agent-widget] .pb-1{padding-bottom:.25rem}[data-super-agent-widget] .pb-2\\.5{padding-bottom:.625rem}[data-super-agent-widget] .pt-2{padding-top:.5rem}[data-super-agent-widget] .text-left{text-align:left}[data-super-agent-widget] .text-center{text-align:center}[data-super-agent-widget] .text-\\[11px\\]{font-size:11px}[data-super-agent-widget] .text-\\[12px\\]{font-size:12px}[data-super-agent-widget] .text-\\[13px\\]{font-size:13px}[data-super-agent-widget] .text-\\[14px\\]{font-size:14px}[data-super-agent-widget] .text-\\[15px\\]{font-size:15px}[data-super-agent-widget] .text-\\[18px\\]{font-size:18px}[data-super-agent-widget] .text-\\[9px\\]{font-size:9px}[data-super-agent-widget] .font-bold{font-weight:700}[data-super-agent-widget] .font-medium{font-weight:500}[data-super-agent-widget] .font-semibold{font-weight:600}[data-super-agent-widget] .italic{font-style:italic}[data-super-agent-widget] .leading-\\[1\\.3\\]{line-height:1.3}[data-super-agent-widget] .leading-\\[1\\.4\\]{line-height:1.4}[data-super-agent-widget] .leading-\\[1\\.5\\]{line-height:1.5}[data-super-agent-widget] .leading-\\[14px\\]{line-height:14px}[data-super-agent-widget] .leading-none{line-height:1}[data-super-agent-widget] .text-\\[\\#18181b\\]{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#333\\]{--tw-text-opacity: 1;color:rgb(51 51 51 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#666\\]{--tw-text-opacity: 1;color:rgb(102 102 102 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#999\\]{--tw-text-opacity: 1;color:rgb(153 153 153 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#9A9A9A\\]{--tw-text-opacity: 1;color:rgb(154 154 154 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#A0A0A0\\]{--tw-text-opacity: 1;color:rgb(160 160 160 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#B8B8B8\\]{--tw-text-opacity: 1;color:rgb(184 184 184 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#C0C0C0\\]{--tw-text-opacity: 1;color:rgb(192 192 192 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-\\[\\#ef4444\\]{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .underline{text-decoration-line:underline}[data-super-agent-widget] .antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}[data-super-agent-widget] .opacity-0{opacity:0}[data-super-agent-widget] .opacity-10{opacity:.1}[data-super-agent-widget] .opacity-100{opacity:1}[data-super-agent-widget] .opacity-60{opacity:.6}[data-super-agent-widget] .opacity-70{opacity:.7}[data-super-agent-widget] .shadow-\\[0_-12px_48px_rgba\\(0\\,0\\,0\\,0\\.25\\)\\]{--tw-shadow: 0 -12px 48px rgba(0,0,0,.25);--tw-shadow-colored: 0 -12px 48px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-super-agent-widget] .shadow-\\[0_2px_8px_rgba\\(0\\,0\\,0\\,0\\.12\\)\\]{--tw-shadow: 0 2px 8px rgba(0,0,0,.12);--tw-shadow-colored: 0 2px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-super-agent-widget] .outline-none{outline:2px solid transparent;outline-offset:2px}[data-super-agent-widget] .outline{outline-style:solid}[data-super-agent-widget] .blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-super-agent-widget] .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-super-agent-widget] .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-super-agent-widget] .transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-super-agent-widget] .transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-super-agent-widget] .duration-200{transition-duration:.2s}[data-super-agent-widget] .ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}[data-super-agent-widget] .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes sa-window-in{0%{opacity:0;transform:translateY(20px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes sa-slide-up-full{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes sa-home-fade-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes sa-chip-in{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes sa-logo-float{0%,to{transform:translateY(0)}50%{transform:translateY(-3px)}}@keyframes sa-title-shimmer{0%{background-position:100% 0}to{background-position:-100% 0}}@keyframes sa-history-in{0%{opacity:0;transform:translate(-10px)}to{opacity:1;transform:translate(0)}}[data-super-agent-widget] .animate-sa-window-in{animation:sa-window-in .3s cubic-bezier(.16,1,.3,1)}[data-super-agent-widget] .animate-sa-slide-up-full{animation:sa-slide-up-full .3s cubic-bezier(.16,1,.3,1)}[data-super-agent-widget] .animate-sa-fade-in{animation:sa-fade-in .2s ease}[data-super-agent-widget] .animate-sa-home-fade-in{animation:sa-home-fade-in .4s ease forwards}[data-super-agent-widget] .animate-sa-chip-in{animation:sa-chip-in .4s cubic-bezier(.22,1,.36,1) forwards}[data-super-agent-widget] .animate-sa-logo-float{animation:sa-logo-float 3s ease-in-out infinite}[data-super-agent-widget] .animate-sa-title-shimmer{animation:sa-title-shimmer 2.5s ease forwards}[data-super-agent-widget] .animate-sa-history-in{animation:sa-history-in .2s ease}[data-super-agent-widget] .sa-tip{position:relative}[data-super-agent-widget] .sa-tip:before,[data-super-agent-widget] .sa-tip:after{position:absolute;top:100%;left:50%;pointer-events:none;opacity:0;transition:opacity .15s ease;z-index:100}[data-super-agent-widget] .sa-tip:before{content:attr(data-tooltip);transform:translate(-50%);margin-top:6px;padding:4px 8px;background:#fff;color:#333;font-size:12px;line-height:1.4;white-space:nowrap;border-radius:4px;box-shadow:0 2px 8px #0000001f;border:1px solid #e8e8e8}[data-super-agent-widget] .sa-tip:after{content:"";transform:translate(-50%);margin-top:2px;border:4px solid transparent;border-bottom-color:#fff;filter:drop-shadow(0 -1px 1px rgba(0,0,0,.06))}[data-super-agent-widget] .sa-tip:hover:before,[data-super-agent-widget] .sa-tip:hover:after{opacity:1}[data-super-agent-widget] .sa-chip{background:linear-gradient(#fff,#fff) padding-box,linear-gradient(#e0e0e0,#e0e0e0) border-box;border:1px solid transparent}[data-super-agent-widget] .sa-chip:hover{background:linear-gradient(#fff,#fff) padding-box,linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7) border-box}[data-super-agent-widget] .sa-chip:hover .sa-chip-text{background:linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}[data-super-agent-widget] .sa-shimmer-text{background:linear-gradient(90deg,#333,#333 35%,#00d4ff 40%,#1881f0,#2b52ee,#d116ea,#ff2e7e 56%,#333 61%,#333);background-size:300% 100%;background-position:100% 0;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}[data-super-agent-widget] .sa-new-chat{background:linear-gradient(258deg,#ff2e7e1a -4%,#d116ea1a 16%,#2b52ee1a 53%,#1881f01a 81%,#00d4ff1a 106%)}[data-super-agent-widget] .sa-new-chat:hover{background:linear-gradient(258deg,#ff2e7e29 -4%,#d116ea29 16%,#2b52ee29 53%,#1881f029 81%,#00d4ff29 106%)}[data-super-agent-widget] .sa-new-chat .sa-new-chat-text{background:linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}[data-super-agent-widget] .sa-home-gradient{background:linear-gradient(239deg,#ff2e7e -3%,#d116ea 17%,#2b52ee 54%,#1881f0 82%,#00d4ff 107%)}[data-super-agent-widget] .sa-home-gradient-fade{background:linear-gradient(180deg,#fff0,#fff)}[data-super-agent-widget] .sa-home-view .sa-thread{background:transparent}[data-super-agent-widget] .sa-resize-handle:hover{background:color-mix(in srgb,var(--sa-primary) 30%,transparent)}[data-super-agent-widget] .sa-input-form{border:1px solid transparent;background-color:#fff;background-image:linear-gradient(#fff,#fff),linear-gradient(110deg,#03b5ff80,#285cff80 47%,#ff28a780);background-origin:border-box;background-clip:padding-box,border-box;transition:background .15s ease}[data-super-agent-widget] .sa-input-form-active,[data-super-agent-widget] .sa-input-form:focus-within{background-image:linear-gradient(#fff,#fff),linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7)}[data-super-agent-widget] .sa-input-form-streaming,[data-super-agent-widget] .sa-input-form-streaming:focus-within{background-image:linear-gradient(#f5f5f7,#f5f5f7),linear-gradient(#e5e7eb,#e5e7eb);cursor:not-allowed}[data-super-agent-widget] .sa-input-form-streaming .sa-input-field{cursor:not-allowed}[data-super-agent-widget] .sa-input-field:disabled::-moz-placeholder{color:#b8b8b8}[data-super-agent-widget] .sa-input-field:disabled::placeholder{color:#b8b8b8}[data-super-agent-widget] .sa-send-btn{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border:none;border-radius:9999px;background:linear-gradient(110deg,#03b5ff80,#285cff80 47%,#ff28a780);cursor:pointer;flex-shrink:0;transition:background .15s ease,opacity .15s ease}[data-super-agent-widget] .sa-send-btn-active,[data-super-agent-widget] .sa-input-form:focus-within .sa-send-btn{background:linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7)}[data-super-agent-widget] .sa-send-btn:hover{opacity:.9}[data-super-agent-widget] .sa-send-btn:active{opacity:.7}[data-super-agent-widget] .sa-send-btn img{display:block;width:14px;height:14px;filter:brightness(0) invert(1)}[data-super-agent-widget] .sa-stop-icon{display:block;width:8px;height:8px;border-radius:2px;background:#fff}[data-super-agent-widget] .sa-send-hint{display:flex;align-items:center;gap:3px;flex-shrink:0;font-size:11px;line-height:1;color:#9ca3af;-webkit-user-select:none;-moz-user-select:none;user-select:none}[data-super-agent-widget] .sa-send-kbd{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 4px;border:1px solid #e5e7eb;border-radius:4px;background:#f5f5f7;font-family:inherit;font-size:11px;line-height:1;color:#6b7280}[data-super-agent-widget] .sa-attach-btn{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border:none;border-radius:9999px;background:linear-gradient(110deg,#03b5ff80,#285cff80 47%,#ff28a780);color:#fff;cursor:pointer;flex-shrink:0;transition:background .15s ease,opacity .15s ease}[data-super-agent-widget] .sa-attach-btn:hover{background:linear-gradient(110deg,#03b5ff,#285cff 47%,#ff28a7);opacity:.9}[data-super-agent-widget] .sa-attach-btn:active{opacity:.7}[data-super-agent-widget] .sa-attachment-tray{display:flex;flex-wrap:wrap;gap:6px;padding:2px 0}[data-super-agent-widget] .sa-attachment-tray-chip{display:inline-flex;align-items:center;gap:4px;max-width:220px;padding:4px 8px;border:1px solid rgba(40,92,255,.25);border-radius:6px;background:#285cff0d;font-size:12px;line-height:1;color:#333}[data-super-agent-widget] .sa-attachment-tray-chip-error{border-color:#ef444459;background:#ef44440f}[data-super-agent-widget] .sa-attachment-tray-chip-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}[data-super-agent-widget] .sa-attachment-tray-chip-size{color:#b8b8b8;flex-shrink:0}[data-super-agent-widget] .sa-attachment-tray-chip-remove{display:flex;align-items:center;justify-content:center;width:14px;height:14px;border:none;border-radius:9999px;background:transparent;color:#b8b8b8;font-size:10px;line-height:1;cursor:pointer;flex-shrink:0;padding:0}[data-super-agent-widget] .sa-attachment-tray-chip-remove:hover{background:#00000014;color:#666}[data-super-agent-widget] .sa-attachment-chip{display:inline-flex;align-items:center;gap:4px;max-width:240px;margin:2px 0;padding:5px 10px;border-radius:8px;background:#ffffff59;font-size:12px;line-height:1;color:inherit}[data-super-agent-widget] .sa-attachment-chip-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}[data-super-agent-widget] .sa-attachment-chip-size{color:#00000073;flex-shrink:0}[data-super-agent-widget] .placeholder\\:text-\\[\\#B8B8B8\\]::-moz-placeholder{--tw-text-opacity: 1;color:rgb(184 184 184 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .placeholder\\:text-\\[\\#B8B8B8\\]::placeholder{--tw-text-opacity: 1;color:rgb(184 184 184 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .hover\\:scale-\\[1\\.08\\]:hover{--tw-scale-x: 1.08;--tw-scale-y: 1.08;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-super-agent-widget] .hover\\:bg-\\[\\#E8F1FE\\]:hover{--tw-bg-opacity: 1;background-color:rgb(232 241 254 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .hover\\:bg-\\[\\#F5F5F5\\]:hover{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .hover\\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] .hover\\:bg-white\\/70:hover{background-color:#ffffffb3}[data-super-agent-widget] .hover\\:text-\\[\\#1881F0\\]:hover{--tw-text-opacity: 1;color:rgb(24 129 240 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .hover\\:text-\\[\\#ef4444\\]:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}[data-super-agent-widget] .hover\\:text-\\[var\\(--sa-primary\\)\\]:hover{color:var(--sa-primary)}[data-super-agent-widget] .active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-super-agent-widget] .active\\:cursor-grabbing:active{cursor:grabbing}[data-super-agent-widget] .active\\:bg-\\[\\#F5F5F5\\]:active{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}[data-super-agent-widget] :is(.group:hover .group-hover\\:flex){display:flex}',ma={primaryColor:"#6366f1",backgroundColor:"#ffffff",fontFamily:"system-ui, -apple-system, sans-serif",borderRadius:16,panelWidth:400,panelHeight:648,zIndex:9999};function Vp(e,t){const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16),s=1-t;return`#${Math.round(n*s).toString(16).padStart(2,"0")}${Math.round(r*s).toString(16).padStart(2,"0")}${Math.round(i*s).toString(16).padStart(2,"0")}`}function qp(e,t){const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return`#${Math.round(n+(255-n)*t).toString(16).padStart(2,"0")}${Math.round(r+(255-r)*t).toString(16).padStart(2,"0")}${Math.round(i+(255-i)*t).toString(16).padStart(2,"0")}`}function xa(e){const t={...ma,...e},n=t.primaryColor,r=t.backgroundColor;return[`--sa-primary: ${n}`,`--sa-bg: ${r}`,`--sa-font: ${t.fontFamily}`,`--sa-radius: ${t.borderRadius}px`,`--sa-panel-width: ${t.panelWidth}px`,`--sa-panel-height: ${t.panelHeight}px`,`--sa-z-index: ${t.zIndex}`,`--sa-primary-dark: ${Vp(n,.15)}`,`--sa-primary-light: ${qp(n,.9)}`,`--sa-surface: ${r}`,"--sa-border: #e5e7eb","--sa-hover: #f4f4f5","--sa-text: #374151","--sa-text-muted: #9ca3af","--sa-text-light: #6b7280"].join("; ")}function Wp(e,t){const n=typeof e=="string"?document.querySelector(e):e;if(!n)throw new Error(`Target element not found: ${e}`);const r=document.createElement("div");r.setAttribute("data-super-agent-widget","");const i=xa(t.theme??{});if(r.setAttribute("style",`${i}; height: 100%;`),n.appendChild(r),!document.getElementById("sa-widget-styles")){const l=document.createElement("style");l.id="sa-widget-styles",l.textContent=`${ga}
1265
+ ${Up}`,document.head.appendChild(l)}let s=ba.createRoot(r),a=!1;const o=l=>{s&&s.render(k.createElement(ha,{...t,initialOpen:l??a,onOpenChange:u=>{a=u}}))};return o(!1),{open(){a=!0,o(!0)},close(){a=!1,o(!1)},destroy(){s&&(s.unmount(),s=null),r.remove()}}}exports.ASSETS=pe;exports.ActionBar=la;exports.ChatProvider=Jt;exports.ChatWidget=ha;exports.Composer=Dn;exports.ErrorPart=aa;exports.FullpageLayout=fa;exports.Header=Ur;exports.Icon=J;exports.InterruptCard=oa;exports.Message=ua;exports.PageOverlay=da;exports.TextPart=ea;exports.ThinkingPart=na;exports.Thread=Ln;exports.ThreadList=Zt;exports.ToolCallPart=ra;exports.ToolResultPart=ia;exports.Trigger=Hr;exports.WelcomeScreen=ca;exports.defaultTheme=ma;exports.ensureIconFont=ta;exports.mount=Wp;exports.themeToCSSVars=xa;exports.useAutoScroll=qr;exports.useChat=Rr;exports.useChatContext=Te;exports.useConversations=Fr;exports.widgetStyles=ga;