@workflow/web 4.1.0-beta.37 → 4.1.0-beta.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. package/build/client/assets/{highlighted-body-B3W2YXNL-BO6bNJzI.js → highlighted-body-B3W2YXNL-Rt-vkvmE.js} +1 -1
  2. package/build/client/assets/{home-bWDrLREI.js → home-Cpz2_ZDM.js} +1 -1
  3. package/build/client/assets/manifest-069935e6.js +1 -0
  4. package/build/client/assets/{mermaid-3ZIDBTTL-CJ6mkUFN.js → mermaid-3ZIDBTTL-DcdZu9sS.js} +3 -3
  5. package/build/client/assets/{root-Ckv-c9_b.js → root-DZgYUaDo.js} +1 -1
  6. package/build/client/assets/run-detail-xcvWVR2B.js +41 -0
  7. package/build/client/assets/{use-workflow-graph-JKiMb5g6.js → use-workflow-graph-CF7nLapT.js} +1 -1
  8. package/build/server/assets/{app-CatvtWxS.js → app-B9Eg2ZwJ.js} +1 -1
  9. package/build/server/assets/{highlighted-body-B3W2YXNL-DoOhy3wX.js → highlighted-body-B3W2YXNL-CppXFHRG.js} +3 -3
  10. package/build/server/assets/{mermaid-3ZIDBTTL-uuxw6-ur.js → mermaid-3ZIDBTTL-DB0PiTjt.js} +3 -3
  11. package/build/server/assets/{server-build-XXW48t5z.js → server-build-HMYt9inG.js} +314 -278
  12. package/build/server/assets/{token-CLFHo1Az.js → token-CBxSSoxh.js} +2 -2
  13. package/build/server/assets/{token-C58qysN7.js → token-COnBvzNW.js} +3 -3
  14. package/build/server/assets/{token-util-CcopqG1U.js → token-util-7Q4_oN66.js} +2 -2
  15. package/build/server/assets/{token-util-C6iVpF77.js → token-util-CagM_XOH.js} +2 -2
  16. package/build/server/assets/{token-util-CbxhzlWz.js → token-util-QvbM3ECv.js} +1 -1
  17. package/build/server/index.js +1 -1
  18. package/package.json +6 -6
  19. package/build/client/assets/manifest-daa82ff1.js +0 -1
  20. package/build/client/assets/run-detail-EcdnCjQk.js +0 -41
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-B3W2YXNL-BO6bNJzI.js","assets/index-DklpUtP3.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-B3W2YXNL-Rt-vkvmE.js","assets/index-DklpUtP3.js"])))=>i.map(i=>d[i]);
2
2
  var Mm=Object.defineProperty;var Bm=(e,t,n)=>t in e?Mm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ne=(e,t,n)=>Bm(e,typeof t!="symbol"?t+"":t,n);import{r as b,j as g,f as Go,D as $d,R as j,A as Fm,G as Vd}from"./index-DklpUtP3.js";function dn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function iu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Wd(...e){return t=>{let n=!1;const r=e.map(i=>{const a=iu(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():iu(e[i],null)}}}}function er(...e){return b.useCallback(Wd(...e),e)}function Yv(e,t){const n=b.createContext(t),r=a=>{const{children:s,...o}=a,l=b.useMemo(()=>o,Object.values(o));return g.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(a){const s=b.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function Yd(e,t=[]){let n=[];function r(a,s){const o=b.createContext(s),l=n.length;n=[...n,s];const u=c=>{var _;const{scope:p,children:h,...m}=c,E=((_=p==null?void 0:p[e])==null?void 0:_[l])||o,k=b.useMemo(()=>m,Object.values(m));return g.jsx(E.Provider,{value:k,children:h})};u.displayName=a+"Provider";function d(c,p){var E;const h=((E=p==null?void 0:p[e])==null?void 0:E[l])||o,m=b.useContext(h);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${a}\``)}return[u,d]}const i=()=>{const a=n.map(s=>b.createContext(s));return function(o){const l=(o==null?void 0:o[e])||a;return b.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return i.scopeName=e,[r,Hm(i,...t)]}function Hm(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((o,{useScope:l,scopeName:u})=>{const c=l(a)[`__scope${u}`];return{...o,...c}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Um(e){const t=jm(e),n=b.forwardRef((r,i)=>{const{children:a,...s}=r,o=b.Children.toArray(a),l=o.find($m);if(l){const u=l.props.children,d=o.map(c=>c===l?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:c);return g.jsx(t,{...s,ref:i,children:b.isValidElement(u)?b.cloneElement(u,void 0,d):null})}return g.jsx(t,{...s,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function jm(e){const t=b.forwardRef((n,r)=>{const{children:i,...a}=n;if(b.isValidElement(i)){const s=Wm(i),o=Vm(a,i.props);return i.type!==b.Fragment&&(o.ref=r?Wd(r,s):s),b.cloneElement(i,o)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qd=Symbol("radix.slottable");function zm(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=qd,t}function $m(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qd}function Vm(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{const l=a(...o);return i(...o),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Wm(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ym=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tr=Ym.reduce((e,t)=>{const n=Um(`Primitive.${t}`),r=b.forwardRef((i,a)=>{const{asChild:s,...o}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...o,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function qm(e,t){e&&Go.flushSync(()=>e.dispatchEvent(t))}function Wa(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Gm(e,t=globalThis==null?void 0:globalThis.document){const n=Wa(e);b.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Km="DismissableLayer",eo="dismissableLayer.update",Xm="dismissableLayer.pointerDownOutside",Qm="dismissableLayer.focusOutside",au,Gd=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Kd=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:o,...l}=e,u=b.useContext(Gd),[d,c]=b.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=b.useState({}),m=er(t,V=>c(V)),E=Array.from(u.layers),[k]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),_=E.indexOf(k),N=d?E.indexOf(d):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,F=N>=_,H=eg(V=>{const U=V.target,Q=[...u.branches].some(O=>O.contains(U));!F||Q||(i==null||i(V),s==null||s(V),V.defaultPrevented||o==null||o())},p),I=tg(V=>{const U=V.target;[...u.branches].some(O=>O.contains(U))||(a==null||a(V),s==null||s(V),V.defaultPrevented||o==null||o())},p);return Gm(V=>{N===u.layers.size-1&&(r==null||r(V),!V.defaultPrevented&&o&&(V.preventDefault(),o()))},p),b.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(au=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),su(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=au)}},[d,p,n,u]),b.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),su())},[d,u]),b.useEffect(()=>{const V=()=>h({});return document.addEventListener(eo,V),()=>document.removeEventListener(eo,V)},[]),g.jsx(tr.div,{...l,ref:m,style:{pointerEvents:C?F?"auto":"none":void 0,...e.style},onFocusCapture:dn(e.onFocusCapture,I.onFocusCapture),onBlurCapture:dn(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:dn(e.onPointerDownCapture,H.onPointerDownCapture)})});Kd.displayName=Km;var Jm="DismissableLayerBranch",Zm=b.forwardRef((e,t)=>{const n=b.useContext(Gd),r=b.useRef(null),i=er(t,r);return b.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),g.jsx(tr.div,{...e,ref:i})});Zm.displayName=Jm;function eg(e,t=globalThis==null?void 0:globalThis.document){const n=Wa(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const a=o=>{if(o.target&&!r.current){let l=function(){Xd(Xm,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function tg(e,t=globalThis==null?void 0:globalThis.document){const n=Wa(e),r=b.useRef(!1);return b.useEffect(()=>{const i=a=>{a.target&&!r.current&&Xd(Qm,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function su(){const e=new CustomEvent(eo);document.dispatchEvent(e)}function Xd(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?qm(i,a):i.dispatchEvent(a)}var Gn=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},ng=$d[" useId ".trim().toString()]||(()=>{}),rg=0;function ig(e){const[t,n]=b.useState(ng());return Gn(()=>{n(r=>r??String(rg++))},[e]),t?`radix-${t}`:""}const ag=["top","right","bottom","left"],Rn=Math.min,St=Math.max,wa=Math.round,Gi=Math.floor,tn=e=>({x:e,y:e}),sg={left:"right",right:"left",bottom:"top",top:"bottom"},og={start:"end",end:"start"};function to(e,t,n){return St(e,Rn(t,n))}function hn(e,t){return typeof e=="function"?e(t):e}function pn(e){return e.split("-")[0]}function Nr(e){return e.split("-")[1]}function Ko(e){return e==="x"?"y":"x"}function Xo(e){return e==="y"?"height":"width"}const lg=new Set(["top","bottom"]);function en(e){return lg.has(pn(e))?"y":"x"}function Qo(e){return Ko(en(e))}function ug(e,t,n){n===void 0&&(n=!1);const r=Nr(e),i=Qo(e),a=Xo(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=Ca(s)),[s,Ca(s)]}function cg(e){const t=Ca(e);return[no(e),t,no(t)]}function no(e){return e.replace(/start|end/g,t=>og[t])}const ou=["left","right"],lu=["right","left"],dg=["top","bottom"],fg=["bottom","top"];function hg(e,t,n){switch(e){case"top":case"bottom":return n?t?lu:ou:t?ou:lu;case"left":case"right":return t?dg:fg;default:return[]}}function pg(e,t,n,r){const i=Nr(e);let a=hg(pn(e),n==="start",r);return i&&(a=a.map(s=>s+"-"+i),t&&(a=a.concat(a.map(no)))),a}function Ca(e){return e.replace(/left|right|bottom|top/g,t=>sg[t])}function mg(e){return{top:0,right:0,bottom:0,left:0,...e}}function Qd(e){return typeof e!="number"?mg(e):{top:e,right:e,bottom:e,left:e}}function Sa(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function uu(e,t,n){let{reference:r,floating:i}=e;const a=en(t),s=Qo(t),o=Xo(s),l=pn(t),u=a==="y",d=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,p=r[o]/2-i[o]/2;let h;switch(l){case"top":h={x:d,y:r.y-i.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:c};break;case"left":h={x:r.x-i.width,y:c};break;default:h={x:r.x,y:r.y}}switch(Nr(t)){case"start":h[s]-=p*(n&&u?-1:1);break;case"end":h[s]+=p*(n&&u?-1:1);break}return h}const gg=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:s}=n,o=a.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:c}=uu(u,r,l),p=r,h={},m=0;for(let E=0;E<o.length;E++){const{name:k,fn:_}=o[E],{x:N,y:C,data:F,reset:H}=await _({x:d,y:c,initialPlacement:r,placement:p,strategy:i,middlewareData:h,rects:u,platform:s,elements:{reference:e,floating:t}});d=N??d,c=C??c,h={...h,[k]:{...h[k],...F}},H&&m<=50&&(m++,typeof H=="object"&&(H.placement&&(p=H.placement),H.rects&&(u=H.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):H.rects),{x:d,y:c}=uu(u,p,l)),E=-1)}return{x:d,y:c,placement:p,strategy:i,middlewareData:h}};async function pi(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:s,elements:o,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:c="floating",altBoundary:p=!1,padding:h=0}=hn(t,e),m=Qd(h),k=o[p?c==="floating"?"reference":"floating":c],_=Sa(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(k)))==null||n?k:k.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(o.floating)),boundary:u,rootBoundary:d,strategy:l})),N=c==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(o.floating)),F=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},H=Sa(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:N,offsetParent:C,strategy:l}):N);return{top:(_.top-H.top+m.top)/F.y,bottom:(H.bottom-_.bottom+m.bottom)/F.y,left:(_.left-H.left+m.left)/F.x,right:(H.right-_.right+m.right)/F.x}}const bg=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:s,elements:o,middlewareData:l}=t,{element:u,padding:d=0}=hn(e,t)||{};if(u==null)return{};const c=Qd(d),p={x:n,y:r},h=Qo(i),m=Xo(h),E=await s.getDimensions(u),k=h==="y",_=k?"top":"left",N=k?"bottom":"right",C=k?"clientHeight":"clientWidth",F=a.reference[m]+a.reference[h]-p[h]-a.floating[m],H=p[h]-a.reference[h],I=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let V=I?I[C]:0;(!V||!await(s.isElement==null?void 0:s.isElement(I)))&&(V=o.floating[C]||a.floating[m]);const U=F/2-H/2,Q=V/2-E[m]/2-1,O=Rn(c[_],Q),K=Rn(c[N],Q),z=O,x=V-E[m]-K,L=V/2-E[m]/2+U,v=to(z,L,x),D=!l.arrow&&Nr(i)!=null&&L!==v&&a.reference[m]/2-(L<z?O:K)-E[m]/2<0,P=D?L<z?L-z:L-x:0;return{[h]:p[h]+P,data:{[h]:v,centerOffset:L-v-P,...D&&{alignmentOffset:P}},reset:D}}}),Eg=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:s,initialPlacement:o,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:c=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:E=!0,...k}=hn(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const _=pn(i),N=en(o),C=pn(o)===o,F=await(l.isRTL==null?void 0:l.isRTL(u.floating)),H=p||(C||!E?[Ca(o)]:cg(o)),I=m!=="none";!p&&I&&H.push(...pg(o,E,m,F));const V=[o,...H],U=await pi(t,k),Q=[];let O=((r=a.flip)==null?void 0:r.overflows)||[];if(d&&Q.push(U[_]),c){const L=ug(i,s,F);Q.push(U[L[0]],U[L[1]])}if(O=[...O,{placement:i,overflows:Q}],!Q.every(L=>L<=0)){var K,z;const L=(((K=a.flip)==null?void 0:K.index)||0)+1,v=V[L];if(v&&(!(c==="alignment"?N!==en(v):!1)||O.every(q=>en(q.placement)===N?q.overflows[0]>0:!0)))return{data:{index:L,overflows:O},reset:{placement:v}};let D=(z=O.filter(P=>P.overflows[0]<=0).sort((P,q)=>P.overflows[1]-q.overflows[1])[0])==null?void 0:z.placement;if(!D)switch(h){case"bestFit":{var x;const P=(x=O.filter(q=>{if(I){const J=en(q.placement);return J===N||J==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(J=>J>0).reduce((J,T)=>J+T,0)]).sort((q,J)=>q[1]-J[1])[0])==null?void 0:x[0];P&&(D=P);break}case"initialPlacement":D=o;break}if(i!==D)return{reset:{placement:D}}}return{}}}};function cu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function du(e){return ag.some(t=>e[t]>=0)}const Tg=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=hn(e,t);switch(r){case"referenceHidden":{const a=await pi(t,{...i,elementContext:"reference"}),s=cu(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:du(s)}}}case"escaped":{const a=await pi(t,{...i,altBoundary:!0}),s=cu(a,n.floating);return{data:{escapedOffsets:s,escaped:du(s)}}}default:return{}}}}},Jd=new Set(["left","top"]);async function yg(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=pn(n),o=Nr(n),l=en(n)==="y",u=Jd.has(s)?-1:1,d=a&&l?-1:1,c=hn(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:m}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return o&&typeof m=="number"&&(h=o==="end"?m*-1:m),l?{x:h*d,y:p*u}:{x:p*u,y:h*d}}const xg=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:s,middlewareData:o}=t,l=await yg(t,e);return s===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:s}}}}},_g=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:o={fn:k=>{let{x:_,y:N}=k;return{x:_,y:N}}},...l}=hn(e,t),u={x:n,y:r},d=await pi(t,l),c=en(pn(i)),p=Ko(c);let h=u[p],m=u[c];if(a){const k=p==="y"?"top":"left",_=p==="y"?"bottom":"right",N=h+d[k],C=h-d[_];h=to(N,h,C)}if(s){const k=c==="y"?"top":"left",_=c==="y"?"bottom":"right",N=m+d[k],C=m-d[_];m=to(N,m,C)}const E=o.fn({...t,[p]:h,[c]:m});return{...E,data:{x:E.x-n,y:E.y-r,enabled:{[p]:a,[c]:s}}}}}},kg=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:s}=t,{offset:o=0,mainAxis:l=!0,crossAxis:u=!0}=hn(e,t),d={x:n,y:r},c=en(i),p=Ko(c);let h=d[p],m=d[c];const E=hn(o,t),k=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(l){const C=p==="y"?"height":"width",F=a.reference[p]-a.floating[C]+k.mainAxis,H=a.reference[p]+a.reference[C]-k.mainAxis;h<F?h=F:h>H&&(h=H)}if(u){var _,N;const C=p==="y"?"width":"height",F=Jd.has(pn(i)),H=a.reference[c]-a.floating[C]+(F&&((_=s.offset)==null?void 0:_[c])||0)+(F?0:k.crossAxis),I=a.reference[c]+a.reference[C]+(F?0:((N=s.offset)==null?void 0:N[c])||0)-(F?k.crossAxis:0);m<H?m=H:m>I&&(m=I)}return{[p]:h,[c]:m}}}},Ag=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:s,elements:o}=t,{apply:l=()=>{},...u}=hn(e,t),d=await pi(t,u),c=pn(i),p=Nr(i),h=en(i)==="y",{width:m,height:E}=a.floating;let k,_;c==="top"||c==="bottom"?(k=c,_=p===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(_=c,k=p==="end"?"top":"bottom");const N=E-d.top-d.bottom,C=m-d.left-d.right,F=Rn(E-d[k],N),H=Rn(m-d[_],C),I=!t.middlewareData.shift;let V=F,U=H;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(U=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(V=N),I&&!p){const O=St(d.left,0),K=St(d.right,0),z=St(d.top,0),x=St(d.bottom,0);h?U=m-2*(O!==0||K!==0?O+K:St(d.left,d.right)):V=E-2*(z!==0||x!==0?z+x:St(d.top,d.bottom))}await l({...t,availableWidth:U,availableHeight:V});const Q=await s.getDimensions(o.floating);return m!==Q.width||E!==Q.height?{reset:{rects:!0}}:{}}}};function Ya(){return typeof window<"u"}function Ir(e){return Zd(e)?(e.nodeName||"").toLowerCase():"#document"}function It(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function an(e){var t;return(t=(Zd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zd(e){return Ya()?e instanceof Node||e instanceof It(e).Node:!1}function Wt(e){return Ya()?e instanceof Element||e instanceof It(e).Element:!1}function rn(e){return Ya()?e instanceof HTMLElement||e instanceof It(e).HTMLElement:!1}function fu(e){return!Ya()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof It(e).ShadowRoot}const wg=new Set(["inline","contents"]);function Oi(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Yt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!wg.has(i)}const Cg=new Set(["table","td","th"]);function Sg(e){return Cg.has(Ir(e))}const Ng=[":popover-open",":modal"];function qa(e){return Ng.some(t=>{try{return e.matches(t)}catch{return!1}})}const Ig=["transform","translate","scale","rotate","perspective"],Rg=["transform","translate","scale","rotate","perspective","filter"],Og=["paint","layout","strict","content"];function Jo(e){const t=Zo(),n=Wt(e)?Yt(e):e;return Ig.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Rg.some(r=>(n.willChange||"").includes(r))||Og.some(r=>(n.contain||"").includes(r))}function Lg(e){let t=On(e);for(;rn(t)&&!kr(t);){if(Jo(t))return t;if(qa(t))return null;t=On(t)}return null}function Zo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vg=new Set(["html","body","#document"]);function kr(e){return vg.has(Ir(e))}function Yt(e){return It(e).getComputedStyle(e)}function Ga(e){return Wt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function On(e){if(Ir(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fu(e)&&e.host||an(e);return fu(t)?t.host:t}function ef(e){const t=On(e);return kr(t)?e.ownerDocument?e.ownerDocument.body:e.body:rn(t)&&Oi(t)?t:ef(t)}function mi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=ef(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),s=It(i);if(a){const o=ro(s);return t.concat(s,s.visualViewport||[],Oi(i)?i:[],o&&n?mi(o):[])}return t.concat(i,mi(i,[],n))}function ro(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tf(e){const t=Yt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=rn(e),a=i?e.offsetWidth:n,s=i?e.offsetHeight:r,o=wa(n)!==a||wa(r)!==s;return o&&(n=a,r=s),{width:n,height:r,$:o}}function el(e){return Wt(e)?e:e.contextElement}function Tr(e){const t=el(e);if(!rn(t))return tn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=tf(t);let s=(a?wa(n.width):n.width)/r,o=(a?wa(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}const Dg=tn(0);function nf(e){const t=It(e);return!Zo()||!t.visualViewport?Dg:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Pg(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==It(e)?!1:t}function Kn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=el(e);let s=tn(1);t&&(r?Wt(r)&&(s=Tr(r)):s=Tr(e));const o=Pg(a,n,r)?nf(a):tn(0);let l=(i.left+o.x)/s.x,u=(i.top+o.y)/s.y,d=i.width/s.x,c=i.height/s.y;if(a){const p=It(a),h=r&&Wt(r)?It(r):r;let m=p,E=ro(m);for(;E&&r&&h!==m;){const k=Tr(E),_=E.getBoundingClientRect(),N=Yt(E),C=_.left+(E.clientLeft+parseFloat(N.paddingLeft))*k.x,F=_.top+(E.clientTop+parseFloat(N.paddingTop))*k.y;l*=k.x,u*=k.y,d*=k.x,c*=k.y,l+=C,u+=F,m=It(E),E=ro(m)}}return Sa({width:d,height:c,x:l,y:u})}function Ka(e,t){const n=Ga(e).scrollLeft;return t?t.left+n:Kn(an(e)).left+n}function rf(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ka(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Mg(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",s=an(r),o=t?qa(t.floating):!1;if(r===s||o&&a)return n;let l={scrollLeft:0,scrollTop:0},u=tn(1);const d=tn(0),c=rn(r);if((c||!c&&!a)&&((Ir(r)!=="body"||Oi(s))&&(l=Ga(r)),rn(r))){const h=Kn(r);u=Tr(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=s&&!c&&!a?rf(s,l):tn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function Bg(e){return Array.from(e.getClientRects())}function Fg(e){const t=an(e),n=Ga(e),r=e.ownerDocument.body,i=St(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=St(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ka(e);const o=-n.scrollTop;return Yt(r).direction==="rtl"&&(s+=St(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:s,y:o}}const hu=25;function Hg(e,t){const n=It(e),r=an(e),i=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,o=0,l=0;if(i){a=i.width,s=i.height;const d=Zo();(!d||d&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}const u=Ka(r);if(u<=0){const d=r.ownerDocument,c=d.body,p=getComputedStyle(c),h=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(r.clientWidth-c.clientWidth-h);m<=hu&&(a-=m)}else u<=hu&&(a+=u);return{width:a,height:s,x:o,y:l}}const Ug=new Set(["absolute","fixed"]);function jg(e,t){const n=Kn(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=rn(e)?Tr(e):tn(1),s=e.clientWidth*a.x,o=e.clientHeight*a.y,l=i*a.x,u=r*a.y;return{width:s,height:o,x:l,y:u}}function pu(e,t,n){let r;if(t==="viewport")r=Hg(e,n);else if(t==="document")r=Fg(an(e));else if(Wt(t))r=jg(t,n);else{const i=nf(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Sa(r)}function af(e,t){const n=On(e);return n===t||!Wt(n)||kr(n)?!1:Yt(n).position==="fixed"||af(n,t)}function zg(e,t){const n=t.get(e);if(n)return n;let r=mi(e,[],!1).filter(o=>Wt(o)&&Ir(o)!=="body"),i=null;const a=Yt(e).position==="fixed";let s=a?On(e):e;for(;Wt(s)&&!kr(s);){const o=Yt(s),l=Jo(s);!l&&o.position==="fixed"&&(i=null),(a?!l&&!i:!l&&o.position==="static"&&!!i&&Ug.has(i.position)||Oi(s)&&!l&&af(e,s))?r=r.filter(d=>d!==s):i=o,s=On(s)}return t.set(e,r),r}function $g(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?qa(t)?[]:zg(t,this._c):[].concat(n),r],o=s[0],l=s.reduce((u,d)=>{const c=pu(t,d,i);return u.top=St(c.top,u.top),u.right=Rn(c.right,u.right),u.bottom=Rn(c.bottom,u.bottom),u.left=St(c.left,u.left),u},pu(t,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Vg(e){const{width:t,height:n}=tf(e);return{width:t,height:n}}function Wg(e,t,n){const r=rn(t),i=an(t),a=n==="fixed",s=Kn(e,!0,a,t);let o={scrollLeft:0,scrollTop:0};const l=tn(0);function u(){l.x=Ka(i)}if(r||!r&&!a)if((Ir(t)!=="body"||Oi(i))&&(o=Ga(t)),r){const h=Kn(t,!0,a,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else i&&u();a&&!r&&i&&u();const d=i&&!r&&!a?rf(i,o):tn(0),c=s.left+o.scrollLeft-l.x-d.x,p=s.top+o.scrollTop-l.y-d.y;return{x:c,y:p,width:s.width,height:s.height}}function xs(e){return Yt(e).position==="static"}function mu(e,t){if(!rn(e)||Yt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return an(e)===n&&(n=n.ownerDocument.body),n}function sf(e,t){const n=It(e);if(qa(e))return n;if(!rn(e)){let i=On(e);for(;i&&!kr(i);){if(Wt(i)&&!xs(i))return i;i=On(i)}return n}let r=mu(e,t);for(;r&&Sg(r)&&xs(r);)r=mu(r,t);return r&&kr(r)&&xs(r)&&!Jo(r)?n:r||Lg(e)||n}const Yg=async function(e){const t=this.getOffsetParent||sf,n=this.getDimensions,r=await n(e.floating);return{reference:Wg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function qg(e){return Yt(e).direction==="rtl"}const Gg={convertOffsetParentRelativeRectToViewportRelativeRect:Mg,getDocumentElement:an,getClippingRect:$g,getOffsetParent:sf,getElementRects:Yg,getClientRects:Bg,getDimensions:Vg,getScale:Tr,isElement:Wt,isRTL:qg};function of(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kg(e,t){let n=null,r;const i=an(e);function a(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function s(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),a();const u=e.getBoundingClientRect(),{left:d,top:c,width:p,height:h}=u;if(o||t(),!p||!h)return;const m=Gi(c),E=Gi(i.clientWidth-(d+p)),k=Gi(i.clientHeight-(c+h)),_=Gi(d),C={rootMargin:-m+"px "+-E+"px "+-k+"px "+-_+"px",threshold:St(0,Rn(1,l))||1};let F=!0;function H(I){const V=I[0].intersectionRatio;if(V!==l){if(!F)return s();V?s(!1,V):r=setTimeout(()=>{s(!1,1e-7)},1e3)}V===1&&!of(u,e.getBoundingClientRect())&&s(),F=!1}try{n=new IntersectionObserver(H,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(H,C)}n.observe(e)}return s(!0),a}function Xg(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=el(e),d=i||a?[...u?mi(u):[],...mi(t)]:[];d.forEach(_=>{i&&_.addEventListener("scroll",n,{passive:!0}),a&&_.addEventListener("resize",n)});const c=u&&o?Kg(u,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(_=>{let[N]=_;N&&N.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var C;(C=h)==null||C.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let m,E=l?Kn(e):null;l&&k();function k(){const _=Kn(e);E&&!of(E,_)&&n(),E=_,m=requestAnimationFrame(k)}return n(),()=>{var _;d.forEach(N=>{i&&N.removeEventListener("scroll",n),a&&N.removeEventListener("resize",n)}),c==null||c(),(_=h)==null||_.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const Qg=xg,Jg=_g,Zg=Eg,e1=Ag,t1=Tg,gu=bg,n1=kg,r1=(e,t,n)=>{const r=new Map,i={platform:Gg,...n},a={...i.platform,_c:r};return gg(e,t,{...i,platform:a})};var i1=typeof document<"u",a1=function(){},ha=i1?b.useLayoutEffect:a1;function Na(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Na(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!Na(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function lf(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bu(e,t){const n=lf(e);return Math.round(t*n)/n}function _s(e){const t=b.useRef(e);return ha(()=>{t.current=e}),t}function s1(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:s}={},transform:o=!0,whileElementsMounted:l,open:u}=e,[d,c]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=b.useState(r);Na(p,r)||h(r);const[m,E]=b.useState(null),[k,_]=b.useState(null),N=b.useCallback(q=>{q!==I.current&&(I.current=q,E(q))},[]),C=b.useCallback(q=>{q!==V.current&&(V.current=q,_(q))},[]),F=a||m,H=s||k,I=b.useRef(null),V=b.useRef(null),U=b.useRef(d),Q=l!=null,O=_s(l),K=_s(i),z=_s(u),x=b.useCallback(()=>{if(!I.current||!V.current)return;const q={placement:t,strategy:n,middleware:p};K.current&&(q.platform=K.current),r1(I.current,V.current,q).then(J=>{const T={...J,isPositioned:z.current!==!1};L.current&&!Na(U.current,T)&&(U.current=T,Go.flushSync(()=>{c(T)}))})},[p,t,n,K,z]);ha(()=>{u===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,c(q=>({...q,isPositioned:!1})))},[u]);const L=b.useRef(!1);ha(()=>(L.current=!0,()=>{L.current=!1}),[]),ha(()=>{if(F&&(I.current=F),H&&(V.current=H),F&&H){if(O.current)return O.current(F,H,x);x()}},[F,H,x,O,Q]);const v=b.useMemo(()=>({reference:I,floating:V,setReference:N,setFloating:C}),[N,C]),D=b.useMemo(()=>({reference:F,floating:H}),[F,H]),P=b.useMemo(()=>{const q={position:n,left:0,top:0};if(!D.floating)return q;const J=bu(D.floating,d.x),T=bu(D.floating,d.y);return o?{...q,transform:"translate("+J+"px, "+T+"px)",...lf(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:T}},[n,o,D.floating,d.x,d.y]);return b.useMemo(()=>({...d,update:x,refs:v,elements:D,floatingStyles:P}),[d,x,v,D,P])}const o1=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?gu({element:r.current,padding:i}).fn(n):{}:r?gu({element:r,padding:i}).fn(n):{}}}},l1=(e,t)=>({...Qg(e),options:[e,t]}),u1=(e,t)=>({...Jg(e),options:[e,t]}),c1=(e,t)=>({...n1(e),options:[e,t]}),d1=(e,t)=>({...Zg(e),options:[e,t]}),f1=(e,t)=>({...e1(e),options:[e,t]}),h1=(e,t)=>({...t1(e),options:[e,t]}),p1=(e,t)=>({...o1(e),options:[e,t]});var m1="Arrow",uf=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return g.jsx(tr.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});uf.displayName=m1;var g1=uf;function b1(e){const[t,n]=b.useState(void 0);return Gn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let s,o;if("borderBoxSize"in a){const l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,o=u.blockSize}else s=e.offsetWidth,o=e.offsetHeight;n({width:s,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var tl="Popper",[cf,df]=Yd(tl),[E1,ff]=cf(tl),hf=e=>{const{__scopePopper:t,children:n}=e,[r,i]=b.useState(null);return g.jsx(E1,{scope:t,anchor:r,onAnchorChange:i,children:n})};hf.displayName=tl;var pf="PopperAnchor",mf=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=ff(pf,n),s=b.useRef(null),o=er(t,s),l=b.useRef(null);return b.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||s.current,u!==l.current&&a.onAnchorChange(l.current)}),r?null:g.jsx(tr.div,{...i,ref:o})});mf.displayName=pf;var nl="PopperContent",[T1,y1]=cf(nl),gf=b.forwardRef((e,t)=>{var He,be,ke,Xe,Qe,tt;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:s=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:c="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:m,...E}=e,k=ff(nl,n),[_,N]=b.useState(null),C=er(t,Tt=>N(Tt)),[F,H]=b.useState(null),I=b1(F),V=(I==null?void 0:I.width)??0,U=(I==null?void 0:I.height)??0,Q=r+(a!=="center"?"-"+a:""),O=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},K=Array.isArray(u)?u:[u],z=K.length>0,x={padding:O,boundary:K.filter(_1),altBoundary:z},{refs:L,floatingStyles:v,placement:D,isPositioned:P,middlewareData:q}=s1({strategy:"fixed",placement:Q,whileElementsMounted:(...Tt)=>Xg(...Tt,{animationFrame:h==="always"}),elements:{reference:k.anchor},middleware:[l1({mainAxis:i+U,alignmentAxis:s}),l&&u1({mainAxis:!0,crossAxis:!1,limiter:c==="partial"?c1():void 0,...x}),l&&d1({...x}),f1({...x,apply:({elements:Tt,rects:yt,availableWidth:lr,availableHeight:Mn})=>{const{width:Gt,height:ur}=yt.reference,Je=Tt.floating.style;Je.setProperty("--radix-popper-available-width",`${lr}px`),Je.setProperty("--radix-popper-available-height",`${Mn}px`),Je.setProperty("--radix-popper-anchor-width",`${Gt}px`),Je.setProperty("--radix-popper-anchor-height",`${ur}px`)}}),F&&p1({element:F,padding:o}),k1({arrowWidth:V,arrowHeight:U}),p&&h1({strategy:"referenceHidden",...x})]}),[J,T]=Tf(D),ie=Wa(m);Gn(()=>{P&&(ie==null||ie())},[P,ie]);const te=(He=q.arrow)==null?void 0:He.x,w=(be=q.arrow)==null?void 0:be.y,he=((ke=q.arrow)==null?void 0:ke.centerOffset)!==0,[ue,de]=b.useState();return Gn(()=>{_&&de(window.getComputedStyle(_).zIndex)},[_]),g.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...v,transform:P?v.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(Xe=q.transformOrigin)==null?void 0:Xe.x,(Qe=q.transformOrigin)==null?void 0:Qe.y].join(" "),...((tt=q.hide)==null?void 0:tt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(T1,{scope:n,placedSide:J,onArrowChange:H,arrowX:te,arrowY:w,shouldHideArrow:he,children:g.jsx(tr.div,{"data-side":J,"data-align":T,...E,ref:C,style:{...E.style,animation:P?void 0:"none"}})})})});gf.displayName=nl;var bf="PopperArrow",x1={top:"bottom",right:"left",bottom:"top",left:"right"},Ef=b.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=y1(bf,r),s=x1[a.placedSide];return g.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:g.jsx(g1,{...i,ref:n,style:{...i.style,display:"block"}})})});Ef.displayName=bf;function _1(e){return e!==null}var k1=e=>({name:"transformOrigin",options:e,fn(t){var k,_,N;const{placement:n,rects:r,middlewareData:i}=t,s=((k=i.arrow)==null?void 0:k.centerOffset)!==0,o=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,d]=Tf(n),c={start:"0%",center:"50%",end:"100%"}[d],p=(((_=i.arrow)==null?void 0:_.x)??0)+o/2,h=(((N=i.arrow)==null?void 0:N.y)??0)+l/2;let m="",E="";return u==="bottom"?(m=s?c:`${p}px`,E=`${-l}px`):u==="top"?(m=s?c:`${p}px`,E=`${r.floating.height+l}px`):u==="right"?(m=`${-l}px`,E=s?c:`${h}px`):u==="left"&&(m=`${r.floating.width+l}px`,E=s?c:`${h}px`),{data:{x:m,y:E}}}});function Tf(e){const[t,n="center"]=e.split("-");return[t,n]}var A1=hf,w1=mf,C1=gf,S1=Ef;function N1(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var yf=e=>{const{present:t,children:n}=e,r=I1(t),i=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),a=er(r.ref,R1(i));return typeof n=="function"||r.isPresent?b.cloneElement(i,{ref:a}):null};yf.displayName="Presence";function I1(e){const[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),a=b.useRef("none"),s=e?"mounted":"unmounted",[o,l]=N1(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=Ki(r.current);a.current=o==="mounted"?u:"none"},[o]),Gn(()=>{const u=r.current,d=i.current;if(d!==e){const p=a.current,h=Ki(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&p!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Gn(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,c=h=>{const E=Ki(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&E&&(l("ANIMATION_END"),!i.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},p=h=>{h.target===t&&(a.current=Ki(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:b.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Ki(e){return(e==null?void 0:e.animationName)||"none"}function R1(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var O1=$d[" useInsertionEffect ".trim().toString()]||Gn;function L1({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,s]=v1({defaultProp:t,onChange:n}),o=e!==void 0,l=o?e:i;{const d=b.useRef(e!==void 0);b.useEffect(()=>{const c=d.current;c!==o&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=o},[o,r])}const u=b.useCallback(d=>{var c;if(o){const p=D1(d)?d(e):d;p!==e&&((c=s.current)==null||c.call(s,p))}else a(d)},[o,e,a,s]);return[l,u]}function v1({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),i=b.useRef(n),a=b.useRef(t);return O1(()=>{a.current=t},[t]),b.useEffect(()=>{var s;i.current!==n&&((s=a.current)==null||s.call(a,n),i.current=n)},[n,i]),[n,r,a]}function D1(e){return typeof e=="function"}var P1=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),M1="VisuallyHidden",xf=b.forwardRef((e,t)=>g.jsx(tr.span,{...e,ref:t,style:{...P1,...e.style}}));xf.displayName=M1;var B1=xf,[Xa]=Yd("Tooltip",[df]),Qa=df(),_f="TooltipProvider",F1=700,io="tooltip.open",[H1,rl]=Xa(_f),U1=e=>{const{__scopeTooltip:t,delayDuration:n=F1,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,s=b.useRef(!0),o=b.useRef(!1),l=b.useRef(0);return b.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),g.jsx(H1,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:o,onPointerInTransitChange:b.useCallback(u=>{o.current=u},[]),disableHoverableContent:i,children:a})};U1.displayName=_f;var gi="Tooltip",[j1,Ja]=Xa(gi),kf=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:s,delayDuration:o}=e,l=rl(gi,e.__scopeTooltip),u=Qa(t),[d,c]=b.useState(null),p=ig(),h=b.useRef(0),m=s??l.disableHoverableContent,E=o??l.delayDuration,k=b.useRef(!1),[_,N]=L1({prop:r,defaultProp:i??!1,onChange:V=>{V?(l.onOpen(),document.dispatchEvent(new CustomEvent(io))):l.onClose(),a==null||a(V)},caller:gi}),C=b.useMemo(()=>_?k.current?"delayed-open":"instant-open":"closed",[_]),F=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,k.current=!1,N(!0)},[N]),H=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,N(!1)},[N]),I=b.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{k.current=!0,N(!0),h.current=0},E)},[E,N]);return b.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),g.jsx(A1,{...u,children:g.jsx(j1,{scope:t,contentId:p,open:_,stateAttribute:C,trigger:d,onTriggerChange:c,onTriggerEnter:b.useCallback(()=>{l.isOpenDelayedRef.current?I():F()},[l.isOpenDelayedRef,I,F]),onTriggerLeave:b.useCallback(()=>{m?H():(window.clearTimeout(h.current),h.current=0)},[H,m]),onOpen:F,onClose:H,disableHoverableContent:m,children:n})})};kf.displayName=gi;var ao="TooltipTrigger",Af=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Ja(ao,n),a=rl(ao,n),s=Qa(n),o=b.useRef(null),l=er(t,o,i.onTriggerChange),u=b.useRef(!1),d=b.useRef(!1),c=b.useCallback(()=>u.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",c),[c]),g.jsx(w1,{asChild:!0,...s,children:g.jsx(tr.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:dn(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:dn(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:dn(e.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:dn(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:dn(e.onBlur,i.onClose),onClick:dn(e.onClick,i.onClose)})})});Af.displayName=ao;var z1="TooltipPortal",[qv,$1]=Xa(z1,{forceMount:void 0}),Ar="TooltipContent",wf=b.forwardRef((e,t)=>{const n=$1(Ar,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,s=Ja(Ar,e.__scopeTooltip);return g.jsx(yf,{present:r||s.open,children:s.disableHoverableContent?g.jsx(Cf,{side:i,...a,ref:t}):g.jsx(V1,{side:i,...a,ref:t})})}),V1=b.forwardRef((e,t)=>{const n=Ja(Ar,e.__scopeTooltip),r=rl(Ar,e.__scopeTooltip),i=b.useRef(null),a=er(t,i),[s,o]=b.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:c}=r,p=b.useCallback(()=>{o(null),c(!1)},[c]),h=b.useCallback((m,E)=>{const k=m.currentTarget,_={x:m.clientX,y:m.clientY},N=K1(_,k.getBoundingClientRect()),C=X1(_,N),F=Q1(E.getBoundingClientRect()),H=Z1([...C,...F]);o(H),c(!0)},[c]);return b.useEffect(()=>()=>p(),[p]),b.useEffect(()=>{if(l&&d){const m=k=>h(k,d),E=k=>h(k,l);return l.addEventListener("pointerleave",m),d.addEventListener("pointerleave",E),()=>{l.removeEventListener("pointerleave",m),d.removeEventListener("pointerleave",E)}}},[l,d,h,p]),b.useEffect(()=>{if(s){const m=E=>{const k=E.target,_={x:E.clientX,y:E.clientY},N=(l==null?void 0:l.contains(k))||(d==null?void 0:d.contains(k)),C=!J1(_,s);N?p():C&&(p(),u())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,d,s,u,p]),g.jsx(Cf,{...e,ref:a})}),[W1,Y1]=Xa(gi,{isInside:!1}),q1=zm("TooltipContent"),Cf=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...o}=e,l=Ja(Ar,n),u=Qa(n),{onClose:d}=l;return b.useEffect(()=>(document.addEventListener(io,d),()=>document.removeEventListener(io,d)),[d]),b.useEffect(()=>{if(l.trigger){const c=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&d()};return window.addEventListener("scroll",c,{capture:!0}),()=>window.removeEventListener("scroll",c,{capture:!0})}},[l.trigger,d]),g.jsx(Kd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:c=>c.preventDefault(),onDismiss:d,children:g.jsxs(C1,{"data-state":l.stateAttribute,...u,...o,ref:t,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(q1,{children:r}),g.jsx(W1,{scope:n,isInside:!0,children:g.jsx(B1,{id:l.contentId,role:"tooltip",children:i||r})})]})})});wf.displayName=Ar;var Sf="TooltipArrow",G1=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Qa(n);return Y1(Sf,n).isInside?null:g.jsx(S1,{...i,...r,ref:t})});G1.displayName=Sf;function K1(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function X1(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Q1(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function J1(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const o=t[a],l=t[s],u=o.x,d=o.y,c=l.x,p=l.y;d>r!=p>r&&n<(c-u)*(r-d)/(p-d)+u&&(i=!i)}return i}function Z1(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),eb(t)}function eb(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const a=t[t.length-1],s=t[t.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const a=n[n.length-1],s=n[n.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var tb=kf,nb=Af,Nf=wf;function If(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=If(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function at(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=If(e))&&(r&&(r+=" "),r+=t);return r}const rb=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},ib=(e,t)=>({classGroupId:e,validator:t}),Rf=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ia="-",Eu=[],ab="arbitrary..",sb=e=>{const t=lb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return ob(s);const o=s.split(Ia),l=o[0]===""&&o.length>1?1:0;return Of(o,l,t)},getConflictingClassGroupIds:(s,o)=>{if(o){const l=r[s],u=n[s];return l?u?rb(u,l):l:u||Eu}return n[s]||Eu}}},Of=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const u=Of(e,t+1,a);if(u)return u}const s=n.validators;if(s===null)return;const o=t===0?e.join(Ia):e.slice(t).join(Ia),l=s.length;for(let u=0;u<l;u++){const d=s[u];if(d.validator(o))return d.classGroupId}},ob=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?ab+r:void 0})(),lb=e=>{const{theme:t,classGroups:n}=e;return ub(n,t)},ub=(e,t)=>{const n=Rf();for(const r in e){const i=e[r];il(i,n,r,t)}return n},il=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const s=e[a];cb(s,t,n,r)}},cb=(e,t,n,r)=>{if(typeof e=="string"){db(e,t,n);return}if(typeof e=="function"){fb(e,t,n,r);return}hb(e,t,n,r)},db=(e,t,n)=>{const r=e===""?t:Lf(t,e);r.classGroupId=n},fb=(e,t,n,r)=>{if(pb(e)){il(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(ib(n,e))},hb=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let s=0;s<a;s++){const[o,l]=i[s];il(l,Lf(t,o),n,r)}},Lf=(e,t)=>{let n=e;const r=t.split(Ia),i=r.length;for(let a=0;a<i;a++){const s=r[a];let o=n.nextPart.get(s);o||(o=Rf(),n.nextPart.set(s,o)),n=o}return n},pb=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,mb=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,s)=>{n[a]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let s=n[a];if(s!==void 0)return s;if((s=r[a])!==void 0)return i(a,s),s},set(a,s){a in n?n[a]=s:i(a,s)}}},so="!",Tu=":",gb=[],yu=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),bb=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let s=0,o=0,l=0,u;const d=i.length;for(let E=0;E<d;E++){const k=i[E];if(s===0&&o===0){if(k===Tu){a.push(i.slice(l,E)),l=E+1;continue}if(k==="/"){u=E;continue}}k==="["?s++:k==="]"?s--:k==="("?o++:k===")"&&o--}const c=a.length===0?i:i.slice(l);let p=c,h=!1;c.endsWith(so)?(p=c.slice(0,-1),h=!0):c.startsWith(so)&&(p=c.slice(1),h=!0);const m=u&&u>l?u-l:void 0;return yu(a,h,p,m)};if(t){const i=t+Tu,a=r;r=s=>s.startsWith(i)?a(s.slice(i.length)):yu(gb,!1,s,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},Eb=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const s=n[a],o=s[0]==="[",l=t.has(s);o||l?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(s)):i.push(s)}return i.length>0&&(i.sort(),r.push(...i)),r}},Tb=e=>({cache:mb(e.cacheSize),parseClassName:bb(e),sortModifiers:Eb(e),...sb(e)}),yb=/\s+/,xb=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,s=[],o=e.trim().split(yb);let l="";for(let u=o.length-1;u>=0;u-=1){const d=o[u],{isExternal:c,modifiers:p,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:E}=n(d);if(c){l=d+(l.length>0?" "+l:l);continue}let k=!!E,_=r(k?m.substring(0,E):m);if(!_){if(!k){l=d+(l.length>0?" "+l:l);continue}if(_=r(m),!_){l=d+(l.length>0?" "+l:l);continue}k=!1}const N=p.length===0?"":p.length===1?p[0]:a(p).join(":"),C=h?N+so:N,F=C+_;if(s.indexOf(F)>-1)continue;s.push(F);const H=i(_,k);for(let I=0;I<H.length;++I){const V=H[I];s.push(C+V)}l=d+(l.length>0?" "+l:l)}return l},_b=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=vf(n))&&(i&&(i+=" "),i+=r);return i},vf=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vf(e[r]))&&(n&&(n+=" "),n+=t);return n},kb=(e,...t)=>{let n,r,i,a;const s=l=>{const u=t.reduce((d,c)=>c(d),e());return n=Tb(u),r=n.cache.get,i=n.cache.set,a=o,o(l)},o=l=>{const u=r(l);if(u)return u;const d=xb(l,n);return i(l,d),d};return a=s,(...l)=>a(_b(...l))},Ab=[],$e=e=>{const t=n=>n[e]||Ab;return t.isThemeGetter=!0,t},Df=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Pf=/^\((?:(\w[\w-]*):)?(.+)\)$/i,wb=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Cb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Sb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Nb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ib=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Rb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yn=e=>wb.test(e),Te=e=>!!e&&!Number.isNaN(Number(e)),xn=e=>!!e&&Number.isInteger(Number(e)),ks=e=>e.endsWith("%")&&Te(e.slice(0,-1)),ln=e=>Cb.test(e),Mf=()=>!0,Ob=e=>Sb.test(e)&&!Nb.test(e),al=()=>!1,Lb=e=>Ib.test(e),vb=e=>Rb.test(e),Db=e=>!ae(e)&&!oe(e),Pb=e=>Dn(e,Hf,al),ae=e=>Df.test(e),Hn=e=>Dn(e,Uf,Ob),xu=e=>Dn(e,$b,Te),Mb=e=>Dn(e,zf,Mf),Bb=e=>Dn(e,jf,al),_u=e=>Dn(e,Bf,al),Fb=e=>Dn(e,Ff,vb),Xi=e=>Dn(e,$f,Lb),oe=e=>Pf.test(e),Br=e=>nr(e,Uf),Hb=e=>nr(e,jf),ku=e=>nr(e,Bf),Ub=e=>nr(e,Hf),jb=e=>nr(e,Ff),Qi=e=>nr(e,$f,!0),zb=e=>nr(e,zf,!0),Dn=(e,t,n)=>{const r=Df.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},nr=(e,t,n=!1)=>{const r=Pf.exec(e);return r?r[1]?t(r[1]):n:!1},Bf=e=>e==="position"||e==="percentage",Ff=e=>e==="image"||e==="url",Hf=e=>e==="length"||e==="size"||e==="bg-size",Uf=e=>e==="length",$b=e=>e==="number",jf=e=>e==="family-name",zf=e=>e==="number"||e==="weight",$f=e=>e==="shadow",Vb=()=>{const e=$e("color"),t=$e("font"),n=$e("text"),r=$e("font-weight"),i=$e("tracking"),a=$e("leading"),s=$e("breakpoint"),o=$e("container"),l=$e("spacing"),u=$e("radius"),d=$e("shadow"),c=$e("inset-shadow"),p=$e("text-shadow"),h=$e("drop-shadow"),m=$e("blur"),E=$e("perspective"),k=$e("aspect"),_=$e("ease"),N=$e("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],H=()=>[...F(),oe,ae],I=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto","contain","none"],U=()=>[oe,ae,l],Q=()=>[yn,"full","auto",...U()],O=()=>[xn,"none","subgrid",oe,ae],K=()=>["auto",{span:["full",xn,oe,ae]},xn,oe,ae],z=()=>[xn,"auto",oe,ae],x=()=>["auto","min","max","fr",oe,ae],L=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],v=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...U()],P=()=>[yn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],q=()=>[yn,"screen","full","dvw","lvw","svw","min","max","fit",...U()],J=()=>[yn,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],T=()=>[e,oe,ae],ie=()=>[...F(),ku,_u,{position:[oe,ae]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],w=()=>["auto","cover","contain",Ub,Pb,{size:[oe,ae]}],he=()=>[ks,Br,Hn],ue=()=>["","none","full",u,oe,ae],de=()=>["",Te,Br,Hn],He=()=>["solid","dashed","dotted","double"],be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ke=()=>[Te,ks,ku,_u],Xe=()=>["","none",m,oe,ae],Qe=()=>["none",Te,oe,ae],tt=()=>["none",Te,oe,ae],Tt=()=>[Te,oe,ae],yt=()=>[yn,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ln],breakpoint:[ln],color:[Mf],container:[ln],"drop-shadow":[ln],ease:["in","out","in-out"],font:[Db],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ln],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ln],shadow:[ln],spacing:["px",Te],text:[ln],"text-shadow":[ln],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yn,ae,oe,k]}],container:["container"],columns:[{columns:[Te,ae,oe,o]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:H()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Q()}],"inset-x":[{"inset-x":Q()}],"inset-y":[{"inset-y":Q()}],start:[{"inset-s":Q(),start:Q()}],end:[{"inset-e":Q(),end:Q()}],"inset-bs":[{"inset-bs":Q()}],"inset-be":[{"inset-be":Q()}],top:[{top:Q()}],right:[{right:Q()}],bottom:[{bottom:Q()}],left:[{left:Q()}],visibility:["visible","invisible","collapse"],z:[{z:[xn,"auto",oe,ae]}],basis:[{basis:[yn,"full","auto",o,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,yn,"auto","initial","none",ae]}],grow:[{grow:["",Te,oe,ae]}],shrink:[{shrink:["",Te,oe,ae]}],order:[{order:[xn,"first","last","none",oe,ae]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":x()}],"auto-rows":[{"auto-rows":x()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...L(),"normal"]}],"justify-items":[{"justify-items":[...v(),"normal"]}],"justify-self":[{"justify-self":["auto",...v()]}],"align-content":[{content:["normal",...L()]}],"align-items":[{items:[...v(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...v(),{baseline:["","last"]}]}],"place-content":[{"place-content":L()}],"place-items":[{"place-items":[...v(),"baseline"]}],"place-self":[{"place-self":["auto",...v()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:P()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[o,"screen",...P()]}],"min-w":[{"min-w":[o,"screen","none",...P()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[s]},...P()]}],h:[{h:["screen","lh",...P()]}],"min-h":[{"min-h":["screen","lh","none",...P()]}],"max-h":[{"max-h":["screen","lh",...P()]}],"font-size":[{text:["base",n,Br,Hn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,zb,Mb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ks,ae]}],"font-family":[{font:[Hb,Bb,t]}],"font-features":[{"font-features":[ae]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,oe,ae]}],"line-clamp":[{"line-clamp":[Te,"none",oe,xu]}],leading:[{leading:[a,...U()]}],"list-image":[{"list-image":["none",oe,ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",oe,ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...He(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",oe,Hn]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[Te,"auto",oe,ae]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",oe,ae]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",oe,ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:w()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xn,oe,ae],radial:["",oe,ae],conic:[xn,oe,ae]},jb,Fb]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:he()}],"gradient-via-pos":[{via:he()}],"gradient-to-pos":[{to:he()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...He(),"hidden","none"]}],"divide-style":[{divide:[...He(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...He(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,oe,ae]}],"outline-w":[{outline:["",Te,Br,Hn]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",d,Qi,Xi]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",c,Qi,Xi]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[Te,Hn]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",p,Qi,Xi]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[Te,oe,ae]}],"mix-blend":[{"mix-blend":[...be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":be()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Te]}],"mask-image-linear-from-pos":[{"mask-linear-from":ke()}],"mask-image-linear-to-pos":[{"mask-linear-to":ke()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":ke()}],"mask-image-t-to-pos":[{"mask-t-to":ke()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":ke()}],"mask-image-r-to-pos":[{"mask-r-to":ke()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":ke()}],"mask-image-b-to-pos":[{"mask-b-to":ke()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":ke()}],"mask-image-l-to-pos":[{"mask-l-to":ke()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":ke()}],"mask-image-x-to-pos":[{"mask-x-to":ke()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":ke()}],"mask-image-y-to-pos":[{"mask-y-to":ke()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[oe,ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":ke()}],"mask-image-radial-to-pos":[{"mask-radial-to":ke()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":F()}],"mask-image-conic-pos":[{"mask-conic":[Te]}],"mask-image-conic-from-pos":[{"mask-conic-from":ke()}],"mask-image-conic-to-pos":[{"mask-conic-to":ke()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:w()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",oe,ae]}],filter:[{filter:["","none",oe,ae]}],blur:[{blur:Xe()}],brightness:[{brightness:[Te,oe,ae]}],contrast:[{contrast:[Te,oe,ae]}],"drop-shadow":[{"drop-shadow":["","none",h,Qi,Xi]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",Te,oe,ae]}],"hue-rotate":[{"hue-rotate":[Te,oe,ae]}],invert:[{invert:["",Te,oe,ae]}],saturate:[{saturate:[Te,oe,ae]}],sepia:[{sepia:["",Te,oe,ae]}],"backdrop-filter":[{"backdrop-filter":["","none",oe,ae]}],"backdrop-blur":[{"backdrop-blur":Xe()}],"backdrop-brightness":[{"backdrop-brightness":[Te,oe,ae]}],"backdrop-contrast":[{"backdrop-contrast":[Te,oe,ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,oe,ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,oe,ae]}],"backdrop-invert":[{"backdrop-invert":["",Te,oe,ae]}],"backdrop-opacity":[{"backdrop-opacity":[Te,oe,ae]}],"backdrop-saturate":[{"backdrop-saturate":[Te,oe,ae]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,oe,ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",oe,ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",oe,ae]}],ease:[{ease:["linear","initial",_,oe,ae]}],delay:[{delay:[Te,oe,ae]}],animate:[{animate:["none",N,oe,ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,oe,ae]}],"perspective-origin":[{"perspective-origin":H()}],rotate:[{rotate:Qe()}],"rotate-x":[{"rotate-x":Qe()}],"rotate-y":[{"rotate-y":Qe()}],"rotate-z":[{"rotate-z":Qe()}],scale:[{scale:tt()}],"scale-x":[{"scale-x":tt()}],"scale-y":[{"scale-y":tt()}],"scale-z":[{"scale-z":tt()}],"scale-3d":["scale-3d"],skew:[{skew:Tt()}],"skew-x":[{"skew-x":Tt()}],"skew-y":[{"skew-y":Tt()}],transform:[{transform:[oe,ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:H()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:yt()}],"translate-x":[{"translate-x":yt()}],"translate-y":[{"translate-y":yt()}],"translate-z":[{"translate-z":yt()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",oe,ae]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",oe,ae]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[Te,Br,Hn,xu]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},sl=kb(Vb);/**
3
3
  * @license lucide-react v0.575.0 - ISC
4
4
  *
@@ -157,7 +157,7 @@ ${this.parser.parse(e)}</blockquote>
157
157
  ${e}</tr>
158
158
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
159
159
  `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${cn(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=nd(e);if(i===null)return r;e=i;let a='<a href="'+e+'"';return t&&(a+=' title="'+cn(t)+'"'),a+=">"+r+"</a>",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=nd(e);if(i===null)return cn(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${cn(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:cn(e.text)}},$l=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},$t=class vo{constructor(t){Ne(this,"options");Ne(this,"renderer");Ne(this,"textRenderer");this.options=t||or,this.options.renderer=this.options.renderer||new ja,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $l}static parse(t,n){return new vo(n).parse(t)}static parseInline(t,n){return new vo(n).parseInline(t)}parse(t){var r,i;let n="";for(let a=0;a<t.length;a++){let s=t[a];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[s.type]){let l=s,u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=u||"";continue}}let o=s;switch(o.type){case"space":{n+=this.renderer.space(o);break}case"hr":{n+=this.renderer.hr(o);break}case"heading":{n+=this.renderer.heading(o);break}case"code":{n+=this.renderer.code(o);break}case"table":{n+=this.renderer.table(o);break}case"blockquote":{n+=this.renderer.blockquote(o);break}case"list":{n+=this.renderer.list(o);break}case"checkbox":{n+=this.renderer.checkbox(o);break}case"html":{n+=this.renderer.html(o);break}case"def":{n+=this.renderer.def(o);break}case"paragraph":{n+=this.renderer.paragraph(o);break}case"text":{n+=this.renderer.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(t,n=this.renderer){var i,a;let r="";for(let s=0;s<t.length;s++){let o=t[s];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[o.type]){let u=this.options.extensions.renderers[o.type].call({parser:this},o);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){r+=u||"";continue}}let l=o;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"checkbox":{r+=n.checkbox(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{let u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},fa,ei=(fa=class{constructor(e){Ne(this,"options");Ne(this,"block");this.options=e||or}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Pt.lex:Pt.lexInline}provideParser(){return this.block?$t.parse:$t.parseInline}},Ne(fa,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ne(fa,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),fa),_I=class{constructor(...e){Ne(this,"defaults",Pl());Ne(this,"options",this.setOptions);Ne(this,"parse",this.parseMarkdown(!0));Ne(this,"parseInline",this.parseMarkdown(!1));Ne(this,"Parser",$t);Ne(this,"Renderer",ja);Ne(this,"TextRenderer",$l);Ne(this,"Lexer",Pt);Ne(this,"Tokenizer",Ua);Ne(this,"Hooks",ei);this.use(...e)}walkTokens(e,t){var r,i;let n=[];for(let a of e)switch(n=n.concat(t.call(this,a)),a.type){case"table":{let s=a;for(let o of s.header)n=n.concat(this.walkTokens(o.tokens,t));for(let o of s.rows)for(let l of o)n=n.concat(this.walkTokens(l.tokens,t));break}case"list":{let s=a;n=n.concat(this.walkTokens(s.items,t));break}default:{let s=a;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[s.type]?this.defaults.extensions.childTokens[s.type].forEach(o=>{let l=s[o].flat(1/0);n=n.concat(this.walkTokens(l,t))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=t.renderers[i.name];a?t.renderers[i.name]=function(...s){let o=i.renderer.apply(this,s);return o===!1&&(o=a.apply(this,s)),o}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=t[i.level];a?a.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){let i=this.defaults.renderer||new ja(this.defaults);for(let a in n.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let s=a,o=n.renderer[s],l=i[s];i[s]=(...u)=>{let d=o.apply(i,u);return d===!1&&(d=l.apply(i,u)),d||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new Ua(this.defaults);for(let a in n.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let s=a,o=n.tokenizer[s],l=i[s];i[s]=(...u)=>{let d=o.apply(i,u);return d===!1&&(d=l.apply(i,u)),d}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new ei;for(let a in n.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let s=a,o=n.hooks[s],l=i[s];ei.passThroughHooks.has(a)?i[s]=u=>{if(this.defaults.async&&ei.passThroughHooksRespectAsync.has(a))return(async()=>{let c=await o.call(i,u);return l.call(i,c)})();let d=o.call(i,u);return l.call(i,d)}:i[s]=(...u)=>{if(this.defaults.async)return(async()=>{let c=await o.apply(i,u);return c===!1&&(c=await l.apply(i,u)),c})();let d=o.apply(i,u);return d===!1&&(d=l.apply(i,u)),d}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,a=n.walkTokens;r.walkTokens=function(s){let o=[];return o.push(a.call(this,s)),i&&(o=o.concat(i.call(this,s))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Pt.lex(e,t??this.defaults)}parser(e,t){return $t.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let s=i.hooks?await i.hooks.preprocess(t):t,o=await(i.hooks?await i.hooks.provideLexer():e?Pt.lex:Pt.lexInline)(s,i),l=i.hooks?await i.hooks.processAllTokens(o):o;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser():e?$t.parse:$t.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let s=(i.hooks?i.hooks.provideLexer():e?Pt.lex:Pt.lexInline)(t,i);i.hooks&&(s=i.hooks.processAllTokens(s)),i.walkTokens&&this.walkTokens(s,i.walkTokens);let o=(i.hooks?i.hooks.provideParser():e?$t.parse:$t.parseInline)(s,i);return i.hooks&&(o=i.hooks.postprocess(o)),o}catch(s){return a(s)}}}onError(e,t){return n=>{if(n.message+=`
160
- Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+cn(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},Jn=new _I;function Ie(e,t){return Jn.parse(e,t)}Ie.options=Ie.setOptions=function(e){return Jn.setOptions(e),Ie.defaults=Jn.defaults,A0(Ie.defaults),Ie};Ie.getDefaults=Pl;Ie.defaults=or;Ie.use=function(...e){return Jn.use(...e),Ie.defaults=Jn.defaults,A0(Ie.defaults),Ie};Ie.walkTokens=function(e,t){return Jn.walkTokens(e,t)};Ie.parseInline=Jn.parseInline;Ie.Parser=$t;Ie.parser=$t.parse;Ie.Renderer=ja;Ie.TextRenderer=$l;Ie.Lexer=Pt;Ie.lexer=Pt.lex;Ie.Tokenizer=Ua;Ie.Hooks=ei;Ie.parse=Ie;Ie.options;Ie.setOptions;Ie.use;Ie.walkTokens;Ie.parseInline;$t.parse;Pt.lex;var kI=300,AI="300px",wI=500;function CI(e={}){let{immediate:t=!1,debounceDelay:n=kI,rootMargin:r=AI,idleTimeout:i=wI}=e,[a,s]=b.useState(!1),o=b.useRef(null),l=b.useRef(null),u=b.useRef(null),d=b.useMemo(()=>h=>{let m=Date.now();return window.setTimeout(()=>{h({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-m))})},1)},[]),c=b.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(h,m)=>window.requestIdleCallback(h,m):d,[d]),p=b.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?h=>window.cancelIdleCallback(h):h=>{clearTimeout(h)},[]);return b.useEffect(()=>{if(t){s(!0);return}let h=o.current;if(!h)return;l.current&&(clearTimeout(l.current),l.current=null),u.current&&(p(u.current),u.current=null);let m=()=>{l.current&&(clearTimeout(l.current),l.current=null),u.current&&(p(u.current),u.current=null)},E=C=>{u.current=c(F=>{F.timeRemaining()>0||F.didTimeout?(s(!0),C.disconnect()):u.current=c(()=>{s(!0),C.disconnect()},{timeout:i/2})},{timeout:i})},k=C=>{m(),l.current=window.setTimeout(()=>{var F,H;let I=C.takeRecords();(I.length===0||(H=(F=I.at(-1))==null?void 0:F.isIntersecting)!=null&&H)&&E(C)},n)},_=(C,F)=>{C.isIntersecting?k(F):m()},N=new IntersectionObserver(C=>{for(let F of C)_(F,N)},{rootMargin:r,threshold:0});return N.observe(h),()=>{l.current&&clearTimeout(l.current),u.current&&p(u.current),N.disconnect()}},[t,n,r,i,p,c]),{shouldRender:a,containerRef:o}}var M0=/\s/,SI=/^\s+$/,NI=new Set(["code","pre","svg","math","annotation"]),II=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",RI=e=>e.some(t=>II(t)&&NI.has(t.tagName)),OI=e=>{let t=[],n="",r=!1;for(let i of e){let a=M0.test(i);a!==r&&n&&(t.push(n),n=""),n+=i,r=a}return n&&t.push(n),t},LI=e=>{let t=[],n="";for(let r of e)M0.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},vI=(e,t,n,r)=>({type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:`--sd-animation:sd-${t};--sd-duration:${n}ms;--sd-easing:${r}`},children:[{type:"text",value:e}]}),DI=(e,t,n)=>{let r=t.at(-1);if(!(r&&"children"in r))return;if(RI(t))return wp;let i=r,a=i.children.indexOf(e);if(a===-1)return;let s=e.value;if(!s.trim())return;let o=(n.sep==="char"?LI(s):OI(s)).map(l=>SI.test(l)?{type:"text",value:l}:vI(l,n.animation,n.duration,n.easing));return i.children.splice(a,1,...o),a+o.length};function Do(e){var t,n,r,i;let a={animation:(t=e==null?void 0:e.animation)!=null?t:"fadeIn",duration:(n=e==null?void 0:e.duration)!=null?n:150,easing:(r=e==null?void 0:e.easing)!=null?r:"ease",sep:(i=e==null?void 0:e.sep)!=null?i:"word"};return{name:"animate",type:"animate",rehypePlugin:()=>s=>{Cp(s,"text",(o,l)=>DI(o,l,a))}}}Do();var B0=b.createContext(!1),PI=()=>b.useContext(B0),ce=(...e)=>sl(at(e)),_r=(e,t,n)=>{let r=typeof t=="string"?new Blob([t],{type:n}):t,i=URL.createObjectURL(r),a=document.createElement("a");a.href=i,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)},MI=ce("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),BI=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let i=n.slice(0,r).trim(),a=n.slice(r+1).trim();i&&a&&(t[i]=a)}}return t},FI=b.memo(({children:e,result:t,language:n,className:r,...i})=>{let a=b.useMemo(()=>{let s={};return t.bg&&(s["--sdm-bg"]=t.bg),t.fg&&(s["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(s,BI(t.rootStyle)),s},[t.bg,t.fg,t.rootStyle]);return g.jsx("div",{className:ce(r,"overflow-hidden rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...i,children:g.jsx("pre",{className:ce(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:a,children:g.jsx("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:t.tokens.map((s,o)=>g.jsx("span",{className:MI,children:s.map((l,u)=>{let d={},c=!!l.bgColor;if(l.color&&(d["--sdm-c"]=l.color),l.bgColor&&(d["--sdm-tbg"]=l.bgColor),l.htmlStyle)for(let[p,h]of Object.entries(l.htmlStyle))p==="color"?d["--sdm-c"]=h:p==="background-color"?(d["--sdm-tbg"]=h,c=!0):d[p]=h;return g.jsx("span",{className:ce("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",c&&"bg-[var(--sdm-tbg)]",c&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:d,...l.htmlAttrs,children:l.content},u)})},o))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className),HI=({className:e,language:t,style:n,isIncomplete:r,...i})=>g.jsx("div",{className:ce("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...i}),F0=b.createContext({code:""}),H0=()=>b.useContext(F0),UI=({language:e})=>g.jsx("div",{className:"flex h-8 items-center text-muted-foreground text-xs","data-language":e,"data-streamdown":"code-block-header",children:g.jsx("span",{className:"ml-1 font-mono lowercase",children:e})}),jI=/\n+$/,zI=b.lazy(()=>bi(()=>import("./highlighted-body-B3W2YXNL-BO6bNJzI.js"),__vite__mapDeps([0,1])).then(e=>({default:e.HighlightedCodeBlockBody}))),$I=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,...a})=>{let s=b.useMemo(()=>e.replace(jI,""),[e]),o=b.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:s.split(`
160
+ Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+cn(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},Jn=new _I;function Ie(e,t){return Jn.parse(e,t)}Ie.options=Ie.setOptions=function(e){return Jn.setOptions(e),Ie.defaults=Jn.defaults,A0(Ie.defaults),Ie};Ie.getDefaults=Pl;Ie.defaults=or;Ie.use=function(...e){return Jn.use(...e),Ie.defaults=Jn.defaults,A0(Ie.defaults),Ie};Ie.walkTokens=function(e,t){return Jn.walkTokens(e,t)};Ie.parseInline=Jn.parseInline;Ie.Parser=$t;Ie.parser=$t.parse;Ie.Renderer=ja;Ie.TextRenderer=$l;Ie.Lexer=Pt;Ie.lexer=Pt.lex;Ie.Tokenizer=Ua;Ie.Hooks=ei;Ie.parse=Ie;Ie.options;Ie.setOptions;Ie.use;Ie.walkTokens;Ie.parseInline;$t.parse;Pt.lex;var kI=300,AI="300px",wI=500;function CI(e={}){let{immediate:t=!1,debounceDelay:n=kI,rootMargin:r=AI,idleTimeout:i=wI}=e,[a,s]=b.useState(!1),o=b.useRef(null),l=b.useRef(null),u=b.useRef(null),d=b.useMemo(()=>h=>{let m=Date.now();return window.setTimeout(()=>{h({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-m))})},1)},[]),c=b.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(h,m)=>window.requestIdleCallback(h,m):d,[d]),p=b.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?h=>window.cancelIdleCallback(h):h=>{clearTimeout(h)},[]);return b.useEffect(()=>{if(t){s(!0);return}let h=o.current;if(!h)return;l.current&&(clearTimeout(l.current),l.current=null),u.current&&(p(u.current),u.current=null);let m=()=>{l.current&&(clearTimeout(l.current),l.current=null),u.current&&(p(u.current),u.current=null)},E=C=>{u.current=c(F=>{F.timeRemaining()>0||F.didTimeout?(s(!0),C.disconnect()):u.current=c(()=>{s(!0),C.disconnect()},{timeout:i/2})},{timeout:i})},k=C=>{m(),l.current=window.setTimeout(()=>{var F,H;let I=C.takeRecords();(I.length===0||(H=(F=I.at(-1))==null?void 0:F.isIntersecting)!=null&&H)&&E(C)},n)},_=(C,F)=>{C.isIntersecting?k(F):m()},N=new IntersectionObserver(C=>{for(let F of C)_(F,N)},{rootMargin:r,threshold:0});return N.observe(h),()=>{l.current&&clearTimeout(l.current),u.current&&p(u.current),N.disconnect()}},[t,n,r,i,p,c]),{shouldRender:a,containerRef:o}}var M0=/\s/,SI=/^\s+$/,NI=new Set(["code","pre","svg","math","annotation"]),II=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",RI=e=>e.some(t=>II(t)&&NI.has(t.tagName)),OI=e=>{let t=[],n="",r=!1;for(let i of e){let a=M0.test(i);a!==r&&n&&(t.push(n),n=""),n+=i,r=a}return n&&t.push(n),t},LI=e=>{let t=[],n="";for(let r of e)M0.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},vI=(e,t,n,r)=>({type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:`--sd-animation:sd-${t};--sd-duration:${n}ms;--sd-easing:${r}`},children:[{type:"text",value:e}]}),DI=(e,t,n)=>{let r=t.at(-1);if(!(r&&"children"in r))return;if(RI(t))return wp;let i=r,a=i.children.indexOf(e);if(a===-1)return;let s=e.value;if(!s.trim())return;let o=(n.sep==="char"?LI(s):OI(s)).map(l=>SI.test(l)?{type:"text",value:l}:vI(l,n.animation,n.duration,n.easing));return i.children.splice(a,1,...o),a+o.length};function Do(e){var t,n,r,i;let a={animation:(t=e==null?void 0:e.animation)!=null?t:"fadeIn",duration:(n=e==null?void 0:e.duration)!=null?n:150,easing:(r=e==null?void 0:e.easing)!=null?r:"ease",sep:(i=e==null?void 0:e.sep)!=null?i:"word"};return{name:"animate",type:"animate",rehypePlugin:()=>s=>{Cp(s,"text",(o,l)=>DI(o,l,a))}}}Do();var B0=b.createContext(!1),PI=()=>b.useContext(B0),ce=(...e)=>sl(at(e)),_r=(e,t,n)=>{let r=typeof t=="string"?new Blob([t],{type:n}):t,i=URL.createObjectURL(r),a=document.createElement("a");a.href=i,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)},MI=ce("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),BI=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let i=n.slice(0,r).trim(),a=n.slice(r+1).trim();i&&a&&(t[i]=a)}}return t},FI=b.memo(({children:e,result:t,language:n,className:r,...i})=>{let a=b.useMemo(()=>{let s={};return t.bg&&(s["--sdm-bg"]=t.bg),t.fg&&(s["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(s,BI(t.rootStyle)),s},[t.bg,t.fg,t.rootStyle]);return g.jsx("div",{className:ce(r,"overflow-hidden rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...i,children:g.jsx("pre",{className:ce(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:a,children:g.jsx("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:t.tokens.map((s,o)=>g.jsx("span",{className:MI,children:s.map((l,u)=>{let d={},c=!!l.bgColor;if(l.color&&(d["--sdm-c"]=l.color),l.bgColor&&(d["--sdm-tbg"]=l.bgColor),l.htmlStyle)for(let[p,h]of Object.entries(l.htmlStyle))p==="color"?d["--sdm-c"]=h:p==="background-color"?(d["--sdm-tbg"]=h,c=!0):d[p]=h;return g.jsx("span",{className:ce("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",c&&"bg-[var(--sdm-tbg)]",c&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:d,...l.htmlAttrs,children:l.content},u)})},o))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className),HI=({className:e,language:t,style:n,isIncomplete:r,...i})=>g.jsx("div",{className:ce("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...i}),F0=b.createContext({code:""}),H0=()=>b.useContext(F0),UI=({language:e})=>g.jsx("div",{className:"flex h-8 items-center text-muted-foreground text-xs","data-language":e,"data-streamdown":"code-block-header",children:g.jsx("span",{className:"ml-1 font-mono lowercase",children:e})}),jI=/\n+$/,zI=b.lazy(()=>bi(()=>import("./highlighted-body-B3W2YXNL-Rt-vkvmE.js"),__vite__mapDeps([0,1])).then(e=>({default:e.HighlightedCodeBlockBody}))),$I=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,...a})=>{let s=b.useMemo(()=>e.replace(jI,""),[e]),o=b.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:s.split(`
161
161
  `).map(l=>[{content:l,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[s]);return g.jsx(F0.Provider,{value:{code:e},children:g.jsxs(HI,{isIncomplete:i,language:t,children:[g.jsx(UI,{language:t}),r?g.jsx("div",{className:"pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end",children:g.jsx("div",{className:"pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur","data-streamdown":"code-block-actions",children:r})}):null,g.jsx(b.Suspense,{fallback:g.jsx(FI,{className:n,language:t,result:o,...a}),children:g.jsx(zI,{className:n,code:s,language:t,raw:o,...a})})]})})},Vl=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),Wl=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),fs=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),VI=e=>g.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[g.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),g.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),WI=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),YI=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),U0=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),ad=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),qI=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),GI=e=>g.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:g.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),sd=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...s})=>{let[o,l]=b.useState(!1),u=b.useRef(0),{code:d}=H0(),{isAnimating:c}=b.useContext(Ft),p=a??d,h=async()=>{var E;if(typeof window>"u"||!((E=navigator==null?void 0:navigator.clipboard)!=null&&E.writeText)){t==null||t(new Error("Clipboard API not available"));return}try{o||(await navigator.clipboard.writeText(p),l(!0),e==null||e(),u.current=window.setTimeout(()=>l(!1),n))}catch(k){t==null||t(k)}};b.useEffect(()=>()=>{window.clearTimeout(u.current)},[]);let m=o?Vl:Wl;return g.jsx("button",{className:ce("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:c,onClick:h,title:"Copy Code",type:"button",...s,children:r??g.jsx(m,{size:14})})},od={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},KI=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...s})=>{let{code:o}=H0(),{isAnimating:l}=b.useContext(Ft),u=a??o,d=`file.${n&&n in od?od[n]:"txt"}`,c="text/plain",p=()=>{try{_r(d,u,c),e==null||e()}catch(h){t==null||t(h)}};return g.jsx("button",{className:ce("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:l,onClick:p,title:"Download file",type:"button",...s,children:r??g.jsx(fs,{size:14})})},XI=()=>g.jsxs("div",{className:"w-full divide-y divide-border overflow-hidden rounded-xl border border-border",children:[g.jsx("div",{className:"h-[46px] w-full bg-muted/80"}),g.jsx("div",{className:"flex w-full items-center justify-center p-4",children:g.jsx(VI,{className:"size-4 animate-spin"})})]}),QI=/\.[^/.]+$/,JI=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,...s})=>{let o=b.useRef(null),[l,u]=b.useState(!1),[d,c]=b.useState(!1),p=s.width!=null||s.height!=null,h=(l||p)&&!d,m=d&&!p;b.useEffect(()=>{let N=o.current;if(N!=null&&N.complete){let C=N.naturalWidth>0;u(C),c(!C)}},[]);let E=b.useCallback(N=>{u(!0),c(!1),i==null||i(N)},[i]),k=b.useCallback(N=>{u(!1),c(!0),a==null||a(N)},[a]),_=async()=>{if(n)try{let N=await(await fetch(n)).blob(),C=new URL(n,window.location.origin).pathname.split("/").pop()||"",F=C.split(".").pop(),H=C.includes(".")&&F!==void 0&&F.length<=4,I="";if(H)I=C;else{let V=N.type,U="png";V.includes("jpeg")||V.includes("jpg")?U="jpg":V.includes("png")?U="png":V.includes("svg")?U="svg":V.includes("gif")?U="gif":V.includes("webp")&&(U="webp"),I=`${(r||C||"image").replace(QI,"")}.${U}`}_r(I,N,N.type)}catch{window.open(n,"_blank")}};return n?g.jsxs("div",{className:"group relative my-4 inline-block","data-streamdown":"image-wrapper",children:[g.jsx("img",{alt:r,className:ce("max-w-full rounded-lg",m&&"hidden",t),"data-streamdown":"image",onError:k,onLoad:E,ref:o,src:n,...s}),m&&g.jsx("span",{className:"text-muted-foreground text-xs italic","data-streamdown":"image-fallback",children:"Image not available"}),g.jsx("div",{className:"pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"}),h&&g.jsx("button",{className:ce("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:_,title:"Download image",type:"button",children:g.jsx(fs,{size:14})})]}):null},fi=0,ZI=()=>{fi+=1,fi===1&&(document.body.style.overflow="hidden")},eR=()=>{fi=Math.max(0,fi-1),fi===0&&(document.body.style.overflow="")},tR=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let[i,a]=b.useState(!1),s=b.useCallback(async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)}catch{}},[e]),o=b.useCallback(()=>{r(),n()},[r,n]);return b.useEffect(()=>{if(t){ZI();let l=u=>{u.key==="Escape"&&n()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l),eR()}}},[t,n]),t?g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm","data-streamdown":"link-safety-modal",onClick:n,onKeyDown:l=>{l.key==="Escape"&&n()},role:"button",tabIndex:0,children:g.jsxs("div",{className:"relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg",onClick:l=>l.stopPropagation(),onKeyDown:l=>l.stopPropagation(),role:"presentation",children:[g.jsx("button",{className:"absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:n,title:"Close",type:"button",children:g.jsx(U0,{size:16})}),g.jsxs("div",{className:"flex flex-col gap-2",children:[g.jsxs("div",{className:"flex items-center gap-2 font-semibold text-lg",children:[g.jsx(ad,{size:20}),g.jsx("span",{children:"Open external link?"})]}),g.jsx("p",{className:"text-muted-foreground text-sm",children:"You're about to visit an external website."})]}),g.jsx("div",{className:ce("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx("button",{className:"flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted",onClick:s,type:"button",children:i?g.jsxs(g.Fragment,{children:[g.jsx(Vl,{size:14}),g.jsx("span",{children:"Copied"})]}):g.jsxs(g.Fragment,{children:[g.jsx(Wl,{size:14}),g.jsx("span",{children:"Copy link"})]})}),g.jsxs("button",{className:"flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90",onClick:o,type:"button",children:[g.jsx(ad,{size:14}),g.jsx("span",{children:"Open link"})]})]})]})}):null},Po=b.createContext(null),j0=()=>b.useContext(Po),i4=()=>{var e;let t=j0();return(e=t==null?void 0:t.code)!=null?e:null},Yl=()=>{var e;let t=j0();return(e=t==null?void 0:t.mermaid)!=null?e:null},nR=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,a)=>{let s="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),o=new Image;o.crossOrigin="anonymous",o.onload=()=>{let l=document.createElement("canvas"),u=o.width*r,d=o.height*r;l.width=u,l.height=d;let c=l.getContext("2d");if(!c){a(new Error("Failed to create 2D canvas context for PNG export"));return}c.drawImage(o,0,0,u,d),l.toBlob(p=>{if(!p){a(new Error("Failed to create PNG blob"));return}i(p)},"image/png")},o.onerror=()=>a(new Error("Failed to load SVG image")),o.src=s})},rR=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let[s,o]=b.useState(!1),l=b.useRef(null),{isAnimating:u}=b.useContext(Ft),d=Yl(),c=async p=>{try{if(p==="mmd"){_r("diagram.mmd",e,"text/plain"),o(!1),r==null||r(p);return}if(!d){a==null||a(new Error("Mermaid plugin not available"));return}let h=d.getMermaid(i),m=e.split("").reduce((_,N)=>(_<<5)-_+N.charCodeAt(0)|0,0),E=`mermaid-${Math.abs(m)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:k}=await h.render(E,e);if(!k){a==null||a(new Error("SVG not found. Please wait for the diagram to render."));return}if(p==="svg"){_r("diagram.svg",k,"image/svg+xml"),o(!1),r==null||r(p);return}if(p==="png"){let _=await nR(k);_r("diagram.png",_,"image/png"),r==null||r(p),o(!1);return}}catch(h){a==null||a(h)}};return b.useEffect(()=>{let p=h=>{let m=h.composedPath();l.current&&!m.includes(l.current)&&o(!1)};return document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[]),g.jsxs("div",{className:"relative",ref:l,children:[g.jsx("button",{className:ce("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:u,onClick:()=>o(!s),title:"Download diagram",type:"button",children:t??g.jsx(fs,{size:14})}),s?g.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[g.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>c("svg"),title:"Download diagram as SVG",type:"button",children:"SVG"}),g.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>c("png"),title:"Download diagram as PNG",type:"button",children:"PNG"}),g.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>c("mmd"),title:"Download diagram as MMD",type:"button",children:"MMD"})]}):null]})},hi=0,iR=()=>{hi+=1,hi===1&&(document.body.style.overflow="hidden")},aR=()=>{hi=Math.max(0,hi-1),hi===0&&(document.body.style.overflow="")},sR=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let[s,o]=b.useState(!1),{isAnimating:l,controls:u}=b.useContext(Ft),d=(()=>{if(typeof u=="boolean")return u;let p=u.mermaid;return p===!1?!1:p===!0||p===void 0?!0:p.panZoom!==!1})(),c=()=>{o(!s)};return b.useEffect(()=>{if(s){iR();let p=h=>{h.key==="Escape"&&o(!1)};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p),aR()}}},[s]),b.useEffect(()=>{s?n==null||n():r&&r()},[s,n,r]),g.jsxs(g.Fragment,{children:[g.jsx("button",{className:ce("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:l,onClick:c,title:"View fullscreen",type:"button",...a,children:g.jsx(WI,{size:14})}),s?Go.createPortal(g.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm",onClick:c,onKeyDown:p=>{p.key==="Escape"&&c()},role:"button",tabIndex:0,children:[g.jsx("button",{className:"absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:c,title:"Exit fullscreen",type:"button",children:g.jsx(U0,{size:20})}),g.jsx("div",{className:"flex size-full items-center justify-center p-4",onClick:p=>p.stopPropagation(),onKeyDown:p=>p.stopPropagation(),role:"presentation",children:g.jsx(gm,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:t,fullscreen:!0,showControls:d})})]}),document.body):null]})},z0=e=>{var t,n;let r=[],i=[],a=e.querySelectorAll("thead th");for(let o of a)r.push(((t=o.textContent)==null?void 0:t.trim())||"");let s=e.querySelectorAll("tbody tr");for(let o of s){let l=[],u=o.querySelectorAll("td");for(let d of u)l.push(((n=d.textContent)==null?void 0:n.trim())||"");i.push(l)}return{headers:r,rows:i}},$0=e=>{let{headers:t,rows:n}=e,r=o=>{let l=!1,u=!1;for(let d of o){if(d==='"'){l=!0,u=!0;break}(d===","||d===`
162
162
  `)&&(l=!0)}return l?u?`"${o.replace(/"/g,'""')}"`:`"${o}"`:o},i=t.length>0?n.length+1:n.length,a=new Array(i),s=0;t.length>0&&(a[s]=t.map(r).join(","),s+=1);for(let o of n)a[s]=o.map(r).join(","),s+=1;return a.join(`
163
163
  `)},oR=e=>{let{headers:t,rows:n}=e,r=o=>{let l=!1;for(let d of o)if(d===" "||d===`
@@ -169,4 +169,4 @@ Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error
169
169
  `);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&bR.test(r))return!0}return!1},TR=()=>e=>{Ln(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},ud=[],cd={allowDangerousHtml:!0},oa=new WeakMap,yR=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let d="default";return this.keyCache.set(e,d),d}let a=d=>{if(!d||d.length===0)return"";let c="";for(let p=0;p<d.length;p+=1){let h=d[p];if(p>0&&(c+=","),Array.isArray(h)){let[m,E]=h;if(typeof m=="function"){let k=oa.get(m);k||(k=m.name,oa.set(m,k)),c+=k}else c+=String(m);c+=":",c+=JSON.stringify(E)}else if(typeof h=="function"){let m=oa.get(h);m||(m=h.name,oa.set(h,m)),c+=m}else c+=String(h)}return c},s=a(n),o=a(r),l=i?JSON.stringify(i):"",u=`${o}::${s}::${l}`;return this.keyCache.set(e,u),u}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},dd=new yR,pm=e=>{let t=xR(e),n=e.children||"";return NR(t.runSync(t.parse(n),n),e)},xR=e=>{let t=dd.get(e);if(t)return t;let n=kR(e);return dd.set(e,n),n},_R=e=>e.some(t=>Array.isArray(t)?t[0]===ko:t===ko),kR=e=>{let t=e.rehypePlugins||ud,n=e.remarkPlugins||ud,r=_R(t)?n:[...n,TR],i=e.remarkRehypeOptions?{...cd,...e.remarkRehypeOptions}:cd;return RN().use(I3).use(r).use(dN,i).use(t)},AR=e=>e,wR=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},CR=(e,t)=>{var n;for(let r in Us)if(Object.hasOwn(Us,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],a=Us[r];(a===null||a.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},SR=(e,t,n,r,i,a)=>{let s=!1;return r?s=!r.includes(e.tagName):i&&(s=i.includes(e.tagName)),!s&&a&&typeof t=="number"&&(s=!a(e,t,n)),s},NR=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:s,urlTransform:o}=t;if(n||r||i||a||o){let l=o||AR;Ln(e,(u,d,c)=>{if(u.type==="raw"&&c&&typeof d=="number")return wR(c,d,a,u.value),d;if(u.type==="element"&&(CR(u,l),SR(u,d,c,r,i,n)&&c&&typeof d=="number"))return s&&u.children?c.children.splice(d,1,...u.children):c.children.splice(d,1),d})}return BS(e,{Fragment:g.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0})},IR=/\[\^[\w-]{1,200}\](?!:)/,RR=/\[\^[\w-]{1,200}\]:/,OR=/<(\w+)[\s>]/,LR=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),fd=new Map,hd=new Map,vR=e=>{let t=e.toLowerCase(),n=fd.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return fd.set(t,r),r},DR=e=>{let t=e.toLowerCase(),n=hd.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return hd.set(t,r),r},pd=(e,t)=>{if(LR.has(t.toLowerCase()))return 0;let n=e.match(vR(t));if(!n)return 0;let r=0;for(let i of n)i.trimEnd().endsWith("/>")||(r+=1);return r},md=(e,t)=>{let n=e.match(DR(t));return n?n.length:0},PR=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},MR=e=>{let t=IR.test(e),n=RR.test(e);if(t||n)return[e];let r=Pt.lex(e,{gfm:!0}),i=[],a=[],s=!1;for(let o of r){let l=o.raw,u=i.length;if(a.length>0){i[u-1]+=l;let d=a.at(-1),c=pd(l,d),p=md(l,d);for(let h=0;h<c;h+=1)a.push(d);for(let h=0;h<p;h+=1)a.length>0&&a.at(-1)===d&&a.pop();continue}if(o.type==="html"&&o.block){let d=l.match(OR);if(d){let c=d[1],p=pd(l,c),h=md(l,c);p>h&&a.push(c)}}if(u>0&&!s){let d=i[u-1];if(PR(d)%2===1){i[u-1]=d+l;continue}}i.push(l),o.type!=="space"&&(s=o.type==="code")}return i},BR=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let i=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(i,(a,s,o,l)=>{let u=o.replace(/\n\n/g,`
170
170
  <!---->
171
171
  `);return s+u+l})}return n},FR=/^[ \t]*<[\w!/?-]/,HR=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,UR=e=>typeof e!="string"||e.length===0||!FR.test(e)?e:e.replace(HR,"$1"),gd,bd,_a={...ui,protocols:{...ui.protocols,href:[...(bd=(gd=ui.protocols)==null?void 0:gd.href)!=null?bd:[],"tel"]}},Fo={raw:ko,sanitize:[kp,_a],harden:[FT,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},jR={gfm:[pC,{}]},Ed=Object.values(Fo),zR=Object.values(jR),$R={block:" ▋",circle:" ●"},VR={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},Ft=b.createContext(VR),mm=b.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,...a})=>{let s=typeof e=="string"&&n?UR(e):e;return g.jsx(B0.Provider,{value:i,children:g.jsx(pm,{...a,children:s})})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var a,s;return((a=e.components)==null?void 0:a[i])!==((s=t.components)==null?void 0:s[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});mm.displayName="Block";var WR=["github-light","github-dark"],YR=b.memo(({children:e,mode:t="streaming",parseIncompleteMarkdown:n=!0,normalizeHtmlIndentation:r=!1,components:i,rehypePlugins:a=Ed,remarkPlugins:s=zR,className:o,shikiTheme:l=WR,mermaid:u,controls:d=!0,isAnimating:c=!1,animated:p,BlockComponent:h=mm,parseMarkdownIntoBlocksFn:m=MR,caret:E,plugins:k,remend:_,linkSafety:N={enabled:!0},allowedTags:C,...F})=>{let H=b.useId(),[I,V]=b.useTransition(),U=b.useMemo(()=>C?Object.keys(C):[],[C]),Q=b.useMemo(()=>{if(typeof e!="string")return"";let te=t==="streaming"&&n?xS(e,_):e;return U.length>0&&(te=BR(te,U)),te},[e,t,n,_,U]),O=b.useMemo(()=>m(Q),[Q,m]),[K,z]=b.useState(O);b.useEffect(()=>{t==="streaming"?V(()=>{z(O)}):z(O)},[O,t]);let x=t==="streaming"?K:O,L=b.useMemo(()=>x.map((te,w)=>`${H}-${w}`),[x.length,H]),v=b.useMemo(()=>p?p===!0?Do():Do(p):null,[p]),D=b.useMemo(()=>{var te,w;return{shikiTheme:(w=(te=k==null?void 0:k.code)==null?void 0:te.getThemes())!=null?w:l,controls:d,isAnimating:c,mode:t,mermaid:u,linkSafety:N}},[l,d,c,t,u,N,k==null?void 0:k.code]),P=b.useMemo(()=>({...mR,...i}),[i]),q=b.useMemo(()=>{let te=[];return k!=null&&k.cjk&&(te=[...te,...k.cjk.remarkPluginsBefore]),te=[...te,...s],k!=null&&k.cjk&&(te=[...te,...k.cjk.remarkPluginsAfter]),k!=null&&k.math&&(te=[...te,k.math.remarkPlugin]),te},[s,k==null?void 0:k.math,k==null?void 0:k.cjk]),J=b.useMemo(()=>{var te;let w=a;if(C&&Object.keys(C).length>0&&a===Ed){let he={..._a,tagNames:[...(te=_a.tagNames)!=null?te:[],...Object.keys(C)],attributes:{..._a.attributes,...C}};w=[Fo.raw,[kp,he],Fo.harden]}return k!=null&&k.math&&(w=[...w,k.math.rehypePlugin]),v&&c&&(w=[...w,v.rehypePlugin]),w},[a,k==null?void 0:k.math,v,c,C]),T=b.useMemo(()=>{if(!c||x.length===0)return!1;let te=x.at(-1);return ld(te)||ER(te)},[c,x]),ie=b.useMemo(()=>E&&c&&!T?{"--streamdown-caret":`"${$R[E]}"`}:void 0,[E,c,T]);return t==="static"?g.jsx(Po.Provider,{value:k??null,children:g.jsx(Ft.Provider,{value:D,children:g.jsx("div",{className:ce("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",o),children:g.jsx(pm,{components:P,rehypePlugins:J,remarkPlugins:q,...F,children:Q})})})}):g.jsx(Po.Provider,{value:k??null,children:g.jsx(Ft.Provider,{value:D,children:g.jsxs("div",{className:ce("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",E&&!T?"*:last:after:inline *:last:after:align-baseline *:last:after:content-[var(--streamdown-caret)]":null,o),style:ie,children:[x.length===0&&E&&c&&g.jsx("span",{}),x.map((te,w)=>{let he=w===x.length-1,ue=c&&he&&ld(te);return g.jsx(h,{components:P,content:te,index:w,isIncomplete:ue,rehypePlugins:J,remarkPlugins:q,shouldNormalizeHtmlIndentation:r,shouldParseIncompleteMarkdown:n,...F},L[w])})]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation);YR.displayName="Streamdown";var qR=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:s=1,fullscreen:o=!1})=>{let l=b.useRef(null),u=b.useRef(null),[d,c]=b.useState(s),[p,h]=b.useState({x:0,y:0}),[m,E]=b.useState(!1),[k,_]=b.useState({x:0,y:0}),[N,C]=b.useState({x:0,y:0}),F=b.useCallback(z=>{c(x=>Math.max(n,Math.min(r,x+z)))},[n,r]),H=b.useCallback(()=>{F(i)},[F,i]),I=b.useCallback(()=>{F(-i)},[F,i]),V=b.useCallback(()=>{c(s),h({x:0,y:0})},[s]),U=b.useCallback(z=>{z.preventDefault();let x=z.deltaY>0?-i:i;F(x)},[F,i]),Q=b.useCallback(z=>{if(z.button!==0||z.isPrimary===!1)return;E(!0),_({x:z.clientX,y:z.clientY}),C(p);let x=z.currentTarget;x instanceof HTMLElement&&x.setPointerCapture(z.pointerId)},[p]),O=b.useCallback(z=>{if(!m)return;z.preventDefault();let x=z.clientX-k.x,L=z.clientY-k.y;h({x:N.x+x,y:N.y+L})},[m,k,N]),K=b.useCallback(z=>{E(!1);let x=z.currentTarget;x instanceof HTMLElement&&x.releasePointerCapture(z.pointerId)},[]);return b.useEffect(()=>{let z=l.current;if(z)return z.addEventListener("wheel",U,{passive:!1}),()=>{z.removeEventListener("wheel",U)}},[U]),b.useEffect(()=>{let z=u.current;if(z&&m)return document.body.style.userSelect="none",z.addEventListener("pointermove",O,{passive:!1}),z.addEventListener("pointerup",K),z.addEventListener("pointercancel",K),()=>{document.body.style.userSelect="",z.removeEventListener("pointermove",O),z.removeEventListener("pointerup",K),z.removeEventListener("pointercancel",K)}},[m,O,K]),g.jsxs("div",{className:ce("relative flex flex-col",o?"h-full w-full":"min-h-28 w-full",t),ref:l,style:{cursor:m?"grabbing":"grab"},children:[a?g.jsxs("div",{className:ce("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",o?"bottom-4 left-4":"bottom-2 left-2"),children:[g.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:d>=r,onClick:H,title:"Zoom in",type:"button",children:g.jsx(qI,{size:16})}),g.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:d<=n,onClick:I,title:"Zoom out",type:"button",children:g.jsx(GI,{size:16})}),g.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:V,title:"Reset zoom and pan",type:"button",children:g.jsx(YI,{size:16})})]}):null,g.jsx("div",{className:ce("flex-1 origin-center transition-transform duration-150 ease-out",o?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:Q,ref:u,role:"application",style:{transform:`translate(${p.x}px, ${p.y}px) scale(${d})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},gm=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let[a,s]=b.useState(null),[o,l]=b.useState(!1),[u,d]=b.useState(""),[c,p]=b.useState(""),[h,m]=b.useState(0),{mermaid:E}=b.useContext(Ft),k=Yl(),_=E==null?void 0:E.errorComponent,{shouldRender:N,containerRef:C}=CI({immediate:r});if(b.useEffect(()=>{if(N){if(!k){s("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{s(null),l(!0);let H=k.getMermaid(n),I=e.split("").reduce((Q,O)=>(Q<<5)-Q+O.charCodeAt(0)|0,0),V=`mermaid-${Math.abs(I)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:U}=await H.render(V,e);d(U),p(U)}catch(H){if(!(c||u)){let I=H instanceof Error?H.message:"Failed to render Mermaid chart";s(I)}}finally{l(!1)}})()}},[e,n,h,N,k]),!(N||u||c))return g.jsx("div",{className:ce("my-4 min-h-[200px]",t),ref:C});if(o&&!u&&!c)return g.jsx("div",{className:ce("my-4 flex justify-center p-4",t),ref:C,children:g.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[g.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),g.jsx("span",{className:"text-sm",children:"Loading diagram..."})]})});if(a&&!u&&!c){let H=()=>m(I=>I+1);return _?g.jsx("div",{ref:C,children:g.jsx(_,{chart:e,error:a,retry:H})}):g.jsxs("div",{className:ce("rounded-md bg-red-50 p-4",t),ref:C,children:[g.jsxs("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",a]}),g.jsxs("details",{className:"mt-2",children:[g.jsx("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),g.jsx("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]})}let F=u||c;return g.jsx("div",{className:ce("size-full",t),"data-streamdown":"mermaid",ref:C,children:g.jsx(qR,{className:ce(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:g.jsx("div",{"aria-label":"Mermaid chart",className:ce("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:F},role:"img"})})})};const GR=40,KR=8,mr=56,za=8,Si=2,In=24,ps=24,a4=8,XR=()=>{if(!("document"in globalThis))return 0;const e=400,t=document.createElement("div");t.style.width=`${e}px`,t.style.height=`${e}px`,t.style.overflow="scroll",document.body.appendChild(t);const n=e-t.scrollWidth;return t.remove(),n},Gl={root:{startTime:0,endTime:1,duration:1,depth:0,children:[]},spanMap:{},resourceMap:{},filter:"",selected:null,baseScale:1,scaleRatio:1,scale:1,width:640,height:480,timelineWidth:640,timelineHeight:480,panelWidth:380,panelHeight:480,scrollbarWidth:0,timelineRef:{current:null},scrollSnapshotRef:{current:void 0},memoCacheRef:{current:new Map},getQuickLinks:()=>[],withPanel:!1,isMobile:!1},Td=e=>(e.timelineWidth-e.scrollbarWidth)/e.root.duration,Kl=b.createContext({state:Gl,dispatch:()=>{}});Kl.displayName="TraceViewerContext";const Be=(e,t)=>{var n;switch(t.type){case"setRoot":return e.scrollSnapshotRef.current=void 0,e.memoCacheRef.current.clear(),Be({...e,root:t.root,spanMap:t.spanMap,resourceMap:Object.fromEntries(t.resources.map(({name:r,attributes:i})=>[r,i]))},{type:"detectBaseScale"});case"setSize":{const r=t.height-mr-GR-3*KR,i=e.withPanel&&t.width<=768;let a={...e,width:t.width,height:t.height,timelineWidth:t.width-+!!(e.selected&&e.withPanel&&!i)*e.panelWidth,timelineHeight:r,panelHeight:r,isMobile:i};return a.width!==e.width&&(a=Be(a,{type:"detectBaseScale"})),a}case"setPanelWidth":{const r=Math.max(240,Math.min(t.width,e.width-240)),i=e.withPanel&&e.selected&&!e.isMobile?e.width-r:e.width;return Be({...e,timelineWidth:i,panelWidth:r},{type:"detectBaseScale"})}case"setFilter":return{...e,filter:t.filter};case"deselect":return Be({...e,selected:null,timelineWidth:e.width},{type:"detectBaseScale"});case"select":{const r=e.spanMap[t.id];return r?Be({...e,selected:r,timelineWidth:e.width-(e.withPanel&&!e.isMobile?e.panelWidth:0)},{type:"detectBaseScale"}):e}case"escape":return e.selected?Be(e,{type:"deselect"}):Be(e,{type:"resetScale"});case"toggleSelection":{let r=e;return e.selected&&(r=Be(r,{type:"deselect"})),((n=e.selected)==null?void 0:n.span.spanId)===t.id?r:Be(r,{type:"select",id:t.id})}case"detectBaseScale":{const r=(e.timelineWidth-e.scrollbarWidth)/e.root.duration;return Be({...e,baseScale:r,scale:r*e.scaleRatio},{type:"minScale"})}case"setScale":return{...e,scaleRatio:t.scale,scale:e.baseScale*t.scale};case"resetScale":return Be(e,{type:"scaleToRange",t1:e.root.startTime,t2:e.root.endTime});case"scaleToNode":{const r=e.spanMap[t.id];return r?Be(Be(e,{type:"setScale",scale:(e.width-e.scrollbarWidth-(e.withPanel&&!e.isMobile?e.panelWidth:0))/r.duration/e.baseScale}),{type:"setScrollSnapshot",anchorT:r.startTime-e.root.startTime,anchorX:0}):e}case"scaleToRange":{const r=Math.abs(t.t1-t.t2);return Be(Be(e,{type:"setScale",scale:(e.width-e.scrollbarWidth-(e.selected&&e.withPanel?e.panelWidth:0))/r/e.baseScale}),{type:"setScrollSnapshot",anchorT:Math.min(t.t1,t.t2)-e.root.startTime,anchorX:0})}case"adjustScaleRatio":{let{scaleRatio:r}=e;switch(t.direction){case-1:r*=.8;break;case 1:r*=1.25;break;default:r=1;break}const i=e.timelineRef.current;if(!i)return console.warn("timelineRef is null"),e;const{clientWidth:a,scrollLeft:s}=i;return Be(Be({...e,scaleRatio:r,scale:e.baseScale*r},{type:"minScale"}),{type:"setScrollSnapshot",anchorT:(s+a*.5)/e.scale,anchorX:a*.5})}case"trackpadScale":{const r=Td(e)/e.baseScale,i=Math.max(r,e.scaleRatio*(1+.2*Math.sign(t.delta)*Math.sqrt(Math.abs(t.delta))));return Be({...e,scaleRatio:i,scale:e.baseScale*i},{type:"setScrollSnapshot",anchorT:t.anchorT,anchorX:t.anchorX})}case"minScale":{const r=Td(e);return e.scale>=r?e:{...e,scale:r,scaleRatio:r/e.baseScale}}case"setScrollSnapshot":{const r=e.timelineRef.current;if(!r)return e;const{anchorT:i,anchorX:a}=t,s=i*e.scale-a,{scrollTop:o}=r,l=(o-ps-za)/(In+Si),u=l+Math.ceil(e.timelineHeight/(In+Si));return e.scrollSnapshotRef.current={anchorT:i,anchorX:a,scrollLeft:s,scrollTop:o,startTime:e.root.startTime+s/e.scale,endTime:e.root.startTime+(s+e.timelineWidth)/e.scale,startRow:l,endRow:u,scale:e.scale},e}case"setWithPanel":{if(e.withPanel===t.withPanel)return e;const r=t.withPanel&&e.selected&&!e.isMobile?e.width-e.panelWidth:e.width;return Be({...e,withPanel:t.withPanel,timelineWidth:r},{type:"detectBaseScale"})}case"forceRender":return e.memoCacheRef.current.set("",{}),{...e};case"updateRoot":return e.memoCacheRef.current.set("",{}),Be({...e,root:t.root,spanMap:t.spanMap,resourceMap:Object.fromEntries(t.resources.map(({name:r,attributes:i})=>[r,i]))},{type:"detectBaseScale"})}};function s4({getQuickLinks:e,withPanel:t=!1,children:n,customSpanClassNameFunc:r,customSpanEventClassNameFunc:i,customPanelComponent:a=null}){const s=b.useRef(null),o=b.useRef(void 0),l=b.useRef(e);l.current=e;const u=b.useRef(new Map),d=b.useRef(new Map),[c,p]=b.useReducer(Be,Gl,m=>({...m,scrollbarWidth:XR(),timelineRef:s,scrollSnapshotRef:o,customSpanClassNameFunc:r,customSpanEventClassNameFunc:i,memoCacheRef:u,withPanel:t,getQuickLinks:E=>{var C;const k=E.spanId,_=d.current.get(k);if(_)return _;const N=((C=l.current)==null?void 0:C.call(l,E))||[];return d.current.set(k,N),N}}));b.useEffect(()=>p({type:"setWithPanel",withPanel:t}),[t]);const h=b.useMemo(()=>({state:c,dispatch:p}),[c,p]);return g.jsx(bm.Provider,{value:a,children:g.jsx(Kl.Provider,{value:h,children:n})})}const ms=()=>b.useContext(Kl),bm=b.createContext(null),QR=()=>b.useContext(bm),JR="_traceNode_1fmf2_1",ZR="_childRow_1fmf2_5",eO="_spanNode_1fmf2_11",tO="_huge_1fmf2_31",nO="_spanName_1fmf2_34",rO="_spanSpacer_1fmf2_40",iO="_spanDuration_1fmf2_44",aO="_small_1fmf2_62",sO="_xHover_1fmf2_62",oO="_spanNodeEvent_1fmf2_118",lO="_eventDiamond_1fmf2_124",uO="_customEventColor_1fmf2_140",cO="_hoverInfo_1fmf2_145",dO="_eventName_1fmf2_149",fO="_eventTimestamp_1fmf2_153",hO="_alignStart_1fmf2_174",pO="_alignEnd_1fmf2_178",mO="_colorVercel_1fmf2_205",gO="_color0_1fmf2_213",bO="_color1_1fmf2_220",EO="_color2_1fmf2_227",TO="_color3_1fmf2_234",yO="_color4_1fmf2_241",xO="_colorHighlight_1fmf2_248",_O="_unlit_1fmf2_256",kO="_mapContainer_1fmf2_262",AO="_spanDetailPanel_1fmf2_329",wO="_spanDetailPanelResizer_1fmf2_338",CO="_spanDetailPanelTop_1fmf2_353",SO="_spanDetailPanelBody_1fmf2_362",NO="_spanDetailPanelTopInfo_1fmf2_375",IO="_spanNameDetailPanel_1fmf2_389",RO="_spanDetailPanelTruncatedHeading_1fmf2_395",OO="_spanDetailPanelName_1fmf2_405",LO="_spanDetailPanelDuration_1fmf2_416",vO="_spanDetailPanelCorner_1fmf2_427",DO="_spanDetailPanelCornerInner_1fmf2_437",PO="_spanDetailPanelCloseVerticalRule_1fmf2_445",MO="_spanDetailPanelClose_1fmf2_445",BO="_spanDetailPanelAttribute_1fmf2_467",FO="_spanDetailPanelAttributeKey_1fmf2_484",HO="_spanDetailPanelAttributeValue_1fmf2_492",UO="_spanDetailPanelQuickLink_1fmf2_503",jO="_spanDetailPanelQuickLinkLabel_1fmf2_506",zO="_detailGroup_1fmf2_519",$O="_expanded_1fmf2_533",VO="_collapsed_1fmf2_534",WO="_ancestorGroup_1fmf2_535",YO="_detailHeading_1fmf2_539",qO="_buttonLink_1fmf2_562",GO="_note_1fmf2_581",KO="_skeleton_1fmf2_589",XO="_skeletonRounded_1fmf2_595",QO="_detailHeadingIcon_1fmf2_599",JO="_infraSpanDescription_1fmf2_603",ZO="_ancestorNode_1fmf2_613",e6="_ancestorText_1fmf2_629",t6="_ancestorName_1fmf2_639",n6="_ancestorDuration_1fmf2_644",r6="_ancestorLineContainer_1fmf2_649",i6="_ancestorLine_1fmf2_649",a6="_zoomButtonGroup_1fmf2_701",s6="_zoomButton_1fmf2_701",o6="_divider_1fmf2_751",l6="_markersContainer_1fmf2_758",u6="_markers_1fmf2_758",c6="_marker_1fmf2_758",d6="_notch_1fmf2_792",f6="_markerLabel_1fmf2_798",h6="_markerClockTime_1fmf2_807",p6="_eventMarkersContainer_1fmf2_816",m6="_eventMarkers_1fmf2_816",g6="_eventMarker_1fmf2_816",b6="_cursorMarkerStickyParent_1fmf2_839",E6="_cursorMarkerLabelContainer_1fmf2_848",T6="_cursorMarkerLabel_1fmf2_848",y6="_cursorMarkerContainer_1fmf2_898",x6="_cursorMarker_1fmf2_839",_6="_cursorSelection_1fmf2_916",k6="_traceViewer_1fmf2_966",A6="_mapCanvas_1fmf2_972",w6="_zoomButtonTraceViewer_1fmf2_988",C6="_timeline_1fmf2_1011",S6="_searchBar_1fmf2_1019",N6="_searchInput_1fmf2_1031",I6="_searchInputLabel_1fmf2_1038",R6="_searchInputPrefix_1fmf2_1063",O6="_mapThumb_1fmf2_1101",L6="_spanDetailPanelTraceViewer_1fmf2_1115",v6="_traceViewerContent_1fmf2_1134",D6="_inert_1fmf2_1144",P6="_hidden_1fmf2_1180",M6="_mobile_1fmf2_1184",B6="_spanRunning_1fmf2_1194",F6="_spanPending_1fmf2_1195",H6="_spanCompleted_1fmf2_1203",U6="_spanCancelled_1fmf2_1211",j6="_spanFailed_1fmf2_1219",z6="_spanPendingStriped_1fmf2_1228",$6="_hasQueuedTime_1fmf2_1242",V6="_spanSleep_1fmf2_1254",W6="_spanHook_1fmf2_1263",Y6="_segmentLayer_1fmf2_1275",q6="_segment_1fmf2_1275",G6="_segmentLabel_1fmf2_1291",K6="_segmentTag_1fmf2_1306",X6="_segQueued_1fmf2_1314",Q6="_segRunning_1fmf2_1325",J6="_segFailed_1fmf2_1330",Z6="_segRetrying_1fmf2_1335",eL="_segSucceeded_1fmf2_1346",tL="_segWaiting_1fmf2_1351",nL="_segSleeping_1fmf2_1362",rL="_segReceived_1fmf2_1367",iL="_boundaryMarker_1fmf2_1372",aL="_boundaryLine_1fmf2_1373",sL="_hasSegments_1fmf2_1395",oL="_eventFailed_1fmf2_1432",lL="_eventRetrying_1fmf2_1441",uL="_eventHook_1fmf2_1450",cL="_eventDefault_1fmf2_1459",re={traceNode:JR,childRow:ZR,spanNode:eO,huge:tO,spanName:nO,spanSpacer:rO,spanDuration:iO,small:aO,xHover:sO,spanNodeEvent:oO,eventDiamond:lO,customEventColor:uO,hoverInfo:cO,eventName:dO,eventTimestamp:fO,alignStart:hO,alignEnd:pO,colorVercel:mO,color0:gO,color1:bO,color2:EO,color3:TO,color4:yO,colorHighlight:xO,unlit:_O,mapContainer:kO,spanDetailPanel:AO,spanDetailPanelResizer:wO,spanDetailPanelTop:CO,spanDetailPanelBody:SO,spanDetailPanelTopInfo:NO,spanNameDetailPanel:IO,spanDetailPanelTruncatedHeading:RO,spanDetailPanelName:OO,spanDetailPanelDuration:LO,spanDetailPanelCorner:vO,spanDetailPanelCornerInner:DO,spanDetailPanelCloseVerticalRule:PO,spanDetailPanelClose:MO,spanDetailPanelAttribute:BO,spanDetailPanelAttributeKey:FO,spanDetailPanelAttributeValue:HO,spanDetailPanelQuickLink:UO,spanDetailPanelQuickLinkLabel:jO,detailGroup:zO,expanded:$O,collapsed:VO,ancestorGroup:WO,detailHeading:YO,buttonLink:qO,note:GO,skeleton:KO,skeletonRounded:XO,detailHeadingIcon:QO,infraSpanDescription:JO,ancestorNode:ZO,ancestorText:e6,ancestorName:t6,ancestorDuration:n6,ancestorLineContainer:r6,ancestorLine:i6,zoomButtonGroup:a6,"zoom-buttons-fade-in":"_zoom-buttons-fade-in_1fmf2_1",zoomButton:s6,divider:o6,markersContainer:l6,markers:u6,marker:c6,notch:d6,markerLabel:f6,markerClockTime:h6,eventMarkersContainer:p6,eventMarkers:m6,eventMarker:g6,cursorMarkerStickyParent:b6,cursorMarkerLabelContainer:E6,cursorMarkerLabel:T6,cursorMarkerContainer:y6,cursorMarker:x6,cursorSelection:_6,traceViewer:k6,"span-skeleton":"_span-skeleton_1fmf2_1",mapCanvas:A6,zoomButtonTraceViewer:w6,timeline:C6,searchBar:S6,searchInput:N6,searchInputLabel:I6,searchInputPrefix:R6,mapThumb:O6,spanDetailPanelTraceViewer:L6,traceViewerContent:v6,inert:D6,hidden:P6,mobile:M6,spanRunning:B6,spanPending:F6,spanCompleted:H6,spanCancelled:U6,spanFailed:j6,spanPendingStriped:z6,hasQueuedTime:$6,spanSleep:V6,spanHook:W6,segmentLayer:Y6,segment:q6,segmentLabel:G6,segmentTag:K6,segQueued:X6,segRunning:Q6,segFailed:J6,segRetrying:Z6,segSucceeded:eL,segWaiting:tL,segSleeping:nL,segReceived:rL,boundaryMarker:iL,boundaryLine:aL,hasSegments:sL,eventFailed:oL,eventRetrying:lL,eventHook:uL,eventDefault:cL};function la([e,t]){return e*1e3+t/1e6}function o4(e){return[Math.floor(e/1e3),e%1e3*1e3]}const l4=e=>Rt(e,!0),yd=new Intl.NumberFormat(void 0,{minimumFractionDigits:2,maximumFractionDigits:2});function u4(e){return e>=1e3?`${yd.format(e/1e3)}s`:`${yd.format(e)}ms`}function c4(e){const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),i=String(t.getSeconds()).padStart(2,"0"),a=String(t.getMilliseconds()).padStart(3,"0");return`${n}:${r}:${i}.${a}`}const dL={queued:"segQueued",running:"segRunning",failed:"segFailed",retrying:"segRetrying",succeeded:"segSucceeded",waiting:"segWaiting",sleeping:"segSleeping",received:"segReceived"};function fL(e){return Math.max(0,Math.min(1,e))}function nn(e,t,n){return n<=0?0:fL((e-t)/n)}function zi(e){return[...e].sort((t,n)=>t.timestamp-n.timestamp)}function hL(e){const t=e.events?zi(e.events):[],{startTime:n,duration:r}=e,i=[];if(r<=0)return i;const a=t.filter(l=>["step_started","step_retrying","step_failed","step_completed"].includes(l.event.name)).map(l=>({time:l.timestamp,type:l.event.name}));if(a.length===0)return i.push({startFraction:0,endFraction:1,status:"running"}),i;const s=a[0],o=nn(s.time,n,r);o>.001&&i.push({startFraction:0,endFraction:o,status:"queued"});for(let l=0;l<a.length;l++){const u=a[l],d=nn(u.time,n,r),c=a[l+1],p=c?nn(c.time,n,r):1;if(u.type==="step_started")if(l===a.length-1)i.push({startFraction:d,endFraction:1,status:"succeeded"});else{const m=c.type,E=m==="step_retrying"||m==="step_failed"?"failed":m==="step_completed"?"succeeded":"running";i.push({startFraction:d,endFraction:p,status:E})}else u.type==="step_retrying"?i.push({startFraction:d,endFraction:p,status:"retrying"}):u.type==="step_failed"?d<.999&&i.push({startFraction:d,endFraction:1,status:"failed"}):u.type}return i}function pL(e){const t=e.events?zi(e.events):[],{startTime:n,duration:r}=e,i=[];if(r<=0)return i;const a=t.find(u=>u.event.name==="hook_received"),s=t.find(u=>u.event.name==="hook_disposed");if(!a&&!s)return i.push({startFraction:0,endFraction:1,status:"waiting"}),i;const o=a?nn(a.timestamp,n,r):null,l=s?nn(s.timestamp,n,r):null;if(o!==null&&o>.001?i.push({startFraction:0,endFraction:o,status:"waiting"}):o===null&&l!==null&&i.push({startFraction:0,endFraction:l,status:"waiting"}),o!==null){const u=l??1;i.push({startFraction:o,endFraction:u,status:"received"})}return l!==null&&l<.999&&i.push({startFraction:l,endFraction:1,status:"succeeded"}),i}function mL(e){const t=e.events?zi(e.events):[],{startTime:n,duration:r}=e,i=[];if(r<=0)return i;const a=t.find(o=>o.event.name==="wait_completed");if(!a)return i.push({startFraction:0,endFraction:1,status:"sleeping"}),i;const s=nn(a.timestamp,n,r);return s>.001&&i.push({startFraction:0,endFraction:s,status:"sleeping"}),i.push({startFraction:s,endFraction:1,status:"succeeded"}),i}function gL(e){const t=e.events?zi(e.events):[],{startTime:n,duration:r,activeStartTime:i}=e,a=[];if(r<=0)return a;const s=t.find(u=>u.event.name==="run_failed"),o=t.find(u=>u.event.name==="run_completed");let l=0;if(i&&i>n){const u=nn(i,n,r);u>.001&&(a.push({startFraction:0,endFraction:u,status:"queued"}),l=u)}if(s){const u=nn(s.timestamp,n,r);u>l+.001&&a.push({startFraction:l,endFraction:u,status:"running"}),a.push({startFraction:u,endFraction:1,status:"failed"})}else if(o){const u=nn(o.timestamp,n,r);u>l+.001&&a.push({startFraction:l,endFraction:u,status:"running"}),a.push({startFraction:u,endFraction:1,status:"succeeded"})}else a.push({startFraction:l,endFraction:1,status:"running"});return a}const bL={step_started:"Started",step_retrying:"Retrying",step_failed:"Failed",hook_created:"Created",hook_received:"Received",hook_disposed:"Resolved",wait_created:"Sleep started",wait_completed:"Sleep completed",run_completed:"Completed",run_failed:"Run failed",step_completed:"Completed"};function ua(e,t){const n=e.events?zi(e.events):[],{startTime:r,duration:i}=e;if(i<=0)return[];const a=[];for(const s of n){if(!t.includes(s.event.name))continue;const o=nn(s.timestamp,r,i);o<.01||o>.99||a.push({fraction:o,label:bL[s.event.name]??s.event.name,offsetMs:s.timestamp-r})}return a}function Em(e,t){switch(e){case"step":return{segments:hL(t),boundaries:ua(t,["step_started","step_retrying","step_failed","step_completed"])};case"hook":return{segments:pL(t),boundaries:ua(t,["hook_created","hook_received","hook_disposed"])};case"sleep":return{segments:mL(t),boundaries:ua(t,["wait_created","wait_completed"])};case"run":return{segments:gL(t),boundaries:ua(t,["run_completed","run_failed"])};default:return{segments:[],boundaries:[]}}}function EL(e){return e.isInstrumentationHint?"Get Started":Rt(e.duration)}const Tm={queued:"Queued",running:"",failed:"Failed",retrying:"Retry wait",succeeded:"Executed",waiting:"Waiting",sleeping:"Sleeping",received:"Received"};function TL({segments:e,spanDuration:t}){return e.length===0?null:g.jsx("div",{className:re.segmentLayer,children:e.map((n,r)=>{const i=re[dL[n.status]],a=(n.endFraction-n.startFraction)*t,s=Tm[n.status],o={left:`${n.startFraction*100}%`,width:`${(n.endFraction-n.startFraction)*100}%`};return g.jsx("div",{className:`${re.segment} ${String(i)}`,style:o,title:s?`${s} ${Rt(a)}`:Rt(a)},`seg-${n.status}-${String(r)}`)})})}function yL(e,t){const n=[];for(let r=0;r<e.length;r++){const i=e[r],a=Tm[i.status];if(!a)continue;let s=(i.endFraction-i.startFraction)*t;if(s<1&&(i.status==="succeeded"||i.status==="failed")&&r>0){const o=e[r-1];o.status==="running"&&(s=(o.endFraction-o.startFraction)*t)}s<1||n.push({label:a,duration:Rt(s)})}return n}function ym({node:e,layout:t,durationMs:n,segmentTags:r}){const i=e.isInstrumentationHint?EL(e):Rt(n??e.duration);if(t.isSmall&&!t.isHovered)return null;const a=r&&r.length>0&&(t.isHovered||t.width>200);return g.jsxs(g.Fragment,{children:[g.jsxs("span",{className:re.spanName,children:[e.label||e.span.name,a?r.map((s,o)=>g.jsxs("span",{className:re.segmentTag,children:[" · ",s.label," ",s.duration]},o)):null]}),t.isHuge?g.jsx("span",{className:re.spanSpacer}):null,t.isHovered||t.width>128?g.jsx("span",{className:re.spanDuration,children:i}):null]})}function xL({node:e,layout:t}){return g.jsx(ym,{node:e,layout:t})}function gs({resourceType:e,node:t,layout:n,durationMs:r}){const i=r??t.duration,{segments:a}=Em(e,t),s=yL(a,i);return g.jsxs(g.Fragment,{children:[g.jsx(TL,{segments:a,spanDuration:i}),g.jsx(ym,{durationMs:i,node:t,layout:n,segmentTags:s})]})}function _L(e){return g.jsx(gs,{resourceType:"run",...e})}function kL(e){return g.jsx(gs,{resourceType:"step",...e})}function AL(e){return g.jsx(gs,{resourceType:"hook",...e})}function wL(e){return g.jsx(gs,{resourceType:"sleep",...e})}function CL({resourceType:e,...t}){switch(e){case"run":return g.jsx(_L,{...t});case"step":return g.jsx(kL,{...t});case"hook":return g.jsx(AL,{...t});case"sleep":return g.jsx(wL,{...t});default:return g.jsx(xL,{...t})}}const SL=4;function NL(e){var n;const t=(n=e.span.attributes)==null?void 0:n.resource;return t==="run"||t==="step"||t==="hook"||t==="sleep"?t:"default"}function IL(e){return e<64}function RL(e){return e>=500}function OL(e,t){return e.isHovered&&!t&&e.isHighlighted!==!1}function LL(e,t,n,r){if(!r)return!1;let i=t.duration,a=t.endTime;const s=n.current;return s&&(i=s.endTime-s.startTime,a=s.endTime),a-e.startTime<.25*i}function $i(e,t,n,r){const i=(e.startTime-t.startTime)*n;let a=ps+(In+Si)*e.row;const s=e.duration*n,o=Math.max(s,SL);let l=In;const u=RL(s),d=IL(s),c=OL(e,u),p=c||!!e.isSelected;d&&!p&&(l*=.4,a+=(In-l)*.5);const h=LL(e,t,r,p);return{width:o,actualWidth:s,height:l,top:a,left:i,isSmall:d,isHuge:u,isHovered:c,isExpanded:p,isNearRightSide:h}}function vL(e,t,n,r){return $i(e,t,n,r)}function DL(e,t,n,r){return $i(e,t,n,r)}function PL(e,t,n,r){return $i(e,t,n,r)}function ML(e,t,n,r){return $i(e,t,n,r)}function BL(e,t,n,r,i){switch(e){case"run":return vL(t,n,r,i);case"step":return DL(t,n,r,i);case"hook":return PL(t,n,r,i);case"sleep":return ML(t,n,r,i);default:return $i(t,n,r,i)}}const Xl=e=>e.isVercel?String(re.colorVercel):String(re[`color${e.resourceIndex%5}`]);function FL(e,t){const n=t.events;if(n!=null&&n.length)switch(e){case"hook":for(let r=n.length;r--;)if(n[r].event.name==="hook_disposed")return n[r].timestamp;return;case"sleep":for(let r=n.length;r--;)if(n[r].event.name==="wait_completed")return n[r].timestamp;return;case"run":for(let r=n.length;r--;){const i=n[r].event.name;if(i==="run_completed"||i==="run_failed"||i==="run_cancelled")return n[r].timestamp}return;case"step":for(let r=n.length;r--;){const i=n[r].event.name;if(i==="step_completed"||i==="step_failed")return n[r].timestamp;if(i==="step_started"||i==="step_retrying")return}return;default:return}}const d4=b.memo(function({root:t,scale:n,spans:r,isLive:i=!1,scrollSnapshotRef:a,cache:s,customSpanClassNameFunc:o,customSpanEventClassNameFunc:l}){return r.map(u=>g.jsx(UL,{cacheKey:s.get(u.span.spanId),customSpanEventClassNameFunc:l,customSpanClassNameFunc:o,node:u,root:t,scale:n,traceIsLive:i,scrollSnapshotRef:a},u.span.spanId))});function HL(e,t,n,r){const i=e.isExpanded;return{"--span-width":`${Math.max(e.actualWidth,1)}px`,minWidth:i?e.width:void 0,width:i?void 0:e.width,height:e.height,maxWidth:i&&!e.isNearRightSide?(n.endTime-t.startTime)*r:void 0,containIntrinsicWidth:i?void 0:e.width,containIntrinsicHeight:e.height,left:e.isNearRightSide?void 0:e.left,right:e.isNearRightSide?(n.endTime-t.endTime)*r:void 0,top:e.top}}const UL=b.memo(function({node:t,root:n,scale:r,traceIsLive:i=!1,scrollSnapshotRef:a,customSpanClassNameFunc:s,customSpanEventClassNameFunc:o}){var D;const l=b.useRef(null);b.useEffect(()=>(t.ref=l,()=>{t.ref=void 0}),[t]);const{span:u}=t,d=NL(t),[c,p]=b.useState(0),h=s?s(t):"",m=d!=="default",E=(D=u.attributes)==null?void 0:D.data,k=FL(d,t),_=k!=null,C=(d==="hook"?!!(E!=null&&E.disposedAt):!!(E!=null&&E.completedAt))||_,F=i&&m&&!C;b.useEffect(()=>{if(!F)return;p(Date.now());const P=setInterval(()=>{p(Date.now())},250);return()=>clearInterval(P)},[F]);const H=la(u.startTime),I=la(u.endTime),V=la(u.duration),U=u.activeStartTime?la(u.activeStartTime):void 0,Q=k!=null?Math.max(0,k-H):F?Math.max(0,(c||Date.now())-H):V,O=t.isInstrumentationHint?"Get Started":Rt(Q),K={...t,startTime:H,endTime:I,duration:V,activeStartTime:U},z=F?{...K,duration:Q,endTime:H+Q}:K,x=m&&Em(d,z).segments.length>0,L=BL(d,z,n,r,a);if(F){const q=Q*r,J=Math.max(q,4);L.actualWidth=q,L.width=J,L.isSmall=q<64,L.isHuge=q>=500,L.isSmall||(L.height=In,L.top=ps+(In+Si)*z.row)}b.useEffect(()=>{if(!F||!l.current)return;let P=0;const q=()=>{const J=l.current;if(!J)return;const T=Date.now()-H,ie=Math.max(T*r,2);J.style.width=`${ie}px`,J.style.setProperty("--span-width",`${ie}px`),P=requestAnimationFrame(q)};return P=requestAnimationFrame(q),()=>cancelAnimationFrame(P)},[F,H,r]);const v=z;return g.jsxs(g.Fragment,{children:[g.jsx("button",{"aria-label":`${u.name} - ${O}`,className:at(re.spanNode,L.isHuge&&re.huge,L.isSmall&&re.small,L.isExpanded&&re.xHover,t.isHighlighted?re.colorHighlight:Xl(t),t.isHighlighted===!1&&re.unlit,h,x&&re.hasSegments),"data-span-id":u.spanId,"data-start-time":z.startTime-n.startTime,"data-right-side":L.isNearRightSide,"data-selected":t.isSelected?"":void 0,ref:l,style:HL(L,z,n,r),type:"button",children:g.jsx(CL,{durationMs:Q,resourceType:d,node:v,layout:L})}),z.events&&!L.isSmall?z.events.map(P=>g.jsx(zL,{customSpanEventClassNameFunc:o,event:P,node:z,root:n,scale:r,asBoundary:m},P.key)):null]})}),jL={step_started:"Started",step_retrying:"Retrying",step_failed:"Failed",hook_created:"Created",hook_received:"Received",hook_disposed:"Resolved",wait_created:"Sleep started",wait_completed:"Sleep completed",run_started:"Started",run_completed:"Completed",run_failed:"Run failed",step_completed:"Completed"},zL=b.memo(function({event:t,node:n,root:r,scale:i,customSpanEventClassNameFunc:a,asBoundary:s=!1}){const o=b.useRef(null);b.useEffect(()=>(t.ref=o,()=>{t.ref=void 0}),[t]);const{event:{name:l}}=t,u=Rt(t.timestamp-r.startTime),d=s?jL[l]??l:l,c=s&&(l==="step_started"||l==="run_started"||l==="step_retrying"),p=s&&(l==="step_completed"||l==="run_completed");let h=null,m=null;if((c||p)&&n.events){const C=[...n.events].sort((H,I)=>H.timestamp-I.timestamp),F=C.findIndex(H=>H.key===t.key);if(p){let H=null;for(let I=F-1;I>=0;I--)if(C[I].event.name==="step_started"){H=C[I].timestamp;break}H!==null&&(h=Rt(t.timestamp-H),m="Executed")}else{const H=C[F+1],I=H?H.timestamp:n.endTime;h=Rt(I-t.timestamp),m=l==="step_retrying"?"Waited":"Executed"}}const E=(t.timestamp-r.startTime)*i,k=ps+(In+Si)*n.row,_=n.duration<=0||(t.timestamp-n.startTime)/n.duration<.5,N=a?a(t):"";return g.jsxs("div",{title:h?`${d} ${u}
172
- ${m} ${h}`:`${d} ${u}`,className:at(re.spanNodeEvent,N,s&&re.boundaryMarker,n.isHighlighted?re.colorHighlight:Xl(n),n.isHighlighted===!1&&re.unlit),"data-hovered":t.isHovered,ref:o,style:{left:E,top:k},children:[g.jsx("div",{className:at(re.hoverInfo,_?re.alignStart:re.alignEnd),children:s?g.jsxs(g.Fragment,{children:[g.jsx("span",{className:re.eventName,children:d}),g.jsx("span",{className:re.eventTimestamp,children:u}),h?g.jsxs(g.Fragment,{children:[g.jsx("span",{className:re.eventName,children:m}),g.jsx("span",{className:re.eventTimestamp,children:h})]}):null]}):g.jsxs(g.Fragment,{children:[g.jsx("span",{className:re.eventName,children:l}),g.jsx("span",{className:re.eventTimestamp,children:u})]})}),s?g.jsx("div",{className:re.boundaryLine}):g.jsx("div",{className:re.eventDiamond})]})}),xm={"gray-700":"var(--ds-gray-700)","gray-900":"var(--ds-gray-900)"};function $L({size:e=16,color:t="gray-700"}){const n={color:xm[t]||t};return g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",style:n,"aria-hidden":!0,children:[g.jsx("title",{children:"Cross"}),g.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function VL({size:e=16}){return g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,className:re.detailHeadingIcon,children:[g.jsx("title",{children:"Chevron Down"}),g.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function WL({size:e=16,color:t="gray-900"}){const n={color:xm[t]||t};return g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",style:n,"aria-hidden":!0,children:[g.jsx("title",{children:"External Small"}),g.jsx("path",{d:"M14 4h6m0 0v6m0-6L10 14",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M20 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function YL(e){const{as:t,className:n,href:r,children:i,...a}=e;return(t||"a")==="span"||!r?g.jsx("span",{className:n,...a,children:i}):g.jsx("a",{className:n,href:r,...a,children:i})}function qL(e){const{className:t,children:n,size:r,...i}=e;return g.jsx("a",{...i,className:at(re.buttonLink,t),children:n})}function GL({children:e,className:t}){return g.jsx("div",{className:at(re.note,t),children:e})}function xd({width:e,height:t,rounded:n}){return g.jsx("span",{className:at(re.skeleton,n&&re.skeletonRounded),style:{width:e,height:t},"aria-hidden":!0})}const _d=e=>`${(100*e).toFixed(3)}%`,kd=(e,t)=>e<t?-1:e>t?1:0,Ad=e=>{const t={};for(const[r,i]of Object.entries(e)){const a=r.indexOf(".");let s="",o="";a!==-1?(s=r.substring(0,a),o=r.substring(a+1)):o=r;let l=t[s];l||(l={prefix:s,attributes:[]},t[s]=l),l.attributes.push({key:r,suffix:o,value:String(i)})}const n=Array.from(Object.values(t)).sort((r,i)=>kd(r.prefix,i.prefix));for(const r of n)r.attributes.sort((i,a)=>kd(i.suffix,a.suffix));return n},KL=(e,t)=>{const n=[];if(!t)return n;for(let r=t;"parent"in r;r=r.parent)n.unshift(r);return n},XL=()=>{var d;const{state:{root:e,selected:t,resourceMap:n,getQuickLinks:r},dispatch:i}=ms(),a=b.useMemo(()=>KL(e,t),[e,t]),s=b.useMemo(()=>Ad((t==null?void 0:t.span.attributes)??{}),[t]),o=b.useMemo(()=>{const c=t==null?void 0:t.span.resource;if(!c)return[];const p=n[c];return p?Ad(p):[]},[n,t]);if(!t)return null;const{span:l}=t,u=_m(t);return g.jsxs(g.Fragment,{children:[t.isVercel?g.jsx(ev,{node:t}):null,t.isInstrumentationHint?g.jsx(iv,{}):null,!t.isInstrumentationHint&&a.length?g.jsx(Sn,{className:re.ancestorGroup,name:"Location",children:a.map(c=>g.jsxs("button",{className:re.ancestorNode,onClick:()=>i({type:"select",id:c.span.spanId}),type:"button",children:[g.jsxs("div",{className:re.ancestorText,children:[g.jsx("span",{className:re.ancestorName,children:c.label||c.span.name}),g.jsx("span",{className:re.ancestorDuration,children:Rt(c.duration)})]}),g.jsx("span",{"aria-hidden":!0,className:re.ancestorLineContainer,children:g.jsx("span",{className:at(re.ancestorLine,Xl(c)),style:{left:_d((c.startTime-e.startTime)/e.duration),width:_d(c.duration/e.duration)}})})]},`${t.span.spanId}.${c.span.spanId}`))}):null,u?g.jsx(tv,{getQuickLinks:r,span:t.span}):null,(d=t.events)!=null&&d.length?g.jsx(Sn,{name:"Events",children:t.events.map(c=>g.jsxs(b.Fragment,{children:[g.jsxs("dl",{className:re.spanDetailPanelAttribute,children:[g.jsx("dt",{className:re.spanDetailPanelAttributeKey,children:c.event.name}),g.jsx("dd",{className:re.spanDetailPanelAttributeValue,children:Rt(c.timestamp-e.startTime)})]}),Object.entries(c.event.attributes).map(([p,h])=>g.jsx(Yr,{name:`${c.event.name}.${p}`,value:h},p))]},c.key))}):null,s.length?g.jsx(Sn,{name:"Attributes",children:s.map(c=>g.jsx(b.Fragment,{children:c.attributes.map(({key:p,value:h})=>g.jsx(Yr,{name:p,value:h},p))},c.prefix))}):null,o.length?g.jsx(Sn,{name:"Resource",children:o.map(c=>g.jsx(b.Fragment,{children:c.attributes.map(({key:p,value:h})=>g.jsx(Yr,{name:p,value:h},p))},c.prefix))}):null,t.isInstrumentationHint?null:g.jsxs(Sn,{name:"Library",children:[g.jsx(Yr,{name:"name",value:l.library.name}),l.library.version?g.jsx(Yr,{name:"version",value:l.library.version}):null]})]})};function f4({attached:e=!1}){const{state:{selected:t,isMobile:n},dispatch:r}=ms(),i=QR();if(!t)return null;const{span:a}=t;return g.jsxs("div",{className:at(re.spanDetailPanel,n&&re.mobile),children:[e&&!n?g.jsx(av,{}):null,g.jsx("div",{className:re.spanDetailPanelTop,children:g.jsxs("div",{className:re.spanDetailPanelTopInfo,children:[g.jsx("span",{className:re.spanDetailPanelName,title:a.name,children:a.name}),g.jsxs("div",{className:re.spanDetailPanelCorner,children:[t.isInstrumentationHint?null:g.jsx("span",{className:re.spanDetailPanelDuration,children:Rt(t.duration)}),g.jsx("div",{className:re.spanDetailPanelCloseVerticalRule}),g.jsx("button",{"aria-label":"Close Span Details",className:re.spanDetailPanelClose,onClick:()=>r({type:"deselect"}),type:"button",children:g.jsx($L,{color:"gray-700",size:20})})]})]})}),g.jsx("div",{className:at("flex gap-3",re.spanDetailPanelBody),children:i||g.jsx(XL,{})})]})}const wd="vc-trace-span-exp:";function Sn({name:e,className:t="",children:n}){const[r,i]=b.useState(()=>"localStorage"in globalThis?localStorage.getItem(`${wd}${e}`)!=="0":!0),a=b.useCallback(()=>{i(s=>{const o=!s;return localStorage.setItem(`${wd}${e}`,String(Number(o))),o})},[e]);return g.jsxs("div",{className:at(re.detailGroup,r?re.expanded:re.collapsed,t),children:[g.jsxs("button",{className:re.detailHeading,onClick:a,type:"button",children:[g.jsx("span",{children:e}),g.jsx(VL,{})]}),r?n:null]})}const QL=new Set(["OPTIONS","HEAD","GET","PUT","POST","DELETE"]),JL={"Resolve Deployment":"How long it took Vercel's routing layer to retrieve details for the deployment.","Resolve Cache":"How long it took Vercel's routing layer to check for a cached function invocation.","Resolve Route":"How long it took Vercel's routing layer to resolve routing rules, including redirects and rewrites.","Invoke Middleware":"How long it took this middleware to start and run user code.","Invoke Function":"How long it took this Vercel Function to start and run user code.",waitUntil:"How long it took to run user code inside of waitUntil.","Start VM":"How long it took to start the Virtual Machine which contains the Vercel Function.","Spawn Node.js":"How long it took the Virtual Machine to start the Node.js runtime.","Spawn Python":"How long it took the Virtual Machine to start the Python runtime.","Init User Code":"How long it took to import the user code and run any globally-scoped code."},Cd=new Set(["Start VM","Spawn Node.js","Spawn Python","Init User Code"]),Sd=e=>{if(!e||!("span"in e))return null;const t=e.span.attributes,n=t["vercel.region"]||t["vercel.function.region"];return n?String(n):null},ZL=e=>{const{name:t}=e.span,n=Sd(e),r=Sd(e.parent);return e.span.attributes["vercel.middleware.internal"]==="true"?"The Vercel Toolbar created this middleware.":Cd.has(t)||t==="Invoke Function"&&e.children.some(i=>Cd.has(i.span.name))?"This function encountered a cold start.":n&&r&&n!==r?"This request was routed across regions.":null},_m=e=>{if(!e.isVercel)return!1;const{name:t}=e.span,n=t.indexOf(" ");if(n===-1)return!1;const r=t.substring(0,n);return QL.has(r)};function ev({node:e}){const{name:t}=e.span;let n=JL[t];if(!n&&_m(e)&&(n="How long it took for Vercel to process the request and send the response."),!n)return null;const r=ZL(e);return g.jsx(Sn,{name:"What is this?",children:g.jsxs("div",{className:re.infraSpanDescription,children:[g.jsx("span",{children:n}),r&&g.jsx(GL,{children:r})]})})}const tv=b.memo(function({getQuickLinks:t,span:n}){const r=t(n);return r.length?g.jsx(Sn,{name:"Links",children:r.map(({key:i,value:a})=>g.jsx(rv,{link:a,name:i},i))}):null});function nv(e){const[t,n]=b.useState({}),r=e.__resolvedValue!==void 0||e.__rejectedValue!==void 0;return b.useEffect(()=>{r||e.then(i=>{e.__resolvedValue=i}).catch(i=>{e.__rejectedValue=i}).finally(()=>n({}))},[e,r]),e.__resolvedValue}function rv({name:e,link:t}){const n=nv(t);return g.jsxs(YL,{as:n?void 0:"span",className:at(re.spanDetailPanelAttribute,re.spanDetailPanelQuickLink),href:(n==null?void 0:n.href)||"",children:[g.jsx("span",{className:re.spanDetailPanelAttributeKey,children:e}),g.jsx("span",{className:at(re.spanDetailPanelAttributeValue,re.spanDetailPanelQuickLinkLabel),children:n?g.jsxs(g.Fragment,{children:[n.label,n.icon||g.jsx(WL,{color:"gray-900"})]}):g.jsxs(g.Fragment,{children:[g.jsx(xd,{height:18,width:32+e.length*8}),g.jsx(xd,{height:18,rounded:!0,width:18})]})})]})}function iv(){return g.jsx(Sn,{name:"What is this?",children:g.jsxs("div",{className:re.infraSpanDescription,children:[g.jsx("span",{children:"You can visualize your application's spans alongside Vercel's spans in this viewer."}),g.jsx(qL,{href:"https://vercel.com/docs/session-tracing#adding-custom-spans",size:"small",target:"_blank",children:"Get Started"})]})})}function Yr({name:e,value:t}){return g.jsxs("dl",{className:re.spanDetailPanelAttribute,children:[g.jsx("dt",{className:re.spanDetailPanelAttributeKey,children:e}),g.jsx("dd",{className:re.spanDetailPanelAttributeValue,title:String(t),children:String(t)})]})}function av(){const{state:{panelWidth:e},dispatch:t}=ms(),n=b.useRef({start:{x:0,width:e},x:0,width:e,isHeld:!1});n.current.width=e;const r=b.useCallback(a=>{if(a.pointerType!=="mouse")return;a.preventDefault();const s=n.current;s.start.x=a.clientX,s.x=a.clientX,s.start.width=s.width,s.isHeld=!0},[]),i=b.useCallback(()=>{t({type:"setPanelWidth",width:Gl.panelWidth})},[t]);return b.useEffect(()=>{let a=0;const s=()=>{const u=n.current,d=u.start.width+u.start.x-u.x;t({type:"setPanelWidth",width:d})},o=u=>{n.current.isHeld&&(u.preventDefault(),n.current.x=u.clientX,cancelAnimationFrame(a),a=requestAnimationFrame(s))},l=()=>{n.current.isHeld=!1};return window.addEventListener("pointermove",o),window.addEventListener("pointerup",l),()=>{window.removeEventListener("pointermove",o),window.removeEventListener("pointerup",l)}},[t]),g.jsx("div",{"aria-hidden":!0,className:re.spanDetailPanelResizer,onDoubleClick:i,onPointerDown:r})}function sv(e){const t=b.useRef({});return{setStyle:b.useCallback((r,i)=>{if(t.current[r]=i,!!e.current){if(!i){e.current.style.removeProperty(r);return}e.current.style.setProperty(r,i)}},[e]),styleRef:t,style:{...t.current}}}const ov=()=>"devicePixelRatio"in globalThis&&globalThis.devicePixelRatio||1,lv=()=>{const[e,t]=b.useState(1);return b.useLayoutEffect(()=>{const n=()=>t(ov()),r=matchMedia(`(resolution: ${e}dppx)`);return r.addEventListener("change",n),n(),()=>{r.removeEventListener("change",n)}},[e]),e},qr=za,h4=b.memo(function({timelineRef:t,rows:n,scale:r}){const{state:{root:i,baseScale:a,timelineWidth:s,width:o,scrollbarWidth:l}}=ms(),u=o+za*2,d=lv(),c=b.useRef(null),p=b.useRef(null),h=o/(o-l)*Math.min(o/s,a/r),m=Math.min(o,(s-l)*h);b.useEffect(()=>{let N=!1,C=0,F;const H=x=>{var L;return!!((L=c.current)!=null&&L.contains(x))};let I=0;const V=()=>{if(!N||!F)return;const x=t.current;if(!x)return;const L=C-m*.5-F.left;x.scrollLeft=L/h},U=x=>{({clientX:C}=x),cancelAnimationFrame(I),I=requestAnimationFrame(V)},Q=x=>{var L;H(x.target)&&(N=!0,F=(L=c.current)==null?void 0:L.getBoundingClientRect(),U(x))},O=()=>{N=!1,F=void 0},K=x=>{H(x.target)&&x.cancelable&&x.preventDefault()},z=x=>{N&&x.cancelable&&x.preventDefault()};return window.addEventListener("pointerdown",Q),window.addEventListener("pointermove",U),window.addEventListener("pointerup",O),window.addEventListener("blur",O),window.addEventListener("touchstart",K,{passive:!1}),window.addEventListener("touchmove",z,{passive:!1}),()=>{window.removeEventListener("pointerdown",Q),window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",O),window.removeEventListener("blur",O),window.removeEventListener("touchstart",K),window.removeEventListener("touchmove",z),cancelAnimationFrame(I)}},[t,h,m]),b.useEffect(()=>{const N=p.current,C=N==null?void 0:N.getContext("2d");if(!N||!C)return;const H=requestAnimationFrame(()=>{C.resetTransform(),C.clearRect(0,0,N.width,N.height),C.scale(d,d);const I=1,V=3,U=(u-qr*2)/i.duration;C.fillStyle="#ccc",C.beginPath();for(const Q of n)for(const O of Q){const K=qr-I+(I+V)*O.row;if(K>=mr-V-qr)break;const z=qr+(O.startTime-i.startTime)*U,x=O.duration*U;C.roundRect(z,K,x,V,V)}C.fill()});return()=>cancelAnimationFrame(H)},[d,i,u,n]);const E=b.useRef(null),{style:k,setStyle:_}=sv(E);return b.useLayoutEffect(()=>{const N=t.current;if(!N)return;let C=0;const F=()=>{_("transform",`translateX(${qr+N.scrollLeft*h}px)`)};F();const H=()=>{cancelAnimationFrame(C),C=requestAnimationFrame(F)};return N.addEventListener("scroll",H),()=>{cancelAnimationFrame(C),N.removeEventListener("scroll",H)}},[t,h,_]),g.jsxs("div",{className:re.mapContainer,ref:c,style:{width:m>0?u:"100%",height:mr},children:[g.jsx("canvas",{className:re.mapCanvas,height:mr*d,ref:p,style:{width:u,height:mr},width:u*d}),g.jsx("div",{className:re.mapThumb,ref:E,style:{transform:k.transform,width:m>0?m:`calc(100% - ${za*2}px)`,top:2,height:mr-4}})]})});function uv(e){try{const t=JSON.parse(e);return typeof t=="string"?t:JSON.stringify(t,null,2)}catch{return e}}function cv(e){try{return JSON.parse(e)}catch{return e}}const dv=j.memo(function({chunk:t,index:n}){const r=cv(t.text);return g.jsxs("div",{className:"text-[11px] rounded-md border p-3",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)"},children:[g.jsxs("span",{className:"select-none mr-2",style:{color:"var(--ds-gray-500)"},children:["[",n,"]"]}),typeof r=="string"?g.jsx("span",{className:"whitespace-pre-wrap break-words",style:{color:"var(--ds-gray-1000)"},children:uv(r)}):g.jsx(rT,{data:r,expandLevel:1})]})});function fv(){return g.jsxs("div",{className:"flex flex-col gap-3 animate-in fade-in",children:[g.jsx(vu,{style:{width:120,height:16,borderRadius:4}}),[1,2,3,4].map(e=>g.jsx(vu,{style:{height:56,borderRadius:6}},e))]})}function p4({streamId:e,chunks:t,isLive:n,error:r,isLoading:i}){const[a,s]=b.useState(!1),o=b.useRef(null),l=b.useCallback(()=>{if(o.current){const{scrollTop:u,scrollHeight:d,clientHeight:c}=o.current,p=d-u-c<10;s(!p&&d>c)}},[]);return b.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight),l()},[t.length,l]),i&&t.length===0?g.jsx("div",{className:"flex flex-col h-full pb-4",children:g.jsx(fv,{})}):g.jsxs("div",{className:"flex flex-col h-full pb-4",children:[n&&g.jsxs("div",{className:"flex items-center gap-1.5 mb-3 px-1",children:[g.jsx("span",{className:"inline-block w-2 h-2 rounded-full",style:{backgroundColor:"var(--ds-green-600)"}}),g.jsx("span",{className:"text-xs",style:{color:"var(--ds-green-700)"},children:"Live"})]}),t.length>0&&g.jsxs("div",{className:"flex items-center gap-2 mb-2 px-1",children:[g.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--ds-gray-900)"},children:"Stream Chunks"}),g.jsxs("span",{className:"text-xs tabular-nums",style:{color:"var(--ds-gray-600)"},children:["(",t.length,")"]})]}),g.jsxs("div",{className:"relative flex-1 min-h-[200px]",children:[g.jsx("div",{ref:o,onScroll:l,className:"absolute inset-0 overflow-auto flex flex-col gap-2",children:r?g.jsxs("div",{className:"text-[11px] rounded-md border p-3",style:{borderColor:"var(--ds-red-300)",backgroundColor:"var(--ds-red-100)",color:"var(--ds-red-700)"},children:[g.jsx("div",{children:"Error reading stream:"}),g.jsx("div",{children:r})]}):t.length===0?g.jsx("div",{className:"text-[11px] rounded-md border p-3",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)",color:"var(--ds-gray-600)"},children:n?"Waiting for stream data...":"Stream is empty"}):t.map((u,d)=>g.jsx(dv,{chunk:u,index:d},`${e}-chunk-${u.id}`))}),a&&g.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-8 pointer-events-none",style:{background:"linear-gradient(to top, var(--ds-background-100), transparent)"}})]})]})}const m4=10;function km(...e){return sl(at(e))}const g4=5e3;function b4(e,t,n){return n?`Page ${e} of ${t}+`:`Page ${e} of ${t}`}const E4=tb,T4=nb,hv=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(Nf,{ref:r,sideOffset:t,className:km("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));hv.displayName=Nf.displayName;const Am=b.createContext(null);function y4({children:e,serverConfig:t}){const n={serverConfig:t};return g.jsx(Am.Provider,{value:n,children:e})}function x4(){const e=b.useContext(Am);if(!e)throw new Error("useServerConfig must be used within a ServerConfigProvider");return e}function Nd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wm(...e){return t=>{let n=!1;const r=e.map(i=>{const a=Nd(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():Nd(e[i],null)}}}}function _4(...e){return b.useCallback(wm(...e),e)}var Cm=b.forwardRef((e,t)=>{const{children:n,...r}=e,i=b.Children.toArray(n),a=i.find(mv);if(a){const s=a.props.children,o=i.map(l=>l===a?b.Children.count(s)>1?b.Children.only(null):b.isValidElement(s)?s.props.children:null:l);return g.jsx(Ho,{...r,ref:t,children:b.isValidElement(s)?b.cloneElement(s,void 0,o):null})}return g.jsx(Ho,{...r,ref:t,children:n})});Cm.displayName="Slot";var Ho=b.forwardRef((e,t)=>{const{children:n,...r}=e;if(b.isValidElement(n)){const i=bv(n);return b.cloneElement(n,{...gv(r,n.props),ref:t?wm(t,i):i})}return b.Children.count(n)>1?b.Children.only(null):null});Ho.displayName="SlotClone";var pv=({children:e})=>g.jsx(g.Fragment,{children:e});function mv(e){return b.isValidElement(e)&&e.type===pv}function gv(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{a(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function bv(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Id=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Rd=at,Ev=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Rd(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,s=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],c=a==null?void 0:a[u];if(d===null)return null;const p=Id(d)||Id(c);return i[u][p]}),o=n&&Object.entries(n).reduce((u,d)=>{let[c,p]=d;return p===void 0||(u[c]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:p,...h}=d;return Object.entries(h).every(m=>{let[E,k]=m;return Array.isArray(k)?k.includes({...a,...o}[E]):{...a,...o}[E]===k})?[...u,c,p]:u},[]);return Rd(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Tv=Ev("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),yv=b.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const s=r?Cm:"button";return g.jsx(s,{className:km(Tv({variant:t,size:n,className:e})),ref:a,...i})});yv.displayName="Button";let Uo;try{Uo=new TextDecoder}catch{}let se,qn,Y=0;const xv=105,_v=57342,kv=57343,Od=57337,Ld=6,fr={};let Gr=11281e4,un=1681e4,_e={},Pe,$a,Va=0,Ni=0,We,Mt,ze=[],jo=[],bt,ut,ti,vd={useRecords:!1,mapsAsObjects:!0},Ii=!1,Sm=2;try{new Function("")}catch{Sm=1/0}class Ri{constructor(t){if(t&&((t.keyMap||t._keyMap)&&!t.useRecords&&(t.useRecords=!1,t.mapsAsObjects=!0),t.useRecords===!1&&t.mapsAsObjects===void 0&&(t.mapsAsObjects=!0),t.getStructures&&(t.getShared=t.getStructures),t.getShared&&!t.structures&&((t.structures=[]).uninitialized=!0),t.keyMap)){this.mapKey=new Map;for(let[n,r]of Object.entries(t.keyMap))this.mapKey.set(r,n)}Object.assign(this,t)}decodeKey(t){return this.keyMap&&this.mapKey.get(t)||t}encodeKey(t){return this.keyMap&&this.keyMap.hasOwnProperty(t)?this.keyMap[t]:t}encodeKeys(t){if(!this._keyMap)return t;let n=new Map;for(let[r,i]of Object.entries(t))n.set(this._keyMap.hasOwnProperty(r)?this._keyMap[r]:r,i);return n}decodeKeys(t){if(!this._keyMap||t.constructor.name!="Map")return t;if(!this._mapKey){this._mapKey=new Map;for(let[r,i]of Object.entries(this._keyMap))this._mapKey.set(i,r)}let n={};return t.forEach((r,i)=>n[Bt(this._mapKey.has(i)?this._mapKey.get(i):i)]=r),n}mapDecode(t,n){let r=this.decode(t);if(this._keyMap)switch(r.constructor.name){case"Array":return r.map(i=>this.decodeKeys(i))}return r}decode(t,n){if(se)return Om(()=>(Wo(),this?this.decode(t,n):Ri.prototype.decode.call(vd,t,n)));qn=n>-1?n:t.length,Y=0,Ni=0,$a=null,We=null,se=t;try{ut=t.dataView||(t.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength))}catch(r){throw se=null,t instanceof Uint8Array?r:new Error("Source must be a Uint8Array or Buffer but was a "+(t&&typeof t=="object"?t.constructor.name:typeof t))}if(this instanceof Ri){if(_e=this,bt=this.sharedValues&&(this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this.structures)return Pe=this.structures,ca();(!Pe||Pe.length>0)&&(Pe=[])}else _e=vd,(!Pe||Pe.length>0)&&(Pe=[]),bt=null;return ca()}decodeMultiple(t,n){let r,i=0;try{let a=t.length;Ii=!0;let s=this?this.decode(t,a):Zl.decode(t,a);if(n){if(n(s)===!1)return;for(;Y<a;)if(i=Y,n(ca())===!1)return}else{for(r=[s];Y<a;)i=Y,r.push(ca());return r}}catch(a){throw a.lastPosition=i,a.values=r,a}finally{Ii=!1,Wo()}}}function ca(){try{let e=Ae();if(We){if(Y>=We.postBundlePosition){let t=new Error("Unexpected bundle position");throw t.incomplete=!0,t}Y=We.postBundlePosition,We=null}if(Y==qn)Pe=null,se=null,Mt&&(Mt=null);else if(Y>qn){let t=new Error("Unexpected end of CBOR data");throw t.incomplete=!0,t}else if(!Ii)throw new Error("Data read, but end of buffer not reached");return e}catch(e){throw Wo(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer"))&&(e.incomplete=!0),e}}function Ae(){let e=se[Y++],t=e>>5;if(e=e&31,e>23)switch(e){case 24:e=se[Y++];break;case 25:if(t==7)return Sv();e=ut.getUint16(Y),Y+=2;break;case 26:if(t==7){let n=ut.getFloat32(Y);if(_e.useFloat32>2){let r=Jl[(se[Y]&127)<<1|se[Y+1]>>7];return Y+=4,(r*n+(n>0?.5:-.5)>>0)/r}return Y+=4,n}e=ut.getUint32(Y),Y+=4;break;case 27:if(t==7){let n=ut.getFloat64(Y);return Y+=8,n}if(t>1){if(ut.getUint32(Y)>0)throw new Error("JavaScript does not support arrays, maps, or strings with length over 4294967295");e=ut.getUint32(Y+4)}else _e.int64AsNumber?(e=ut.getUint32(Y)*4294967296,e+=ut.getUint32(Y+4)):e=ut.getBigUint64(Y);Y+=8;break;case 31:switch(t){case 2:case 3:throw new Error("Indefinite length not supported for byte or text strings");case 4:let n=[],r,i=0;for(;(r=Ae())!=fr;){if(i>=Gr)throw new Error(`Array length exceeds ${Gr}`);n[i++]=r}return t==4?n:t==3?n.join(""):Buffer.concat(n);case 5:let a;if(_e.mapsAsObjects){let s={},o=0;if(_e.keyMap)for(;(a=Ae())!=fr;){if(o++>=un)throw new Error(`Property count exceeds ${un}`);s[Bt(_e.decodeKey(a))]=Ae()}else for(;(a=Ae())!=fr;){if(o++>=un)throw new Error(`Property count exceeds ${un}`);s[Bt(a)]=Ae()}return s}else{ti&&(_e.mapsAsObjects=!0,ti=!1);let s=new Map;if(_e.keyMap){let o=0;for(;(a=Ae())!=fr;){if(o++>=un)throw new Error(`Map size exceeds ${un}`);s.set(_e.decodeKey(a),Ae())}}else{let o=0;for(;(a=Ae())!=fr;){if(o++>=un)throw new Error(`Map size exceeds ${un}`);s.set(a,Ae())}}return s}case 7:return fr;default:throw new Error("Invalid major type for indefinite length "+t)}default:throw new Error("Unknown token "+e)}switch(t){case 0:return e;case 1:return~e;case 2:return Cv(e);case 3:if(Ni>=Y)return $a.slice(Y-Va,(Y+=e)-Va);if(Ni==0&&qn<140&&e<32){let i=e<16?Nm(e):wv(e);if(i!=null)return i}return Av(e);case 4:if(e>=Gr)throw new Error(`Array length exceeds ${Gr}`);let n=new Array(e);for(let i=0;i<e;i++)n[i]=Ae();return n;case 5:if(e>=un)throw new Error(`Map size exceeds ${Gr}`);if(_e.mapsAsObjects){let i={};if(_e.keyMap)for(let a=0;a<e;a++)i[Bt(_e.decodeKey(Ae()))]=Ae();else for(let a=0;a<e;a++)i[Bt(Ae())]=Ae();return i}else{ti&&(_e.mapsAsObjects=!0,ti=!1);let i=new Map;if(_e.keyMap)for(let a=0;a<e;a++)i.set(_e.decodeKey(Ae()),Ae());else for(let a=0;a<e;a++)i.set(Ae(),Ae());return i}case 6:if(e>=Od){let i=Pe[e&8191];if(i)return i.read||(i.read=zo(i)),i.read();if(e<65536){if(e==kv){let a=Er(),s=Ae(),o=Ae();Vo(s,o);let l={};if(_e.keyMap)for(let u=2;u<a;u++){let d=_e.decodeKey(o[u-2]);l[Bt(d)]=Ae()}else for(let u=2;u<a;u++){let d=o[u-2];l[Bt(d)]=Ae()}return l}else if(e==_v){let a=Er(),s=Ae();for(let o=2;o<a;o++)Vo(s++,Ae());return Ae()}else if(e==Od)return vv();if(_e.getShared&&(Ql(),i=Pe[e&8191],i))return i.read||(i.read=zo(i)),i.read()}}let r=ze[e];if(r)return r.handlesRead?r(Ae):r(Ae());{let i=Ae();for(let a=0;a<jo.length;a++){let s=jo[a](e,i);if(s!==void 0)return s}return new Zn(i,e)}case 7:switch(e){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;case 31:default:let i=(bt||zn())[e];if(i!==void 0)return i;throw new Error("Unknown token "+e)}default:if(isNaN(e)){let i=new Error("Unexpected end of CBOR data");throw i.incomplete=!0,i}throw new Error("Unknown CBOR token "+e)}}const Dd=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function zo(e){if(!e)throw new Error("Structure is required in record definition");function t(){let n=se[Y++];if(n=n&31,n>23)switch(n){case 24:n=se[Y++];break;case 25:n=ut.getUint16(Y),Y+=2;break;case 26:n=ut.getUint32(Y),Y+=4;break;default:throw new Error("Expected array header, but got "+se[Y-1])}let r=this.compiledReader;for(;r;){if(r.propertyCount===n)return r(Ae);r=r.next}if(this.slowReads++>=Sm){let a=this.length==n?this:this.slice(0,n);return r=_e.keyMap?new Function("r","return {"+a.map(s=>_e.decodeKey(s)).map(s=>Dd.test(s)?Bt(s)+":r()":"["+JSON.stringify(s)+"]:r()").join(",")+"}"):new Function("r","return {"+a.map(s=>Dd.test(s)?Bt(s)+":r()":"["+JSON.stringify(s)+"]:r()").join(",")+"}"),this.compiledReader&&(r.next=this.compiledReader),r.propertyCount=n,this.compiledReader=r,r(Ae)}let i={};if(_e.keyMap)for(let a=0;a<n;a++)i[Bt(_e.decodeKey(this[a]))]=Ae();else for(let a=0;a<n;a++)i[Bt(this[a])]=Ae();return i}return e.slowReads=0,t}function Bt(e){if(typeof e=="string")return e==="__proto__"?"__proto_":e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return e.toString();if(e==null)return e+"";throw new Error("Invalid property name type "+typeof e)}let Av=$o;function $o(e){let t;if(e<16&&(t=Nm(e)))return t;if(e>64&&Uo)return Uo.decode(se.subarray(Y,Y+=e));const n=Y+e,r=[];for(t="";Y<n;){const i=se[Y++];if((i&128)===0)r.push(i);else if((i&224)===192){const a=se[Y++]&63;r.push((i&31)<<6|a)}else if((i&240)===224){const a=se[Y++]&63,s=se[Y++]&63;r.push((i&31)<<12|a<<6|s)}else if((i&248)===240){const a=se[Y++]&63,s=se[Y++]&63,o=se[Y++]&63;let l=(i&7)<<18|a<<12|s<<6|o;l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|l&1023),r.push(l)}else r.push(i);r.length>=4096&&(t+=Ge.apply(String,r),r.length=0)}return r.length>0&&(t+=Ge.apply(String,r)),t}let Ge=String.fromCharCode;function wv(e){let t=Y,n=new Array(e);for(let r=0;r<e;r++){const i=se[Y++];if((i&128)>0){Y=t;return}n[r]=i}return Ge.apply(String,n)}function Nm(e){if(e<4)if(e<2){if(e===0)return"";{let t=se[Y++];if((t&128)>1){Y-=1;return}return Ge(t)}}else{let t=se[Y++],n=se[Y++];if((t&128)>0||(n&128)>0){Y-=2;return}if(e<3)return Ge(t,n);let r=se[Y++];if((r&128)>0){Y-=3;return}return Ge(t,n,r)}else{let t=se[Y++],n=se[Y++],r=se[Y++],i=se[Y++];if((t&128)>0||(n&128)>0||(r&128)>0||(i&128)>0){Y-=4;return}if(e<6){if(e===4)return Ge(t,n,r,i);{let a=se[Y++];if((a&128)>0){Y-=5;return}return Ge(t,n,r,i,a)}}else if(e<8){let a=se[Y++],s=se[Y++];if((a&128)>0||(s&128)>0){Y-=6;return}if(e<7)return Ge(t,n,r,i,a,s);let o=se[Y++];if((o&128)>0){Y-=7;return}return Ge(t,n,r,i,a,s,o)}else{let a=se[Y++],s=se[Y++],o=se[Y++],l=se[Y++];if((a&128)>0||(s&128)>0||(o&128)>0||(l&128)>0){Y-=8;return}if(e<10){if(e===8)return Ge(t,n,r,i,a,s,o,l);{let u=se[Y++];if((u&128)>0){Y-=9;return}return Ge(t,n,r,i,a,s,o,l,u)}}else if(e<12){let u=se[Y++],d=se[Y++];if((u&128)>0||(d&128)>0){Y-=10;return}if(e<11)return Ge(t,n,r,i,a,s,o,l,u,d);let c=se[Y++];if((c&128)>0){Y-=11;return}return Ge(t,n,r,i,a,s,o,l,u,d,c)}else{let u=se[Y++],d=se[Y++],c=se[Y++],p=se[Y++];if((u&128)>0||(d&128)>0||(c&128)>0||(p&128)>0){Y-=12;return}if(e<14){if(e===12)return Ge(t,n,r,i,a,s,o,l,u,d,c,p);{let h=se[Y++];if((h&128)>0){Y-=13;return}return Ge(t,n,r,i,a,s,o,l,u,d,c,p,h)}}else{let h=se[Y++],m=se[Y++];if((h&128)>0||(m&128)>0){Y-=14;return}if(e<15)return Ge(t,n,r,i,a,s,o,l,u,d,c,p,h,m);let E=se[Y++];if((E&128)>0){Y-=15;return}return Ge(t,n,r,i,a,s,o,l,u,d,c,p,h,m,E)}}}}}function Cv(e){return _e.copyBuffers?Uint8Array.prototype.slice.call(se,Y,Y+=e):se.subarray(Y,Y+=e)}let Im=new Float32Array(1),da=new Uint8Array(Im.buffer,0,4);function Sv(){let e=se[Y++],t=se[Y++],n=(e&127)>>2;if(n===31)return t||e&3?NaN:e&128?-1/0:1/0;if(n===0){let r=((e&3)<<8|t)/16777216;return e&128?-r:r}return da[3]=e&128|(n>>1)+56,da[2]=(e&7)<<5|t>>3,da[1]=t<<5,da[0]=0,Im[0]}new Array(4096);class Zn{constructor(t,n){this.value=t,this.tag=n}}ze[0]=e=>new Date(e);ze[1]=e=>new Date(Math.round(e*1e3));ze[2]=e=>{let t=BigInt(0);for(let n=0,r=e.byteLength;n<r;n++)t=BigInt(e[n])+(t<<BigInt(8));return t};ze[3]=e=>BigInt(-1)-ze[2](e);ze[4]=e=>+(e[1]+"e"+e[0]);ze[5]=e=>e[1]*Math.exp(e[0]*Math.log(2));const Vo=(e,t)=>{e=e-57344;let n=Pe[e];n&&n.isShared&&((Pe.restoreStructures||(Pe.restoreStructures=[]))[e]=n),Pe[e]=t,t.read=zo(t)};ze[xv]=e=>{let t=e.length,n=e[1];Vo(e[0],n);let r={};for(let i=2;i<t;i++){let a=n[i-2];r[Bt(a)]=e[i]}return r};ze[14]=e=>We?We[0].slice(We.position0,We.position0+=e):new Zn(e,14);ze[15]=e=>We?We[1].slice(We.position1,We.position1+=e):new Zn(e,15);let Nv={Error,RegExp};ze[27]=e=>(Nv[e[0]]||Error)(e[1],e[2]);const Rm=e=>{if(se[Y++]!=132){let n=new Error("Packed values structure must be followed by a 4 element array");throw se.length<Y&&(n.incomplete=!0),n}let t=e();if(!t||!t.length){let n=new Error("Packed values structure must be followed by a 4 element array");throw n.incomplete=!0,n}return bt=bt?t.concat(bt.slice(t.length)):t,bt.prefixes=e(),bt.suffixes=e(),e()};Rm.handlesRead=!0;ze[51]=Rm;ze[Ld]=e=>{if(!bt)if(_e.getShared)Ql();else return new Zn(e,Ld);if(typeof e=="number")return bt[16+(e>=0?2*e:-2*e-1)];let t=new Error("No support for non-integer packed references yet");throw e===void 0&&(t.incomplete=!0),t};ze[28]=e=>{Mt||(Mt=new Map,Mt.id=0);let t=Mt.id++,n=Y,r=se[Y],i;r>>5==4?i=[]:i={};let a={target:i};Mt.set(t,a);let s=e();return a.used?(Object.getPrototypeOf(i)!==Object.getPrototypeOf(s)&&(Y=n,i=s,Mt.set(t,{target:i}),s=e()),Object.assign(i,s)):(a.target=s,s)};ze[28].handlesRead=!0;ze[29]=e=>{let t=Mt.get(e);return t.used=!0,t.target};ze[258]=e=>new Set(e);(ze[259]=e=>(_e.mapsAsObjects&&(_e.mapsAsObjects=!1,ti=!0),e())).handlesRead=!0;function hr(e,t){return typeof e=="string"?e+t:e instanceof Array?e.concat(t):Object.assign({},e,t)}function zn(){if(!bt)if(_e.getShared)Ql();else throw new Error("No packed values available");return bt}const Iv=1399353956;jo.push((e,t)=>{if(e>=225&&e<=255)return hr(zn().prefixes[e-224],t);if(e>=28704&&e<=32767)return hr(zn().prefixes[e-28672],t);if(e>=1879052288&&e<=2147483647)return hr(zn().prefixes[e-1879048192],t);if(e>=216&&e<=223)return hr(t,zn().suffixes[e-216]);if(e>=27647&&e<=28671)return hr(t,zn().suffixes[e-27639]);if(e>=1811940352&&e<=1879048191)return hr(t,zn().suffixes[e-1811939328]);if(e==Iv)return{packedValues:bt,structures:Pe.slice(0),version:t};if(e==55799)return t});const Rv=new Uint8Array(new Uint16Array([1]).buffer)[0]==1,Pd=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>"u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"?{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array],Ov=[64,68,69,70,71,72,77,78,79,85,86];for(let e=0;e<Pd.length;e++)Lv(Pd[e],Ov[e]);function Lv(e,t){let n="get"+e.name.slice(0,-5),r;typeof e=="function"?r=e.BYTES_PER_ELEMENT:e=null;for(let i=0;i<2;i++){if(!i&&r==1)continue;let a=r==2?1:r==4?2:r==8?3:0;ze[i?t:t-4]=r==1||i==Rv?s=>{if(!e)throw new Error("Could not find typed array for code "+t);return!_e.copyBuffers&&(r===1||r===2&&!(s.byteOffset&1)||r===4&&!(s.byteOffset&3)||r===8&&!(s.byteOffset&7))?new e(s.buffer,s.byteOffset,s.byteLength>>a):new e(Uint8Array.prototype.slice.call(s,0).buffer)}:s=>{if(!e)throw new Error("Could not find typed array for code "+t);let o=new DataView(s.buffer,s.byteOffset,s.byteLength),l=s.length>>a,u=new e(l),d=o[n];for(let c=0;c<l;c++)u[c]=d.call(o,c<<a,i);return u}}}function vv(){let e=Er(),t=Y+Ae();for(let r=2;r<e;r++){let i=Er();Y+=i}let n=Y;return Y=t,We=[$o(Er()),$o(Er())],We.position0=0,We.position1=0,We.postBundlePosition=Y,Y=n,Ae()}function Er(){let e=se[Y++]&31;if(e>23)switch(e){case 24:e=se[Y++];break;case 25:e=ut.getUint16(Y),Y+=2;break;case 26:e=ut.getUint32(Y),Y+=4;break}return e}function Ql(){if(_e.getShared){let e=Om(()=>(se=null,_e.getShared()))||{},t=e.structures||[];_e.sharedVersion=e.version,bt=_e.sharedValues=e.packedValues,Pe===!0?_e.structures=Pe=t:Pe.splice.apply(Pe,[0,t.length].concat(t))}}function Om(e){let t=qn,n=Y,r=Va,i=Ni,a=$a,s=Mt,o=We,l=new Uint8Array(se.slice(0,qn)),u=Pe,d=_e,c=Ii,p=e();return qn=t,Y=n,Va=r,Ni=i,$a=a,Mt=s,We=o,se=l,Ii=c,Pe=u,_e=d,ut=new DataView(se.buffer,se.byteOffset,se.byteLength),p}function Wo(){se=null,Mt=null,Pe=null}const Jl=new Array(147);for(let e=0;e<256;e++)Jl[e]=+("1e"+Math.floor(45.15-e*.30103));let Zl=new Ri({useRecords:!1});const Md=Zl.decode;Zl.decodeMultiple;let ka;try{ka=new TextEncoder}catch{}let Yo,Lm;const bs=typeof globalThis=="object"&&globalThis.Buffer,Vi=typeof bs<"u",Xs=Vi?bs.allocUnsafeSlow:Uint8Array,Bd=Vi?bs:Uint8Array,Fd=256,Hd=Vi?4294967296:2144337920;let Qs,B,ve,R=0,kn,Ve=null;const Dv=61440,Pv=/[\u0080-\uFFFF]/,kt=Symbol("record-id");class Mv extends Ri{constructor(t){super(t),this.offset=0;let n,r,i,a,s;t=t||{};let o=Bd.prototype.utf8Write?function(x,L,v){return B.utf8Write(x,L,v)}:ka&&ka.encodeInto?function(x,L){return ka.encodeInto(x,B.subarray(L)).written}:!1,l=this,u=t.structures||t.saveStructures,d=t.maxSharedStructures;if(d==null&&(d=u?128:0),d>8190)throw new Error("Maximum maxSharedStructure is 8190");let c=t.sequential;c&&(d=0),this.structures||(this.structures=[]),this.saveStructures&&(this.saveShared=this.saveStructures);let p,h,m=t.sharedValues,E;if(m){E=Object.create(null);for(let x=0,L=m.length;x<L;x++)E[m[x]]=x}let k=[],_=0,N=0;this.mapEncode=function(x,L){if(this._keyMap&&!this._mapped)switch(x.constructor.name){case"Array":x=x.map(v=>this.encodeKeys(v));break}return this.encode(x,L)},this.encode=function(x,L){if(B||(B=new Xs(8192),ve=new DataView(B.buffer,0,8192),R=0),kn=B.length-10,kn-R<2048?(B=new Xs(B.length),ve=new DataView(B.buffer,0,B.length),kn=B.length-10,R=0):L===zd&&(R=R+7&2147483640),n=R,l.useSelfDescribedHeader&&(ve.setUint32(R,3654940416),R+=3),s=l.structuredClone?new Map:null,l.bundleStrings&&typeof x!="string"?(Ve=[],Ve.size=1/0):Ve=null,r=l.structures,r){if(r.uninitialized){let D=l.getShared()||{};l.structures=r=D.structures||[],l.sharedVersion=D.version;let P=l.sharedValues=D.packedValues;if(P){E={};for(let q=0,J=P.length;q<J;q++)E[P[q]]=q}}let v=r.length;if(v>d&&!c&&(v=d),!r.transitions){r.transitions=Object.create(null);for(let D=0;D<v;D++){let P=r[D];if(!P)continue;let q,J=r.transitions;for(let T=0,ie=P.length;T<ie;T++){J[kt]===void 0&&(J[kt]=D);let te=P[T];q=J[te],q||(q=J[te]=Object.create(null)),J=q}J[kt]=D|1048576}}c||(r.nextId=v)}if(i&&(i=!1),a=r||[],h=E,t.pack){let v=new Map;if(v.values=[],v.encoder=l,v.maxValues=t.maxPrivatePackedValues||(E?16:1/0),v.objectMap=E||!1,v.samplingPackedValues=p,Aa(x,v),v.values.length>0){B[R++]=216,B[R++]=51,Jt(4);let D=v.values;C(D),Jt(0),Jt(0),h=Object.create(E||null);for(let P=0,q=D.length;P<q;P++)h[D[P]]=P}}Qs=L&Zs;try{if(Qs)return;if(C(x),Ve&&jd(n,C),l.offset=R,s&&s.idsToInsert){R+=s.idsToInsert.length*2,R>kn&&H(R),l.offset=R;let v=Hv(B.subarray(n,R),s.idsToInsert);return s=null,v}return L&zd?(B.start=n,B.end=R,B):B.subarray(n,R)}finally{if(r){if(N<10&&N++,r.length>d&&(r.length=d),_>1e4)r.transitions=null,N=0,_=0,k.length>0&&(k=[]);else if(k.length>0&&!c){for(let v=0,D=k.length;v<D;v++)k[v][kt]=void 0;k=[]}}if(i&&l.saveShared){l.structures.length>d&&(l.structures=l.structures.slice(0,d));let v=B.subarray(n,R);return l.updateSharedData()===!1?l.encode(x):v}L&jv&&(R=n)}},this.findCommonStringsToPack=()=>(p=new Map,E||(E=Object.create(null)),x=>{let L=x&&x.threshold||4,v=this.pack?x.maxPrivatePackedValues||16:0;m||(m=this.sharedValues=[]);for(let[D,P]of p)P.count>L&&(E[D]=v++,m.push(D),i=!0);for(;this.saveShared&&this.updateSharedData()===!1;);p=null});const C=x=>{R>kn&&(B=H(R));var L=typeof x,v;if(L==="string"){if(h){let J=h[x];if(J>=0){J<16?B[R++]=J+224:(B[R++]=198,J&1?C(15-J>>1):C(J-16>>1));return}else if(p&&!t.pack){let T=p.get(x);T?T.count++:p.set(x,{count:1})}}let D=x.length;if(Ve&&D>=4&&D<1024){if((Ve.size+=D)>Dv){let T,ie=(Ve[0]?Ve[0].length*3+Ve[1].length:0)+10;R+ie>kn&&(B=H(R+ie)),B[R++]=217,B[R++]=223,B[R++]=249,B[R++]=Ve.position?132:130,B[R++]=26,T=R-n,R+=4,Ve.position&&jd(n,C),Ve=["",""],Ve.size=0,Ve.position=T}let J=Pv.test(x);Ve[J?0:1]+=x,B[R++]=J?206:207,C(D);return}let P;D<32?P=1:D<256?P=2:D<65536?P=3:P=5;let q=D*3;if(R+q>kn&&(B=H(R+q)),D<64||!o){let J,T,ie,te=R+P;for(J=0;J<D;J++)T=x.charCodeAt(J),T<128?B[te++]=T:T<2048?(B[te++]=T>>6|192,B[te++]=T&63|128):(T&64512)===55296&&((ie=x.charCodeAt(J+1))&64512)===56320?(T=65536+((T&1023)<<10)+(ie&1023),J++,B[te++]=T>>18|240,B[te++]=T>>12&63|128,B[te++]=T>>6&63|128,B[te++]=T&63|128):(B[te++]=T>>12|224,B[te++]=T>>6&63|128,B[te++]=T&63|128);v=te-R-P}else v=o(x,R+P,q);v<24?B[R++]=96|v:v<256?(P<2&&B.copyWithin(R+2,R+1,R+1+v),B[R++]=120,B[R++]=v):v<65536?(P<3&&B.copyWithin(R+3,R+2,R+2+v),B[R++]=121,B[R++]=v>>8,B[R++]=v&255):(P<5&&B.copyWithin(R+5,R+3,R+3+v),B[R++]=122,ve.setUint32(R,v),R+=4),R+=v}else if(L==="number")if(!this.alwaysUseFloat&&x>>>0===x)x<24?B[R++]=x:x<256?(B[R++]=24,B[R++]=x):x<65536?(B[R++]=25,B[R++]=x>>8,B[R++]=x&255):(B[R++]=26,ve.setUint32(R,x),R+=4);else if(!this.alwaysUseFloat&&x>>0===x)x>=-24?B[R++]=31-x:x>=-256?(B[R++]=56,B[R++]=~x):x>=-65536?(B[R++]=57,ve.setUint16(R,~x),R+=2):(B[R++]=58,ve.setUint32(R,~x),R+=4);else{let D;if((D=this.useFloat32)>0&&x<4294967296&&x>=-2147483648){B[R++]=250,ve.setFloat32(R,x);let P;if(D<4||(P=x*Jl[(B[R]&127)<<1|B[R+1]>>7])>>0===P){R+=4;return}else R--}B[R++]=251,ve.setFloat64(R,x),R+=8}else if(L==="object")if(!x)B[R++]=246;else{if(s){let P=s.get(x);if(P){if(B[R++]=216,B[R++]=29,B[R++]=25,!P.references){let q=s.idsToInsert||(s.idsToInsert=[]);P.references=[],q.push(P)}P.references.push(R-n),R+=2;return}else s.set(x,{offset:R-n})}let D=x.constructor;if(D===Object)F(x);else if(D===Array){v=x.length,v<24?B[R++]=128|v:Jt(v);for(let P=0;P<v;P++)C(x[P])}else if(D===Map)if((this.mapsAsObjects?this.useTag259ForMaps!==!1:this.useTag259ForMaps)&&(B[R++]=217,B[R++]=1,B[R++]=3),v=x.size,v<24?B[R++]=160|v:v<256?(B[R++]=184,B[R++]=v):v<65536?(B[R++]=185,B[R++]=v>>8,B[R++]=v&255):(B[R++]=186,ve.setUint32(R,v),R+=4),l.keyMap)for(let[P,q]of x)C(l.encodeKey(P)),C(q);else for(let[P,q]of x)C(P),C(q);else{for(let P=0,q=Yo.length;P<q;P++){let J=Lm[P];if(x instanceof J){let T=Yo[P],ie=T.tag;ie==null&&(ie=T.getTag&&T.getTag.call(this,x)),ie<24?B[R++]=192|ie:ie<256?(B[R++]=216,B[R++]=ie):ie<65536?(B[R++]=217,B[R++]=ie>>8,B[R++]=ie&255):ie>-1&&(B[R++]=218,ve.setUint32(R,ie),R+=4),T.encode.call(this,x,C,H);return}}if(x[Symbol.iterator]){if(Qs){let P=new Error("Iterable should be serialized as iterator");throw P.iteratorNotHandled=!0,P}B[R++]=159;for(let P of x)C(P);B[R++]=255;return}if(x[Symbol.asyncIterator]||Js(x)){let P=new Error("Iterable/blob should be serialized as iterator");throw P.iteratorNotHandled=!0,P}if(this.useToJSON&&x.toJSON){const P=x.toJSON();if(P!==x)return C(P)}F(x)}}else if(L==="boolean")B[R++]=x?245:244;else if(L==="bigint"){if(x<BigInt(1)<<BigInt(64)&&x>=0)B[R++]=27,ve.setBigUint64(R,x);else if(x>-(BigInt(1)<<BigInt(64))&&x<0)B[R++]=59,ve.setBigUint64(R,-x-BigInt(1));else if(this.largeBigIntToFloat)B[R++]=251,ve.setFloat64(R,Number(x));else{x>=BigInt(0)?B[R++]=194:(B[R++]=195,x=BigInt(-1)-x);let D=[];for(;x;)D.push(Number(x&BigInt(255))),x>>=BigInt(8);qo(new Uint8Array(D.reverse()),H);return}R+=8}else if(L==="undefined")B[R++]=247;else throw new Error("Unknown type: "+L)},F=this.useRecords===!1?this.variableMapSize?x=>{let L=Object.keys(x),v=Object.values(x),D=L.length;if(D<24?B[R++]=160|D:D<256?(B[R++]=184,B[R++]=D):D<65536?(B[R++]=185,B[R++]=D>>8,B[R++]=D&255):(B[R++]=186,ve.setUint32(R,D),R+=4),l.keyMap)for(let P=0;P<D;P++)C(l.encodeKey(L[P])),C(v[P]);else for(let P=0;P<D;P++)C(L[P]),C(v[P])}:x=>{B[R++]=185;let L=R-n;R+=2;let v=0;if(l.keyMap)for(let D in x)(typeof x.hasOwnProperty!="function"||x.hasOwnProperty(D))&&(C(l.encodeKey(D)),C(x[D]),v++);else for(let D in x)(typeof x.hasOwnProperty!="function"||x.hasOwnProperty(D))&&(C(D),C(x[D]),v++);B[L+++n]=v>>8,B[L+n]=v&255}:(x,L)=>{let v,D=a.transitions||(a.transitions=Object.create(null)),P=0,q=0,J,T;if(this.keyMap){T=Object.keys(x).map(te=>this.encodeKey(te)),q=T.length;for(let te=0;te<q;te++){let w=T[te];v=D[w],v||(v=D[w]=Object.create(null),P++),D=v}}else for(let te in x)(typeof x.hasOwnProperty!="function"||x.hasOwnProperty(te))&&(v=D[te],v||(D[kt]&1048576&&(J=D[kt]&65535),v=D[te]=Object.create(null),P++),D=v,q++);let ie=D[kt];if(ie!==void 0)ie&=65535,B[R++]=217,B[R++]=ie>>8|224,B[R++]=ie&255;else if(T||(T=D.__keys__||(D.__keys__=Object.keys(x))),J===void 0?(ie=a.nextId++,ie||(ie=0,a.nextId=1),ie>=Fd&&(a.nextId=(ie=d)+1)):ie=J,a[ie]=T,ie<d){B[R++]=217,B[R++]=ie>>8|224,B[R++]=ie&255,D=a.transitions;for(let te=0;te<q;te++)(D[kt]===void 0||D[kt]&1048576)&&(D[kt]=ie),D=D[T[te]];D[kt]=ie|1048576,i=!0}else{if(D[kt]=ie,ve.setUint32(R,3655335680),R+=3,P&&(_+=N*P),k.length>=Fd-d&&(k.shift()[kt]=void 0),k.push(D),Jt(q+2),C(57344+ie),C(T),L)return;for(let te in x)(typeof x.hasOwnProperty!="function"||x.hasOwnProperty(te))&&C(x[te]);return}if(q<24?B[R++]=128|q:Jt(q),!L)for(let te in x)(typeof x.hasOwnProperty!="function"||x.hasOwnProperty(te))&&C(x[te])},H=x=>{let L;if(x>16777216){if(x-n>Hd)throw new Error("Encoded buffer would be larger than maximum buffer size");L=Math.min(Hd,Math.round(Math.max((x-n)*(x>67108864?1.25:2),4194304)/4096)*4096)}else L=(Math.max(x-n<<2,B.length-1)>>12)+1<<12;let v=new Xs(L);return ve=new DataView(v.buffer,0,L),B.copy?B.copy(v,0,n,x):v.set(B.slice(n,x)),R-=n,n=0,kn=v.length-10,B=v};let I=100,V=1e3;this.encodeAsIterable=function(x,L){return K(x,L,U)},this.encodeAsAsyncIterable=function(x,L){return K(x,L,z)};function*U(x,L,v){let D=x.constructor;if(D===Object){let P=l.useRecords!==!1;P?F(x,!0):Ud(Object.keys(x).length,160);for(let q in x){let J=x[q];P||C(q),J&&typeof J=="object"?L[q]?yield*U(J,L[q]):yield*Q(J,L,q):C(J)}}else if(D===Array){let P=x.length;Jt(P);for(let q=0;q<P;q++){let J=x[q];J&&(typeof J=="object"||R-n>I)?L.element?yield*U(J,L.element):yield*Q(J,L,"element"):C(J)}}else if(x[Symbol.iterator]&&!x.buffer){B[R++]=159;for(let P of x)P&&(typeof P=="object"||R-n>I)?L.element?yield*U(P,L.element):yield*Q(P,L,"element"):C(P);B[R++]=255}else Js(x)?(Ud(x.size,64),yield B.subarray(n,R),yield x,O()):x[Symbol.asyncIterator]?(B[R++]=159,yield B.subarray(n,R),yield x,O(),B[R++]=255):C(x);v&&R>n?yield B.subarray(n,R):R-n>I&&(yield B.subarray(n,R),O())}function*Q(x,L,v){let D=R-n;try{C(x),R-n>I&&(yield B.subarray(n,R),O())}catch(P){if(P.iteratorNotHandled)L[v]={},R=n+D,yield*U.call(this,x,L[v]);else throw P}}function O(){I=V,l.encode(null,Zs)}function K(x,L,v){return L&&L.chunkThreshold?I=V=L.chunkThreshold:I=100,x&&typeof x=="object"?(l.encode(null,Zs),v(x,l.iterateProperties||(l.iterateProperties={}),!0)):[l.encode(x)]}async function*z(x,L){for(let v of U(x,L,!0)){let D=v.constructor;if(D===Bd||D===Uint8Array)yield v;else if(Js(v)){let P=v.stream().getReader(),q;for(;!(q=await P.read()).done;)yield q.value}else if(v[Symbol.asyncIterator])for await(let P of v)O(),P?yield*z(P,L.async||(L.async={})):yield l.encode(P);else yield v}}}useBuffer(t){B=t,ve=new DataView(B.buffer,B.byteOffset,B.byteLength),R=0}clearSharedData(){this.structures&&(this.structures=[]),this.sharedValues&&(this.sharedValues=void 0)}updateSharedData(){let t=this.sharedVersion||0;this.sharedVersion=t+1;let n=this.structures.slice(0),r=new vm(n,this.sharedValues,this.sharedVersion),i=this.saveShared(r,a=>(a&&a.version||0)==t);return i===!1?(r=this.getShared()||{},this.structures=r.structures||[],this.sharedValues=r.packedValues,this.sharedVersion=r.version,this.structures.nextId=this.structures.length):n.forEach((a,s)=>this.structures[s]=a),i}}function Ud(e,t){e<24?B[R++]=t|e:e<256?(B[R++]=t|24,B[R++]=e):e<65536?(B[R++]=t|25,B[R++]=e>>8,B[R++]=e&255):(B[R++]=t|26,ve.setUint32(R,e),R+=4)}class vm{constructor(t,n,r){this.structures=t,this.packedValues=n,this.version=r}}function Jt(e){e<24?B[R++]=128|e:e<256?(B[R++]=152,B[R++]=e):e<65536?(B[R++]=153,B[R++]=e>>8,B[R++]=e&255):(B[R++]=154,ve.setUint32(R,e),R+=4)}const Bv=typeof Blob>"u"?function(){}:Blob;function Js(e){if(e instanceof Bv)return!0;let t=e[Symbol.toStringTag];return t==="Blob"||t==="File"}function Aa(e,t){switch(typeof e){case"string":if(e.length>3){if(t.objectMap[e]>-1||t.values.length>=t.maxValues)return;let r=t.get(e);if(r)++r.count==2&&t.values.push(e);else if(t.set(e,{count:1}),t.samplingPackedValues){let i=t.samplingPackedValues.get(e);i?i.count++:t.samplingPackedValues.set(e,{count:1})}}break;case"object":if(e)if(e instanceof Array)for(let r=0,i=e.length;r<i;r++)Aa(e[r],t);else{let r=!t.encoder.useRecords;for(var n in e)e.hasOwnProperty(n)&&(r&&Aa(n,t),Aa(e[n],t))}break;case"function":console.log(e)}}const Fv=new Uint8Array(new Uint16Array([1]).buffer)[0]==1;Lm=[Date,Set,Error,RegExp,Zn,ArrayBuffer,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>"u"?function(){}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"?function(){}:BigInt64Array,Float32Array,Float64Array,vm];Yo=[{tag:1,encode(e,t){let n=e.getTime()/1e3;(this.useTimestamp32||e.getMilliseconds()===0)&&n>=0&&n<4294967296?(B[R++]=26,ve.setUint32(R,n),R+=4):(B[R++]=251,ve.setFloat64(R,n),R+=8)}},{tag:258,encode(e,t){let n=Array.from(e);t(n)}},{tag:27,encode(e,t){t([e.name,e.message])}},{tag:27,encode(e,t){t(["RegExp",e.source,e.flags])}},{getTag(e){return e.tag},encode(e,t){t(e.value)}},{encode(e,t,n){qo(e,n)}},{getTag(e){if(e.constructor===Uint8Array&&(this.tagUint8Array||Vi&&this.tagUint8Array!==!1))return 64},encode(e,t,n){qo(e,n)}},Xt(68,1),Xt(69,2),Xt(70,4),Xt(71,8),Xt(72,1),Xt(77,2),Xt(78,4),Xt(79,8),Xt(85,4),Xt(86,8),{encode(e,t){let n=e.packedValues||[],r=e.structures||[];if(n.values.length>0){B[R++]=216,B[R++]=51,Jt(4);let i=n.values;t(i),Jt(0),Jt(0),packedObjectMap=Object.create(sharedPackedObjectMap||null);for(let a=0,s=i.length;a<s;a++)packedObjectMap[i[a]]=a}if(r){ve.setUint32(R,3655335424),R+=3;let i=r.slice(0);i.unshift(57344),i.push(new Zn(e.version,1399353956)),t(i)}else t(new Zn(e.version,1399353956))}}];function Xt(e,t){return!Fv&&t>1&&(e-=4),{tag:e,encode:function(r,i){let a=r.byteLength,s=r.byteOffset||0,o=r.buffer||r;i(Vi?bs.from(o,s,a):new Uint8Array(o,s,a))}}}function qo(e,t){let n=e.byteLength;n<24?B[R++]=64+n:n<256?(B[R++]=88,B[R++]=n):n<65536?(B[R++]=89,B[R++]=n>>8,B[R++]=n&255):(B[R++]=90,ve.setUint32(R,n),R+=4),R+n>=B.length&&t(R+n),B.set(e.buffer?e:new Uint8Array(e),R),R+=n}function Hv(e,t){let n,r=t.length*2,i=e.length-r;t.sort((a,s)=>a.offset>s.offset?1:-1);for(let a=0;a<t.length;a++){let s=t[a];s.id=a;for(let o of s.references)e[o++]=a>>8,e[o]=a&255}for(;n=t.pop();){let a=n.offset;e.copyWithin(a+r,a,i),r-=2;let s=a+r;e[s++]=216,e[s++]=28,i=a}return e}function jd(e,t){ve.setUint32(Ve.position+e,R-Ve.position-e+1);let n=Ve;Ve=null,t(n[0]),t(n[1])}let eu=new Mv({useRecords:!1});const Uv=eu.encode;eu.encodeAsIterable;eu.encodeAsAsyncIterable;const zd=512,jv=1024,Zs=2048;async function et(e,t){var i;const n=await fetch("/api/rpc",{method:"POST",headers:{"Content-Type":"application/cbor",Accept:"application/cbor"},body:new Uint8Array(Uv({method:e,params:t??{}}))});if(!n.ok){try{const a=await n.arrayBuffer(),s=Md(new Uint8Array(a));if((i=s==null?void 0:s.error)!=null&&i.message)throw new Error(s.error.message)}catch(a){if(a instanceof Error&&a.message!==`RPC call ${e} failed`)throw a}throw new Error(`RPC call ${e} failed: ${n.status} ${n.statusText}`)}const r=await n.arrayBuffer();return Md(new Uint8Array(r))}async function k4(e,t){return et("fetchRuns",{worldEnv:e,params:t})}async function A4(e,t,n="all"){return et("fetchRun",{worldEnv:e,runId:t,resolveData:n})}async function w4(e,t,n){return et("fetchSteps",{worldEnv:e,runId:t,params:n})}async function C4(e,t,n,r="all"){return et("fetchStep",{worldEnv:e,runId:t,stepId:n,resolveData:r})}async function S4(e,t,n){return et("fetchEvents",{worldEnv:e,runId:t,params:n})}async function N4(e,t,n){return et("fetchEventsByCorrelationId",{worldEnv:e,correlationId:t,params:n})}async function I4(e,t){return et("fetchHooks",{worldEnv:e,params:t})}async function R4(e,t,n="all"){return et("fetchHook",{worldEnv:e,hookId:t,resolveData:n})}async function O4(e,t){return et("cancelRun",{worldEnv:e,runId:t})}async function L4(e,t,n){return et("recreateRun",{worldEnv:e,runId:t,deploymentId:n})}async function v4(e,t){return et("reenqueueRun",{worldEnv:e,runId:t})}async function D4(e,t,n){return et("wakeUpRun",{worldEnv:e,runId:t,options:n})}async function P4(e,t,n){return et("resumeHook",{worldEnv:e,token:t,payload:n})}async function M4(e,t){return et("fetchStreams",{worldEnv:e,runId:t})}async function B4(e){return et("fetchWorkflowsManifest",{worldEnv:e})}async function F4(e,t,n){return et("runHealthCheck",{worldEnv:e,endpoint:t,options:n})}async function H4(e,t){return et("getEncryptionKeyForRun",{worldEnv:e,runId:t})}const zv=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:gm},Symbol.toStringTag,{value:"Module"}));export{re as $,w1 as A,yv as B,C1 as C,m4 as D,A4 as E,S4 as F,yf as G,Yv as H,Rt as I,vu as J,i4 as K,Gv as L,rT as M,dh as N,YE as O,tr as P,FI as Q,Ft as R,y4 as S,E4 as T,Kv as U,P1 as V,Xv as W,Jb as X,at as Y,ms as Z,YR as _,T4 as a,l4 as a0,c4 as a1,sv as a2,za as a3,u4 as a4,ps as a5,In as a6,Si as a7,GR as a8,la as a9,s1 as aA,l1 as aB,u1 as aC,d1 as aD,f1 as aE,p1 as aF,h1 as aG,c1 as aH,Xg as aI,O4 as aJ,v4 as aK,D4 as aL,P4 as aM,L4 as aN,B4 as aO,o4 as aa,a4 as ab,mr as ac,KR as ad,h4 as ae,d4 as af,f4 as ag,s4 as ah,Jv as ai,Qv as aj,R4 as ak,C4 as al,w4 as am,M4 as an,Cm as ao,pv as ap,Tv as aq,Md as ar,Nt as as,WE as at,g4 as au,H4 as av,p4 as aw,Zb as ax,Ev as ay,wm as az,hv as b,Wf as c,km as d,e4 as e,U1 as f,Gn as g,k4 as h,I4 as i,b4 as j,N4 as k,Wa as l,er as m,df as n,Yd as o,dn as p,ig as q,F4 as r,Um as s,Zv as t,x4 as u,Kd as v,L1 as w,A1 as x,S1 as y,_4 as z};
172
+ ${m} ${h}`:`${d} ${u}`,className:at(re.spanNodeEvent,N,s&&re.boundaryMarker,n.isHighlighted?re.colorHighlight:Xl(n),n.isHighlighted===!1&&re.unlit),"data-hovered":t.isHovered,ref:o,style:{left:E,top:k},children:[g.jsx("div",{className:at(re.hoverInfo,_?re.alignStart:re.alignEnd),children:s?g.jsxs(g.Fragment,{children:[g.jsx("span",{className:re.eventName,children:d}),g.jsx("span",{className:re.eventTimestamp,children:u}),h?g.jsxs(g.Fragment,{children:[g.jsx("span",{className:re.eventName,children:m}),g.jsx("span",{className:re.eventTimestamp,children:h})]}):null]}):g.jsxs(g.Fragment,{children:[g.jsx("span",{className:re.eventName,children:l}),g.jsx("span",{className:re.eventTimestamp,children:u})]})}),s?g.jsx("div",{className:re.boundaryLine}):g.jsx("div",{className:re.eventDiamond})]})}),xm={"gray-700":"var(--ds-gray-700)","gray-900":"var(--ds-gray-900)"};function $L({size:e=16,color:t="gray-700"}){const n={color:xm[t]||t};return g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",style:n,"aria-hidden":!0,children:[g.jsx("title",{children:"Cross"}),g.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function VL({size:e=16}){return g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,className:re.detailHeadingIcon,children:[g.jsx("title",{children:"Chevron Down"}),g.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function WL({size:e=16,color:t="gray-900"}){const n={color:xm[t]||t};return g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",style:n,"aria-hidden":!0,children:[g.jsx("title",{children:"External Small"}),g.jsx("path",{d:"M14 4h6m0 0v6m0-6L10 14",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("path",{d:"M20 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function YL(e){const{as:t,className:n,href:r,children:i,...a}=e;return(t||"a")==="span"||!r?g.jsx("span",{className:n,...a,children:i}):g.jsx("a",{className:n,href:r,...a,children:i})}function qL(e){const{className:t,children:n,size:r,...i}=e;return g.jsx("a",{...i,className:at(re.buttonLink,t),children:n})}function GL({children:e,className:t}){return g.jsx("div",{className:at(re.note,t),children:e})}function xd({width:e,height:t,rounded:n}){return g.jsx("span",{className:at(re.skeleton,n&&re.skeletonRounded),style:{width:e,height:t},"aria-hidden":!0})}const _d=e=>`${(100*e).toFixed(3)}%`,kd=(e,t)=>e<t?-1:e>t?1:0,Ad=e=>{const t={};for(const[r,i]of Object.entries(e)){const a=r.indexOf(".");let s="",o="";a!==-1?(s=r.substring(0,a),o=r.substring(a+1)):o=r;let l=t[s];l||(l={prefix:s,attributes:[]},t[s]=l),l.attributes.push({key:r,suffix:o,value:String(i)})}const n=Array.from(Object.values(t)).sort((r,i)=>kd(r.prefix,i.prefix));for(const r of n)r.attributes.sort((i,a)=>kd(i.suffix,a.suffix));return n},KL=(e,t)=>{const n=[];if(!t)return n;for(let r=t;"parent"in r;r=r.parent)n.unshift(r);return n},XL=()=>{var d;const{state:{root:e,selected:t,resourceMap:n,getQuickLinks:r},dispatch:i}=ms(),a=b.useMemo(()=>KL(e,t),[e,t]),s=b.useMemo(()=>Ad((t==null?void 0:t.span.attributes)??{}),[t]),o=b.useMemo(()=>{const c=t==null?void 0:t.span.resource;if(!c)return[];const p=n[c];return p?Ad(p):[]},[n,t]);if(!t)return null;const{span:l}=t,u=_m(t);return g.jsxs(g.Fragment,{children:[t.isVercel?g.jsx(ev,{node:t}):null,t.isInstrumentationHint?g.jsx(iv,{}):null,!t.isInstrumentationHint&&a.length?g.jsx(Sn,{className:re.ancestorGroup,name:"Location",children:a.map(c=>g.jsxs("button",{className:re.ancestorNode,onClick:()=>i({type:"select",id:c.span.spanId}),type:"button",children:[g.jsxs("div",{className:re.ancestorText,children:[g.jsx("span",{className:re.ancestorName,children:c.label||c.span.name}),g.jsx("span",{className:re.ancestorDuration,children:Rt(c.duration)})]}),g.jsx("span",{"aria-hidden":!0,className:re.ancestorLineContainer,children:g.jsx("span",{className:at(re.ancestorLine,Xl(c)),style:{left:_d((c.startTime-e.startTime)/e.duration),width:_d(c.duration/e.duration)}})})]},`${t.span.spanId}.${c.span.spanId}`))}):null,u?g.jsx(tv,{getQuickLinks:r,span:t.span}):null,(d=t.events)!=null&&d.length?g.jsx(Sn,{name:"Events",children:t.events.map(c=>g.jsxs(b.Fragment,{children:[g.jsxs("dl",{className:re.spanDetailPanelAttribute,children:[g.jsx("dt",{className:re.spanDetailPanelAttributeKey,children:c.event.name}),g.jsx("dd",{className:re.spanDetailPanelAttributeValue,children:Rt(c.timestamp-e.startTime)})]}),Object.entries(c.event.attributes).map(([p,h])=>g.jsx(Yr,{name:`${c.event.name}.${p}`,value:h},p))]},c.key))}):null,s.length?g.jsx(Sn,{name:"Attributes",children:s.map(c=>g.jsx(b.Fragment,{children:c.attributes.map(({key:p,value:h})=>g.jsx(Yr,{name:p,value:h},p))},c.prefix))}):null,o.length?g.jsx(Sn,{name:"Resource",children:o.map(c=>g.jsx(b.Fragment,{children:c.attributes.map(({key:p,value:h})=>g.jsx(Yr,{name:p,value:h},p))},c.prefix))}):null,t.isInstrumentationHint?null:g.jsxs(Sn,{name:"Library",children:[g.jsx(Yr,{name:"name",value:l.library.name}),l.library.version?g.jsx(Yr,{name:"version",value:l.library.version}):null]})]})};function f4({attached:e=!1}){const{state:{selected:t,isMobile:n},dispatch:r}=ms(),i=QR();if(!t)return null;const{span:a}=t;return g.jsxs("div",{className:at(re.spanDetailPanel,n&&re.mobile),children:[e&&!n?g.jsx(av,{}):null,g.jsx("div",{className:re.spanDetailPanelTop,children:g.jsxs("div",{className:re.spanDetailPanelTopInfo,children:[g.jsx("span",{className:re.spanDetailPanelName,title:a.name,children:a.name}),g.jsxs("div",{className:re.spanDetailPanelCorner,children:[t.isInstrumentationHint?null:g.jsx("span",{className:re.spanDetailPanelDuration,children:Rt(t.duration)}),g.jsx("div",{className:re.spanDetailPanelCloseVerticalRule}),g.jsx("button",{"aria-label":"Close Span Details",className:re.spanDetailPanelClose,onClick:()=>r({type:"deselect"}),type:"button",children:g.jsx($L,{color:"gray-700",size:20})})]})]})}),g.jsx("div",{className:at("flex gap-3",re.spanDetailPanelBody),children:i||g.jsx(XL,{})})]})}const wd="vc-trace-span-exp:";function Sn({name:e,className:t="",children:n}){const[r,i]=b.useState(()=>"localStorage"in globalThis?localStorage.getItem(`${wd}${e}`)!=="0":!0),a=b.useCallback(()=>{i(s=>{const o=!s;return localStorage.setItem(`${wd}${e}`,String(Number(o))),o})},[e]);return g.jsxs("div",{className:at(re.detailGroup,r?re.expanded:re.collapsed,t),children:[g.jsxs("button",{className:re.detailHeading,onClick:a,type:"button",children:[g.jsx("span",{children:e}),g.jsx(VL,{})]}),r?n:null]})}const QL=new Set(["OPTIONS","HEAD","GET","PUT","POST","DELETE"]),JL={"Resolve Deployment":"How long it took Vercel's routing layer to retrieve details for the deployment.","Resolve Cache":"How long it took Vercel's routing layer to check for a cached function invocation.","Resolve Route":"How long it took Vercel's routing layer to resolve routing rules, including redirects and rewrites.","Invoke Middleware":"How long it took this middleware to start and run user code.","Invoke Function":"How long it took this Vercel Function to start and run user code.",waitUntil:"How long it took to run user code inside of waitUntil.","Start VM":"How long it took to start the Virtual Machine which contains the Vercel Function.","Spawn Node.js":"How long it took the Virtual Machine to start the Node.js runtime.","Spawn Python":"How long it took the Virtual Machine to start the Python runtime.","Init User Code":"How long it took to import the user code and run any globally-scoped code."},Cd=new Set(["Start VM","Spawn Node.js","Spawn Python","Init User Code"]),Sd=e=>{if(!e||!("span"in e))return null;const t=e.span.attributes,n=t["vercel.region"]||t["vercel.function.region"];return n?String(n):null},ZL=e=>{const{name:t}=e.span,n=Sd(e),r=Sd(e.parent);return e.span.attributes["vercel.middleware.internal"]==="true"?"The Vercel Toolbar created this middleware.":Cd.has(t)||t==="Invoke Function"&&e.children.some(i=>Cd.has(i.span.name))?"This function encountered a cold start.":n&&r&&n!==r?"This request was routed across regions.":null},_m=e=>{if(!e.isVercel)return!1;const{name:t}=e.span,n=t.indexOf(" ");if(n===-1)return!1;const r=t.substring(0,n);return QL.has(r)};function ev({node:e}){const{name:t}=e.span;let n=JL[t];if(!n&&_m(e)&&(n="How long it took for Vercel to process the request and send the response."),!n)return null;const r=ZL(e);return g.jsx(Sn,{name:"What is this?",children:g.jsxs("div",{className:re.infraSpanDescription,children:[g.jsx("span",{children:n}),r&&g.jsx(GL,{children:r})]})})}const tv=b.memo(function({getQuickLinks:t,span:n}){const r=t(n);return r.length?g.jsx(Sn,{name:"Links",children:r.map(({key:i,value:a})=>g.jsx(rv,{link:a,name:i},i))}):null});function nv(e){const[t,n]=b.useState({}),r=e.__resolvedValue!==void 0||e.__rejectedValue!==void 0;return b.useEffect(()=>{r||e.then(i=>{e.__resolvedValue=i}).catch(i=>{e.__rejectedValue=i}).finally(()=>n({}))},[e,r]),e.__resolvedValue}function rv({name:e,link:t}){const n=nv(t);return g.jsxs(YL,{as:n?void 0:"span",className:at(re.spanDetailPanelAttribute,re.spanDetailPanelQuickLink),href:(n==null?void 0:n.href)||"",children:[g.jsx("span",{className:re.spanDetailPanelAttributeKey,children:e}),g.jsx("span",{className:at(re.spanDetailPanelAttributeValue,re.spanDetailPanelQuickLinkLabel),children:n?g.jsxs(g.Fragment,{children:[n.label,n.icon||g.jsx(WL,{color:"gray-900"})]}):g.jsxs(g.Fragment,{children:[g.jsx(xd,{height:18,width:32+e.length*8}),g.jsx(xd,{height:18,rounded:!0,width:18})]})})]})}function iv(){return g.jsx(Sn,{name:"What is this?",children:g.jsxs("div",{className:re.infraSpanDescription,children:[g.jsx("span",{children:"You can visualize your application's spans alongside Vercel's spans in this viewer."}),g.jsx(qL,{href:"https://vercel.com/docs/session-tracing#adding-custom-spans",size:"small",target:"_blank",children:"Get Started"})]})})}function Yr({name:e,value:t}){return g.jsxs("dl",{className:re.spanDetailPanelAttribute,children:[g.jsx("dt",{className:re.spanDetailPanelAttributeKey,children:e}),g.jsx("dd",{className:re.spanDetailPanelAttributeValue,title:String(t),children:String(t)})]})}function av(){const{state:{panelWidth:e},dispatch:t}=ms(),n=b.useRef({start:{x:0,width:e},x:0,width:e,isHeld:!1});n.current.width=e;const r=b.useCallback(a=>{if(a.pointerType!=="mouse")return;a.preventDefault();const s=n.current;s.start.x=a.clientX,s.x=a.clientX,s.start.width=s.width,s.isHeld=!0},[]),i=b.useCallback(()=>{t({type:"setPanelWidth",width:Gl.panelWidth})},[t]);return b.useEffect(()=>{let a=0;const s=()=>{const u=n.current,d=u.start.width+u.start.x-u.x;t({type:"setPanelWidth",width:d})},o=u=>{n.current.isHeld&&(u.preventDefault(),n.current.x=u.clientX,cancelAnimationFrame(a),a=requestAnimationFrame(s))},l=()=>{n.current.isHeld=!1};return window.addEventListener("pointermove",o),window.addEventListener("pointerup",l),()=>{window.removeEventListener("pointermove",o),window.removeEventListener("pointerup",l)}},[t]),g.jsx("div",{"aria-hidden":!0,className:re.spanDetailPanelResizer,onDoubleClick:i,onPointerDown:r})}function sv(e){const t=b.useRef({});return{setStyle:b.useCallback((r,i)=>{if(t.current[r]=i,!!e.current){if(!i){e.current.style.removeProperty(r);return}e.current.style.setProperty(r,i)}},[e]),styleRef:t,style:{...t.current}}}const ov=()=>"devicePixelRatio"in globalThis&&globalThis.devicePixelRatio||1,lv=()=>{const[e,t]=b.useState(1);return b.useLayoutEffect(()=>{const n=()=>t(ov()),r=matchMedia(`(resolution: ${e}dppx)`);return r.addEventListener("change",n),n(),()=>{r.removeEventListener("change",n)}},[e]),e},qr=za,h4=b.memo(function({timelineRef:t,rows:n,scale:r}){const{state:{root:i,baseScale:a,timelineWidth:s,width:o,scrollbarWidth:l}}=ms(),u=o+za*2,d=lv(),c=b.useRef(null),p=b.useRef(null),h=o/(o-l)*Math.min(o/s,a/r),m=Math.min(o,(s-l)*h);b.useEffect(()=>{let N=!1,C=0,F;const H=x=>{var L;return!!((L=c.current)!=null&&L.contains(x))};let I=0;const V=()=>{if(!N||!F)return;const x=t.current;if(!x)return;const L=C-m*.5-F.left;x.scrollLeft=L/h},U=x=>{({clientX:C}=x),cancelAnimationFrame(I),I=requestAnimationFrame(V)},Q=x=>{var L;H(x.target)&&(N=!0,F=(L=c.current)==null?void 0:L.getBoundingClientRect(),U(x))},O=()=>{N=!1,F=void 0},K=x=>{H(x.target)&&x.cancelable&&x.preventDefault()},z=x=>{N&&x.cancelable&&x.preventDefault()};return window.addEventListener("pointerdown",Q),window.addEventListener("pointermove",U),window.addEventListener("pointerup",O),window.addEventListener("blur",O),window.addEventListener("touchstart",K,{passive:!1}),window.addEventListener("touchmove",z,{passive:!1}),()=>{window.removeEventListener("pointerdown",Q),window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",O),window.removeEventListener("blur",O),window.removeEventListener("touchstart",K),window.removeEventListener("touchmove",z),cancelAnimationFrame(I)}},[t,h,m]),b.useEffect(()=>{const N=p.current,C=N==null?void 0:N.getContext("2d");if(!N||!C)return;const H=requestAnimationFrame(()=>{C.resetTransform(),C.clearRect(0,0,N.width,N.height),C.scale(d,d);const I=1,V=3,U=(u-qr*2)/i.duration;C.fillStyle="#ccc",C.beginPath();for(const Q of n)for(const O of Q){const K=qr-I+(I+V)*O.row;if(K>=mr-V-qr)break;const z=qr+(O.startTime-i.startTime)*U,x=O.duration*U;C.roundRect(z,K,x,V,V)}C.fill()});return()=>cancelAnimationFrame(H)},[d,i,u,n]);const E=b.useRef(null),{style:k,setStyle:_}=sv(E);return b.useLayoutEffect(()=>{const N=t.current;if(!N)return;let C=0;const F=()=>{_("transform",`translateX(${qr+N.scrollLeft*h}px)`)};F();const H=()=>{cancelAnimationFrame(C),C=requestAnimationFrame(F)};return N.addEventListener("scroll",H),()=>{cancelAnimationFrame(C),N.removeEventListener("scroll",H)}},[t,h,_]),g.jsxs("div",{className:re.mapContainer,ref:c,style:{width:m>0?u:"100%",height:mr},children:[g.jsx("canvas",{className:re.mapCanvas,height:mr*d,ref:p,style:{width:u,height:mr},width:u*d}),g.jsx("div",{className:re.mapThumb,ref:E,style:{transform:k.transform,width:m>0?m:`calc(100% - ${za*2}px)`,top:2,height:mr-4}})]})});function uv(e){try{const t=JSON.parse(e);return typeof t=="string"?t:JSON.stringify(t,null,2)}catch{return e}}function cv(e){try{return JSON.parse(e)}catch{return e}}const dv=j.memo(function({chunk:t,index:n}){const r=cv(t.text);return g.jsxs("div",{className:"text-[11px] rounded-md border p-3",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)"},children:[g.jsxs("span",{className:"select-none mr-2",style:{color:"var(--ds-gray-500)"},children:["[",n,"]"]}),typeof r=="string"?g.jsx("span",{className:"whitespace-pre-wrap break-words",style:{color:"var(--ds-gray-1000)"},children:uv(r)}):g.jsx(rT,{data:r,expandLevel:1})]})});function fv(){return g.jsxs("div",{className:"flex flex-col gap-3 animate-in fade-in",children:[g.jsx(vu,{style:{width:120,height:16,borderRadius:4}}),[1,2,3,4].map(e=>g.jsx(vu,{style:{height:56,borderRadius:6}},e))]})}function p4({streamId:e,chunks:t,isLive:n,error:r,isLoading:i}){const[a,s]=b.useState(!1),o=b.useRef(null),l=b.useCallback(()=>{if(o.current){const{scrollTop:u,scrollHeight:d,clientHeight:c}=o.current,p=d-u-c<10;s(!p&&d>c)}},[]);return b.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight),l()},[t.length,l]),i&&t.length===0?g.jsx("div",{className:"flex flex-col h-full pb-4",children:g.jsx(fv,{})}):g.jsxs("div",{className:"flex flex-col h-full pb-4",children:[n&&g.jsxs("div",{className:"flex items-center gap-1.5 mb-3 px-1",children:[g.jsx("span",{className:"inline-block w-2 h-2 rounded-full",style:{backgroundColor:"var(--ds-green-600)"}}),g.jsx("span",{className:"text-xs",style:{color:"var(--ds-green-700)"},children:"Live"})]}),t.length>0&&g.jsxs("div",{className:"flex items-center gap-2 mb-2 px-1",children:[g.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--ds-gray-900)"},children:"Stream Chunks"}),g.jsxs("span",{className:"text-xs tabular-nums",style:{color:"var(--ds-gray-600)"},children:["(",t.length,")"]})]}),g.jsxs("div",{className:"relative flex-1 min-h-[200px]",children:[g.jsx("div",{ref:o,onScroll:l,className:"absolute inset-0 overflow-auto flex flex-col gap-2",children:r?g.jsxs("div",{className:"text-[11px] rounded-md border p-3",style:{borderColor:"var(--ds-red-300)",backgroundColor:"var(--ds-red-100)",color:"var(--ds-red-700)"},children:[g.jsx("div",{children:"Error reading stream:"}),g.jsx("div",{children:r})]}):t.length===0?g.jsx("div",{className:"text-[11px] rounded-md border p-3",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)",color:"var(--ds-gray-600)"},children:n?"Waiting for stream data...":"Stream is empty"}):t.map((u,d)=>g.jsx(dv,{chunk:u,index:d},`${e}-chunk-${u.id}`))}),a&&g.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-8 pointer-events-none",style:{background:"linear-gradient(to top, var(--ds-background-100), transparent)"}})]})]})}const m4=10;function km(...e){return sl(at(e))}const g4=5e3;function b4(e,t,n){return n?`Page ${e} of ${t}+`:`Page ${e} of ${t}`}const E4=tb,T4=nb,hv=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(Nf,{ref:r,sideOffset:t,className:km("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));hv.displayName=Nf.displayName;const Am=b.createContext(null);function y4({children:e,serverConfig:t}){const n={serverConfig:t};return g.jsx(Am.Provider,{value:n,children:e})}function x4(){const e=b.useContext(Am);if(!e)throw new Error("useServerConfig must be used within a ServerConfigProvider");return e}function Nd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wm(...e){return t=>{let n=!1;const r=e.map(i=>{const a=Nd(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():Nd(e[i],null)}}}}function _4(...e){return b.useCallback(wm(...e),e)}var Cm=b.forwardRef((e,t)=>{const{children:n,...r}=e,i=b.Children.toArray(n),a=i.find(mv);if(a){const s=a.props.children,o=i.map(l=>l===a?b.Children.count(s)>1?b.Children.only(null):b.isValidElement(s)?s.props.children:null:l);return g.jsx(Ho,{...r,ref:t,children:b.isValidElement(s)?b.cloneElement(s,void 0,o):null})}return g.jsx(Ho,{...r,ref:t,children:n})});Cm.displayName="Slot";var Ho=b.forwardRef((e,t)=>{const{children:n,...r}=e;if(b.isValidElement(n)){const i=bv(n);return b.cloneElement(n,{...gv(r,n.props),ref:t?wm(t,i):i})}return b.Children.count(n)>1?b.Children.only(null):null});Ho.displayName="SlotClone";var pv=({children:e})=>g.jsx(g.Fragment,{children:e});function mv(e){return b.isValidElement(e)&&e.type===pv}function gv(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...o)=>{a(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function bv(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Id=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Rd=at,Ev=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Rd(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,s=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],c=a==null?void 0:a[u];if(d===null)return null;const p=Id(d)||Id(c);return i[u][p]}),o=n&&Object.entries(n).reduce((u,d)=>{let[c,p]=d;return p===void 0||(u[c]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:p,...h}=d;return Object.entries(h).every(m=>{let[E,k]=m;return Array.isArray(k)?k.includes({...a,...o}[E]):{...a,...o}[E]===k})?[...u,c,p]:u},[]);return Rd(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Tv=Ev("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),yv=b.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const s=r?Cm:"button";return g.jsx(s,{className:km(Tv({variant:t,size:n,className:e})),ref:a,...i})});yv.displayName="Button";let Uo;try{Uo=new TextDecoder}catch{}let se,qn,Y=0;const xv=105,_v=57342,kv=57343,Od=57337,Ld=6,fr={};let Gr=11281e4,un=1681e4,_e={},Pe,$a,Va=0,Ni=0,We,Mt,ze=[],jo=[],bt,ut,ti,vd={useRecords:!1,mapsAsObjects:!0},Ii=!1,Sm=2;try{new Function("")}catch{Sm=1/0}class Ri{constructor(t){if(t&&((t.keyMap||t._keyMap)&&!t.useRecords&&(t.useRecords=!1,t.mapsAsObjects=!0),t.useRecords===!1&&t.mapsAsObjects===void 0&&(t.mapsAsObjects=!0),t.getStructures&&(t.getShared=t.getStructures),t.getShared&&!t.structures&&((t.structures=[]).uninitialized=!0),t.keyMap)){this.mapKey=new Map;for(let[n,r]of Object.entries(t.keyMap))this.mapKey.set(r,n)}Object.assign(this,t)}decodeKey(t){return this.keyMap&&this.mapKey.get(t)||t}encodeKey(t){return this.keyMap&&this.keyMap.hasOwnProperty(t)?this.keyMap[t]:t}encodeKeys(t){if(!this._keyMap)return t;let n=new Map;for(let[r,i]of Object.entries(t))n.set(this._keyMap.hasOwnProperty(r)?this._keyMap[r]:r,i);return n}decodeKeys(t){if(!this._keyMap||t.constructor.name!="Map")return t;if(!this._mapKey){this._mapKey=new Map;for(let[r,i]of Object.entries(this._keyMap))this._mapKey.set(i,r)}let n={};return t.forEach((r,i)=>n[Bt(this._mapKey.has(i)?this._mapKey.get(i):i)]=r),n}mapDecode(t,n){let r=this.decode(t);if(this._keyMap)switch(r.constructor.name){case"Array":return r.map(i=>this.decodeKeys(i))}return r}decode(t,n){if(se)return Om(()=>(Wo(),this?this.decode(t,n):Ri.prototype.decode.call(vd,t,n)));qn=n>-1?n:t.length,Y=0,Ni=0,$a=null,We=null,se=t;try{ut=t.dataView||(t.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength))}catch(r){throw se=null,t instanceof Uint8Array?r:new Error("Source must be a Uint8Array or Buffer but was a "+(t&&typeof t=="object"?t.constructor.name:typeof t))}if(this instanceof Ri){if(_e=this,bt=this.sharedValues&&(this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this.structures)return Pe=this.structures,ca();(!Pe||Pe.length>0)&&(Pe=[])}else _e=vd,(!Pe||Pe.length>0)&&(Pe=[]),bt=null;return ca()}decodeMultiple(t,n){let r,i=0;try{let a=t.length;Ii=!0;let s=this?this.decode(t,a):Zl.decode(t,a);if(n){if(n(s)===!1)return;for(;Y<a;)if(i=Y,n(ca())===!1)return}else{for(r=[s];Y<a;)i=Y,r.push(ca());return r}}catch(a){throw a.lastPosition=i,a.values=r,a}finally{Ii=!1,Wo()}}}function ca(){try{let e=Ae();if(We){if(Y>=We.postBundlePosition){let t=new Error("Unexpected bundle position");throw t.incomplete=!0,t}Y=We.postBundlePosition,We=null}if(Y==qn)Pe=null,se=null,Mt&&(Mt=null);else if(Y>qn){let t=new Error("Unexpected end of CBOR data");throw t.incomplete=!0,t}else if(!Ii)throw new Error("Data read, but end of buffer not reached");return e}catch(e){throw Wo(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer"))&&(e.incomplete=!0),e}}function Ae(){let e=se[Y++],t=e>>5;if(e=e&31,e>23)switch(e){case 24:e=se[Y++];break;case 25:if(t==7)return Sv();e=ut.getUint16(Y),Y+=2;break;case 26:if(t==7){let n=ut.getFloat32(Y);if(_e.useFloat32>2){let r=Jl[(se[Y]&127)<<1|se[Y+1]>>7];return Y+=4,(r*n+(n>0?.5:-.5)>>0)/r}return Y+=4,n}e=ut.getUint32(Y),Y+=4;break;case 27:if(t==7){let n=ut.getFloat64(Y);return Y+=8,n}if(t>1){if(ut.getUint32(Y)>0)throw new Error("JavaScript does not support arrays, maps, or strings with length over 4294967295");e=ut.getUint32(Y+4)}else _e.int64AsNumber?(e=ut.getUint32(Y)*4294967296,e+=ut.getUint32(Y+4)):e=ut.getBigUint64(Y);Y+=8;break;case 31:switch(t){case 2:case 3:throw new Error("Indefinite length not supported for byte or text strings");case 4:let n=[],r,i=0;for(;(r=Ae())!=fr;){if(i>=Gr)throw new Error(`Array length exceeds ${Gr}`);n[i++]=r}return t==4?n:t==3?n.join(""):Buffer.concat(n);case 5:let a;if(_e.mapsAsObjects){let s={},o=0;if(_e.keyMap)for(;(a=Ae())!=fr;){if(o++>=un)throw new Error(`Property count exceeds ${un}`);s[Bt(_e.decodeKey(a))]=Ae()}else for(;(a=Ae())!=fr;){if(o++>=un)throw new Error(`Property count exceeds ${un}`);s[Bt(a)]=Ae()}return s}else{ti&&(_e.mapsAsObjects=!0,ti=!1);let s=new Map;if(_e.keyMap){let o=0;for(;(a=Ae())!=fr;){if(o++>=un)throw new Error(`Map size exceeds ${un}`);s.set(_e.decodeKey(a),Ae())}}else{let o=0;for(;(a=Ae())!=fr;){if(o++>=un)throw new Error(`Map size exceeds ${un}`);s.set(a,Ae())}}return s}case 7:return fr;default:throw new Error("Invalid major type for indefinite length "+t)}default:throw new Error("Unknown token "+e)}switch(t){case 0:return e;case 1:return~e;case 2:return Cv(e);case 3:if(Ni>=Y)return $a.slice(Y-Va,(Y+=e)-Va);if(Ni==0&&qn<140&&e<32){let i=e<16?Nm(e):wv(e);if(i!=null)return i}return Av(e);case 4:if(e>=Gr)throw new Error(`Array length exceeds ${Gr}`);let n=new Array(e);for(let i=0;i<e;i++)n[i]=Ae();return n;case 5:if(e>=un)throw new Error(`Map size exceeds ${Gr}`);if(_e.mapsAsObjects){let i={};if(_e.keyMap)for(let a=0;a<e;a++)i[Bt(_e.decodeKey(Ae()))]=Ae();else for(let a=0;a<e;a++)i[Bt(Ae())]=Ae();return i}else{ti&&(_e.mapsAsObjects=!0,ti=!1);let i=new Map;if(_e.keyMap)for(let a=0;a<e;a++)i.set(_e.decodeKey(Ae()),Ae());else for(let a=0;a<e;a++)i.set(Ae(),Ae());return i}case 6:if(e>=Od){let i=Pe[e&8191];if(i)return i.read||(i.read=zo(i)),i.read();if(e<65536){if(e==kv){let a=Er(),s=Ae(),o=Ae();Vo(s,o);let l={};if(_e.keyMap)for(let u=2;u<a;u++){let d=_e.decodeKey(o[u-2]);l[Bt(d)]=Ae()}else for(let u=2;u<a;u++){let d=o[u-2];l[Bt(d)]=Ae()}return l}else if(e==_v){let a=Er(),s=Ae();for(let o=2;o<a;o++)Vo(s++,Ae());return Ae()}else if(e==Od)return vv();if(_e.getShared&&(Ql(),i=Pe[e&8191],i))return i.read||(i.read=zo(i)),i.read()}}let r=ze[e];if(r)return r.handlesRead?r(Ae):r(Ae());{let i=Ae();for(let a=0;a<jo.length;a++){let s=jo[a](e,i);if(s!==void 0)return s}return new Zn(i,e)}case 7:switch(e){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;case 31:default:let i=(bt||zn())[e];if(i!==void 0)return i;throw new Error("Unknown token "+e)}default:if(isNaN(e)){let i=new Error("Unexpected end of CBOR data");throw i.incomplete=!0,i}throw new Error("Unknown CBOR token "+e)}}const Dd=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function zo(e){if(!e)throw new Error("Structure is required in record definition");function t(){let n=se[Y++];if(n=n&31,n>23)switch(n){case 24:n=se[Y++];break;case 25:n=ut.getUint16(Y),Y+=2;break;case 26:n=ut.getUint32(Y),Y+=4;break;default:throw new Error("Expected array header, but got "+se[Y-1])}let r=this.compiledReader;for(;r;){if(r.propertyCount===n)return r(Ae);r=r.next}if(this.slowReads++>=Sm){let a=this.length==n?this:this.slice(0,n);return r=_e.keyMap?new Function("r","return {"+a.map(s=>_e.decodeKey(s)).map(s=>Dd.test(s)?Bt(s)+":r()":"["+JSON.stringify(s)+"]:r()").join(",")+"}"):new Function("r","return {"+a.map(s=>Dd.test(s)?Bt(s)+":r()":"["+JSON.stringify(s)+"]:r()").join(",")+"}"),this.compiledReader&&(r.next=this.compiledReader),r.propertyCount=n,this.compiledReader=r,r(Ae)}let i={};if(_e.keyMap)for(let a=0;a<n;a++)i[Bt(_e.decodeKey(this[a]))]=Ae();else for(let a=0;a<n;a++)i[Bt(this[a])]=Ae();return i}return e.slowReads=0,t}function Bt(e){if(typeof e=="string")return e==="__proto__"?"__proto_":e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return e.toString();if(e==null)return e+"";throw new Error("Invalid property name type "+typeof e)}let Av=$o;function $o(e){let t;if(e<16&&(t=Nm(e)))return t;if(e>64&&Uo)return Uo.decode(se.subarray(Y,Y+=e));const n=Y+e,r=[];for(t="";Y<n;){const i=se[Y++];if((i&128)===0)r.push(i);else if((i&224)===192){const a=se[Y++]&63;r.push((i&31)<<6|a)}else if((i&240)===224){const a=se[Y++]&63,s=se[Y++]&63;r.push((i&31)<<12|a<<6|s)}else if((i&248)===240){const a=se[Y++]&63,s=se[Y++]&63,o=se[Y++]&63;let l=(i&7)<<18|a<<12|s<<6|o;l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|l&1023),r.push(l)}else r.push(i);r.length>=4096&&(t+=Ge.apply(String,r),r.length=0)}return r.length>0&&(t+=Ge.apply(String,r)),t}let Ge=String.fromCharCode;function wv(e){let t=Y,n=new Array(e);for(let r=0;r<e;r++){const i=se[Y++];if((i&128)>0){Y=t;return}n[r]=i}return Ge.apply(String,n)}function Nm(e){if(e<4)if(e<2){if(e===0)return"";{let t=se[Y++];if((t&128)>1){Y-=1;return}return Ge(t)}}else{let t=se[Y++],n=se[Y++];if((t&128)>0||(n&128)>0){Y-=2;return}if(e<3)return Ge(t,n);let r=se[Y++];if((r&128)>0){Y-=3;return}return Ge(t,n,r)}else{let t=se[Y++],n=se[Y++],r=se[Y++],i=se[Y++];if((t&128)>0||(n&128)>0||(r&128)>0||(i&128)>0){Y-=4;return}if(e<6){if(e===4)return Ge(t,n,r,i);{let a=se[Y++];if((a&128)>0){Y-=5;return}return Ge(t,n,r,i,a)}}else if(e<8){let a=se[Y++],s=se[Y++];if((a&128)>0||(s&128)>0){Y-=6;return}if(e<7)return Ge(t,n,r,i,a,s);let o=se[Y++];if((o&128)>0){Y-=7;return}return Ge(t,n,r,i,a,s,o)}else{let a=se[Y++],s=se[Y++],o=se[Y++],l=se[Y++];if((a&128)>0||(s&128)>0||(o&128)>0||(l&128)>0){Y-=8;return}if(e<10){if(e===8)return Ge(t,n,r,i,a,s,o,l);{let u=se[Y++];if((u&128)>0){Y-=9;return}return Ge(t,n,r,i,a,s,o,l,u)}}else if(e<12){let u=se[Y++],d=se[Y++];if((u&128)>0||(d&128)>0){Y-=10;return}if(e<11)return Ge(t,n,r,i,a,s,o,l,u,d);let c=se[Y++];if((c&128)>0){Y-=11;return}return Ge(t,n,r,i,a,s,o,l,u,d,c)}else{let u=se[Y++],d=se[Y++],c=se[Y++],p=se[Y++];if((u&128)>0||(d&128)>0||(c&128)>0||(p&128)>0){Y-=12;return}if(e<14){if(e===12)return Ge(t,n,r,i,a,s,o,l,u,d,c,p);{let h=se[Y++];if((h&128)>0){Y-=13;return}return Ge(t,n,r,i,a,s,o,l,u,d,c,p,h)}}else{let h=se[Y++],m=se[Y++];if((h&128)>0||(m&128)>0){Y-=14;return}if(e<15)return Ge(t,n,r,i,a,s,o,l,u,d,c,p,h,m);let E=se[Y++];if((E&128)>0){Y-=15;return}return Ge(t,n,r,i,a,s,o,l,u,d,c,p,h,m,E)}}}}}function Cv(e){return _e.copyBuffers?Uint8Array.prototype.slice.call(se,Y,Y+=e):se.subarray(Y,Y+=e)}let Im=new Float32Array(1),da=new Uint8Array(Im.buffer,0,4);function Sv(){let e=se[Y++],t=se[Y++],n=(e&127)>>2;if(n===31)return t||e&3?NaN:e&128?-1/0:1/0;if(n===0){let r=((e&3)<<8|t)/16777216;return e&128?-r:r}return da[3]=e&128|(n>>1)+56,da[2]=(e&7)<<5|t>>3,da[1]=t<<5,da[0]=0,Im[0]}new Array(4096);class Zn{constructor(t,n){this.value=t,this.tag=n}}ze[0]=e=>new Date(e);ze[1]=e=>new Date(Math.round(e*1e3));ze[2]=e=>{let t=BigInt(0);for(let n=0,r=e.byteLength;n<r;n++)t=BigInt(e[n])+(t<<BigInt(8));return t};ze[3]=e=>BigInt(-1)-ze[2](e);ze[4]=e=>+(e[1]+"e"+e[0]);ze[5]=e=>e[1]*Math.exp(e[0]*Math.log(2));const Vo=(e,t)=>{e=e-57344;let n=Pe[e];n&&n.isShared&&((Pe.restoreStructures||(Pe.restoreStructures=[]))[e]=n),Pe[e]=t,t.read=zo(t)};ze[xv]=e=>{let t=e.length,n=e[1];Vo(e[0],n);let r={};for(let i=2;i<t;i++){let a=n[i-2];r[Bt(a)]=e[i]}return r};ze[14]=e=>We?We[0].slice(We.position0,We.position0+=e):new Zn(e,14);ze[15]=e=>We?We[1].slice(We.position1,We.position1+=e):new Zn(e,15);let Nv={Error,RegExp};ze[27]=e=>(Nv[e[0]]||Error)(e[1],e[2]);const Rm=e=>{if(se[Y++]!=132){let n=new Error("Packed values structure must be followed by a 4 element array");throw se.length<Y&&(n.incomplete=!0),n}let t=e();if(!t||!t.length){let n=new Error("Packed values structure must be followed by a 4 element array");throw n.incomplete=!0,n}return bt=bt?t.concat(bt.slice(t.length)):t,bt.prefixes=e(),bt.suffixes=e(),e()};Rm.handlesRead=!0;ze[51]=Rm;ze[Ld]=e=>{if(!bt)if(_e.getShared)Ql();else return new Zn(e,Ld);if(typeof e=="number")return bt[16+(e>=0?2*e:-2*e-1)];let t=new Error("No support for non-integer packed references yet");throw e===void 0&&(t.incomplete=!0),t};ze[28]=e=>{Mt||(Mt=new Map,Mt.id=0);let t=Mt.id++,n=Y,r=se[Y],i;r>>5==4?i=[]:i={};let a={target:i};Mt.set(t,a);let s=e();return a.used?(Object.getPrototypeOf(i)!==Object.getPrototypeOf(s)&&(Y=n,i=s,Mt.set(t,{target:i}),s=e()),Object.assign(i,s)):(a.target=s,s)};ze[28].handlesRead=!0;ze[29]=e=>{let t=Mt.get(e);return t.used=!0,t.target};ze[258]=e=>new Set(e);(ze[259]=e=>(_e.mapsAsObjects&&(_e.mapsAsObjects=!1,ti=!0),e())).handlesRead=!0;function hr(e,t){return typeof e=="string"?e+t:e instanceof Array?e.concat(t):Object.assign({},e,t)}function zn(){if(!bt)if(_e.getShared)Ql();else throw new Error("No packed values available");return bt}const Iv=1399353956;jo.push((e,t)=>{if(e>=225&&e<=255)return hr(zn().prefixes[e-224],t);if(e>=28704&&e<=32767)return hr(zn().prefixes[e-28672],t);if(e>=1879052288&&e<=2147483647)return hr(zn().prefixes[e-1879048192],t);if(e>=216&&e<=223)return hr(t,zn().suffixes[e-216]);if(e>=27647&&e<=28671)return hr(t,zn().suffixes[e-27639]);if(e>=1811940352&&e<=1879048191)return hr(t,zn().suffixes[e-1811939328]);if(e==Iv)return{packedValues:bt,structures:Pe.slice(0),version:t};if(e==55799)return t});const Rv=new Uint8Array(new Uint16Array([1]).buffer)[0]==1,Pd=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>"u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"?{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array],Ov=[64,68,69,70,71,72,77,78,79,85,86];for(let e=0;e<Pd.length;e++)Lv(Pd[e],Ov[e]);function Lv(e,t){let n="get"+e.name.slice(0,-5),r;typeof e=="function"?r=e.BYTES_PER_ELEMENT:e=null;for(let i=0;i<2;i++){if(!i&&r==1)continue;let a=r==2?1:r==4?2:r==8?3:0;ze[i?t:t-4]=r==1||i==Rv?s=>{if(!e)throw new Error("Could not find typed array for code "+t);return!_e.copyBuffers&&(r===1||r===2&&!(s.byteOffset&1)||r===4&&!(s.byteOffset&3)||r===8&&!(s.byteOffset&7))?new e(s.buffer,s.byteOffset,s.byteLength>>a):new e(Uint8Array.prototype.slice.call(s,0).buffer)}:s=>{if(!e)throw new Error("Could not find typed array for code "+t);let o=new DataView(s.buffer,s.byteOffset,s.byteLength),l=s.length>>a,u=new e(l),d=o[n];for(let c=0;c<l;c++)u[c]=d.call(o,c<<a,i);return u}}}function vv(){let e=Er(),t=Y+Ae();for(let r=2;r<e;r++){let i=Er();Y+=i}let n=Y;return Y=t,We=[$o(Er()),$o(Er())],We.position0=0,We.position1=0,We.postBundlePosition=Y,Y=n,Ae()}function Er(){let e=se[Y++]&31;if(e>23)switch(e){case 24:e=se[Y++];break;case 25:e=ut.getUint16(Y),Y+=2;break;case 26:e=ut.getUint32(Y),Y+=4;break}return e}function Ql(){if(_e.getShared){let e=Om(()=>(se=null,_e.getShared()))||{},t=e.structures||[];_e.sharedVersion=e.version,bt=_e.sharedValues=e.packedValues,Pe===!0?_e.structures=Pe=t:Pe.splice.apply(Pe,[0,t.length].concat(t))}}function Om(e){let t=qn,n=Y,r=Va,i=Ni,a=$a,s=Mt,o=We,l=new Uint8Array(se.slice(0,qn)),u=Pe,d=_e,c=Ii,p=e();return qn=t,Y=n,Va=r,Ni=i,$a=a,Mt=s,We=o,se=l,Ii=c,Pe=u,_e=d,ut=new DataView(se.buffer,se.byteOffset,se.byteLength),p}function Wo(){se=null,Mt=null,Pe=null}const Jl=new Array(147);for(let e=0;e<256;e++)Jl[e]=+("1e"+Math.floor(45.15-e*.30103));let Zl=new Ri({useRecords:!1});const Md=Zl.decode;Zl.decodeMultiple;let ka;try{ka=new TextEncoder}catch{}let Yo,Lm;const bs=typeof globalThis=="object"&&globalThis.Buffer,Vi=typeof bs<"u",Xs=Vi?bs.allocUnsafeSlow:Uint8Array,Bd=Vi?bs:Uint8Array,Fd=256,Hd=Vi?4294967296:2144337920;let Qs,B,ve,R=0,kn,Ve=null;const Dv=61440,Pv=/[\u0080-\uFFFF]/,kt=Symbol("record-id");class Mv extends Ri{constructor(t){super(t),this.offset=0;let n,r,i,a,s;t=t||{};let o=Bd.prototype.utf8Write?function(x,L,v){return B.utf8Write(x,L,v)}:ka&&ka.encodeInto?function(x,L){return ka.encodeInto(x,B.subarray(L)).written}:!1,l=this,u=t.structures||t.saveStructures,d=t.maxSharedStructures;if(d==null&&(d=u?128:0),d>8190)throw new Error("Maximum maxSharedStructure is 8190");let c=t.sequential;c&&(d=0),this.structures||(this.structures=[]),this.saveStructures&&(this.saveShared=this.saveStructures);let p,h,m=t.sharedValues,E;if(m){E=Object.create(null);for(let x=0,L=m.length;x<L;x++)E[m[x]]=x}let k=[],_=0,N=0;this.mapEncode=function(x,L){if(this._keyMap&&!this._mapped)switch(x.constructor.name){case"Array":x=x.map(v=>this.encodeKeys(v));break}return this.encode(x,L)},this.encode=function(x,L){if(B||(B=new Xs(8192),ve=new DataView(B.buffer,0,8192),R=0),kn=B.length-10,kn-R<2048?(B=new Xs(B.length),ve=new DataView(B.buffer,0,B.length),kn=B.length-10,R=0):L===zd&&(R=R+7&2147483640),n=R,l.useSelfDescribedHeader&&(ve.setUint32(R,3654940416),R+=3),s=l.structuredClone?new Map:null,l.bundleStrings&&typeof x!="string"?(Ve=[],Ve.size=1/0):Ve=null,r=l.structures,r){if(r.uninitialized){let D=l.getShared()||{};l.structures=r=D.structures||[],l.sharedVersion=D.version;let P=l.sharedValues=D.packedValues;if(P){E={};for(let q=0,J=P.length;q<J;q++)E[P[q]]=q}}let v=r.length;if(v>d&&!c&&(v=d),!r.transitions){r.transitions=Object.create(null);for(let D=0;D<v;D++){let P=r[D];if(!P)continue;let q,J=r.transitions;for(let T=0,ie=P.length;T<ie;T++){J[kt]===void 0&&(J[kt]=D);let te=P[T];q=J[te],q||(q=J[te]=Object.create(null)),J=q}J[kt]=D|1048576}}c||(r.nextId=v)}if(i&&(i=!1),a=r||[],h=E,t.pack){let v=new Map;if(v.values=[],v.encoder=l,v.maxValues=t.maxPrivatePackedValues||(E?16:1/0),v.objectMap=E||!1,v.samplingPackedValues=p,Aa(x,v),v.values.length>0){B[R++]=216,B[R++]=51,Jt(4);let D=v.values;C(D),Jt(0),Jt(0),h=Object.create(E||null);for(let P=0,q=D.length;P<q;P++)h[D[P]]=P}}Qs=L&Zs;try{if(Qs)return;if(C(x),Ve&&jd(n,C),l.offset=R,s&&s.idsToInsert){R+=s.idsToInsert.length*2,R>kn&&H(R),l.offset=R;let v=Hv(B.subarray(n,R),s.idsToInsert);return s=null,v}return L&zd?(B.start=n,B.end=R,B):B.subarray(n,R)}finally{if(r){if(N<10&&N++,r.length>d&&(r.length=d),_>1e4)r.transitions=null,N=0,_=0,k.length>0&&(k=[]);else if(k.length>0&&!c){for(let v=0,D=k.length;v<D;v++)k[v][kt]=void 0;k=[]}}if(i&&l.saveShared){l.structures.length>d&&(l.structures=l.structures.slice(0,d));let v=B.subarray(n,R);return l.updateSharedData()===!1?l.encode(x):v}L&jv&&(R=n)}},this.findCommonStringsToPack=()=>(p=new Map,E||(E=Object.create(null)),x=>{let L=x&&x.threshold||4,v=this.pack?x.maxPrivatePackedValues||16:0;m||(m=this.sharedValues=[]);for(let[D,P]of p)P.count>L&&(E[D]=v++,m.push(D),i=!0);for(;this.saveShared&&this.updateSharedData()===!1;);p=null});const C=x=>{R>kn&&(B=H(R));var L=typeof x,v;if(L==="string"){if(h){let J=h[x];if(J>=0){J<16?B[R++]=J+224:(B[R++]=198,J&1?C(15-J>>1):C(J-16>>1));return}else if(p&&!t.pack){let T=p.get(x);T?T.count++:p.set(x,{count:1})}}let D=x.length;if(Ve&&D>=4&&D<1024){if((Ve.size+=D)>Dv){let T,ie=(Ve[0]?Ve[0].length*3+Ve[1].length:0)+10;R+ie>kn&&(B=H(R+ie)),B[R++]=217,B[R++]=223,B[R++]=249,B[R++]=Ve.position?132:130,B[R++]=26,T=R-n,R+=4,Ve.position&&jd(n,C),Ve=["",""],Ve.size=0,Ve.position=T}let J=Pv.test(x);Ve[J?0:1]+=x,B[R++]=J?206:207,C(D);return}let P;D<32?P=1:D<256?P=2:D<65536?P=3:P=5;let q=D*3;if(R+q>kn&&(B=H(R+q)),D<64||!o){let J,T,ie,te=R+P;for(J=0;J<D;J++)T=x.charCodeAt(J),T<128?B[te++]=T:T<2048?(B[te++]=T>>6|192,B[te++]=T&63|128):(T&64512)===55296&&((ie=x.charCodeAt(J+1))&64512)===56320?(T=65536+((T&1023)<<10)+(ie&1023),J++,B[te++]=T>>18|240,B[te++]=T>>12&63|128,B[te++]=T>>6&63|128,B[te++]=T&63|128):(B[te++]=T>>12|224,B[te++]=T>>6&63|128,B[te++]=T&63|128);v=te-R-P}else v=o(x,R+P,q);v<24?B[R++]=96|v:v<256?(P<2&&B.copyWithin(R+2,R+1,R+1+v),B[R++]=120,B[R++]=v):v<65536?(P<3&&B.copyWithin(R+3,R+2,R+2+v),B[R++]=121,B[R++]=v>>8,B[R++]=v&255):(P<5&&B.copyWithin(R+5,R+3,R+3+v),B[R++]=122,ve.setUint32(R,v),R+=4),R+=v}else if(L==="number")if(!this.alwaysUseFloat&&x>>>0===x)x<24?B[R++]=x:x<256?(B[R++]=24,B[R++]=x):x<65536?(B[R++]=25,B[R++]=x>>8,B[R++]=x&255):(B[R++]=26,ve.setUint32(R,x),R+=4);else if(!this.alwaysUseFloat&&x>>0===x)x>=-24?B[R++]=31-x:x>=-256?(B[R++]=56,B[R++]=~x):x>=-65536?(B[R++]=57,ve.setUint16(R,~x),R+=2):(B[R++]=58,ve.setUint32(R,~x),R+=4);else{let D;if((D=this.useFloat32)>0&&x<4294967296&&x>=-2147483648){B[R++]=250,ve.setFloat32(R,x);let P;if(D<4||(P=x*Jl[(B[R]&127)<<1|B[R+1]>>7])>>0===P){R+=4;return}else R--}B[R++]=251,ve.setFloat64(R,x),R+=8}else if(L==="object")if(!x)B[R++]=246;else{if(s){let P=s.get(x);if(P){if(B[R++]=216,B[R++]=29,B[R++]=25,!P.references){let q=s.idsToInsert||(s.idsToInsert=[]);P.references=[],q.push(P)}P.references.push(R-n),R+=2;return}else s.set(x,{offset:R-n})}let D=x.constructor;if(D===Object)F(x);else if(D===Array){v=x.length,v<24?B[R++]=128|v:Jt(v);for(let P=0;P<v;P++)C(x[P])}else if(D===Map)if((this.mapsAsObjects?this.useTag259ForMaps!==!1:this.useTag259ForMaps)&&(B[R++]=217,B[R++]=1,B[R++]=3),v=x.size,v<24?B[R++]=160|v:v<256?(B[R++]=184,B[R++]=v):v<65536?(B[R++]=185,B[R++]=v>>8,B[R++]=v&255):(B[R++]=186,ve.setUint32(R,v),R+=4),l.keyMap)for(let[P,q]of x)C(l.encodeKey(P)),C(q);else for(let[P,q]of x)C(P),C(q);else{for(let P=0,q=Yo.length;P<q;P++){let J=Lm[P];if(x instanceof J){let T=Yo[P],ie=T.tag;ie==null&&(ie=T.getTag&&T.getTag.call(this,x)),ie<24?B[R++]=192|ie:ie<256?(B[R++]=216,B[R++]=ie):ie<65536?(B[R++]=217,B[R++]=ie>>8,B[R++]=ie&255):ie>-1&&(B[R++]=218,ve.setUint32(R,ie),R+=4),T.encode.call(this,x,C,H);return}}if(x[Symbol.iterator]){if(Qs){let P=new Error("Iterable should be serialized as iterator");throw P.iteratorNotHandled=!0,P}B[R++]=159;for(let P of x)C(P);B[R++]=255;return}if(x[Symbol.asyncIterator]||Js(x)){let P=new Error("Iterable/blob should be serialized as iterator");throw P.iteratorNotHandled=!0,P}if(this.useToJSON&&x.toJSON){const P=x.toJSON();if(P!==x)return C(P)}F(x)}}else if(L==="boolean")B[R++]=x?245:244;else if(L==="bigint"){if(x<BigInt(1)<<BigInt(64)&&x>=0)B[R++]=27,ve.setBigUint64(R,x);else if(x>-(BigInt(1)<<BigInt(64))&&x<0)B[R++]=59,ve.setBigUint64(R,-x-BigInt(1));else if(this.largeBigIntToFloat)B[R++]=251,ve.setFloat64(R,Number(x));else{x>=BigInt(0)?B[R++]=194:(B[R++]=195,x=BigInt(-1)-x);let D=[];for(;x;)D.push(Number(x&BigInt(255))),x>>=BigInt(8);qo(new Uint8Array(D.reverse()),H);return}R+=8}else if(L==="undefined")B[R++]=247;else throw new Error("Unknown type: "+L)},F=this.useRecords===!1?this.variableMapSize?x=>{let L=Object.keys(x),v=Object.values(x),D=L.length;if(D<24?B[R++]=160|D:D<256?(B[R++]=184,B[R++]=D):D<65536?(B[R++]=185,B[R++]=D>>8,B[R++]=D&255):(B[R++]=186,ve.setUint32(R,D),R+=4),l.keyMap)for(let P=0;P<D;P++)C(l.encodeKey(L[P])),C(v[P]);else for(let P=0;P<D;P++)C(L[P]),C(v[P])}:x=>{B[R++]=185;let L=R-n;R+=2;let v=0;if(l.keyMap)for(let D in x)(typeof x.hasOwnProperty!="function"||x.hasOwnProperty(D))&&(C(l.encodeKey(D)),C(x[D]),v++);else for(let D in x)(typeof x.hasOwnProperty!="function"||x.hasOwnProperty(D))&&(C(D),C(x[D]),v++);B[L+++n]=v>>8,B[L+n]=v&255}:(x,L)=>{let v,D=a.transitions||(a.transitions=Object.create(null)),P=0,q=0,J,T;if(this.keyMap){T=Object.keys(x).map(te=>this.encodeKey(te)),q=T.length;for(let te=0;te<q;te++){let w=T[te];v=D[w],v||(v=D[w]=Object.create(null),P++),D=v}}else for(let te in x)(typeof x.hasOwnProperty!="function"||x.hasOwnProperty(te))&&(v=D[te],v||(D[kt]&1048576&&(J=D[kt]&65535),v=D[te]=Object.create(null),P++),D=v,q++);let ie=D[kt];if(ie!==void 0)ie&=65535,B[R++]=217,B[R++]=ie>>8|224,B[R++]=ie&255;else if(T||(T=D.__keys__||(D.__keys__=Object.keys(x))),J===void 0?(ie=a.nextId++,ie||(ie=0,a.nextId=1),ie>=Fd&&(a.nextId=(ie=d)+1)):ie=J,a[ie]=T,ie<d){B[R++]=217,B[R++]=ie>>8|224,B[R++]=ie&255,D=a.transitions;for(let te=0;te<q;te++)(D[kt]===void 0||D[kt]&1048576)&&(D[kt]=ie),D=D[T[te]];D[kt]=ie|1048576,i=!0}else{if(D[kt]=ie,ve.setUint32(R,3655335680),R+=3,P&&(_+=N*P),k.length>=Fd-d&&(k.shift()[kt]=void 0),k.push(D),Jt(q+2),C(57344+ie),C(T),L)return;for(let te in x)(typeof x.hasOwnProperty!="function"||x.hasOwnProperty(te))&&C(x[te]);return}if(q<24?B[R++]=128|q:Jt(q),!L)for(let te in x)(typeof x.hasOwnProperty!="function"||x.hasOwnProperty(te))&&C(x[te])},H=x=>{let L;if(x>16777216){if(x-n>Hd)throw new Error("Encoded buffer would be larger than maximum buffer size");L=Math.min(Hd,Math.round(Math.max((x-n)*(x>67108864?1.25:2),4194304)/4096)*4096)}else L=(Math.max(x-n<<2,B.length-1)>>12)+1<<12;let v=new Xs(L);return ve=new DataView(v.buffer,0,L),B.copy?B.copy(v,0,n,x):v.set(B.slice(n,x)),R-=n,n=0,kn=v.length-10,B=v};let I=100,V=1e3;this.encodeAsIterable=function(x,L){return K(x,L,U)},this.encodeAsAsyncIterable=function(x,L){return K(x,L,z)};function*U(x,L,v){let D=x.constructor;if(D===Object){let P=l.useRecords!==!1;P?F(x,!0):Ud(Object.keys(x).length,160);for(let q in x){let J=x[q];P||C(q),J&&typeof J=="object"?L[q]?yield*U(J,L[q]):yield*Q(J,L,q):C(J)}}else if(D===Array){let P=x.length;Jt(P);for(let q=0;q<P;q++){let J=x[q];J&&(typeof J=="object"||R-n>I)?L.element?yield*U(J,L.element):yield*Q(J,L,"element"):C(J)}}else if(x[Symbol.iterator]&&!x.buffer){B[R++]=159;for(let P of x)P&&(typeof P=="object"||R-n>I)?L.element?yield*U(P,L.element):yield*Q(P,L,"element"):C(P);B[R++]=255}else Js(x)?(Ud(x.size,64),yield B.subarray(n,R),yield x,O()):x[Symbol.asyncIterator]?(B[R++]=159,yield B.subarray(n,R),yield x,O(),B[R++]=255):C(x);v&&R>n?yield B.subarray(n,R):R-n>I&&(yield B.subarray(n,R),O())}function*Q(x,L,v){let D=R-n;try{C(x),R-n>I&&(yield B.subarray(n,R),O())}catch(P){if(P.iteratorNotHandled)L[v]={},R=n+D,yield*U.call(this,x,L[v]);else throw P}}function O(){I=V,l.encode(null,Zs)}function K(x,L,v){return L&&L.chunkThreshold?I=V=L.chunkThreshold:I=100,x&&typeof x=="object"?(l.encode(null,Zs),v(x,l.iterateProperties||(l.iterateProperties={}),!0)):[l.encode(x)]}async function*z(x,L){for(let v of U(x,L,!0)){let D=v.constructor;if(D===Bd||D===Uint8Array)yield v;else if(Js(v)){let P=v.stream().getReader(),q;for(;!(q=await P.read()).done;)yield q.value}else if(v[Symbol.asyncIterator])for await(let P of v)O(),P?yield*z(P,L.async||(L.async={})):yield l.encode(P);else yield v}}}useBuffer(t){B=t,ve=new DataView(B.buffer,B.byteOffset,B.byteLength),R=0}clearSharedData(){this.structures&&(this.structures=[]),this.sharedValues&&(this.sharedValues=void 0)}updateSharedData(){let t=this.sharedVersion||0;this.sharedVersion=t+1;let n=this.structures.slice(0),r=new vm(n,this.sharedValues,this.sharedVersion),i=this.saveShared(r,a=>(a&&a.version||0)==t);return i===!1?(r=this.getShared()||{},this.structures=r.structures||[],this.sharedValues=r.packedValues,this.sharedVersion=r.version,this.structures.nextId=this.structures.length):n.forEach((a,s)=>this.structures[s]=a),i}}function Ud(e,t){e<24?B[R++]=t|e:e<256?(B[R++]=t|24,B[R++]=e):e<65536?(B[R++]=t|25,B[R++]=e>>8,B[R++]=e&255):(B[R++]=t|26,ve.setUint32(R,e),R+=4)}class vm{constructor(t,n,r){this.structures=t,this.packedValues=n,this.version=r}}function Jt(e){e<24?B[R++]=128|e:e<256?(B[R++]=152,B[R++]=e):e<65536?(B[R++]=153,B[R++]=e>>8,B[R++]=e&255):(B[R++]=154,ve.setUint32(R,e),R+=4)}const Bv=typeof Blob>"u"?function(){}:Blob;function Js(e){if(e instanceof Bv)return!0;let t=e[Symbol.toStringTag];return t==="Blob"||t==="File"}function Aa(e,t){switch(typeof e){case"string":if(e.length>3){if(t.objectMap[e]>-1||t.values.length>=t.maxValues)return;let r=t.get(e);if(r)++r.count==2&&t.values.push(e);else if(t.set(e,{count:1}),t.samplingPackedValues){let i=t.samplingPackedValues.get(e);i?i.count++:t.samplingPackedValues.set(e,{count:1})}}break;case"object":if(e)if(e instanceof Array)for(let r=0,i=e.length;r<i;r++)Aa(e[r],t);else{let r=!t.encoder.useRecords;for(var n in e)e.hasOwnProperty(n)&&(r&&Aa(n,t),Aa(e[n],t))}break;case"function":console.log(e)}}const Fv=new Uint8Array(new Uint16Array([1]).buffer)[0]==1;Lm=[Date,Set,Error,RegExp,Zn,ArrayBuffer,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>"u"?function(){}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"?function(){}:BigInt64Array,Float32Array,Float64Array,vm];Yo=[{tag:1,encode(e,t){let n=e.getTime()/1e3;(this.useTimestamp32||e.getMilliseconds()===0)&&n>=0&&n<4294967296?(B[R++]=26,ve.setUint32(R,n),R+=4):(B[R++]=251,ve.setFloat64(R,n),R+=8)}},{tag:258,encode(e,t){let n=Array.from(e);t(n)}},{tag:27,encode(e,t){t([e.name,e.message])}},{tag:27,encode(e,t){t(["RegExp",e.source,e.flags])}},{getTag(e){return e.tag},encode(e,t){t(e.value)}},{encode(e,t,n){qo(e,n)}},{getTag(e){if(e.constructor===Uint8Array&&(this.tagUint8Array||Vi&&this.tagUint8Array!==!1))return 64},encode(e,t,n){qo(e,n)}},Xt(68,1),Xt(69,2),Xt(70,4),Xt(71,8),Xt(72,1),Xt(77,2),Xt(78,4),Xt(79,8),Xt(85,4),Xt(86,8),{encode(e,t){let n=e.packedValues||[],r=e.structures||[];if(n.values.length>0){B[R++]=216,B[R++]=51,Jt(4);let i=n.values;t(i),Jt(0),Jt(0),packedObjectMap=Object.create(sharedPackedObjectMap||null);for(let a=0,s=i.length;a<s;a++)packedObjectMap[i[a]]=a}if(r){ve.setUint32(R,3655335424),R+=3;let i=r.slice(0);i.unshift(57344),i.push(new Zn(e.version,1399353956)),t(i)}else t(new Zn(e.version,1399353956))}}];function Xt(e,t){return!Fv&&t>1&&(e-=4),{tag:e,encode:function(r,i){let a=r.byteLength,s=r.byteOffset||0,o=r.buffer||r;i(Vi?bs.from(o,s,a):new Uint8Array(o,s,a))}}}function qo(e,t){let n=e.byteLength;n<24?B[R++]=64+n:n<256?(B[R++]=88,B[R++]=n):n<65536?(B[R++]=89,B[R++]=n>>8,B[R++]=n&255):(B[R++]=90,ve.setUint32(R,n),R+=4),R+n>=B.length&&t(R+n),B.set(e.buffer?e:new Uint8Array(e),R),R+=n}function Hv(e,t){let n,r=t.length*2,i=e.length-r;t.sort((a,s)=>a.offset>s.offset?1:-1);for(let a=0;a<t.length;a++){let s=t[a];s.id=a;for(let o of s.references)e[o++]=a>>8,e[o]=a&255}for(;n=t.pop();){let a=n.offset;e.copyWithin(a+r,a,i),r-=2;let s=a+r;e[s++]=216,e[s++]=28,i=a}return e}function jd(e,t){ve.setUint32(Ve.position+e,R-Ve.position-e+1);let n=Ve;Ve=null,t(n[0]),t(n[1])}let eu=new Mv({useRecords:!1});const Uv=eu.encode;eu.encodeAsIterable;eu.encodeAsAsyncIterable;const zd=512,jv=1024,Zs=2048;async function et(e,t){var i;const n=await fetch("/api/rpc",{method:"POST",headers:{"Content-Type":"application/cbor",Accept:"application/cbor"},body:new Uint8Array(Uv({method:e,params:t??{}}))});if(!n.ok){try{const a=await n.arrayBuffer(),s=Md(new Uint8Array(a));if((i=s==null?void 0:s.error)!=null&&i.message)throw new Error(s.error.message)}catch(a){if(a instanceof Error&&a.message!==`RPC call ${e} failed`)throw a}throw new Error(`RPC call ${e} failed: ${n.status} ${n.statusText}`)}const r=await n.arrayBuffer();return Md(new Uint8Array(r))}async function k4(e,t){return et("fetchRuns",{worldEnv:e,params:t})}async function A4(e,t,n="all"){return et("fetchRun",{worldEnv:e,runId:t,resolveData:n})}async function w4(e,t,n){return et("fetchSteps",{worldEnv:e,runId:t,params:n})}async function C4(e,t,n,r="all"){return et("fetchStep",{worldEnv:e,runId:t,stepId:n,resolveData:r})}async function S4(e,t,n){return et("fetchEvents",{worldEnv:e,runId:t,params:n})}async function N4(e,t,n){return et("fetchEventsByCorrelationId",{worldEnv:e,correlationId:t,params:n})}async function I4(e,t){return et("fetchHooks",{worldEnv:e,params:t})}async function R4(e,t,n="all"){return et("fetchHook",{worldEnv:e,hookId:t,resolveData:n})}async function O4(e,t){return et("cancelRun",{worldEnv:e,runId:t})}async function L4(e,t,n){return et("recreateRun",{worldEnv:e,runId:t,deploymentId:n})}async function v4(e,t){return et("reenqueueRun",{worldEnv:e,runId:t})}async function D4(e,t,n){return et("wakeUpRun",{worldEnv:e,runId:t,options:n})}async function P4(e,t,n){return et("resumeHook",{worldEnv:e,token:t,payload:n})}async function M4(e,t){return et("fetchStreams",{worldEnv:e,runId:t})}async function B4(e){return et("fetchWorkflowsManifest",{worldEnv:e})}async function F4(e,t,n){return et("runHealthCheck",{worldEnv:e,endpoint:t,options:n})}async function H4(e,t){return et("getEncryptionKeyForRun",{worldEnv:e,runId:t})}const zv=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:gm},Symbol.toStringTag,{value:"Module"}));export{re as $,w1 as A,yv as B,C1 as C,m4 as D,A4 as E,S4 as F,yf as G,Yv as H,Rt as I,vu as J,i4 as K,Gv as L,rT as M,dh as N,YE as O,tr as P,FI as Q,Ft as R,y4 as S,E4 as T,Kv as U,P1 as V,Xv as W,Jb as X,at as Y,ms as Z,YR as _,T4 as a,l4 as a0,c4 as a1,sv as a2,za as a3,u4 as a4,ps as a5,In as a6,Si as a7,GR as a8,la as a9,wm as aA,s1 as aB,l1 as aC,u1 as aD,d1 as aE,f1 as aF,p1 as aG,h1 as aH,c1 as aI,Xg as aJ,O4 as aK,v4 as aL,D4 as aM,P4 as aN,L4 as aO,B4 as aP,o4 as aa,a4 as ab,mr as ac,KR as ad,h4 as ae,d4 as af,f4 as ag,s4 as ah,Jv as ai,Qv as aj,R4 as ak,C4 as al,w4 as am,M4 as an,Cm as ao,pv as ap,Tv as aq,ul as ar,Ei as as,Nt as at,WE as au,g4 as av,H4 as aw,p4 as ax,Zb as ay,Ev as az,hv as b,Wf as c,km as d,e4 as e,U1 as f,Gn as g,k4 as h,I4 as i,b4 as j,N4 as k,Wa as l,er as m,df as n,Yd as o,dn as p,ig as q,F4 as r,Um as s,Zv as t,x4 as u,Kd as v,L1 as w,A1 as x,S1 as y,_4 as z};