@workflow/web 4.1.0-beta.44 → 4.1.0-beta.45

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 (21) hide show
  1. package/build/client/assets/{highlighted-body-B3W2YXNL-BAmp2St7.js → highlighted-body-B3W2YXNL-DmGJDYCd.js} +1 -1
  2. package/build/client/assets/home-Bg63MGns.js +40 -0
  3. package/build/client/assets/manifest-f52831b8.js +1 -0
  4. package/build/client/assets/{mermaid-3ZIDBTTL-CrmlsXj3.js → mermaid-3ZIDBTTL-ClWSYlBT.js} +3 -3
  5. package/build/client/assets/{root-DXnpwJxc.js → root-CADywoAy.js} +1 -1
  6. package/build/client/assets/run-detail-CX8hD4AT.js +37 -0
  7. package/build/client/assets/workflow-graph-viewer-RUyTSlHH.js +161 -0
  8. package/build/server/assets/{app-DiZXH6x4.js → app-DMT28sgS.js} +1 -1
  9. package/build/server/assets/{highlighted-body-B3W2YXNL-CmDnR6fu.js → highlighted-body-B3W2YXNL-CKl1xXgz.js} +2 -2
  10. package/build/server/assets/{index-cxStGfMq.js → index-BHIV6JOr.js} +2 -2
  11. package/build/server/assets/{mermaid-3ZIDBTTL-CxsJnUQo.js → mermaid-3ZIDBTTL-uTah_BkY.js} +2 -2
  12. package/build/server/assets/{server-build-CZMYXF52.js → server-build-DiN0zpXF.js} +97 -1659
  13. package/build/server/assets/{token-C7BfiMAN.js → token-fvUEOQRa.js} +2 -2
  14. package/build/server/assets/{token-util-CxDoe-ao.js → token-util-1mDJoKQG.js} +2 -2
  15. package/build/server/index.js +1 -1
  16. package/package.json +3 -3
  17. package/build/client/assets/home-CFxVErsy.js +0 -35
  18. package/build/client/assets/manifest-beaac576.js +0 -1
  19. package/build/client/assets/run-detail-C6LG6p9l.js +0 -37
  20. package/build/client/assets/use-workflow-graph-DGcT3V07.js +0 -166
  21. /package/build/client/assets/{use-workflow-graph-yls6qlc0.css → workflow-graph-viewer-yls6qlc0.css} +0 -0
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-B3W2YXNL-BAmp2St7.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-DmGJDYCd.js","assets/index-DklpUtP3.js"])))=>i.map(i=>d[i]);
2
2
  var _b=Object.defineProperty;var kb=(e,t,n)=>t in e?_b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ve=(e,t,n)=>kb(e,typeof t!="symbol"?t+"":t,n);import{r as x,j as g,f as Tu,D as Kh,R as F,A as Xh,G as Qh}from"./index-DklpUtP3.js";function Xn(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 jc(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zh(...e){return t=>{let n=!1;const r=e.map(i=>{const s=jc(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():jc(e[i],null)}}}}function Yr(...e){return x.useCallback(Zh(...e),e)}function oM(e,t){const n=x.createContext(t),r=s=>{const{children:a,...o}=s,l=x.useMemo(()=>o,Object.values(o));return g.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function i(s){const a=x.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function Jh(e,t=[]){let n=[];function r(s,a){const o=x.createContext(a),l=n.length;n=[...n,a];const u=c=>{var b;const{scope:h,children:p,...m}=c,E=((b=h==null?void 0:h[e])==null?void 0:b[l])||o,T=x.useMemo(()=>m,Object.values(m));return g.jsx(E.Provider,{value:T,children:p})};u.displayName=s+"Provider";function d(c,h){var E;const p=((E=h==null?void 0:h[e])==null?void 0:E[l])||o,m=x.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${c}\` must be used within \`${s}\``)}return[u,d]}const i=()=>{const s=n.map(a=>x.createContext(a));return function(o){const l=(o==null?void 0:o[e])||s;return x.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return i.scopeName=e,[r,wb(i,...t)]}function wb(...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(s){const a=r.reduce((o,{useScope:l,scopeName:u})=>{const c=l(s)[`__scope${u}`];return{...o,...c}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Cb(e){const t=Ab(e),n=x.forwardRef((r,i)=>{const{children:s,...a}=r,o=x.Children.toArray(s),l=o.find(Ib);if(l){const u=l.props.children,d=o.map(c=>c===l?x.Children.count(u)>1?x.Children.only(null):x.isValidElement(u)?u.props.children:null:c);return g.jsx(t,{...a,ref:i,children:x.isValidElement(u)?x.cloneElement(u,void 0,d):null})}return g.jsx(t,{...a,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function Ab(e){const t=x.forwardRef((n,r)=>{const{children:i,...s}=n;if(x.isValidElement(i)){const a=Rb(i),o=vb(s,i.props);return i.type!==x.Fragment&&(o.ref=r?Zh(r,a):a),x.cloneElement(i,o)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ep=Symbol("radix.slottable");function Sb(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ep,t}function Ib(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ep}function vb(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...o)=>{const l=s(...o);return i(...o),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function Rb(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 Nb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gr=Nb.reduce((e,t)=>{const n=Cb(`Primitive.${t}`),r=x.forwardRef((i,s)=>{const{asChild:a,...o}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...o,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ob(e,t){e&&Tu.flushSync(()=>e.dispatchEvent(t))}function to(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Lb(e,t=globalThis==null?void 0:globalThis.document){const n=to(e);x.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 Db="DismissableLayer",Tl="dismissableLayer.update",Pb="dismissableLayer.pointerDownOutside",Mb="dismissableLayer.focusOutside",zc,tp=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),np=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...l}=e,u=x.useContext(tp),[d,c]=x.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=x.useState({}),m=Yr(t,A=>c(A)),E=Array.from(u.layers),[T]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=E.indexOf(T),y=d?E.indexOf(d):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,P=y>=b,D=Hb(A=>{const N=A.target,z=[...u.branches].some(R=>R.contains(N));!P||z||(i==null||i(A),a==null||a(A),A.defaultPrevented||o==null||o())},h),v=Ub(A=>{const N=A.target;[...u.branches].some(R=>R.contains(N))||(s==null||s(A),a==null||a(A),A.defaultPrevented||o==null||o())},h);return Lb(A=>{y===u.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&o&&(A.preventDefault(),o()))},h),x.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(zc=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),$c(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=zc)}},[d,h,n,u]),x.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),$c())},[d,u]),x.useEffect(()=>{const A=()=>p({});return document.addEventListener(Tl,A),()=>document.removeEventListener(Tl,A)},[]),g.jsx(Gr.div,{...l,ref:m,style:{pointerEvents:k?P?"auto":"none":void 0,...e.style},onFocusCapture:Xn(e.onFocusCapture,v.onFocusCapture),onBlurCapture:Xn(e.onBlurCapture,v.onBlurCapture),onPointerDownCapture:Xn(e.onPointerDownCapture,D.onPointerDownCapture)})});np.displayName=Db;var Bb="DismissableLayerBranch",Fb=x.forwardRef((e,t)=>{const n=x.useContext(tp),r=x.useRef(null),i=Yr(t,r);return x.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),g.jsx(Gr.div,{...e,ref:i})});Fb.displayName=Bb;function Hb(e,t=globalThis==null?void 0:globalThis.document){const n=to(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const s=o=>{if(o.target&&!r.current){let l=function(){rp(Pb,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},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ub(e,t=globalThis==null?void 0:globalThis.document){const n=to(e),r=x.useRef(!1);return x.useEffect(()=>{const i=s=>{s.target&&!r.current&&rp(Mb,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function $c(){const e=new CustomEvent(Tl);document.dispatchEvent(e)}function rp(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ob(i,s):i.dispatchEvent(s)}var Hr=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},jb=Kh[" useId ".trim().toString()]||(()=>{}),zb=0;function $b(e){const[t,n]=x.useState(jb());return Hr(()=>{n(r=>r??String(zb++))},[e]),t?`radix-${t}`:""}const Vb=["top","right","bottom","left"],mr=Math.min,nn=Math.max,La=Math.round,ea=Math.floor,jn=e=>({x:e,y:e}),Wb={left:"right",right:"left",bottom:"top",top:"bottom"},Yb={start:"end",end:"start"};function xl(e,t,n){return nn(e,mr(t,n))}function Jn(e,t){return typeof e=="function"?e(t):e}function er(e){return e.split("-")[0]}function ki(e){return e.split("-")[1]}function xu(e){return e==="x"?"y":"x"}function yu(e){return e==="y"?"height":"width"}const Gb=new Set(["top","bottom"]);function Hn(e){return Gb.has(er(e))?"y":"x"}function _u(e){return xu(Hn(e))}function qb(e,t,n){n===void 0&&(n=!1);const r=ki(e),i=_u(e),s=yu(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Da(a)),[a,Da(a)]}function Kb(e){const t=Da(e);return[yl(e),t,yl(t)]}function yl(e){return e.replace(/start|end/g,t=>Yb[t])}const Vc=["left","right"],Wc=["right","left"],Xb=["top","bottom"],Qb=["bottom","top"];function Zb(e,t,n){switch(e){case"top":case"bottom":return n?t?Wc:Vc:t?Vc:Wc;case"left":case"right":return t?Xb:Qb;default:return[]}}function Jb(e,t,n,r){const i=ki(e);let s=Zb(er(e),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),t&&(s=s.concat(s.map(yl)))),s}function Da(e){return e.replace(/left|right|bottom|top/g,t=>Wb[t])}function eE(e){return{top:0,right:0,bottom:0,left:0,...e}}function ip(e){return typeof e!="number"?eE(e):{top:e,right:e,bottom:e,left:e}}function Pa(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 Yc(e,t,n){let{reference:r,floating:i}=e;const s=Hn(t),a=_u(t),o=yu(a),l=er(t),u=s==="y",d=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,h=r[o]/2-i[o]/2;let p;switch(l){case"top":p={x:d,y:r.y-i.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:c};break;case"left":p={x:r.x-i.width,y:c};break;default:p={x:r.x,y:r.y}}switch(ki(t)){case"start":p[a]-=h*(n&&u?-1:1);break;case"end":p[a]+=h*(n&&u?-1:1);break}return p}const tE=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,o=s.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:c}=Yc(u,r,l),h=r,p={},m=0;for(let E=0;E<o.length;E++){const{name:T,fn:b}=o[E],{x:y,y:k,data:P,reset:D}=await b({x:d,y:c,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:u,platform:a,elements:{reference:e,floating:t}});d=y??d,c=k??c,p={...p,[T]:{...p[T],...P}},D&&m<=50&&(m++,typeof D=="object"&&(D.placement&&(h=D.placement),D.rects&&(u=D.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):D.rects),{x:d,y:c}=Yc(u,h,l)),E=-1)}return{x:d,y:c,placement:h,strategy:i,middlewareData:p}};async function fs(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:a,elements:o,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:c="floating",altBoundary:h=!1,padding:p=0}=Jn(t,e),m=ip(p),T=o[h?c==="floating"?"reference":"floating":c],b=Pa(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(T)))==null||n?T:T.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:u,rootBoundary:d,strategy:l})),y=c==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),P=await(s.isElement==null?void 0:s.isElement(k))?await(s.getScale==null?void 0:s.getScale(k))||{x:1,y:1}:{x:1,y:1},D=Pa(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:y,offsetParent:k,strategy:l}):y);return{top:(b.top-D.top+m.top)/P.y,bottom:(D.bottom-b.bottom+m.bottom)/P.y,left:(b.left-D.left+m.left)/P.x,right:(D.right-b.right+m.right)/P.x}}const nE=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:a,elements:o,middlewareData:l}=t,{element:u,padding:d=0}=Jn(e,t)||{};if(u==null)return{};const c=ip(d),h={x:n,y:r},p=_u(i),m=yu(p),E=await a.getDimensions(u),T=p==="y",b=T?"top":"left",y=T?"bottom":"right",k=T?"clientHeight":"clientWidth",P=s.reference[m]+s.reference[p]-h[p]-s.floating[m],D=h[p]-s.reference[p],v=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let A=v?v[k]:0;(!A||!await(a.isElement==null?void 0:a.isElement(v)))&&(A=o.floating[k]||s.floating[m]);const N=P/2-D/2,z=A/2-E[m]/2-1,R=mr(c[b],z),W=mr(c[y],z),j=R,w=A-E[m]-W,L=A/2-E[m]/2+N,M=xl(j,L,w),H=!l.arrow&&ki(i)!=null&&L!==M&&s.reference[m]/2-(L<j?R:W)-E[m]/2<0,U=H?L<j?L-j:L-w:0;return{[p]:h[p]+U,data:{[p]:M,centerOffset:L-M-U,...H&&{alignmentOffset:U}},reset:H}}}),rE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:o,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:c=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:E=!0,...T}=Jn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=er(i),y=Hn(o),k=er(o)===o,P=await(l.isRTL==null?void 0:l.isRTL(u.floating)),D=h||(k||!E?[Da(o)]:Kb(o)),v=m!=="none";!h&&v&&D.push(...Jb(o,E,m,P));const A=[o,...D],N=await fs(t,T),z=[];let R=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&z.push(N[b]),c){const L=qb(i,a,P);z.push(N[L[0]],N[L[1]])}if(R=[...R,{placement:i,overflows:z}],!z.every(L=>L<=0)){var W,j;const L=(((W=s.flip)==null?void 0:W.index)||0)+1,M=A[L];if(M&&(!(c==="alignment"?y!==Hn(M):!1)||R.every(G=>Hn(G.placement)===y?G.overflows[0]>0:!0)))return{data:{index:L,overflows:R},reset:{placement:M}};let H=(j=R.filter(U=>U.overflows[0]<=0).sort((U,G)=>U.overflows[1]-G.overflows[1])[0])==null?void 0:j.placement;if(!H)switch(p){case"bestFit":{var w;const U=(w=R.filter(G=>{if(v){const Q=Hn(G.placement);return Q===y||Q==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(Q=>Q>0).reduce((Q,_)=>Q+_,0)]).sort((G,Q)=>G[1]-Q[1])[0])==null?void 0:w[0];U&&(H=U);break}case"initialPlacement":H=o;break}if(i!==H)return{reset:{placement:H}}}return{}}}};function Gc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qc(e){return Vb.some(t=>e[t]>=0)}const iE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Jn(e,t);switch(r){case"referenceHidden":{const s=await fs(t,{...i,elementContext:"reference"}),a=Gc(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:qc(a)}}}case"escaped":{const s=await fs(t,{...i,altBoundary:!0}),a=Gc(s,n.floating);return{data:{escapedOffsets:a,escaped:qc(a)}}}default:return{}}}}},sp=new Set(["left","top"]);async function sE(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=er(n),o=ki(n),l=Hn(n)==="y",u=sp.has(a)?-1:1,d=s&&l?-1:1,c=Jn(t,e);let{mainAxis:h,crossAxis:p,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"&&(p=o==="end"?m*-1:m),l?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const aE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:a,middlewareData:o}=t,l=await sE(t,e);return a===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:a}}}}},oE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:o={fn:T=>{let{x:b,y}=T;return{x:b,y}}},...l}=Jn(e,t),u={x:n,y:r},d=await fs(t,l),c=Hn(er(i)),h=xu(c);let p=u[h],m=u[c];if(s){const T=h==="y"?"top":"left",b=h==="y"?"bottom":"right",y=p+d[T],k=p-d[b];p=xl(y,p,k)}if(a){const T=c==="y"?"top":"left",b=c==="y"?"bottom":"right",y=m+d[T],k=m-d[b];m=xl(y,m,k)}const E=o.fn({...t,[h]:p,[c]:m});return{...E,data:{x:E.x-n,y:E.y-r,enabled:{[h]:s,[c]:a}}}}}},lE=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:a}=t,{offset:o=0,mainAxis:l=!0,crossAxis:u=!0}=Jn(e,t),d={x:n,y:r},c=Hn(i),h=xu(c);let p=d[h],m=d[c];const E=Jn(o,t),T=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(l){const k=h==="y"?"height":"width",P=s.reference[h]-s.floating[k]+T.mainAxis,D=s.reference[h]+s.reference[k]-T.mainAxis;p<P?p=P:p>D&&(p=D)}if(u){var b,y;const k=h==="y"?"width":"height",P=sp.has(er(i)),D=s.reference[c]-s.floating[k]+(P&&((b=a.offset)==null?void 0:b[c])||0)+(P?0:T.crossAxis),v=s.reference[c]+s.reference[k]+(P?0:((y=a.offset)==null?void 0:y[c])||0)-(P?T.crossAxis:0);m<D?m=D:m>v&&(m=v)}return{[h]:p,[c]:m}}}},uE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:a,elements:o}=t,{apply:l=()=>{},...u}=Jn(e,t),d=await fs(t,u),c=er(i),h=ki(i),p=Hn(i)==="y",{width:m,height:E}=s.floating;let T,b;c==="top"||c==="bottom"?(T=c,b=h===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(b=c,T=h==="end"?"top":"bottom");const y=E-d.top-d.bottom,k=m-d.left-d.right,P=mr(E-d[T],y),D=mr(m-d[b],k),v=!t.middlewareData.shift;let A=P,N=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=y),v&&!h){const R=nn(d.left,0),W=nn(d.right,0),j=nn(d.top,0),w=nn(d.bottom,0);p?N=m-2*(R!==0||W!==0?R+W:nn(d.left,d.right)):A=E-2*(j!==0||w!==0?j+w:nn(d.top,d.bottom))}await l({...t,availableWidth:N,availableHeight:A});const z=await a.getDimensions(o.floating);return m!==z.width||E!==z.height?{reset:{rects:!0}}:{}}}};function no(){return typeof window<"u"}function wi(e){return ap(e)?(e.nodeName||"").toLowerCase():"#document"}function an(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $n(e){var t;return(t=(ap(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ap(e){return no()?e instanceof Node||e instanceof an(e).Node:!1}function In(e){return no()?e instanceof Element||e instanceof an(e).Element:!1}function zn(e){return no()?e instanceof HTMLElement||e instanceof an(e).HTMLElement:!1}function Kc(e){return!no()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof an(e).ShadowRoot}const cE=new Set(["inline","contents"]);function Ps(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=vn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!cE.has(i)}const dE=new Set(["table","td","th"]);function fE(e){return dE.has(wi(e))}const hE=[":popover-open",":modal"];function ro(e){return hE.some(t=>{try{return e.matches(t)}catch{return!1}})}const pE=["transform","translate","scale","rotate","perspective"],mE=["transform","translate","scale","rotate","perspective","filter"],gE=["paint","layout","strict","content"];function ku(e){const t=wu(),n=In(e)?vn(e):e;return pE.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)||mE.some(r=>(n.willChange||"").includes(r))||gE.some(r=>(n.contain||"").includes(r))}function bE(e){let t=gr(e);for(;zn(t)&&!Ei(t);){if(ku(t))return t;if(ro(t))return null;t=gr(t)}return null}function wu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const EE=new Set(["html","body","#document"]);function Ei(e){return EE.has(wi(e))}function vn(e){return an(e).getComputedStyle(e)}function io(e){return In(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gr(e){if(wi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Kc(e)&&e.host||$n(e);return Kc(t)?t.host:t}function op(e){const t=gr(e);return Ei(t)?e.ownerDocument?e.ownerDocument.body:e.body:zn(t)&&Ps(t)?t:op(t)}function hs(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=op(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),a=an(i);if(s){const o=_l(a);return t.concat(a,a.visualViewport||[],Ps(i)?i:[],o&&n?hs(o):[])}return t.concat(i,hs(i,[],n))}function _l(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lp(e){const t=vn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=zn(e),s=i?e.offsetWidth:n,a=i?e.offsetHeight:r,o=La(n)!==s||La(r)!==a;return o&&(n=s,r=a),{width:n,height:r,$:o}}function Cu(e){return In(e)?e:e.contextElement}function fi(e){const t=Cu(e);if(!zn(t))return jn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=lp(t);let a=(s?La(n.width):n.width)/r,o=(s?La(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const TE=jn(0);function up(e){const t=an(e);return!wu()||!t.visualViewport?TE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==an(e)?!1:t}function Ur(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Cu(e);let a=jn(1);t&&(r?In(r)&&(a=fi(r)):a=fi(e));const o=xE(s,n,r)?up(s):jn(0);let l=(i.left+o.x)/a.x,u=(i.top+o.y)/a.y,d=i.width/a.x,c=i.height/a.y;if(s){const h=an(s),p=r&&In(r)?an(r):r;let m=h,E=_l(m);for(;E&&r&&p!==m;){const T=fi(E),b=E.getBoundingClientRect(),y=vn(E),k=b.left+(E.clientLeft+parseFloat(y.paddingLeft))*T.x,P=b.top+(E.clientTop+parseFloat(y.paddingTop))*T.y;l*=T.x,u*=T.y,d*=T.x,c*=T.y,l+=k,u+=P,m=an(E),E=_l(m)}}return Pa({width:d,height:c,x:l,y:u})}function so(e,t){const n=io(e).scrollLeft;return t?t.left+n:Ur($n(e)).left+n}function cp(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-so(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function yE(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",a=$n(r),o=t?ro(t.floating):!1;if(r===a||o&&s)return n;let l={scrollLeft:0,scrollTop:0},u=jn(1);const d=jn(0),c=zn(r);if((c||!c&&!s)&&((wi(r)!=="body"||Ps(a))&&(l=io(r)),zn(r))){const p=Ur(r);u=fi(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=a&&!c&&!s?cp(a,l):jn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-l.scrollTop*u.y+d.y+h.y}}function _E(e){return Array.from(e.getClientRects())}function kE(e){const t=$n(e),n=io(e),r=e.ownerDocument.body,i=nn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=nn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+so(e);const o=-n.scrollTop;return vn(r).direction==="rtl"&&(a+=nn(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:o}}const Xc=25;function wE(e,t){const n=an(e),r=$n(e),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,o=0,l=0;if(i){s=i.width,a=i.height;const d=wu();(!d||d&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}const u=so(r);if(u<=0){const d=r.ownerDocument,c=d.body,h=getComputedStyle(c),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-c.clientWidth-p);m<=Xc&&(s-=m)}else u<=Xc&&(s+=u);return{width:s,height:a,x:o,y:l}}const CE=new Set(["absolute","fixed"]);function AE(e,t){const n=Ur(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=zn(e)?fi(e):jn(1),a=e.clientWidth*s.x,o=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:a,height:o,x:l,y:u}}function Qc(e,t,n){let r;if(t==="viewport")r=wE(e,n);else if(t==="document")r=kE($n(e));else if(In(t))r=AE(t,n);else{const i=up(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Pa(r)}function dp(e,t){const n=gr(e);return n===t||!In(n)||Ei(n)?!1:vn(n).position==="fixed"||dp(n,t)}function SE(e,t){const n=t.get(e);if(n)return n;let r=hs(e,[],!1).filter(o=>In(o)&&wi(o)!=="body"),i=null;const s=vn(e).position==="fixed";let a=s?gr(e):e;for(;In(a)&&!Ei(a);){const o=vn(a),l=ku(a);!l&&o.position==="fixed"&&(i=null),(s?!l&&!i:!l&&o.position==="static"&&!!i&&CE.has(i.position)||Ps(a)&&!l&&dp(e,a))?r=r.filter(d=>d!==a):i=o,a=gr(a)}return t.set(e,r),r}function IE(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?ro(t)?[]:SE(t,this._c):[].concat(n),r],o=a[0],l=a.reduce((u,d)=>{const c=Qc(t,d,i);return u.top=nn(c.top,u.top),u.right=mr(c.right,u.right),u.bottom=mr(c.bottom,u.bottom),u.left=nn(c.left,u.left),u},Qc(t,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function vE(e){const{width:t,height:n}=lp(e);return{width:t,height:n}}function RE(e,t,n){const r=zn(t),i=$n(t),s=n==="fixed",a=Ur(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const l=jn(0);function u(){l.x=so(i)}if(r||!r&&!s)if((wi(t)!=="body"||Ps(i))&&(o=io(t)),r){const p=Ur(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else i&&u();s&&!r&&i&&u();const d=i&&!r&&!s?cp(i,o):jn(0),c=a.left+o.scrollLeft-l.x-d.x,h=a.top+o.scrollTop-l.y-d.y;return{x:c,y:h,width:a.width,height:a.height}}function Do(e){return vn(e).position==="static"}function Zc(e,t){if(!zn(e)||vn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $n(e)===n&&(n=n.ownerDocument.body),n}function fp(e,t){const n=an(e);if(ro(e))return n;if(!zn(e)){let i=gr(e);for(;i&&!Ei(i);){if(In(i)&&!Do(i))return i;i=gr(i)}return n}let r=Zc(e,t);for(;r&&fE(r)&&Do(r);)r=Zc(r,t);return r&&Ei(r)&&Do(r)&&!ku(r)?n:r||bE(e)||n}const NE=async function(e){const t=this.getOffsetParent||fp,n=this.getDimensions,r=await n(e.floating);return{reference:RE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function OE(e){return vn(e).direction==="rtl"}const LE={convertOffsetParentRelativeRectToViewportRelativeRect:yE,getDocumentElement:$n,getClippingRect:IE,getOffsetParent:fp,getElementRects:NE,getClientRects:_E,getDimensions:vE,getScale:fi,isElement:In,isRTL:OE};function hp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function DE(e,t){let n=null,r;const i=$n(e);function s(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:d,top:c,width:h,height:p}=u;if(o||t(),!h||!p)return;const m=ea(c),E=ea(i.clientWidth-(d+h)),T=ea(i.clientHeight-(c+p)),b=ea(d),k={rootMargin:-m+"px "+-E+"px "+-T+"px "+-b+"px",threshold:nn(0,mr(1,l))||1};let P=!0;function D(v){const A=v[0].intersectionRatio;if(A!==l){if(!P)return a();A?a(!1,A):r=setTimeout(()=>{a(!1,1e-7)},1e3)}A===1&&!hp(u,e.getBoundingClientRect())&&a(),P=!1}try{n=new IntersectionObserver(D,{...k,root:i.ownerDocument})}catch{n=new IntersectionObserver(D,k)}n.observe(e)}return a(!0),s}function PE(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Cu(e),d=i||s?[...u?hs(u):[],...hs(t)]:[];d.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const c=u&&o?DE(u,n):null;let h=-1,p=null;a&&(p=new ResizeObserver(b=>{let[y]=b;y&&y.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var k;(k=p)==null||k.observe(t)})),n()}),u&&!l&&p.observe(u),p.observe(t));let m,E=l?Ur(e):null;l&&T();function T(){const b=Ur(e);E&&!hp(E,b)&&n(),E=b,m=requestAnimationFrame(T)}return n(),()=>{var b;d.forEach(y=>{i&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),c==null||c(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const ME=aE,BE=oE,FE=rE,HE=uE,UE=iE,Jc=nE,jE=lE,zE=(e,t,n)=>{const r=new Map,i={platform:LE,...n},s={...i.platform,_c:r};return tE(e,t,{...i,platform:s})};var $E=typeof document<"u",VE=function(){},xa=$E?x.useLayoutEffect:VE;function Ma(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(!Ma(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 s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!Ma(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function pp(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ed(e,t){const n=pp(e);return Math.round(t*n)/n}function Po(e){const t=x.useRef(e);return xa(()=>{t.current=e}),t}function WE(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:o=!0,whileElementsMounted:l,open:u}=e,[d,c]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=x.useState(r);Ma(h,r)||p(r);const[m,E]=x.useState(null),[T,b]=x.useState(null),y=x.useCallback(G=>{G!==v.current&&(v.current=G,E(G))},[]),k=x.useCallback(G=>{G!==A.current&&(A.current=G,b(G))},[]),P=s||m,D=a||T,v=x.useRef(null),A=x.useRef(null),N=x.useRef(d),z=l!=null,R=Po(l),W=Po(i),j=Po(u),w=x.useCallback(()=>{if(!v.current||!A.current)return;const G={placement:t,strategy:n,middleware:h};W.current&&(G.platform=W.current),zE(v.current,A.current,G).then(Q=>{const _={...Q,isPositioned:j.current!==!1};L.current&&!Ma(N.current,_)&&(N.current=_,Tu.flushSync(()=>{c(_)}))})},[h,t,n,W,j]);xa(()=>{u===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,c(G=>({...G,isPositioned:!1})))},[u]);const L=x.useRef(!1);xa(()=>(L.current=!0,()=>{L.current=!1}),[]),xa(()=>{if(P&&(v.current=P),D&&(A.current=D),P&&D){if(R.current)return R.current(P,D,w);w()}},[P,D,w,R,z]);const M=x.useMemo(()=>({reference:v,floating:A,setReference:y,setFloating:k}),[y,k]),H=x.useMemo(()=>({reference:P,floating:D}),[P,D]),U=x.useMemo(()=>{const G={position:n,left:0,top:0};if(!H.floating)return G;const Q=ed(H.floating,d.x),_=ed(H.floating,d.y);return o?{...G,transform:"translate("+Q+"px, "+_+"px)",...pp(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:_}},[n,o,H.floating,d.x,d.y]);return x.useMemo(()=>({...d,update:w,refs:M,elements:H,floatingStyles:U}),[d,w,M,H,U])}const YE=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?Jc({element:r.current,padding:i}).fn(n):{}:r?Jc({element:r,padding:i}).fn(n):{}}}},GE=(e,t)=>({...ME(e),options:[e,t]}),qE=(e,t)=>({...BE(e),options:[e,t]}),KE=(e,t)=>({...jE(e),options:[e,t]}),XE=(e,t)=>({...FE(e),options:[e,t]}),QE=(e,t)=>({...HE(e),options:[e,t]}),ZE=(e,t)=>({...UE(e),options:[e,t]}),JE=(e,t)=>({...YE(e),options:[e,t]});var eT="Arrow",mp=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return g.jsx(Gr.svg,{...s,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"})})});mp.displayName=eT;var tT=mp;function nT(e){const[t,n]=x.useState(void 0);return Hr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let a,o;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,o=u.blockSize}else a=e.offsetWidth,o=e.offsetHeight;n({width:a,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Au="Popper",[gp,bp]=Jh(Au),[rT,Ep]=gp(Au),Tp=e=>{const{__scopePopper:t,children:n}=e,[r,i]=x.useState(null);return g.jsx(rT,{scope:t,anchor:r,onAnchorChange:i,children:n})};Tp.displayName=Au;var xp="PopperAnchor",yp=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=Ep(xp,n),a=x.useRef(null),o=Yr(t,a),l=x.useRef(null);return x.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||a.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:g.jsx(Gr.div,{...i,ref:o})});yp.displayName=xp;var Su="PopperContent",[iT,sT]=gp(Su),_p=x.forwardRef((e,t)=>{var qe,X,ue,ke,Me,Ke;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:c="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:m,...E}=e,T=Ep(Su,n),[b,y]=x.useState(null),k=Yr(t,ze=>y(ze)),[P,D]=x.useState(null),v=nT(P),A=(v==null?void 0:v.width)??0,N=(v==null?void 0:v.height)??0,z=r+(s!=="center"?"-"+s:""),R=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},W=Array.isArray(u)?u:[u],j=W.length>0,w={padding:R,boundary:W.filter(oT),altBoundary:j},{refs:L,floatingStyles:M,placement:H,isPositioned:U,middlewareData:G}=WE({strategy:"fixed",placement:z,whileElementsMounted:(...ze)=>PE(...ze,{animationFrame:p==="always"}),elements:{reference:T.anchor},middleware:[GE({mainAxis:i+N,alignmentAxis:a}),l&&qE({mainAxis:!0,crossAxis:!1,limiter:c==="partial"?KE():void 0,...w}),l&&XE({...w}),QE({...w,apply:({elements:ze,rects:Be,availableWidth:nt,availableHeight:Xe})=>{const{width:Re,height:$e}=Be.reference,Ye=ze.floating.style;Ye.setProperty("--radix-popper-available-width",`${nt}px`),Ye.setProperty("--radix-popper-available-height",`${Xe}px`),Ye.setProperty("--radix-popper-anchor-width",`${Re}px`),Ye.setProperty("--radix-popper-anchor-height",`${$e}px`)}}),P&&JE({element:P,padding:o}),lT({arrowWidth:A,arrowHeight:N}),h&&ZE({strategy:"referenceHidden",...w})]}),[Q,_]=Cp(H),se=to(m);Hr(()=>{U&&(se==null||se())},[U,se]);const te=(qe=G.arrow)==null?void 0:qe.x,S=(X=G.arrow)==null?void 0:X.y,ge=((ue=G.arrow)==null?void 0:ue.centerOffset)!==0,[pe,me]=x.useState();return Hr(()=>{b&&me(window.getComputedStyle(b).zIndex)},[b]),g.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:U?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[(ke=G.transformOrigin)==null?void 0:ke.x,(Me=G.transformOrigin)==null?void 0:Me.y].join(" "),...((Ke=G.hide)==null?void 0:Ke.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(iT,{scope:n,placedSide:Q,onArrowChange:D,arrowX:te,arrowY:S,shouldHideArrow:ge,children:g.jsx(Gr.div,{"data-side":Q,"data-align":_,...E,ref:k,style:{...E.style,animation:U?void 0:"none"}})})})});_p.displayName=Su;var kp="PopperArrow",aT={top:"bottom",right:"left",bottom:"top",left:"right"},wp=x.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=sT(kp,r),a=aT[s.placedSide];return g.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:g.jsx(tT,{...i,ref:n,style:{...i.style,display:"block"}})})});wp.displayName=kp;function oT(e){return e!==null}var lT=e=>({name:"transformOrigin",options:e,fn(t){var T,b,y;const{placement:n,rects:r,middlewareData:i}=t,a=((T=i.arrow)==null?void 0:T.centerOffset)!==0,o=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,d]=Cp(n),c={start:"0%",center:"50%",end:"100%"}[d],h=(((b=i.arrow)==null?void 0:b.x)??0)+o/2,p=(((y=i.arrow)==null?void 0:y.y)??0)+l/2;let m="",E="";return u==="bottom"?(m=a?c:`${h}px`,E=`${-l}px`):u==="top"?(m=a?c:`${h}px`,E=`${r.floating.height+l}px`):u==="right"?(m=`${-l}px`,E=a?c:`${p}px`):u==="left"&&(m=`${r.floating.width+l}px`,E=a?c:`${p}px`),{data:{x:m,y:E}}}});function Cp(e){const[t,n="center"]=e.split("-");return[t,n]}var uT=Tp,cT=yp,dT=_p,fT=wp;function hT(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Ap=e=>{const{present:t,children:n}=e,r=pT(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),s=Yr(r.ref,mT(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:s}):null};Ap.displayName="Presence";function pT(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),s=x.useRef("none"),a=e?"mounted":"unmounted",[o,l]=hT(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const u=ta(r.current);s.current=o==="mounted"?u:"none"},[o]),Hr(()=>{const u=r.current,d=i.current;if(d!==e){const h=s.current,p=ta(u);e?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Hr(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,c=p=>{const E=ta(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&E&&(l("ANIMATION_END"),!i.current)){const T=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=T)})}},h=p=>{p.target===t&&(s.current=ta(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:x.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function ta(e){return(e==null?void 0:e.animationName)||"none"}function mT(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 gT=Kh[" useInsertionEffect ".trim().toString()]||Hr;function bT({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,a]=ET({defaultProp:t,onChange:n}),o=e!==void 0,l=o?e:i;{const d=x.useRef(e!==void 0);x.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=x.useCallback(d=>{var c;if(o){const h=TT(d)?d(e):d;h!==e&&((c=a.current)==null||c.call(a,h))}else s(d)},[o,e,s,a]);return[l,u]}function ET({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),s=x.useRef(t);return gT(()=>{s.current=t},[t]),x.useEffect(()=>{var a;i.current!==n&&((a=s.current)==null||a.call(s,n),i.current=n)},[n,i]),[n,r,s]}function TT(e){return typeof e=="function"}var xT=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"}),yT="VisuallyHidden",Sp=x.forwardRef((e,t)=>g.jsx(Gr.span,{...e,ref:t,style:{...xT,...e.style}}));Sp.displayName=yT;var _T=Sp,[ao]=Jh("Tooltip",[bp]),oo=bp(),Ip="TooltipProvider",kT=700,kl="tooltip.open",[wT,Iu]=ao(Ip),CT=e=>{const{__scopeTooltip:t,delayDuration:n=kT,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,a=x.useRef(!0),o=x.useRef(!1),l=x.useRef(0);return x.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),g.jsx(wT,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:o,onPointerInTransitChange:x.useCallback(u=>{o.current=u},[]),disableHoverableContent:i,children:s})};CT.displayName=Ip;var ps="Tooltip",[AT,lo]=ao(ps),vp=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:a,delayDuration:o}=e,l=Iu(ps,e.__scopeTooltip),u=oo(t),[d,c]=x.useState(null),h=$b(),p=x.useRef(0),m=a??l.disableHoverableContent,E=o??l.delayDuration,T=x.useRef(!1),[b,y]=bT({prop:r,defaultProp:i??!1,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(kl))):l.onClose(),s==null||s(A)},caller:ps}),k=x.useMemo(()=>b?T.current?"delayed-open":"instant-open":"closed",[b]),P=x.useCallback(()=>{window.clearTimeout(p.current),p.current=0,T.current=!1,y(!0)},[y]),D=x.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),v=x.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{T.current=!0,y(!0),p.current=0},E)},[E,y]);return x.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),g.jsx(uT,{...u,children:g.jsx(AT,{scope:t,contentId:h,open:b,stateAttribute:k,trigger:d,onTriggerChange:c,onTriggerEnter:x.useCallback(()=>{l.isOpenDelayedRef.current?v():P()},[l.isOpenDelayedRef,v,P]),onTriggerLeave:x.useCallback(()=>{m?D():(window.clearTimeout(p.current),p.current=0)},[D,m]),onOpen:P,onClose:D,disableHoverableContent:m,children:n})})};vp.displayName=ps;var wl="TooltipTrigger",Rp=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=lo(wl,n),s=Iu(wl,n),a=oo(n),o=x.useRef(null),l=Yr(t,o,i.onTriggerChange),u=x.useRef(!1),d=x.useRef(!1),c=x.useCallback(()=>u.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",c),[c]),g.jsx(cT,{asChild:!0,...a,children:g.jsx(Gr.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Xn(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:Xn(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:Xn(e.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:Xn(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:Xn(e.onBlur,i.onClose),onClick:Xn(e.onClick,i.onClose)})})});Rp.displayName=wl;var ST="TooltipPortal",[lM,IT]=ao(ST,{forceMount:void 0}),Ti="TooltipContent",Np=x.forwardRef((e,t)=>{const n=IT(Ti,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=e,a=lo(Ti,e.__scopeTooltip);return g.jsx(Ap,{present:r||a.open,children:a.disableHoverableContent?g.jsx(Op,{side:i,...s,ref:t}):g.jsx(vT,{side:i,...s,ref:t})})}),vT=x.forwardRef((e,t)=>{const n=lo(Ti,e.__scopeTooltip),r=Iu(Ti,e.__scopeTooltip),i=x.useRef(null),s=Yr(t,i),[a,o]=x.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:c}=r,h=x.useCallback(()=>{o(null),c(!1)},[c]),p=x.useCallback((m,E)=>{const T=m.currentTarget,b={x:m.clientX,y:m.clientY},y=DT(b,T.getBoundingClientRect()),k=PT(b,y),P=MT(E.getBoundingClientRect()),D=FT([...k,...P]);o(D),c(!0)},[c]);return x.useEffect(()=>()=>h(),[h]),x.useEffect(()=>{if(l&&d){const m=T=>p(T,d),E=T=>p(T,l);return l.addEventListener("pointerleave",m),d.addEventListener("pointerleave",E),()=>{l.removeEventListener("pointerleave",m),d.removeEventListener("pointerleave",E)}}},[l,d,p,h]),x.useEffect(()=>{if(a){const m=E=>{const T=E.target,b={x:E.clientX,y:E.clientY},y=(l==null?void 0:l.contains(T))||(d==null?void 0:d.contains(T)),k=!BT(b,a);y?h():k&&(h(),u())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,d,a,u,h]),g.jsx(Op,{...e,ref:s})}),[RT,NT]=ao(ps,{isInside:!1}),OT=Sb("TooltipContent"),Op=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...o}=e,l=lo(Ti,n),u=oo(n),{onClose:d}=l;return x.useEffect(()=>(document.addEventListener(kl,d),()=>document.removeEventListener(kl,d)),[d]),x.useEffect(()=>{if(l.trigger){const c=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",c,{capture:!0}),()=>window.removeEventListener("scroll",c,{capture:!0})}},[l.trigger,d]),g.jsx(np,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:c=>c.preventDefault(),onDismiss:d,children:g.jsxs(dT,{"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(OT,{children:r}),g.jsx(RT,{scope:n,isInside:!0,children:g.jsx(_T,{id:l.contentId,role:"tooltip",children:i||r})})]})})});Np.displayName=Ti;var Lp="TooltipArrow",LT=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=oo(n);return NT(Lp,n).isInside?null:g.jsx(fT,{...i,...r,ref:t})});LT.displayName=Lp;function DT(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function PT(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 MT(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 BT(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const o=t[s],l=t[a],u=o.x,d=o.y,c=l.x,h=l.y;d>r!=h>r&&n<(c-u)*(r-d)/(h-d)+u&&(i=!i)}return i}function FT(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),HT(t)}function HT(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 s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.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 s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.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 UT=vp,jT=Rp,Dp=Np;function Pp(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=Pp(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Pt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Pp(e))&&(r&&(r+=" "),r+=t);return r}const zT=(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},$T=(e,t)=>({classGroupId:e,validator:t}),Mp=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ba="-",td=[],VT="arbitrary..",WT=e=>{const t=GT(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return YT(a);const o=a.split(Ba),l=o[0]===""&&o.length>1?1:0;return Bp(o,l,t)},getConflictingClassGroupIds:(a,o)=>{if(o){const l=r[a],u=n[a];return l?u?zT(u,l):l:u||td}return n[a]||td}}},Bp=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],s=n.nextPart.get(i);if(s){const u=Bp(e,t+1,s);if(u)return u}const a=n.validators;if(a===null)return;const o=t===0?e.join(Ba):e.slice(t).join(Ba),l=a.length;for(let u=0;u<l;u++){const d=a[u];if(d.validator(o))return d.classGroupId}},YT=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?VT+r:void 0})(),GT=e=>{const{theme:t,classGroups:n}=e;return qT(n,t)},qT=(e,t)=>{const n=Mp();for(const r in e){const i=e[r];vu(i,n,r,t)}return n},vu=(e,t,n,r)=>{const i=e.length;for(let s=0;s<i;s++){const a=e[s];KT(a,t,n,r)}},KT=(e,t,n,r)=>{if(typeof e=="string"){XT(e,t,n);return}if(typeof e=="function"){QT(e,t,n,r);return}ZT(e,t,n,r)},XT=(e,t,n)=>{const r=e===""?t:Fp(t,e);r.classGroupId=n},QT=(e,t,n,r)=>{if(JT(e)){vu(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push($T(n,e))},ZT=(e,t,n,r)=>{const i=Object.entries(e),s=i.length;for(let a=0;a<s;a++){const[o,l]=i[a];vu(l,Fp(t,o),n,r)}},Fp=(e,t)=>{let n=e;const r=t.split(Ba),i=r.length;for(let s=0;s<i;s++){const a=r[s];let o=n.nextPart.get(a);o||(o=Mp(),n.nextPart.set(a,o)),n=o}return n},JT=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ex=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(s,a)=>{n[s]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let a=n[s];if(a!==void 0)return a;if((a=r[s])!==void 0)return i(s,a),a},set(s,a){s in n?n[s]=a:i(s,a)}}},Cl="!",nd=":",tx=[],rd=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),nx=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let a=0,o=0,l=0,u;const d=i.length;for(let E=0;E<d;E++){const T=i[E];if(a===0&&o===0){if(T===nd){s.push(i.slice(l,E)),l=E+1;continue}if(T==="/"){u=E;continue}}T==="["?a++:T==="]"?a--:T==="("?o++:T===")"&&o--}const c=s.length===0?i:i.slice(l);let h=c,p=!1;c.endsWith(Cl)?(h=c.slice(0,-1),p=!0):c.startsWith(Cl)&&(h=c.slice(1),p=!0);const m=u&&u>l?u-l:void 0;return rd(s,p,h,m)};if(t){const i=t+nd,s=r;r=a=>a.startsWith(i)?s(a.slice(i.length)):rd(tx,!1,a,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},rx=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let s=0;s<n.length;s++){const a=n[s],o=a[0]==="[",l=t.has(a);o||l?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(a)):i.push(a)}return i.length>0&&(i.sort(),r.push(...i)),r}},ix=e=>({cache:ex(e.cacheSize),parseClassName:nx(e),sortModifiers:rx(e),...WT(e)}),sx=/\s+/,ax=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=t,a=[],o=e.trim().split(sx);let l="";for(let u=o.length-1;u>=0;u-=1){const d=o[u],{isExternal:c,modifiers:h,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:E}=n(d);if(c){l=d+(l.length>0?" "+l:l);continue}let T=!!E,b=r(T?m.substring(0,E):m);if(!b){if(!T){l=d+(l.length>0?" "+l:l);continue}if(b=r(m),!b){l=d+(l.length>0?" "+l:l);continue}T=!1}const y=h.length===0?"":h.length===1?h[0]:s(h).join(":"),k=p?y+Cl:y,P=k+b;if(a.indexOf(P)>-1)continue;a.push(P);const D=i(b,T);for(let v=0;v<D.length;++v){const A=D[v];a.push(k+A)}l=d+(l.length>0?" "+l:l)}return l},ox=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=Hp(n))&&(i&&(i+=" "),i+=r);return i},Hp=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Hp(e[r]))&&(n&&(n+=" "),n+=t);return n},lx=(e,...t)=>{let n,r,i,s;const a=l=>{const u=t.reduce((d,c)=>c(d),e());return n=ix(u),r=n.cache.get,i=n.cache.set,s=o,o(l)},o=l=>{const u=r(l);if(u)return u;const d=ax(l,n);return i(l,d),d};return s=a,(...l)=>s(ox(...l))},ux=[],Et=e=>{const t=n=>n[e]||ux;return t.isThemeGetter=!0,t},Up=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,jp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,cx=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,dx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fx=/\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$/,hx=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,px=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sr=e=>cx.test(e),Ne=e=>!!e&&!Number.isNaN(Number(e)),ar=e=>!!e&&Number.isInteger(Number(e)),Mo=e=>e.endsWith("%")&&Ne(e.slice(0,-1)),Gn=e=>dx.test(e),zp=()=>!0,gx=e=>fx.test(e)&&!hx.test(e),Ru=()=>!1,bx=e=>px.test(e),Ex=e=>mx.test(e),Tx=e=>!ce(e)&&!fe(e),xx=e=>xr(e,Wp,Ru),ce=e=>Up.test(e),Ir=e=>xr(e,Yp,gx),id=e=>xr(e,Ix,Ne),yx=e=>xr(e,qp,zp),_x=e=>xr(e,Gp,Ru),sd=e=>xr(e,$p,Ru),kx=e=>xr(e,Vp,Ex),na=e=>xr(e,Kp,bx),fe=e=>jp.test(e),Di=e=>qr(e,Yp),wx=e=>qr(e,Gp),ad=e=>qr(e,$p),Cx=e=>qr(e,Wp),Ax=e=>qr(e,Vp),ra=e=>qr(e,Kp,!0),Sx=e=>qr(e,qp,!0),xr=(e,t,n)=>{const r=Up.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},qr=(e,t,n=!1)=>{const r=jp.exec(e);return r?r[1]?t(r[1]):n:!1},$p=e=>e==="position"||e==="percentage",Vp=e=>e==="image"||e==="url",Wp=e=>e==="length"||e==="size"||e==="bg-size",Yp=e=>e==="length",Ix=e=>e==="number",Gp=e=>e==="family-name",qp=e=>e==="number"||e==="weight",Kp=e=>e==="shadow",vx=()=>{const e=Et("color"),t=Et("font"),n=Et("text"),r=Et("font-weight"),i=Et("tracking"),s=Et("leading"),a=Et("breakpoint"),o=Et("container"),l=Et("spacing"),u=Et("radius"),d=Et("shadow"),c=Et("inset-shadow"),h=Et("text-shadow"),p=Et("drop-shadow"),m=Et("blur"),E=Et("perspective"),T=Et("aspect"),b=Et("ease"),y=Et("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...P(),fe,ce],v=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],N=()=>[fe,ce,l],z=()=>[sr,"full","auto",...N()],R=()=>[ar,"none","subgrid",fe,ce],W=()=>["auto",{span:["full",ar,fe,ce]},ar,fe,ce],j=()=>[ar,"auto",fe,ce],w=()=>["auto","min","max","fr",fe,ce],L=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],M=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...N()],U=()=>[sr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],G=()=>[sr,"screen","full","dvw","lvw","svw","min","max","fit",...N()],Q=()=>[sr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...N()],_=()=>[e,fe,ce],se=()=>[...P(),ad,sd,{position:[fe,ce]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],S=()=>["auto","cover","contain",Cx,xx,{size:[fe,ce]}],ge=()=>[Mo,Di,Ir],pe=()=>["","none","full",u,fe,ce],me=()=>["",Ne,Di,Ir],qe=()=>["solid","dashed","dotted","double"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[Ne,Mo,ad,sd],ke=()=>["","none",m,fe,ce],Me=()=>["none",Ne,fe,ce],Ke=()=>["none",Ne,fe,ce],ze=()=>[Ne,fe,ce],Be=()=>[sr,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Gn],breakpoint:[Gn],color:[zp],container:[Gn],"drop-shadow":[Gn],ease:["in","out","in-out"],font:[Tx],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Gn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Gn],shadow:[Gn],spacing:["px",Ne],text:[Gn],"text-shadow":[Gn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",sr,ce,fe,T]}],container:["container"],columns:[{columns:[Ne,ce,fe,o]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"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:D()}],overflow:[{overflow:v()}],"overflow-x":[{"overflow-x":v()}],"overflow-y":[{"overflow-y":v()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{"inset-s":z(),start:z()}],end:[{"inset-e":z(),end:z()}],"inset-bs":[{"inset-bs":z()}],"inset-be":[{"inset-be":z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[ar,"auto",fe,ce]}],basis:[{basis:[sr,"full","auto",o,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ne,sr,"auto","initial","none",ce]}],grow:[{grow:["",Ne,fe,ce]}],shrink:[{shrink:["",Ne,fe,ce]}],order:[{order:[ar,"first","last","none",fe,ce]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":w()}],"auto-rows":[{"auto-rows":w()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...L(),"normal"]}],"justify-items":[{"justify-items":[...M(),"normal"]}],"justify-self":[{"justify-self":["auto",...M()]}],"align-content":[{content:["normal",...L()]}],"align-items":[{items:[...M(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...M(),{baseline:["","last"]}]}],"place-content":[{"place-content":L()}],"place-items":[{"place-items":[...M(),"baseline"]}],"place-self":[{"place-self":["auto",...M()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pbs:[{pbs:N()}],pbe:[{pbe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],"inline-size":[{inline:["auto",...G()]}],"min-inline-size":[{"min-inline":["auto",...G()]}],"max-inline-size":[{"max-inline":["none",...G()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[o,"screen",...U()]}],"min-w":[{"min-w":[o,"screen","none",...U()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh",...U()]}],"font-size":[{text:["base",n,Di,Ir]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Sx,yx]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mo,ce]}],"font-family":[{font:[wx,_x,t]}],"font-features":[{"font-features":[ce]}],"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,fe,ce]}],"line-clamp":[{"line-clamp":[Ne,"none",fe,id]}],leading:[{leading:[s,...N()]}],"list-image":[{"list-image":["none",fe,ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fe,ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...qe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ne,"from-font","auto",fe,Ir]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Ne,"auto",fe,ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe,ce]}],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",fe,ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:se()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:S()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ar,fe,ce],radial:["",fe,ce],conic:[ar,fe,ce]},Ax,kx]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:ge()}],"gradient-via-pos":[{via:ge()}],"gradient-to-pos":[{to:ge()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:pe()}],"rounded-s":[{"rounded-s":pe()}],"rounded-e":[{"rounded-e":pe()}],"rounded-t":[{"rounded-t":pe()}],"rounded-r":[{"rounded-r":pe()}],"rounded-b":[{"rounded-b":pe()}],"rounded-l":[{"rounded-l":pe()}],"rounded-ss":[{"rounded-ss":pe()}],"rounded-se":[{"rounded-se":pe()}],"rounded-ee":[{"rounded-ee":pe()}],"rounded-es":[{"rounded-es":pe()}],"rounded-tl":[{"rounded-tl":pe()}],"rounded-tr":[{"rounded-tr":pe()}],"rounded-br":[{"rounded-br":pe()}],"rounded-bl":[{"rounded-bl":pe()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-bs":[{"border-bs":me()}],"border-w-be":[{"border-be":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":me()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...qe(),"hidden","none"]}],"divide-style":[{divide:[...qe(),"hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-bs":[{"border-bs":_()}],"border-color-be":[{"border-be":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...qe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ne,fe,ce]}],"outline-w":[{outline:["",Ne,Di,Ir]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",d,ra,na]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",c,ra,na]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Ne,Ir]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",h,ra,na]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Ne,fe,ce]}],"mix-blend":[{"mix-blend":[...X(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":X()}],"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":[Ne]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[fe,ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"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":P()}],"mask-image-conic-pos":[{"mask-conic":[Ne]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:se()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:S()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fe,ce]}],filter:[{filter:["","none",fe,ce]}],blur:[{blur:ke()}],brightness:[{brightness:[Ne,fe,ce]}],contrast:[{contrast:[Ne,fe,ce]}],"drop-shadow":[{"drop-shadow":["","none",p,ra,na]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Ne,fe,ce]}],"hue-rotate":[{"hue-rotate":[Ne,fe,ce]}],invert:[{invert:["",Ne,fe,ce]}],saturate:[{saturate:[Ne,fe,ce]}],sepia:[{sepia:["",Ne,fe,ce]}],"backdrop-filter":[{"backdrop-filter":["","none",fe,ce]}],"backdrop-blur":[{"backdrop-blur":ke()}],"backdrop-brightness":[{"backdrop-brightness":[Ne,fe,ce]}],"backdrop-contrast":[{"backdrop-contrast":[Ne,fe,ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ne,fe,ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ne,fe,ce]}],"backdrop-invert":[{"backdrop-invert":["",Ne,fe,ce]}],"backdrop-opacity":[{"backdrop-opacity":[Ne,fe,ce]}],"backdrop-saturate":[{"backdrop-saturate":[Ne,fe,ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Ne,fe,ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fe,ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ne,"initial",fe,ce]}],ease:[{ease:["linear","initial",b,fe,ce]}],delay:[{delay:[Ne,fe,ce]}],animate:[{animate:["none",y,fe,ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,fe,ce]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Me()}],"rotate-x":[{"rotate-x":Me()}],"rotate-y":[{"rotate-y":Me()}],"rotate-z":[{"rotate-z":Me()}],scale:[{scale:Ke()}],"scale-x":[{"scale-x":Ke()}],"scale-y":[{"scale-y":Ke()}],"scale-z":[{"scale-z":Ke()}],"scale-3d":["scale-3d"],skew:[{skew:ze()}],"skew-x":[{"skew-x":ze()}],"skew-y":[{"skew-y":ze()}],transform:[{transform:[fe,ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Be()}],"translate-x":[{"translate-x":Be()}],"translate-y":[{"translate-y":Be()}],"translate-z":[{"translate-z":Be()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"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",fe,ce]}],"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":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mbs":[{"scroll-mbs":N()}],"scroll-mbe":[{"scroll-mbe":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pbs":[{"scroll-pbs":N()}],"scroll-pbe":[{"scroll-pbe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",fe,ce]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[Ne,Di,Ir,id]}],stroke:[{stroke:["none",..._()]}],"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"]}},Nu=lx(vx);/**
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>${Kn(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=lh(e);if(i===null)return r;e=i;let s='<a href="'+e+'"';return t&&(s+=' title="'+Kn(t)+'"'),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=lh(e);if(i===null)return Kn(n);e=i;let s=`<img src="${e}" alt="${n}"`;return t&&(s+=` title="${Kn(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Kn(e.text)}},Ac=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}},wn=class iu{constructor(t){Ve(this,"options");Ve(this,"renderer");Ve(this,"textRenderer");this.options=t||ti,this.options.renderer=this.options.renderer||new Qa,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ac}static parse(t,n){return new iu(n).parse(t)}static parseInline(t,n){return new iu(n).parseInline(t)}parse(t){var r,i;let n="";for(let s=0;s<t.length;s++){let a=t[s];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[a.type]){let l=a,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=a;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,s;let r="";for(let a=0;a<t.length;a++){let o=t[a];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[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}},Ta,Xi=(Ta=class{constructor(e){Ve(this,"options");Ve(this,"block");this.options=e||ti}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?hn.lex:hn.lexInline}provideParser(){return this.block?wn.parse:wn.parseInline}},Ve(Ta,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ve(Ta,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Ta),ML=class{constructor(...e){Ve(this,"defaults",Ec());Ve(this,"options",this.setOptions);Ve(this,"parse",this.parseMarkdown(!0));Ve(this,"parseInline",this.parseMarkdown(!1));Ve(this,"Parser",wn);Ve(this,"Renderer",Qa);Ve(this,"TextRenderer",Ac);Ve(this,"Lexer",hn);Ve(this,"Tokenizer",Xa);Ve(this,"Hooks",Xi);this.use(...e)}walkTokens(e,t){var r,i;let n=[];for(let s of e)switch(n=n.concat(t.call(this,s)),s.type){case"table":{let a=s;for(let o of a.header)n=n.concat(this.walkTokens(o.tokens,t));for(let o of a.rows)for(let l of o)n=n.concat(this.walkTokens(l.tokens,t));break}case"list":{let a=s;n=n.concat(this.walkTokens(a.items,t));break}default:{let a=s;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[a.type]?this.defaults.extensions.childTokens[a.type].forEach(o=>{let l=a[o].flat(1/0);n=n.concat(this.walkTokens(l,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.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 s=t.renderers[i.name];s?t.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===!1&&(o=s.apply(this,a)),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 s=t[i.level];s?s.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 Qa(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,o=n.renderer[a],l=i[a];i[a]=(...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 Xa(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,o=n.tokenizer[a],l=i[a];i[a]=(...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 Xi;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,o=n.hooks[a],l=i[a];Xi.passThroughHooks.has(s)?i[a]=u=>{if(this.defaults.async&&Xi.passThroughHooksRespectAsync.has(s))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[a]=(...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,s=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),i&&(o=o.concat(i.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return hn.lex(e,t??this.defaults)}parser(e,t){return wn.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return s(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 s(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return s(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 a=i.hooks?await i.hooks.preprocess(t):t,o=await(i.hooks?await i.hooks.provideLexer():e?hn.lex:hn.lexInline)(a,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?wn.parse:wn.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let a=(i.hooks?i.hooks.provideLexer():e?hn.lex:hn.lexInline)(t,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let o=(i.hooks?i.hooks.provideParser():e?wn.parse:wn.parseInline)(a,i);return i.hooks&&(o=i.hooks.postprocess(o)),o}catch(a){return s(a)}}}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>"+Kn(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},Vr=new ML;function Qe(e,t){return Vr.parse(e,t)}Qe.options=Qe.setOptions=function(e){return Vr.setOptions(e),Qe.defaults=Vr.defaults,c1(Qe.defaults),Qe};Qe.getDefaults=Ec;Qe.defaults=ti;Qe.use=function(...e){return Vr.use(...e),Qe.defaults=Vr.defaults,c1(Qe.defaults),Qe};Qe.walkTokens=function(e,t){return Vr.walkTokens(e,t)};Qe.parseInline=Vr.parseInline;Qe.Parser=wn;Qe.parser=wn.parse;Qe.Renderer=Qa;Qe.TextRenderer=Ac;Qe.Lexer=hn;Qe.lexer=hn.lex;Qe.Tokenizer=Xa;Qe.Hooks=Xi;Qe.parse=Qe;Qe.options;Qe.setOptions;Qe.use;Qe.walkTokens;Qe.parseInline;wn.parse;hn.lex;var BL=300,FL="300px",HL=500;function UL(e={}){let{immediate:t=!1,debounceDelay:n=BL,rootMargin:r=FL,idleTimeout:i=HL}=e,[s,a]=x.useState(!1),o=x.useRef(null),l=x.useRef(null),u=x.useRef(null),d=x.useMemo(()=>p=>{let m=Date.now();return window.setTimeout(()=>{p({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-m))})},1)},[]),c=x.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(p,m)=>window.requestIdleCallback(p,m):d,[d]),h=x.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?p=>window.cancelIdleCallback(p):p=>{clearTimeout(p)},[]);return x.useEffect(()=>{if(t){a(!0);return}let p=o.current;if(!p)return;l.current&&(clearTimeout(l.current),l.current=null),u.current&&(h(u.current),u.current=null);let m=()=>{l.current&&(clearTimeout(l.current),l.current=null),u.current&&(h(u.current),u.current=null)},E=k=>{u.current=c(P=>{P.timeRemaining()>0||P.didTimeout?(a(!0),k.disconnect()):u.current=c(()=>{a(!0),k.disconnect()},{timeout:i/2})},{timeout:i})},T=k=>{m(),l.current=window.setTimeout(()=>{var P,D;let v=k.takeRecords();(v.length===0||(D=(P=v.at(-1))==null?void 0:P.isIntersecting)!=null&&D)&&E(k)},n)},b=(k,P)=>{k.isIntersecting?T(P):m()},y=new IntersectionObserver(k=>{for(let P of k)b(P,y)},{rootMargin:r,threshold:0});return y.observe(p),()=>{l.current&&clearTimeout(l.current),u.current&&h(u.current),y.disconnect()}},[t,n,r,i,h,c]),{shouldRender:s,containerRef:o}}var _1=/\s/,jL=/^\s+$/,zL=new Set(["code","pre","svg","math","annotation"]),$L=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",VL=e=>e.some(t=>$L(t)&&zL.has(t.tagName)),WL=e=>{let t=[],n="",r=!1;for(let i of e){let s=_1.test(i);s!==r&&n&&(t.push(n),n=""),n+=i,r=s}return n&&t.push(n),t},YL=e=>{let t=[],n="";for(let r of e)_1.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},GL=(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}]}),qL=(e,t,n)=>{let r=t.at(-1);if(!(r&&"children"in r))return;if(VL(t))return dg;let i=r,s=i.children.indexOf(e);if(s===-1)return;let a=e.value;if(!a.trim())return;let o=(n.sep==="char"?YL(a):WL(a)).map(l=>jL.test(l)?{type:"text",value:l}:GL(l,n.animation,n.duration,n.easing));return i.children.splice(s,1,...o),s+o.length};function su(e){var t,n,r,i;let s={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:()=>a=>{fg(a,"text",(o,l)=>qL(o,l,s))}}}su();var k1=x.createContext(!1),KL=()=>x.useContext(k1),ye=(...e)=>Nu(Pt(e)),bi=(e,t,n)=>{let r=typeof t=="string"?new Blob([t],{type:n}):t,i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)},XL=ye("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"),QL=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let i=n.slice(0,r).trim(),s=n.slice(r+1).trim();i&&s&&(t[i]=s)}}return t},ZL=x.memo(({children:e,result:t,language:n,className:r,...i})=>{let s=x.useMemo(()=>{let a={};return t.bg&&(a["--sdm-bg"]=t.bg),t.fg&&(a["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(a,QL(t.rootStyle)),a},[t.bg,t.fg,t.rootStyle]);return g.jsx("div",{className:ye(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:ye(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:s,children:g.jsx("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:t.tokens.map((a,o)=>g.jsx("span",{className:XL,children:a.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[h,p]of Object.entries(l.htmlStyle))h==="color"?d["--sdm-c"]=p:h==="background-color"?(d["--sdm-tbg"]=p,c=!0):d[h]=p;return g.jsx("span",{className:ye("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),JL=({className:e,language:t,style:n,isIncomplete:r,...i})=>g.jsx("div",{className:ye("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}),w1=x.createContext({code:""}),C1=()=>x.useContext(w1),e6=({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})}),t6=/\n+$/,n6=x.lazy(()=>_s(()=>import("./highlighted-body-B3W2YXNL-BAmp2St7.js"),__vite__mapDeps([0,1])).then(e=>({default:e.HighlightedCodeBlockBody}))),r6=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,...s})=>{let a=x.useMemo(()=>e.replace(t6,""),[e]),o=x.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:a.split(`
160
+ Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+Kn(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},Vr=new ML;function Qe(e,t){return Vr.parse(e,t)}Qe.options=Qe.setOptions=function(e){return Vr.setOptions(e),Qe.defaults=Vr.defaults,c1(Qe.defaults),Qe};Qe.getDefaults=Ec;Qe.defaults=ti;Qe.use=function(...e){return Vr.use(...e),Qe.defaults=Vr.defaults,c1(Qe.defaults),Qe};Qe.walkTokens=function(e,t){return Vr.walkTokens(e,t)};Qe.parseInline=Vr.parseInline;Qe.Parser=wn;Qe.parser=wn.parse;Qe.Renderer=Qa;Qe.TextRenderer=Ac;Qe.Lexer=hn;Qe.lexer=hn.lex;Qe.Tokenizer=Xa;Qe.Hooks=Xi;Qe.parse=Qe;Qe.options;Qe.setOptions;Qe.use;Qe.walkTokens;Qe.parseInline;wn.parse;hn.lex;var BL=300,FL="300px",HL=500;function UL(e={}){let{immediate:t=!1,debounceDelay:n=BL,rootMargin:r=FL,idleTimeout:i=HL}=e,[s,a]=x.useState(!1),o=x.useRef(null),l=x.useRef(null),u=x.useRef(null),d=x.useMemo(()=>p=>{let m=Date.now();return window.setTimeout(()=>{p({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-m))})},1)},[]),c=x.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(p,m)=>window.requestIdleCallback(p,m):d,[d]),h=x.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?p=>window.cancelIdleCallback(p):p=>{clearTimeout(p)},[]);return x.useEffect(()=>{if(t){a(!0);return}let p=o.current;if(!p)return;l.current&&(clearTimeout(l.current),l.current=null),u.current&&(h(u.current),u.current=null);let m=()=>{l.current&&(clearTimeout(l.current),l.current=null),u.current&&(h(u.current),u.current=null)},E=k=>{u.current=c(P=>{P.timeRemaining()>0||P.didTimeout?(a(!0),k.disconnect()):u.current=c(()=>{a(!0),k.disconnect()},{timeout:i/2})},{timeout:i})},T=k=>{m(),l.current=window.setTimeout(()=>{var P,D;let v=k.takeRecords();(v.length===0||(D=(P=v.at(-1))==null?void 0:P.isIntersecting)!=null&&D)&&E(k)},n)},b=(k,P)=>{k.isIntersecting?T(P):m()},y=new IntersectionObserver(k=>{for(let P of k)b(P,y)},{rootMargin:r,threshold:0});return y.observe(p),()=>{l.current&&clearTimeout(l.current),u.current&&h(u.current),y.disconnect()}},[t,n,r,i,h,c]),{shouldRender:s,containerRef:o}}var _1=/\s/,jL=/^\s+$/,zL=new Set(["code","pre","svg","math","annotation"]),$L=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",VL=e=>e.some(t=>$L(t)&&zL.has(t.tagName)),WL=e=>{let t=[],n="",r=!1;for(let i of e){let s=_1.test(i);s!==r&&n&&(t.push(n),n=""),n+=i,r=s}return n&&t.push(n),t},YL=e=>{let t=[],n="";for(let r of e)_1.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},GL=(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}]}),qL=(e,t,n)=>{let r=t.at(-1);if(!(r&&"children"in r))return;if(VL(t))return dg;let i=r,s=i.children.indexOf(e);if(s===-1)return;let a=e.value;if(!a.trim())return;let o=(n.sep==="char"?YL(a):WL(a)).map(l=>jL.test(l)?{type:"text",value:l}:GL(l,n.animation,n.duration,n.easing));return i.children.splice(s,1,...o),s+o.length};function su(e){var t,n,r,i;let s={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:()=>a=>{fg(a,"text",(o,l)=>qL(o,l,s))}}}su();var k1=x.createContext(!1),KL=()=>x.useContext(k1),ye=(...e)=>Nu(Pt(e)),bi=(e,t,n)=>{let r=typeof t=="string"?new Blob([t],{type:n}):t,i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)},XL=ye("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"),QL=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let i=n.slice(0,r).trim(),s=n.slice(r+1).trim();i&&s&&(t[i]=s)}}return t},ZL=x.memo(({children:e,result:t,language:n,className:r,...i})=>{let s=x.useMemo(()=>{let a={};return t.bg&&(a["--sdm-bg"]=t.bg),t.fg&&(a["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(a,QL(t.rootStyle)),a},[t.bg,t.fg,t.rootStyle]);return g.jsx("div",{className:ye(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:ye(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:s,children:g.jsx("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:t.tokens.map((a,o)=>g.jsx("span",{className:XL,children:a.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[h,p]of Object.entries(l.htmlStyle))h==="color"?d["--sdm-c"]=p:h==="background-color"?(d["--sdm-tbg"]=p,c=!0):d[h]=p;return g.jsx("span",{className:ye("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),JL=({className:e,language:t,style:n,isIncomplete:r,...i})=>g.jsx("div",{className:ye("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}),w1=x.createContext({code:""}),C1=()=>x.useContext(w1),e6=({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})}),t6=/\n+$/,n6=x.lazy(()=>_s(()=>import("./highlighted-body-B3W2YXNL-DmGJDYCd.js"),__vite__mapDeps([0,1])).then(e=>({default:e.HighlightedCodeBlockBody}))),r6=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,...s})=>{let a=x.useMemo(()=>e.replace(t6,""),[e]),o=x.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:a.split(`
161
161
  `).map(l=>[{content:l,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[a]);return g.jsx(w1.Provider,{value:{code:e},children:g.jsxs(JL,{isIncomplete:i,language:t,children:[g.jsx(e6,{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(x.Suspense,{fallback:g.jsx(ZL,{className:n,language:t,result:o,...s}),children:g.jsx(n6,{className:n,code:a,language:t,raw:o,...s})})]})})},Sc=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"})}),Ic=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"})}),Io=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"})}),i6=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"})]}),s6=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"})}),a6=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"})}),A1=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"})}),dh=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"})}),o6=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"})}),l6=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"})}),fh=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:s,...a})=>{let[o,l]=x.useState(!1),u=x.useRef(0),{code:d}=C1(),{isAnimating:c}=x.useContext(En),h=s??d,p=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(h),l(!0),e==null||e(),u.current=window.setTimeout(()=>l(!1),n))}catch(T){t==null||t(T)}};x.useEffect(()=>()=>{window.clearTimeout(u.current)},[]);let m=o?Sc:Ic;return g.jsx("button",{className:ye("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:p,title:"Copy Code",type:"button",...a,children:r??g.jsx(m,{size:14})})},hh={"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"},u6=({onDownload:e,onError:t,language:n,children:r,className:i,code:s,...a})=>{let{code:o}=C1(),{isAnimating:l}=x.useContext(En),u=s??o,d=`file.${n&&n in hh?hh[n]:"txt"}`,c="text/plain",h=()=>{try{bi(d,u,c),e==null||e()}catch(p){t==null||t(p)}};return g.jsx("button",{className:ye("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:h,title:"Download file",type:"button",...a,children:r??g.jsx(Io,{size:14})})},c6=()=>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(i6,{className:"size-4 animate-spin"})})]}),d6=/\.[^/.]+$/,f6=({node:e,className:t,src:n,alt:r,onLoad:i,onError:s,...a})=>{let o=x.useRef(null),[l,u]=x.useState(!1),[d,c]=x.useState(!1),h=a.width!=null||a.height!=null,p=(l||h)&&!d,m=d&&!h;x.useEffect(()=>{let y=o.current;if(y!=null&&y.complete){let k=y.naturalWidth>0;u(k),c(!k)}},[]);let E=x.useCallback(y=>{u(!0),c(!1),i==null||i(y)},[i]),T=x.useCallback(y=>{u(!1),c(!0),s==null||s(y)},[s]),b=async()=>{if(n)try{let y=await(await fetch(n)).blob(),k=new URL(n,window.location.origin).pathname.split("/").pop()||"",P=k.split(".").pop(),D=k.includes(".")&&P!==void 0&&P.length<=4,v="";if(D)v=k;else{let A=y.type,N="png";A.includes("jpeg")||A.includes("jpg")?N="jpg":A.includes("png")?N="png":A.includes("svg")?N="svg":A.includes("gif")?N="gif":A.includes("webp")&&(N="webp"),v=`${(r||k||"image").replace(d6,"")}.${N}`}bi(v,y,y.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:ye("max-w-full rounded-lg",m&&"hidden",t),"data-streamdown":"image",onError:T,onLoad:E,ref:o,src:n,...a}),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"}),p&&g.jsx("button",{className:ye("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:b,title:"Download image",type:"button",children:g.jsx(Io,{size:14})})]}):null},cs=0,h6=()=>{cs+=1,cs===1&&(document.body.style.overflow="hidden")},p6=()=>{cs=Math.max(0,cs-1),cs===0&&(document.body.style.overflow="")},m6=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let[i,s]=x.useState(!1),a=x.useCallback(async()=>{try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),2e3)}catch{}},[e]),o=x.useCallback(()=>{r(),n()},[r,n]);return x.useEffect(()=>{if(t){h6();let l=u=>{u.key==="Escape"&&n()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l),p6()}}},[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(A1,{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(dh,{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:ye("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:a,type:"button",children:i?g.jsxs(g.Fragment,{children:[g.jsx(Sc,{size:14}),g.jsx("span",{children:"Copied"})]}):g.jsxs(g.Fragment,{children:[g.jsx(Ic,{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(dh,{size:14}),g.jsx("span",{children:"Open link"})]})]})]})}):null},au=x.createContext(null),S1=()=>x.useContext(au),xM=()=>{var e;let t=S1();return(e=t==null?void 0:t.code)!=null?e:null},vc=()=>{var e;let t=S1();return(e=t==null?void 0:t.mermaid)!=null?e:null},g6=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,s)=>{let a="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){s(new Error("Failed to create 2D canvas context for PNG export"));return}c.drawImage(o,0,0,u,d),l.toBlob(h=>{if(!h){s(new Error("Failed to create PNG blob"));return}i(h)},"image/png")},o.onerror=()=>s(new Error("Failed to load SVG image")),o.src=a})},b6=({chart:e,children:t,className:n,onDownload:r,config:i,onError:s})=>{let[a,o]=x.useState(!1),l=x.useRef(null),{isAnimating:u}=x.useContext(En),d=vc(),c=async h=>{try{if(h==="mmd"){bi("diagram.mmd",e,"text/plain"),o(!1),r==null||r(h);return}if(!d){s==null||s(new Error("Mermaid plugin not available"));return}let p=d.getMermaid(i),m=e.split("").reduce((b,y)=>(b<<5)-b+y.charCodeAt(0)|0,0),E=`mermaid-${Math.abs(m)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:T}=await p.render(E,e);if(!T){s==null||s(new Error("SVG not found. Please wait for the diagram to render."));return}if(h==="svg"){bi("diagram.svg",T,"image/svg+xml"),o(!1),r==null||r(h);return}if(h==="png"){let b=await g6(T);bi("diagram.png",b,"image/png"),r==null||r(h),o(!1);return}}catch(p){s==null||s(p)}};return x.useEffect(()=>{let h=p=>{let m=p.composedPath();l.current&&!m.includes(l.current)&&o(!1)};return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[]),g.jsxs("div",{className:"relative",ref:l,children:[g.jsx("button",{className:ye("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:u,onClick:()=>o(!a),title:"Download diagram",type:"button",children:t??g.jsx(Io,{size:14})}),a?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]})},ds=0,E6=()=>{ds+=1,ds===1&&(document.body.style.overflow="hidden")},T6=()=>{ds=Math.max(0,ds-1),ds===0&&(document.body.style.overflow="")},x6=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...s})=>{let[a,o]=x.useState(!1),{isAnimating:l,controls:u}=x.useContext(En),d=(()=>{if(typeof u=="boolean")return u;let h=u.mermaid;return h===!1?!1:h===!0||h===void 0?!0:h.panZoom!==!1})(),c=()=>{o(!a)};return x.useEffect(()=>{if(a){E6();let h=p=>{p.key==="Escape"&&o(!1)};return document.addEventListener("keydown",h),()=>{document.removeEventListener("keydown",h),T6()}}},[a]),x.useEffect(()=>{a?n==null||n():r&&r()},[a,n,r]),g.jsxs(g.Fragment,{children:[g.jsx("button",{className:ye("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",...s,children:g.jsx(s6,{size:14})}),a?Tu.createPortal(g.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm",onClick:c,onKeyDown:h=>{h.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(A1,{size:20})}),g.jsx("div",{className:"flex size-full items-center justify-center p-4",onClick:h=>h.stopPropagation(),onKeyDown:h=>h.stopPropagation(),role:"presentation",children:g.jsx(nb,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:t,fullscreen:!0,showControls:d})})]}),document.body):null]})},I1=e=>{var t,n;let r=[],i=[],s=e.querySelectorAll("thead th");for(let o of s)r.push(((t=o.textContent)==null?void 0:t.trim())||"");let a=e.querySelectorAll("tbody tr");for(let o of a){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}},v1=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,s=new Array(i),a=0;t.length>0&&(s[a]=t.map(r).join(","),a+=1);for(let o of n)s[a]=o.map(r).join(","),a+=1;return s.join(`
163
163
  `)},y6=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("|")&&N6.test(r))return!0}return!1},L6=()=>e=>{Er(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},mh=[],gh={allowDangerousHtml:!0},pa=new WeakMap,D6=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 s=d=>{if(!d||d.length===0)return"";let c="";for(let h=0;h<d.length;h+=1){let p=d[h];if(h>0&&(c+=","),Array.isArray(p)){let[m,E]=p;if(typeof m=="function"){let T=pa.get(m);T||(T=m.name,pa.set(m,T)),c+=T}else c+=String(m);c+=":",c+=JSON.stringify(E)}else if(typeof p=="function"){let m=pa.get(p);m||(m=p.name,pa.set(p,m)),c+=m}else c+=String(p)}return c},a=s(n),o=s(r),l=i?JSON.stringify(i):"",u=`${o}::${a}::${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()}},bh=new D6,eb=e=>{let t=P6(e),n=e.children||"";return z6(t.runSync(t.parse(n),n),e)},P6=e=>{let t=bh.get(e);if(t)return t;let n=B6(e);return bh.set(e,n),n},M6=e=>e.some(t=>Array.isArray(t)?t[0]===ql:t===ql),B6=e=>{let t=e.rehypePlugins||mh,n=e.remarkPlugins||mh,r=M6(t)?n:[...n,L6],i=e.remarkRehypeOptions?{...gh,...e.remarkRehypeOptions}:gh;return VO().use($N).use(r).use(CO,i).use(t)},F6=e=>e,H6=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},U6=(e,t)=>{var n;for(let r in sl)if(Object.hasOwn(sl,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],s=sl[r];(s===null||s.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},j6=(e,t,n,r,i,s)=>{let a=!1;return r?a=!r.includes(e.tagName):i&&(a=i.includes(e.tagName)),!a&&s&&typeof t=="number"&&(a=!s(e,t,n)),a},z6=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:s,unwrapDisallowed:a,urlTransform:o}=t;if(n||r||i||s||o){let l=o||F6;Er(e,(u,d,c)=>{if(u.type==="raw"&&c&&typeof d=="number")return H6(c,d,s,u.value),d;if(u.type==="element"&&(U6(u,l),j6(u,d,c,r,i,n)&&c&&typeof d=="number"))return a&&u.children?c.children.splice(d,1,...u.children):c.children.splice(d,1),d})}return QR(e,{Fragment:g.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0})},$6=/\[\^[\w-]{1,200}\](?!:)/,V6=/\[\^[\w-]{1,200}\]:/,W6=/<(\w+)[\s>]/,Y6=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Eh=new Map,Th=new Map,G6=e=>{let t=e.toLowerCase(),n=Eh.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return Eh.set(t,r),r},q6=e=>{let t=e.toLowerCase(),n=Th.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return Th.set(t,r),r},xh=(e,t)=>{if(Y6.has(t.toLowerCase()))return 0;let n=e.match(G6(t));if(!n)return 0;let r=0;for(let i of n)i.trimEnd().endsWith("/>")||(r+=1);return r},yh=(e,t)=>{let n=e.match(q6(t));return n?n.length:0},K6=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},X6=e=>{let t=$6.test(e),n=V6.test(e);if(t||n)return[e];let r=hn.lex(e,{gfm:!0}),i=[],s=[],a=!1;for(let o of r){let l=o.raw,u=i.length;if(s.length>0){i[u-1]+=l;let d=s.at(-1),c=xh(l,d),h=yh(l,d);for(let p=0;p<c;p+=1)s.push(d);for(let p=0;p<h;p+=1)s.length>0&&s.at(-1)===d&&s.pop();continue}if(o.type==="html"&&o.block){let d=l.match(W6);if(d){let c=d[1],h=xh(l,c),p=yh(l,c);h>p&&s.push(c)}}if(u>0&&!a){let d=i[u-1];if(K6(d)%2===1){i[u-1]=d+l;continue}}i.push(l),o.type!=="space"&&(a=o.type==="code")}return i},Q6=(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,(s,a,o,l)=>{let u=o.replace(/\n\n/g,`
170
170
  <!---->
171
171
  `);return a+u+l})}return n},Z6=/^[ \t]*<[\w!/?-]/,J6=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,e4=e=>typeof e!="string"||e.length===0||!Z6.test(e)?e:e.replace(J6,"$1"),_h,kh,Ra={...os,protocols:{...os.protocols,href:[...(kh=(_h=os.protocols)==null?void 0:_h.href)!=null?kh:[],"tel"]}},uu={raw:ql,sanitize:[ug,Ra],harden:[Z_,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},t4={gfm:[Iv,{}]},wh=Object.values(uu),n4=Object.values(t4),r4={block:" ▋",circle:" ●"},i4={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},En=x.createContext(i4),tb=x.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,...s})=>{let a=typeof e=="string"&&n?e4(e):e;return g.jsx(k1.Provider,{value:i,children:g.jsx(eb,{...s,children:a})})},(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 s,a;return((s=e.components)==null?void 0:s[i])!==((a=t.components)==null?void 0:a[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});tb.displayName="Block";var s4=["github-light","github-dark"],a4=x.memo(({children:e,mode:t="streaming",parseIncompleteMarkdown:n=!0,normalizeHtmlIndentation:r=!1,components:i,rehypePlugins:s=wh,remarkPlugins:a=n4,className:o,shikiTheme:l=s4,mermaid:u,controls:d=!0,isAnimating:c=!1,animated:h,BlockComponent:p=tb,parseMarkdownIntoBlocksFn:m=X6,caret:E,plugins:T,remend:b,linkSafety:y={enabled:!0},allowedTags:k,...P})=>{let D=x.useId(),[v,A]=x.useTransition(),N=x.useMemo(()=>k?Object.keys(k):[],[k]),z=x.useMemo(()=>{if(typeof e!="string")return"";let te=t==="streaming"&&n?PR(e,b):e;return N.length>0&&(te=Q6(te,N)),te},[e,t,n,b,N]),R=x.useMemo(()=>m(z),[z,m]),[W,j]=x.useState(R);x.useEffect(()=>{t==="streaming"?A(()=>{j(R)}):j(R)},[R,t]);let w=t==="streaming"?W:R,L=x.useMemo(()=>w.map((te,S)=>`${D}-${S}`),[w.length,D]),M=x.useMemo(()=>h?h===!0?su():su(h):null,[h]),H=x.useMemo(()=>{var te,S;return{shikiTheme:(S=(te=T==null?void 0:T.code)==null?void 0:te.getThemes())!=null?S:l,controls:d,isAnimating:c,mode:t,mermaid:u,linkSafety:y}},[l,d,c,t,u,y,T==null?void 0:T.code]),U=x.useMemo(()=>({...v6,...i}),[i]),G=x.useMemo(()=>{let te=[];return T!=null&&T.cjk&&(te=[...te,...T.cjk.remarkPluginsBefore]),te=[...te,...a],T!=null&&T.cjk&&(te=[...te,...T.cjk.remarkPluginsAfter]),T!=null&&T.math&&(te=[...te,T.math.remarkPlugin]),te},[a,T==null?void 0:T.math,T==null?void 0:T.cjk]),Q=x.useMemo(()=>{var te;let S=s;if(k&&Object.keys(k).length>0&&s===wh){let ge={...Ra,tagNames:[...(te=Ra.tagNames)!=null?te:[],...Object.keys(k)],attributes:{...Ra.attributes,...k}};S=[uu.raw,[ug,ge],uu.harden]}return T!=null&&T.math&&(S=[...S,T.math.rehypePlugin]),M&&c&&(S=[...S,M.rehypePlugin]),S},[s,T==null?void 0:T.math,M,c,k]),_=x.useMemo(()=>{if(!c||w.length===0)return!1;let te=w.at(-1);return ph(te)||O6(te)},[c,w]),se=x.useMemo(()=>E&&c&&!_?{"--streamdown-caret":`"${r4[E]}"`}:void 0,[E,c,_]);return t==="static"?g.jsx(au.Provider,{value:T??null,children:g.jsx(En.Provider,{value:H,children:g.jsx("div",{className:ye("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",o),children:g.jsx(eb,{components:U,rehypePlugins:Q,remarkPlugins:G,...P,children:z})})})}):g.jsx(au.Provider,{value:T??null,children:g.jsx(En.Provider,{value:H,children:g.jsxs("div",{className:ye("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",E&&!_?"*:last:after:inline *:last:after:align-baseline *:last:after:content-[var(--streamdown-caret)]":null,o),style:se,children:[w.length===0&&E&&c&&g.jsx("span",{}),w.map((te,S)=>{let ge=S===w.length-1,pe=c&&ge&&ph(te);return g.jsx(p,{components:U,content:te,index:S,isIncomplete:pe,rehypePlugins:Q,remarkPlugins:G,shouldNormalizeHtmlIndentation:r,shouldParseIncompleteMarkdown:n,...P},L[S])})]})})})},(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);a4.displayName="Streamdown";var o4=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:s=!0,initialZoom:a=1,fullscreen:o=!1})=>{let l=x.useRef(null),u=x.useRef(null),[d,c]=x.useState(a),[h,p]=x.useState({x:0,y:0}),[m,E]=x.useState(!1),[T,b]=x.useState({x:0,y:0}),[y,k]=x.useState({x:0,y:0}),P=x.useCallback(j=>{c(w=>Math.max(n,Math.min(r,w+j)))},[n,r]),D=x.useCallback(()=>{P(i)},[P,i]),v=x.useCallback(()=>{P(-i)},[P,i]),A=x.useCallback(()=>{c(a),p({x:0,y:0})},[a]),N=x.useCallback(j=>{j.preventDefault();let w=j.deltaY>0?-i:i;P(w)},[P,i]),z=x.useCallback(j=>{if(j.button!==0||j.isPrimary===!1)return;E(!0),b({x:j.clientX,y:j.clientY}),k(h);let w=j.currentTarget;w instanceof HTMLElement&&w.setPointerCapture(j.pointerId)},[h]),R=x.useCallback(j=>{if(!m)return;j.preventDefault();let w=j.clientX-T.x,L=j.clientY-T.y;p({x:y.x+w,y:y.y+L})},[m,T,y]),W=x.useCallback(j=>{E(!1);let w=j.currentTarget;w instanceof HTMLElement&&w.releasePointerCapture(j.pointerId)},[]);return x.useEffect(()=>{let j=l.current;if(j)return j.addEventListener("wheel",N,{passive:!1}),()=>{j.removeEventListener("wheel",N)}},[N]),x.useEffect(()=>{let j=u.current;if(j&&m)return document.body.style.userSelect="none",j.addEventListener("pointermove",R,{passive:!1}),j.addEventListener("pointerup",W),j.addEventListener("pointercancel",W),()=>{document.body.style.userSelect="",j.removeEventListener("pointermove",R),j.removeEventListener("pointerup",W),j.removeEventListener("pointercancel",W)}},[m,R,W]),g.jsxs("div",{className:ye("relative flex flex-col",o?"h-full w-full":"min-h-28 w-full",t),ref:l,style:{cursor:m?"grabbing":"grab"},children:[s?g.jsxs("div",{className:ye("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:D,title:"Zoom in",type:"button",children:g.jsx(o6,{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:v,title:"Zoom out",type:"button",children:g.jsx(l6,{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:A,title:"Reset zoom and pan",type:"button",children:g.jsx(a6,{size:16})})]}):null,g.jsx("div",{className:ye("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:z,ref:u,role:"application",style:{transform:`translate(${h.x}px, ${h.y}px) scale(${d})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},nb=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let[s,a]=x.useState(null),[o,l]=x.useState(!1),[u,d]=x.useState(""),[c,h]=x.useState(""),[p,m]=x.useState(0),{mermaid:E}=x.useContext(En),T=vc(),b=E==null?void 0:E.errorComponent,{shouldRender:y,containerRef:k}=UL({immediate:r});if(x.useEffect(()=>{if(y){if(!T){a("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{a(null),l(!0);let D=T.getMermaid(n),v=e.split("").reduce((z,R)=>(z<<5)-z+R.charCodeAt(0)|0,0),A=`mermaid-${Math.abs(v)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:N}=await D.render(A,e);d(N),h(N)}catch(D){if(!(c||u)){let v=D instanceof Error?D.message:"Failed to render Mermaid chart";a(v)}}finally{l(!1)}})()}},[e,n,p,y,T]),!(y||u||c))return g.jsx("div",{className:ye("my-4 min-h-[200px]",t),ref:k});if(o&&!u&&!c)return g.jsx("div",{className:ye("my-4 flex justify-center p-4",t),ref:k,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(s&&!u&&!c){let D=()=>m(v=>v+1);return b?g.jsx("div",{ref:k,children:g.jsx(b,{chart:e,error:s,retry:D})}):g.jsxs("div",{className:ye("rounded-md bg-red-50 p-4",t),ref:k,children:[g.jsxs("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",s]}),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 P=u||c;return g.jsx("div",{className:ye("size-full",t),"data-streamdown":"mermaid",ref:k,children:g.jsx(o4,{className:ye(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:ye("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:P},role:"img"})})})};const l4=40,u4=8,li=56,Za=8,Ns=2,pr=24,Ro=24,yM=8,c4=()=>{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},Nc={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},Ch=e=>(e.timelineWidth-e.scrollbarWidth)/e.root.duration,Oc=x.createContext({state:Nc,dispatch:()=>{}});Oc.displayName="TraceViewerContext";const ft=(e,t)=>{var n;switch(t.type){case"setRoot":return e.scrollSnapshotRef.current=void 0,e.memoCacheRef.current.clear(),ft({...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-li-l4-3*u4,i=e.withPanel&&t.width<=768;let s={...e,width:t.width,height:t.height,timelineWidth:t.width-+!!(e.selected&&e.withPanel&&!i)*e.panelWidth,timelineHeight:r,panelHeight:r,isMobile:i};return s.width!==e.width&&(s=ft(s,{type:"detectBaseScale"})),s}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 ft({...e,timelineWidth:i,panelWidth:r},{type:"detectBaseScale"})}case"setFilter":return{...e,filter:t.filter};case"deselect":return ft({...e,selected:null,timelineWidth:e.width},{type:"detectBaseScale"});case"select":{const r=e.spanMap[t.id];return r?ft({...e,selected:r,timelineWidth:e.width-(e.withPanel&&!e.isMobile?e.panelWidth:0)},{type:"detectBaseScale"}):e}case"escape":return e.selected?ft(e,{type:"deselect"}):ft(e,{type:"resetScale"});case"toggleSelection":{let r=e;return e.selected&&(r=ft(r,{type:"deselect"})),((n=e.selected)==null?void 0:n.span.spanId)===t.id?r:ft(r,{type:"select",id:t.id})}case"detectBaseScale":{const r=(e.timelineWidth-e.scrollbarWidth)/e.root.duration;return ft({...e,baseScale:r,scale:r*e.scaleRatio},{type:"minScale"})}case"setScale":return{...e,scaleRatio:t.scale,scale:e.baseScale*t.scale};case"resetScale":return ft(e,{type:"scaleToRange",t1:e.root.startTime,t2:e.root.endTime});case"scaleToNode":{const r=e.spanMap[t.id];return r?ft(ft(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 ft(ft(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:s,scrollLeft:a}=i;return ft(ft({...e,scaleRatio:r,scale:e.baseScale*r},{type:"minScale"}),{type:"setScrollSnapshot",anchorT:(a+s*.5)/e.scale,anchorX:s*.5})}case"trackpadScale":{const r=Ch(e)/e.baseScale,i=Math.max(r,e.scaleRatio*(1+.2*Math.sign(t.delta)*Math.sqrt(Math.abs(t.delta))));return ft({...e,scaleRatio:i,scale:e.baseScale*i},{type:"setScrollSnapshot",anchorT:t.anchorT,anchorX:t.anchorX})}case"minScale":{const r=Ch(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:s}=t,a=i*e.scale-s,{scrollTop:o}=r,l=(o-Ro-Za)/(pr+Ns),u=l+Math.ceil(e.timelineHeight/(pr+Ns));return e.scrollSnapshotRef.current={anchorT:i,anchorX:s,scrollLeft:a,scrollTop:o,startTime:e.root.startTime+a/e.scale,endTime:e.root.startTime+(a+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 ft({...e,withPanel:t.withPanel,timelineWidth:r},{type:"detectBaseScale"})}case"forceRender":return e.memoCacheRef.current.set("",{}),{...e};case"updateRoot":return e.memoCacheRef.current.set("",{}),ft({...e,root:t.root,spanMap:t.spanMap,resourceMap:Object.fromEntries(t.resources.map(({name:r,attributes:i})=>[r,i]))},{type:"detectBaseScale"})}};function _M({getQuickLinks:e,withPanel:t=!1,children:n,customSpanClassNameFunc:r,customSpanEventClassNameFunc:i,customPanelComponent:s=null}){const a=x.useRef(null),o=x.useRef(void 0),l=x.useRef(e);l.current=e;const u=x.useRef(new Map),d=x.useRef(new Map),[c,h]=x.useReducer(ft,Nc,m=>({...m,scrollbarWidth:c4(),timelineRef:a,scrollSnapshotRef:o,customSpanClassNameFunc:r,customSpanEventClassNameFunc:i,memoCacheRef:u,withPanel:t,getQuickLinks:E=>{var k;const T=E.spanId,b=d.current.get(T);if(b)return b;const y=((k=l.current)==null?void 0:k.call(l,E))||[];return d.current.set(T,y),y}}));x.useEffect(()=>h({type:"setWithPanel",withPanel:t}),[t]);const p=x.useMemo(()=>({state:c,dispatch:h}),[c,h]);return g.jsx(rb.Provider,{value:s,children:g.jsx(Oc.Provider,{value:p,children:n})})}const No=()=>x.useContext(Oc),rb=x.createContext(null),d4=()=>x.useContext(rb),f4="_traceNode_1fmf2_1",h4="_childRow_1fmf2_5",p4="_spanNode_1fmf2_11",m4="_huge_1fmf2_31",g4="_spanName_1fmf2_34",b4="_spanSpacer_1fmf2_40",E4="_spanDuration_1fmf2_44",T4="_small_1fmf2_62",x4="_xHover_1fmf2_62",y4="_spanNodeEvent_1fmf2_118",_4="_eventDiamond_1fmf2_124",k4="_customEventColor_1fmf2_140",w4="_hoverInfo_1fmf2_145",C4="_eventName_1fmf2_149",A4="_eventTimestamp_1fmf2_153",S4="_alignStart_1fmf2_174",I4="_alignEnd_1fmf2_178",v4="_colorVercel_1fmf2_205",R4="_color0_1fmf2_213",N4="_color1_1fmf2_220",O4="_color2_1fmf2_227",L4="_color3_1fmf2_234",D4="_color4_1fmf2_241",P4="_colorHighlight_1fmf2_248",M4="_unlit_1fmf2_256",B4="_mapContainer_1fmf2_262",F4="_spanDetailPanel_1fmf2_329",H4="_spanDetailPanelResizer_1fmf2_338",U4="_spanDetailPanelTop_1fmf2_353",j4="_spanDetailPanelBody_1fmf2_362",z4="_spanDetailPanelTopInfo_1fmf2_375",$4="_spanNameDetailPanel_1fmf2_389",V4="_spanDetailPanelTruncatedHeading_1fmf2_395",W4="_spanDetailPanelName_1fmf2_405",Y4="_spanDetailPanelDuration_1fmf2_416",G4="_spanDetailPanelCorner_1fmf2_427",q4="_spanDetailPanelCornerInner_1fmf2_437",K4="_spanDetailPanelCloseVerticalRule_1fmf2_445",X4="_spanDetailPanelClose_1fmf2_445",Q4="_spanDetailPanelAttribute_1fmf2_467",Z4="_spanDetailPanelAttributeKey_1fmf2_484",J4="_spanDetailPanelAttributeValue_1fmf2_492",eD="_spanDetailPanelQuickLink_1fmf2_503",tD="_spanDetailPanelQuickLinkLabel_1fmf2_506",nD="_detailGroup_1fmf2_519",rD="_expanded_1fmf2_533",iD="_collapsed_1fmf2_534",sD="_ancestorGroup_1fmf2_535",aD="_detailHeading_1fmf2_539",oD="_buttonLink_1fmf2_562",lD="_note_1fmf2_581",uD="_skeleton_1fmf2_589",cD="_skeletonRounded_1fmf2_595",dD="_detailHeadingIcon_1fmf2_599",fD="_infraSpanDescription_1fmf2_603",hD="_ancestorNode_1fmf2_613",pD="_ancestorText_1fmf2_629",mD="_ancestorName_1fmf2_639",gD="_ancestorDuration_1fmf2_644",bD="_ancestorLineContainer_1fmf2_649",ED="_ancestorLine_1fmf2_649",TD="_zoomButtonGroup_1fmf2_701",xD="_zoomButton_1fmf2_701",yD="_divider_1fmf2_751",_D="_markersContainer_1fmf2_758",kD="_markers_1fmf2_758",wD="_marker_1fmf2_758",CD="_notch_1fmf2_792",AD="_markerLabel_1fmf2_798",SD="_markerClockTime_1fmf2_807",ID="_eventMarkersContainer_1fmf2_816",vD="_eventMarkers_1fmf2_816",RD="_eventMarker_1fmf2_816",ND="_cursorMarkerStickyParent_1fmf2_839",OD="_cursorMarkerLabelContainer_1fmf2_848",LD="_cursorMarkerLabel_1fmf2_848",DD="_cursorMarkerContainer_1fmf2_898",PD="_cursorMarker_1fmf2_839",MD="_cursorSelection_1fmf2_916",BD="_traceViewer_1fmf2_966",FD="_mapCanvas_1fmf2_972",HD="_zoomButtonTraceViewer_1fmf2_988",UD="_timeline_1fmf2_1011",jD="_searchBar_1fmf2_1019",zD="_searchInput_1fmf2_1031",$D="_searchInputLabel_1fmf2_1038",VD="_searchInputPrefix_1fmf2_1063",WD="_mapThumb_1fmf2_1101",YD="_spanDetailPanelTraceViewer_1fmf2_1115",GD="_traceViewerContent_1fmf2_1134",qD="_inert_1fmf2_1144",KD="_hidden_1fmf2_1180",XD="_mobile_1fmf2_1184",QD="_spanRunning_1fmf2_1194",ZD="_spanPending_1fmf2_1195",JD="_spanCompleted_1fmf2_1203",e5="_spanCancelled_1fmf2_1211",t5="_spanFailed_1fmf2_1219",n5="_spanPendingStriped_1fmf2_1228",r5="_hasQueuedTime_1fmf2_1242",i5="_spanSleep_1fmf2_1254",s5="_spanHook_1fmf2_1263",a5="_segmentLayer_1fmf2_1275",o5="_segment_1fmf2_1275",l5="_segmentLabel_1fmf2_1291",u5="_segmentTag_1fmf2_1306",c5="_segQueued_1fmf2_1314",d5="_segRunning_1fmf2_1325",f5="_segFailed_1fmf2_1330",h5="_segRetrying_1fmf2_1335",p5="_segSucceeded_1fmf2_1346",m5="_segWaiting_1fmf2_1351",g5="_segSleeping_1fmf2_1362",b5="_segReceived_1fmf2_1367",E5="_boundaryMarker_1fmf2_1372",T5="_boundaryLine_1fmf2_1373",x5="_hasSegments_1fmf2_1395",y5="_eventFailed_1fmf2_1432",_5="_eventRetrying_1fmf2_1441",k5="_eventHook_1fmf2_1450",w5="_eventDefault_1fmf2_1459",oe={traceNode:f4,childRow:h4,spanNode:p4,huge:m4,spanName:g4,spanSpacer:b4,spanDuration:E4,small:T4,xHover:x4,spanNodeEvent:y4,eventDiamond:_4,customEventColor:k4,hoverInfo:w4,eventName:C4,eventTimestamp:A4,alignStart:S4,alignEnd:I4,colorVercel:v4,color0:R4,color1:N4,color2:O4,color3:L4,color4:D4,colorHighlight:P4,unlit:M4,mapContainer:B4,spanDetailPanel:F4,spanDetailPanelResizer:H4,spanDetailPanelTop:U4,spanDetailPanelBody:j4,spanDetailPanelTopInfo:z4,spanNameDetailPanel:$4,spanDetailPanelTruncatedHeading:V4,spanDetailPanelName:W4,spanDetailPanelDuration:Y4,spanDetailPanelCorner:G4,spanDetailPanelCornerInner:q4,spanDetailPanelCloseVerticalRule:K4,spanDetailPanelClose:X4,spanDetailPanelAttribute:Q4,spanDetailPanelAttributeKey:Z4,spanDetailPanelAttributeValue:J4,spanDetailPanelQuickLink:eD,spanDetailPanelQuickLinkLabel:tD,detailGroup:nD,expanded:rD,collapsed:iD,ancestorGroup:sD,detailHeading:aD,buttonLink:oD,note:lD,skeleton:uD,skeletonRounded:cD,detailHeadingIcon:dD,infraSpanDescription:fD,ancestorNode:hD,ancestorText:pD,ancestorName:mD,ancestorDuration:gD,ancestorLineContainer:bD,ancestorLine:ED,zoomButtonGroup:TD,"zoom-buttons-fade-in":"_zoom-buttons-fade-in_1fmf2_1",zoomButton:xD,divider:yD,markersContainer:_D,markers:kD,marker:wD,notch:CD,markerLabel:AD,markerClockTime:SD,eventMarkersContainer:ID,eventMarkers:vD,eventMarker:RD,cursorMarkerStickyParent:ND,cursorMarkerLabelContainer:OD,cursorMarkerLabel:LD,cursorMarkerContainer:DD,cursorMarker:PD,cursorSelection:MD,traceViewer:BD,"span-skeleton":"_span-skeleton_1fmf2_1",mapCanvas:FD,zoomButtonTraceViewer:HD,timeline:UD,searchBar:jD,searchInput:zD,searchInputLabel:$D,searchInputPrefix:VD,mapThumb:WD,spanDetailPanelTraceViewer:YD,traceViewerContent:GD,inert:qD,hidden:KD,mobile:XD,spanRunning:QD,spanPending:ZD,spanCompleted:JD,spanCancelled:e5,spanFailed:t5,spanPendingStriped:n5,hasQueuedTime:r5,spanSleep:i5,spanHook:s5,segmentLayer:a5,segment:o5,segmentLabel:l5,segmentTag:u5,segQueued:c5,segRunning:d5,segFailed:f5,segRetrying:h5,segSucceeded:p5,segWaiting:m5,segSleeping:g5,segReceived:b5,boundaryMarker:E5,boundaryLine:T5,hasSegments:x5,eventFailed:y5,eventRetrying:_5,eventHook:k5,eventDefault:w5};function ma([e,t]){return e*1e3+t/1e6}function kM(e){return[Math.floor(e/1e3),e%1e3*1e3]}const wM=e=>on(e,!0),Ah=new Intl.NumberFormat(void 0,{minimumFractionDigits:2,maximumFractionDigits:2});function CM(e){return e>=1e3?`${Ah.format(e/1e3)}s`:`${Ah.format(e)}ms`}function AM(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");return`${n}:${r}:${i}`}const C5={queued:"segQueued",running:"segRunning",failed:"segFailed",retrying:"segRetrying",succeeded:"segSucceeded",waiting:"segWaiting",sleeping:"segSleeping",received:"segReceived"};function A5(e){return Math.max(0,Math.min(1,e))}function Sn(e,t,n){return n<=0?0:A5((e-t)/n)}function Ks(e){return[...e].sort((t,n)=>t.timestamp-n.timestamp)}function S5(e){const t=e.events?Ks(e.events):[],{startTime:n,duration:r}=e,i=[];if(r<=0)return i;const s=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(s.length===0)return i.push({startFraction:0,endFraction:1,status:"running"}),i;const a=s[0],o=Sn(a.time,n,r);o>.001&&i.push({startFraction:0,endFraction:o,status:"queued"});for(let l=0;l<s.length;l++){const u=s[l],d=Sn(u.time,n,r),c=s[l+1],h=c?Sn(c.time,n,r):1;if(u.type==="step_started")if(l===s.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:h,status:E})}else u.type==="step_retrying"?i.push({startFraction:d,endFraction:h,status:"retrying"}):u.type==="step_failed"?d<.999&&i.push({startFraction:d,endFraction:1,status:"failed"}):u.type}return i}function I5(e){const t=e.events?Ks(e.events):[],{startTime:n,duration:r}=e,i=[];if(r<=0)return i;const s=t.find(u=>u.event.name==="hook_received"),a=t.find(u=>u.event.name==="hook_disposed");if(!s&&!a)return i.push({startFraction:0,endFraction:1,status:"waiting"}),i;const o=s?Sn(s.timestamp,n,r):null,l=a?Sn(a.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 v5(e){const t=e.events?Ks(e.events):[],{startTime:n,duration:r}=e,i=[];if(r<=0)return i;const s=t.find(o=>o.event.name==="wait_completed");if(!s)return i.push({startFraction:0,endFraction:1,status:"sleeping"}),i;const a=Sn(s.timestamp,n,r);return a>.001&&i.push({startFraction:0,endFraction:a,status:"sleeping"}),i.push({startFraction:a,endFraction:1,status:"succeeded"}),i}function R5(e){var d;const t=e.events?Ks(e.events):[],{startTime:n,duration:r,activeStartTime:i}=e,s=[];if(r<=0)return s;if(!t.some(c=>c.event.name==="run_created")){const c=(d=e.span.attributes)==null?void 0:d.data,h=c==null?void 0:c.status;return N5(n,r,i,h)}const o=t.find(c=>c.event.name==="run_failed"),l=t.find(c=>c.event.name==="run_completed");let u=0;if(i&&i>n){const c=Sn(i,n,r);c>.001&&(s.push({startFraction:0,endFraction:c,status:"queued"}),u=c)}if(o){const c=Sn(o.timestamp,n,r);c>u+.001&&s.push({startFraction:u,endFraction:c,status:"running"}),s.push({startFraction:c,endFraction:1,status:"failed"})}else if(l){const c=Sn(l.timestamp,n,r);c>u+.001&&s.push({startFraction:u,endFraction:c,status:"running"}),s.push({startFraction:c,endFraction:1,status:"succeeded"})}else s.push({startFraction:u,endFraction:1,status:"running"});return s}function N5(e,t,n,r){const i=[];let s=0;if(n&&n>e){const a=Sn(n,e,t);a>.001&&(i.push({startFraction:0,endFraction:a,status:"queued"}),s=a)}return r==="failed"?i.push({startFraction:s,endFraction:1,status:"failed"}):r==="completed"||r==="cancelled"?i.push({startFraction:s,endFraction:1,status:"succeeded"}):i.push({startFraction:s,endFraction:1,status:"running"}),i}const O5={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 ga(e,t){const n=e.events?Ks(e.events):[],{startTime:r,duration:i}=e;if(i<=0)return[];const s=[];for(const a of n){if(!t.includes(a.event.name))continue;const o=Sn(a.timestamp,r,i);o<.01||o>.99||s.push({fraction:o,label:O5[a.event.name]??a.event.name,offsetMs:a.timestamp-r})}return s}function ib(e,t){switch(e){case"step":return{segments:S5(t),boundaries:ga(t,["step_started","step_retrying","step_failed","step_completed"])};case"hook":return{segments:I5(t),boundaries:ga(t,["hook_created","hook_received","hook_disposed"])};case"sleep":return{segments:v5(t),boundaries:ga(t,["wait_created","wait_completed"])};case"run":return{segments:R5(t),boundaries:ga(t,["run_completed","run_failed"])};default:return{segments:[],boundaries:[]}}}function L5(e){return e.isInstrumentationHint?"Get Started":on(e.duration)}const sb={queued:"Queued",running:"",failed:"Failed",retrying:"Retry wait",succeeded:"Executed",waiting:"Waiting",sleeping:"Sleeping",received:"Received"};function D5({segments:e,spanDuration:t}){return e.length===0?null:g.jsx("div",{className:oe.segmentLayer,children:e.map((n,r)=>{const i=oe[C5[n.status]],s=(n.endFraction-n.startFraction)*t,a=sb[n.status],o={left:`${n.startFraction*100}%`,width:`${(n.endFraction-n.startFraction)*100}%`};return g.jsx("div",{className:`${oe.segment} ${String(i)}`,style:o,title:a?`${a} ${on(s)}`:on(s)},`seg-${n.status}-${String(r)}`)})})}function P5(e,t){const n=[];for(let r=0;r<e.length;r++){const i=e[r],s=sb[i.status];if(!s)continue;let a=(i.endFraction-i.startFraction)*t;if(a<1&&(i.status==="succeeded"||i.status==="failed")&&r>0){const o=e[r-1];o.status==="running"&&(a=(o.endFraction-o.startFraction)*t)}a<1||n.push({label:s,duration:on(a)})}return n}function ab({node:e,layout:t,durationMs:n,segmentTags:r}){const i=e.isInstrumentationHint?L5(e):on(n??e.duration);if(t.isSmall&&!t.isHovered)return null;const s=r&&r.length>0&&(t.isHovered||t.width>200);return g.jsxs(g.Fragment,{children:[g.jsxs("span",{className:oe.spanName,children:[e.label||e.span.name,s?r.map((a,o)=>g.jsxs("span",{className:oe.segmentTag,children:[" · ",a.label," ",a.duration]},o)):null]}),t.isHuge?g.jsx("span",{className:oe.spanSpacer}):null,t.isHovered||t.width>128?g.jsx("span",{className:oe.spanDuration,children:i}):null]})}function M5({node:e,layout:t}){return g.jsx(ab,{node:e,layout:t})}function Oo({resourceType:e,node:t,layout:n,durationMs:r}){const i=r??t.duration,{segments:s}=ib(e,t),a=P5(s,i);return g.jsxs(g.Fragment,{children:[g.jsx(D5,{segments:s,spanDuration:i}),g.jsx(ab,{durationMs:i,node:t,layout:n,segmentTags:a})]})}function B5(e){return g.jsx(Oo,{resourceType:"run",...e})}function F5(e){return g.jsx(Oo,{resourceType:"step",...e})}function H5(e){return g.jsx(Oo,{resourceType:"hook",...e})}function U5(e){return g.jsx(Oo,{resourceType:"sleep",...e})}function j5({resourceType:e,...t}){switch(e){case"run":return g.jsx(B5,{...t});case"step":return g.jsx(F5,{...t});case"hook":return g.jsx(H5,{...t});case"sleep":return g.jsx(U5,{...t});default:return g.jsx(M5,{...t})}}const z5=4;function $5(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 V5(e){return e<64}function W5(e){return e>=500}function Y5(e,t){return e.isHovered&&!t&&e.isHighlighted!==!1}function G5(e,t,n,r){if(!r)return!1;let i=t.duration,s=t.endTime;const a=n.current;return a&&(i=a.endTime-a.startTime,s=a.endTime),s-e.startTime<.25*i}function Xs(e,t,n,r){const i=(e.startTime-t.startTime)*n;let s=Ro+(pr+Ns)*e.row;const a=e.duration*n,o=Math.max(a,z5);let l=pr;const u=W5(a),d=V5(a),c=Y5(e,u),h=c||!!e.isSelected;d&&!h&&(l*=.4,s+=(pr-l)*.5);const p=G5(e,t,r,h);return{width:o,actualWidth:a,height:l,top:s,left:i,isSmall:d,isHuge:u,isHovered:c,isExpanded:h,isNearRightSide:p}}function q5(e,t,n,r){return Xs(e,t,n,r)}function K5(e,t,n,r){return Xs(e,t,n,r)}function X5(e,t,n,r){return Xs(e,t,n,r)}function Q5(e,t,n,r){return Xs(e,t,n,r)}function Z5(e,t,n,r,i){switch(e){case"run":return q5(t,n,r,i);case"step":return K5(t,n,r,i);case"hook":return X5(t,n,r,i);case"sleep":return Q5(t,n,r,i);default:return Xs(t,n,r,i)}}const Lc=e=>e.isVercel?String(oe.colorVercel):String(oe[`color${e.resourceIndex%5}`]);function J5(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 SM=x.memo(function({root:t,scale:n,spans:r,isLive:i=!1,scrollSnapshotRef:s,cache:a,customSpanClassNameFunc:o,customSpanEventClassNameFunc:l}){return r.map(u=>g.jsx(tP,{cacheKey:a.get(u.span.spanId),customSpanEventClassNameFunc:l,customSpanClassNameFunc:o,node:u,root:t,scale:n,traceIsLive:i,scrollSnapshotRef:s},u.span.spanId))});function eP(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 tP=x.memo(function({node:t,root:n,scale:r,traceIsLive:i=!1,scrollSnapshotRef:s,customSpanClassNameFunc:a,customSpanEventClassNameFunc:o}){var H;const l=x.useRef(null);x.useEffect(()=>(t.ref=l,()=>{t.ref=void 0}),[t]);const{span:u}=t,d=$5(t),[c,h]=x.useState(0),p=a?a(t):"",m=d!=="default",E=(H=u.attributes)==null?void 0:H.data,T=J5(d,t),b=T!=null,k=(d==="hook"?!!(E!=null&&E.disposedAt):!!(E!=null&&E.completedAt))||b,P=i&&m&&!k;x.useEffect(()=>{if(!P)return;h(Date.now());const U=setInterval(()=>{h(Date.now())},250);return()=>clearInterval(U)},[P]);const D=ma(u.startTime),v=ma(u.endTime),A=ma(u.duration),N=u.activeStartTime?ma(u.activeStartTime):void 0,z=T!=null?Math.max(0,T-D):P?Math.max(0,(c||Date.now())-D):A,R=t.isInstrumentationHint?"Get Started":on(z),W={...t,startTime:D,endTime:v,duration:A,activeStartTime:N},j=P?{...W,duration:z,endTime:D+z}:W,w=m&&ib(d,j).segments.length>0,L=Z5(d,j,n,r,s);if(P){const G=z*r,Q=Math.max(G,4);L.actualWidth=G,L.width=Q,L.isSmall=G<64,L.isHuge=G>=500,L.isSmall||(L.height=pr,L.top=Ro+(pr+Ns)*j.row)}x.useEffect(()=>{if(!P||!l.current)return;let U=0;const G=()=>{const Q=l.current;if(!Q)return;const _=Date.now()-D,se=Math.max(_*r,2);Q.style.width=`${se}px`,Q.style.setProperty("--span-width",`${se}px`),U=requestAnimationFrame(G)};return U=requestAnimationFrame(G),()=>cancelAnimationFrame(U)},[P,D,r]);const M=j;return g.jsxs(g.Fragment,{children:[g.jsx("button",{"aria-label":`${u.name} - ${R}`,className:Pt(oe.spanNode,L.isHuge&&oe.huge,L.isSmall&&oe.small,L.isExpanded&&oe.xHover,t.isHighlighted?oe.colorHighlight:Lc(t),t.isHighlighted===!1&&oe.unlit,p,w&&oe.hasSegments),"data-span-id":u.spanId,"data-start-time":j.startTime-n.startTime,"data-right-side":L.isNearRightSide,"data-selected":t.isSelected?"":void 0,ref:l,style:eP(L,j,n,r),type:"button",children:g.jsx(j5,{durationMs:z,resourceType:d,node:M,layout:L})}),j.events&&!L.isSmall?j.events.map(U=>g.jsx(rP,{customSpanEventClassNameFunc:o,event:U,node:j,root:n,scale:r,asBoundary:m},U.key)):null]})}),nP={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"},rP=x.memo(function({event:t,node:n,root:r,scale:i,customSpanEventClassNameFunc:s,asBoundary:a=!1}){const o=x.useRef(null);x.useEffect(()=>(t.ref=o,()=>{t.ref=void 0}),[t]);const{event:{name:l}}=t,u=on(t.timestamp-r.startTime),d=a?nP[l]??l:l,c=a&&(l==="step_started"||l==="run_started"||l==="step_retrying"),h=a&&(l==="step_completed"||l==="run_completed");let p=null,m=null;if((c||h)&&n.events){const k=[...n.events].sort((D,v)=>D.timestamp-v.timestamp),P=k.findIndex(D=>D.key===t.key);if(h){let D=null;for(let v=P-1;v>=0;v--)if(k[v].event.name==="step_started"){D=k[v].timestamp;break}D!==null&&(p=on(t.timestamp-D),m="Executed")}else{const D=k[P+1],v=D?D.timestamp:n.endTime;p=on(v-t.timestamp),m=l==="step_retrying"?"Waited":"Executed"}}const E=(t.timestamp-r.startTime)*i,T=Ro+(pr+Ns)*n.row,b=n.duration<=0||(t.timestamp-n.startTime)/n.duration<.5,y=s?s(t):"";return g.jsxs("div",{title:p?`${d} ${u}
172
- ${m} ${p}`:`${d} ${u}`,className:Pt(oe.spanNodeEvent,y,a&&oe.boundaryMarker,n.isHighlighted?oe.colorHighlight:Lc(n),n.isHighlighted===!1&&oe.unlit),"data-hovered":t.isHovered,ref:o,style:{left:E,top:T},children:[g.jsx("div",{className:Pt(oe.hoverInfo,b?oe.alignStart:oe.alignEnd),children:a?g.jsxs(g.Fragment,{children:[g.jsx("span",{className:oe.eventName,children:d}),g.jsx("span",{className:oe.eventTimestamp,children:u}),p?g.jsxs(g.Fragment,{children:[g.jsx("span",{className:oe.eventName,children:m}),g.jsx("span",{className:oe.eventTimestamp,children:p})]}):null]}):g.jsxs(g.Fragment,{children:[g.jsx("span",{className:oe.eventName,children:l}),g.jsx("span",{className:oe.eventTimestamp,children:u})]})}),a?g.jsx("div",{className:oe.boundaryLine}):g.jsx("div",{className:oe.eventDiamond})]})}),ob={"gray-700":"var(--ds-gray-700)","gray-900":"var(--ds-gray-900)"};function iP({size:e=16,color:t="gray-700"}){const n={color:ob[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 sP({size:e=16}){return g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,className:oe.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 aP({size:e=16,color:t="gray-900"}){const n={color:ob[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 oP(e){const{as:t,className:n,href:r,children:i,...s}=e;return(t||"a")==="span"||!r?g.jsx("span",{className:n,...s,children:i}):g.jsx("a",{className:n,href:r,...s,children:i})}function lP(e){const{className:t,children:n,size:r,...i}=e;return g.jsx("a",{...i,className:Pt(oe.buttonLink,t),children:n})}function uP({children:e,className:t}){return g.jsx("div",{className:Pt(oe.note,t),children:e})}function Sh({width:e,height:t,rounded:n}){return g.jsx("span",{className:Pt(oe.skeleton,n&&oe.skeletonRounded),style:{width:e,height:t},"aria-hidden":!0})}const Ih=e=>`${(100*e).toFixed(3)}%`,vh=(e,t)=>e<t?-1:e>t?1:0,Rh=e=>{const t={};for(const[r,i]of Object.entries(e)){const s=r.indexOf(".");let a="",o="";s!==-1?(a=r.substring(0,s),o=r.substring(s+1)):o=r;let l=t[a];l||(l={prefix:a,attributes:[]},t[a]=l),l.attributes.push({key:r,suffix:o,value:String(i)})}const n=Array.from(Object.values(t)).sort((r,i)=>vh(r.prefix,i.prefix));for(const r of n)r.attributes.sort((i,s)=>vh(i.suffix,s.suffix));return n},cP=(e,t)=>{const n=[];if(!t)return n;for(let r=t;"parent"in r;r=r.parent)n.unshift(r);return n},dP=()=>{var d;const{state:{root:e,selected:t,resourceMap:n,getQuickLinks:r},dispatch:i}=No(),s=x.useMemo(()=>cP(e,t),[e,t]),a=x.useMemo(()=>Rh((t==null?void 0:t.span.attributes)??{}),[t]),o=x.useMemo(()=>{const c=t==null?void 0:t.span.resource;if(!c)return[];const h=n[c];return h?Rh(h):[]},[n,t]);if(!t)return null;const{span:l}=t,u=lb(t);return g.jsxs(g.Fragment,{children:[t.isVercel?g.jsx(mP,{node:t}):null,t.isInstrumentationHint?g.jsx(TP,{}):null,!t.isInstrumentationHint&&s.length?g.jsx(fr,{className:oe.ancestorGroup,name:"Location",children:s.map(c=>g.jsxs("button",{className:oe.ancestorNode,onClick:()=>i({type:"select",id:c.span.spanId}),type:"button",children:[g.jsxs("div",{className:oe.ancestorText,children:[g.jsx("span",{className:oe.ancestorName,children:c.label||c.span.name}),g.jsx("span",{className:oe.ancestorDuration,children:on(c.duration)})]}),g.jsx("span",{"aria-hidden":!0,className:oe.ancestorLineContainer,children:g.jsx("span",{className:Pt(oe.ancestorLine,Lc(c)),style:{left:Ih((c.startTime-e.startTime)/e.duration),width:Ih(c.duration/e.duration)}})})]},`${t.span.spanId}.${c.span.spanId}`))}):null,u?g.jsx(gP,{getQuickLinks:r,span:t.span}):null,(d=t.events)!=null&&d.length?g.jsx(fr,{name:"Events",children:t.events.map(c=>g.jsxs(x.Fragment,{children:[g.jsxs("dl",{className:oe.spanDetailPanelAttribute,children:[g.jsx("dt",{className:oe.spanDetailPanelAttributeKey,children:c.event.name}),g.jsx("dd",{className:oe.spanDetailPanelAttributeValue,children:on(c.timestamp-e.startTime)})]}),Object.entries(c.event.attributes).map(([h,p])=>g.jsx($i,{name:`${c.event.name}.${h}`,value:p},h))]},c.key))}):null,a.length?g.jsx(fr,{name:"Attributes",children:a.map(c=>g.jsx(x.Fragment,{children:c.attributes.map(({key:h,value:p})=>g.jsx($i,{name:h,value:p},h))},c.prefix))}):null,o.length?g.jsx(fr,{name:"Resource",children:o.map(c=>g.jsx(x.Fragment,{children:c.attributes.map(({key:h,value:p})=>g.jsx($i,{name:h,value:p},h))},c.prefix))}):null,t.isInstrumentationHint?null:g.jsxs(fr,{name:"Library",children:[g.jsx($i,{name:"name",value:l.library.name}),l.library.version?g.jsx($i,{name:"version",value:l.library.version}):null]})]})};function IM({attached:e=!1}){const{state:{selected:t,isMobile:n},dispatch:r}=No(),i=d4();if(!t)return null;const{span:s}=t;return g.jsxs("div",{className:Pt(oe.spanDetailPanel,n&&oe.mobile),children:[e&&!n?g.jsx(xP,{}):null,g.jsx("div",{className:oe.spanDetailPanelTop,children:g.jsxs("div",{className:oe.spanDetailPanelTopInfo,children:[g.jsx("span",{className:oe.spanDetailPanelName,title:s.name,children:s.name}),g.jsxs("div",{className:oe.spanDetailPanelCorner,children:[t.isInstrumentationHint?null:g.jsx("span",{className:oe.spanDetailPanelDuration,children:on(t.duration)}),g.jsx("div",{className:oe.spanDetailPanelCloseVerticalRule}),g.jsx("button",{"aria-label":"Close Span Details",className:oe.spanDetailPanelClose,onClick:()=>r({type:"deselect"}),type:"button",children:g.jsx(iP,{color:"gray-700",size:20})})]})]})}),g.jsx("div",{className:Pt("flex gap-3",oe.spanDetailPanelBody),children:i||g.jsx(dP,{})})]})}const Nh="vc-trace-span-exp:";function fr({name:e,className:t="",children:n}){const[r,i]=x.useState(()=>"localStorage"in globalThis?localStorage.getItem(`${Nh}${e}`)!=="0":!0),s=x.useCallback(()=>{i(a=>{const o=!a;return localStorage.setItem(`${Nh}${e}`,String(Number(o))),o})},[e]);return g.jsxs("div",{className:Pt(oe.detailGroup,r?oe.expanded:oe.collapsed,t),children:[g.jsxs("button",{className:oe.detailHeading,onClick:s,type:"button",children:[g.jsx("span",{children:e}),g.jsx(sP,{})]}),r?n:null]})}const fP=new Set(["OPTIONS","HEAD","GET","PUT","POST","DELETE"]),hP={"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."},Oh=new Set(["Start VM","Spawn Node.js","Spawn Python","Init User Code"]),Lh=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},pP=e=>{const{name:t}=e.span,n=Lh(e),r=Lh(e.parent);return e.span.attributes["vercel.middleware.internal"]==="true"?"The Vercel Toolbar created this middleware.":Oh.has(t)||t==="Invoke Function"&&e.children.some(i=>Oh.has(i.span.name))?"This function encountered a cold start.":n&&r&&n!==r?"This request was routed across regions.":null},lb=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 fP.has(r)};function mP({node:e}){const{name:t}=e.span;let n=hP[t];if(!n&&lb(e)&&(n="How long it took for Vercel to process the request and send the response."),!n)return null;const r=pP(e);return g.jsx(fr,{name:"What is this?",children:g.jsxs("div",{className:oe.infraSpanDescription,children:[g.jsx("span",{children:n}),r&&g.jsx(uP,{children:r})]})})}const gP=x.memo(function({getQuickLinks:t,span:n}){const r=t(n);return r.length?g.jsx(fr,{name:"Links",children:r.map(({key:i,value:s})=>g.jsx(EP,{link:s,name:i},i))}):null});function bP(e){const[t,n]=x.useState({}),r=e.__resolvedValue!==void 0||e.__rejectedValue!==void 0;return x.useEffect(()=>{r||e.then(i=>{e.__resolvedValue=i}).catch(i=>{e.__rejectedValue=i}).finally(()=>n({}))},[e,r]),e.__resolvedValue}function EP({name:e,link:t}){const n=bP(t);return g.jsxs(oP,{as:n?void 0:"span",className:Pt(oe.spanDetailPanelAttribute,oe.spanDetailPanelQuickLink),href:(n==null?void 0:n.href)||"",children:[g.jsx("span",{className:oe.spanDetailPanelAttributeKey,children:e}),g.jsx("span",{className:Pt(oe.spanDetailPanelAttributeValue,oe.spanDetailPanelQuickLinkLabel),children:n?g.jsxs(g.Fragment,{children:[n.label,n.icon||g.jsx(aP,{color:"gray-900"})]}):g.jsxs(g.Fragment,{children:[g.jsx(Sh,{height:18,width:32+e.length*8}),g.jsx(Sh,{height:18,rounded:!0,width:18})]})})]})}function TP(){return g.jsx(fr,{name:"What is this?",children:g.jsxs("div",{className:oe.infraSpanDescription,children:[g.jsx("span",{children:"You can visualize your application's spans alongside Vercel's spans in this viewer."}),g.jsx(lP,{href:"https://vercel.com/docs/session-tracing#adding-custom-spans",size:"small",target:"_blank",children:"Get Started"})]})})}function $i({name:e,value:t}){return g.jsxs("dl",{className:oe.spanDetailPanelAttribute,children:[g.jsx("dt",{className:oe.spanDetailPanelAttributeKey,children:e}),g.jsx("dd",{className:oe.spanDetailPanelAttributeValue,title:String(t),children:String(t)})]})}function xP(){const{state:{panelWidth:e},dispatch:t}=No(),n=x.useRef({start:{x:0,width:e},x:0,width:e,isHeld:!1});n.current.width=e;const r=x.useCallback(s=>{if(s.pointerType!=="mouse")return;s.preventDefault();const a=n.current;a.start.x=s.clientX,a.x=s.clientX,a.start.width=a.width,a.isHeld=!0},[]),i=x.useCallback(()=>{t({type:"setPanelWidth",width:Nc.panelWidth})},[t]);return x.useEffect(()=>{let s=0;const a=()=>{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(s),s=requestAnimationFrame(a))},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:oe.spanDetailPanelResizer,onDoubleClick:i,onPointerDown:r})}function yP(e){const t=x.useRef({});return{setStyle:x.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 _P=()=>"devicePixelRatio"in globalThis&&globalThis.devicePixelRatio||1,kP=()=>{const[e,t]=x.useState(1);return x.useLayoutEffect(()=>{const n=()=>t(_P()),r=matchMedia(`(resolution: ${e}dppx)`);return r.addEventListener("change",n),n(),()=>{r.removeEventListener("change",n)}},[e]),e},Vi=Za,vM=x.memo(function({timelineRef:t,rows:n,scale:r}){const{state:{root:i,baseScale:s,timelineWidth:a,width:o,scrollbarWidth:l}}=No(),u=o+Za*2,d=kP(),c=x.useRef(null),h=x.useRef(null),p=o/(o-l)*Math.min(o/a,s/r),m=Math.min(o,(a-l)*p);x.useEffect(()=>{let y=!1,k=0,P;const D=w=>{var L;return!!((L=c.current)!=null&&L.contains(w))};let v=0;const A=()=>{if(!y||!P)return;const w=t.current;if(!w)return;const L=k-m*.5-P.left;w.scrollLeft=L/p},N=w=>{({clientX:k}=w),cancelAnimationFrame(v),v=requestAnimationFrame(A)},z=w=>{var L;D(w.target)&&(y=!0,P=(L=c.current)==null?void 0:L.getBoundingClientRect(),N(w))},R=()=>{y=!1,P=void 0},W=w=>{D(w.target)&&w.cancelable&&w.preventDefault()},j=w=>{y&&w.cancelable&&w.preventDefault()};return window.addEventListener("pointerdown",z),window.addEventListener("pointermove",N),window.addEventListener("pointerup",R),window.addEventListener("blur",R),window.addEventListener("touchstart",W,{passive:!1}),window.addEventListener("touchmove",j,{passive:!1}),()=>{window.removeEventListener("pointerdown",z),window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",R),window.removeEventListener("blur",R),window.removeEventListener("touchstart",W),window.removeEventListener("touchmove",j),cancelAnimationFrame(v)}},[t,p,m]),x.useEffect(()=>{const y=h.current,k=y==null?void 0:y.getContext("2d");if(!y||!k)return;const D=requestAnimationFrame(()=>{k.resetTransform(),k.clearRect(0,0,y.width,y.height),k.scale(d,d);const v=1,A=3,N=(u-Vi*2)/i.duration;k.fillStyle="#ccc",k.beginPath();for(const z of n)for(const R of z){const W=Vi-v+(v+A)*R.row;if(W>=li-A-Vi)break;const j=Vi+(R.startTime-i.startTime)*N,w=R.duration*N;k.roundRect(j,W,w,A,A)}k.fill()});return()=>cancelAnimationFrame(D)},[d,i,u,n]);const E=x.useRef(null),{style:T,setStyle:b}=yP(E);return x.useLayoutEffect(()=>{const y=t.current;if(!y)return;let k=0;const P=()=>{b("transform",`translateX(${Vi+y.scrollLeft*p}px)`)};P();const D=()=>{cancelAnimationFrame(k),k=requestAnimationFrame(P)};return y.addEventListener("scroll",D),()=>{cancelAnimationFrame(k),y.removeEventListener("scroll",D)}},[t,p,b]),g.jsxs("div",{className:oe.mapContainer,ref:c,style:{width:m>0?u:"100%",height:li},children:[g.jsx("canvas",{className:oe.mapCanvas,height:li*d,ref:h,style:{width:u,height:li},width:u*d}),g.jsx("div",{className:oe.mapThumb,ref:E,style:{transform:T.transform,width:m>0?m:`calc(100% - ${Za*2}px)`,top:2,height:li-4}})]})});function wP(e){try{const t=JSON.parse(e);return typeof t=="string"?t:JSON.stringify(t,null,2)}catch{return e}}function CP(e){try{return JSON.parse(e)}catch{return e}}const AP=F.memo(function({chunk:t,index:n}){const r=CP(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:wP(r)}):g.jsx(m_,{data:r,expandLevel:1})]})});function SP(){return g.jsxs("div",{className:"flex flex-col gap-3 animate-in fade-in",children:[g.jsx(Fd,{style:{width:120,height:16,borderRadius:4}}),[1,2,3,4].map(e=>g.jsx(Fd,{style:{height:56,borderRadius:6}},e))]})}function RM({streamId:e,chunks:t,isLive:n,error:r,isLoading:i,onScrollEnd:s}){const a=x.useRef(null),o=x.useRef(0);return x.useEffect(()=>{var l;t.length>o.current&&t.length>0&&((l=a.current)==null||l.scrollToIndex({index:t.length-1,align:"end"})),o.current=t.length},[t.length]),i&&t.length===0?g.jsx("div",{className:"flex flex-col h-full",children:g.jsx(SP,{})}):g.jsxs("div",{className:"flex flex-col h-full",children:[n&&g.jsxs("div",{className:"flex items-center gap-1.5 mb-2 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.jsx("div",{className:"flex-1 min-h-0",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"}):g.jsx(qy,{ref:a,totalCount:t.length,overscan:10,endReached:()=>s==null?void 0:s(),itemContent:l=>g.jsx("div",{style:{paddingBottom:8},children:g.jsx(AP,{chunk:t[l],index:l})}),style:{flex:1,minHeight:0}})})]})}const NM=10;function ub(...e){return Nu(Pt(e))}const OM=5e3;function LM(e,t,n){return n?`Page ${e} of ${t}+`:`Page ${e} of ${t}`}const DM=UT,PM=jT,IP=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(Dp,{ref:r,sideOffset:t,className:ub("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}));IP.displayName=Dp.displayName;const cb=x.createContext(null);function MM({children:e,serverConfig:t}){const n={serverConfig:t};return g.jsx(cb.Provider,{value:n,children:e})}function BM(){const e=x.useContext(cb);if(!e)throw new Error("useServerConfig must be used within a ServerConfigProvider");return e}function Dh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function db(...e){return t=>{let n=!1;const r=e.map(i=>{const s=Dh(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():Dh(e[i],null)}}}}function FM(...e){return x.useCallback(db(...e),e)}var fb=x.forwardRef((e,t)=>{const{children:n,...r}=e,i=x.Children.toArray(n),s=i.find(RP);if(s){const a=s.props.children,o=i.map(l=>l===s?x.Children.count(a)>1?x.Children.only(null):x.isValidElement(a)?a.props.children:null:l);return g.jsx(cu,{...r,ref:t,children:x.isValidElement(a)?x.cloneElement(a,void 0,o):null})}return g.jsx(cu,{...r,ref:t,children:n})});fb.displayName="Slot";var cu=x.forwardRef((e,t)=>{const{children:n,...r}=e;if(x.isValidElement(n)){const i=OP(n);return x.cloneElement(n,{...NP(r,n.props),ref:t?db(t,i):i})}return x.Children.count(n)>1?x.Children.only(null):null});cu.displayName="SlotClone";var vP=({children:e})=>g.jsx(g.Fragment,{children:e});function RP(e){return x.isValidElement(e)&&e.type===vP}function NP(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...o)=>{s(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function OP(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 Ph=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Mh=Pt,LP=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Mh(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,a=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],c=s==null?void 0:s[u];if(d===null)return null;const h=Ph(d)||Ph(c);return i[u][h]}),o=n&&Object.entries(n).reduce((u,d)=>{let[c,h]=d;return h===void 0||(u[c]=h),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:h,...p}=d;return Object.entries(p).every(m=>{let[E,T]=m;return Array.isArray(T)?T.includes({...s,...o}[E]):{...s,...o}[E]===T})?[...u,c,h]:u},[]);return Mh(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},DP=LP("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"}}),PP=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const a=r?fb:"button";return g.jsx(a,{className:ub(DP({variant:t,size:n,className:e})),ref:s,...i})});PP.displayName="Button";let du;try{du=new TextDecoder}catch{}let de,Fr,K=0;const MP=105,BP=57342,FP=57343,Bh=57337,Fh=6,ii={};let Wi=11281e4,qn=1681e4,Pe={},ct,Ja,eo=0,Os=0,yt,pn,bt=[],fu=[],Yt,Ht,Qi,Hh={useRecords:!1,mapsAsObjects:!0},Ls=!1,hb=2;try{new Function("")}catch{hb=1/0}class Ds{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[mn(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(de)return bb(()=>(gu(),this?this.decode(t,n):Ds.prototype.decode.call(Hh,t,n)));Fr=n>-1?n:t.length,K=0,Os=0,Ja=null,yt=null,de=t;try{Ht=t.dataView||(t.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength))}catch(r){throw de=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 Ds){if(Pe=this,Yt=this.sharedValues&&(this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this.structures)return ct=this.structures,ba();(!ct||ct.length>0)&&(ct=[])}else Pe=Hh,(!ct||ct.length>0)&&(ct=[]),Yt=null;return ba()}decodeMultiple(t,n){let r,i=0;try{let s=t.length;Ls=!0;let a=this?this.decode(t,s):Mc.decode(t,s);if(n){if(n(a)===!1)return;for(;K<s;)if(i=K,n(ba())===!1)return}else{for(r=[a];K<s;)i=K,r.push(ba());return r}}catch(s){throw s.lastPosition=i,s.values=r,s}finally{Ls=!1,gu()}}}function ba(){try{let e=Fe();if(yt){if(K>=yt.postBundlePosition){let t=new Error("Unexpected bundle position");throw t.incomplete=!0,t}K=yt.postBundlePosition,yt=null}if(K==Fr)ct=null,de=null,pn&&(pn=null);else if(K>Fr){let t=new Error("Unexpected end of CBOR data");throw t.incomplete=!0,t}else if(!Ls)throw new Error("Data read, but end of buffer not reached");return e}catch(e){throw gu(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer"))&&(e.incomplete=!0),e}}function Fe(){let e=de[K++],t=e>>5;if(e=e&31,e>23)switch(e){case 24:e=de[K++];break;case 25:if(t==7)return zP();e=Ht.getUint16(K),K+=2;break;case 26:if(t==7){let n=Ht.getFloat32(K);if(Pe.useFloat32>2){let r=Pc[(de[K]&127)<<1|de[K+1]>>7];return K+=4,(r*n+(n>0?.5:-.5)>>0)/r}return K+=4,n}e=Ht.getUint32(K),K+=4;break;case 27:if(t==7){let n=Ht.getFloat64(K);return K+=8,n}if(t>1){if(Ht.getUint32(K)>0)throw new Error("JavaScript does not support arrays, maps, or strings with length over 4294967295");e=Ht.getUint32(K+4)}else Pe.int64AsNumber?(e=Ht.getUint32(K)*4294967296,e+=Ht.getUint32(K+4)):e=Ht.getBigUint64(K);K+=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=Fe())!=ii;){if(i>=Wi)throw new Error(`Array length exceeds ${Wi}`);n[i++]=r}return t==4?n:t==3?n.join(""):Buffer.concat(n);case 5:let s;if(Pe.mapsAsObjects){let a={},o=0;if(Pe.keyMap)for(;(s=Fe())!=ii;){if(o++>=qn)throw new Error(`Property count exceeds ${qn}`);a[mn(Pe.decodeKey(s))]=Fe()}else for(;(s=Fe())!=ii;){if(o++>=qn)throw new Error(`Property count exceeds ${qn}`);a[mn(s)]=Fe()}return a}else{Qi&&(Pe.mapsAsObjects=!0,Qi=!1);let a=new Map;if(Pe.keyMap){let o=0;for(;(s=Fe())!=ii;){if(o++>=qn)throw new Error(`Map size exceeds ${qn}`);a.set(Pe.decodeKey(s),Fe())}}else{let o=0;for(;(s=Fe())!=ii;){if(o++>=qn)throw new Error(`Map size exceeds ${qn}`);a.set(s,Fe())}}return a}case 7:return ii;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 jP(e);case 3:if(Os>=K)return Ja.slice(K-eo,(K+=e)-eo);if(Os==0&&Fr<140&&e<32){let i=e<16?pb(e):UP(e);if(i!=null)return i}return HP(e);case 4:if(e>=Wi)throw new Error(`Array length exceeds ${Wi}`);let n=new Array(e);for(let i=0;i<e;i++)n[i]=Fe();return n;case 5:if(e>=qn)throw new Error(`Map size exceeds ${Wi}`);if(Pe.mapsAsObjects){let i={};if(Pe.keyMap)for(let s=0;s<e;s++)i[mn(Pe.decodeKey(Fe()))]=Fe();else for(let s=0;s<e;s++)i[mn(Fe())]=Fe();return i}else{Qi&&(Pe.mapsAsObjects=!0,Qi=!1);let i=new Map;if(Pe.keyMap)for(let s=0;s<e;s++)i.set(Pe.decodeKey(Fe()),Fe());else for(let s=0;s<e;s++)i.set(Fe(),Fe());return i}case 6:if(e>=Bh){let i=ct[e&8191];if(i)return i.read||(i.read=hu(i)),i.read();if(e<65536){if(e==FP){let s=di(),a=Fe(),o=Fe();mu(a,o);let l={};if(Pe.keyMap)for(let u=2;u<s;u++){let d=Pe.decodeKey(o[u-2]);l[mn(d)]=Fe()}else for(let u=2;u<s;u++){let d=o[u-2];l[mn(d)]=Fe()}return l}else if(e==BP){let s=di(),a=Fe();for(let o=2;o<s;o++)mu(a++,Fe());return Fe()}else if(e==Bh)return qP();if(Pe.getShared&&(Dc(),i=ct[e&8191],i))return i.read||(i.read=hu(i)),i.read()}}let r=bt[e];if(r)return r.handlesRead?r(Fe):r(Fe());{let i=Fe();for(let s=0;s<fu.length;s++){let a=fu[s](e,i);if(a!==void 0)return a}return new Wr(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=(Yt||Or())[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 Uh=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function hu(e){if(!e)throw new Error("Structure is required in record definition");function t(){let n=de[K++];if(n=n&31,n>23)switch(n){case 24:n=de[K++];break;case 25:n=Ht.getUint16(K),K+=2;break;case 26:n=Ht.getUint32(K),K+=4;break;default:throw new Error("Expected array header, but got "+de[K-1])}let r=this.compiledReader;for(;r;){if(r.propertyCount===n)return r(Fe);r=r.next}if(this.slowReads++>=hb){let s=this.length==n?this:this.slice(0,n);return r=Pe.keyMap?new Function("r","return {"+s.map(a=>Pe.decodeKey(a)).map(a=>Uh.test(a)?mn(a)+":r()":"["+JSON.stringify(a)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(a=>Uh.test(a)?mn(a)+":r()":"["+JSON.stringify(a)+"]:r()").join(",")+"}"),this.compiledReader&&(r.next=this.compiledReader),r.propertyCount=n,this.compiledReader=r,r(Fe)}let i={};if(Pe.keyMap)for(let s=0;s<n;s++)i[mn(Pe.decodeKey(this[s]))]=Fe();else for(let s=0;s<n;s++)i[mn(this[s])]=Fe();return i}return e.slowReads=0,t}function mn(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 HP=pu;function pu(e){let t;if(e<16&&(t=pb(e)))return t;if(e>64&&du)return du.decode(de.subarray(K,K+=e));const n=K+e,r=[];for(t="";K<n;){const i=de[K++];if((i&128)===0)r.push(i);else if((i&224)===192){const s=de[K++]&63;r.push((i&31)<<6|s)}else if((i&240)===224){const s=de[K++]&63,a=de[K++]&63;r.push((i&31)<<12|s<<6|a)}else if((i&248)===240){const s=de[K++]&63,a=de[K++]&63,o=de[K++]&63;let l=(i&7)<<18|s<<12|a<<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+=Ct.apply(String,r),r.length=0)}return r.length>0&&(t+=Ct.apply(String,r)),t}let Ct=String.fromCharCode;function UP(e){let t=K,n=new Array(e);for(let r=0;r<e;r++){const i=de[K++];if((i&128)>0){K=t;return}n[r]=i}return Ct.apply(String,n)}function pb(e){if(e<4)if(e<2){if(e===0)return"";{let t=de[K++];if((t&128)>1){K-=1;return}return Ct(t)}}else{let t=de[K++],n=de[K++];if((t&128)>0||(n&128)>0){K-=2;return}if(e<3)return Ct(t,n);let r=de[K++];if((r&128)>0){K-=3;return}return Ct(t,n,r)}else{let t=de[K++],n=de[K++],r=de[K++],i=de[K++];if((t&128)>0||(n&128)>0||(r&128)>0||(i&128)>0){K-=4;return}if(e<6){if(e===4)return Ct(t,n,r,i);{let s=de[K++];if((s&128)>0){K-=5;return}return Ct(t,n,r,i,s)}}else if(e<8){let s=de[K++],a=de[K++];if((s&128)>0||(a&128)>0){K-=6;return}if(e<7)return Ct(t,n,r,i,s,a);let o=de[K++];if((o&128)>0){K-=7;return}return Ct(t,n,r,i,s,a,o)}else{let s=de[K++],a=de[K++],o=de[K++],l=de[K++];if((s&128)>0||(a&128)>0||(o&128)>0||(l&128)>0){K-=8;return}if(e<10){if(e===8)return Ct(t,n,r,i,s,a,o,l);{let u=de[K++];if((u&128)>0){K-=9;return}return Ct(t,n,r,i,s,a,o,l,u)}}else if(e<12){let u=de[K++],d=de[K++];if((u&128)>0||(d&128)>0){K-=10;return}if(e<11)return Ct(t,n,r,i,s,a,o,l,u,d);let c=de[K++];if((c&128)>0){K-=11;return}return Ct(t,n,r,i,s,a,o,l,u,d,c)}else{let u=de[K++],d=de[K++],c=de[K++],h=de[K++];if((u&128)>0||(d&128)>0||(c&128)>0||(h&128)>0){K-=12;return}if(e<14){if(e===12)return Ct(t,n,r,i,s,a,o,l,u,d,c,h);{let p=de[K++];if((p&128)>0){K-=13;return}return Ct(t,n,r,i,s,a,o,l,u,d,c,h,p)}}else{let p=de[K++],m=de[K++];if((p&128)>0||(m&128)>0){K-=14;return}if(e<15)return Ct(t,n,r,i,s,a,o,l,u,d,c,h,p,m);let E=de[K++];if((E&128)>0){K-=15;return}return Ct(t,n,r,i,s,a,o,l,u,d,c,h,p,m,E)}}}}}function jP(e){return Pe.copyBuffers?Uint8Array.prototype.slice.call(de,K,K+=e):de.subarray(K,K+=e)}let mb=new Float32Array(1),Ea=new Uint8Array(mb.buffer,0,4);function zP(){let e=de[K++],t=de[K++],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 Ea[3]=e&128|(n>>1)+56,Ea[2]=(e&7)<<5|t>>3,Ea[1]=t<<5,Ea[0]=0,mb[0]}new Array(4096);class Wr{constructor(t,n){this.value=t,this.tag=n}}bt[0]=e=>new Date(e);bt[1]=e=>new Date(Math.round(e*1e3));bt[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};bt[3]=e=>BigInt(-1)-bt[2](e);bt[4]=e=>+(e[1]+"e"+e[0]);bt[5]=e=>e[1]*Math.exp(e[0]*Math.log(2));const mu=(e,t)=>{e=e-57344;let n=ct[e];n&&n.isShared&&((ct.restoreStructures||(ct.restoreStructures=[]))[e]=n),ct[e]=t,t.read=hu(t)};bt[MP]=e=>{let t=e.length,n=e[1];mu(e[0],n);let r={};for(let i=2;i<t;i++){let s=n[i-2];r[mn(s)]=e[i]}return r};bt[14]=e=>yt?yt[0].slice(yt.position0,yt.position0+=e):new Wr(e,14);bt[15]=e=>yt?yt[1].slice(yt.position1,yt.position1+=e):new Wr(e,15);let $P={Error,RegExp};bt[27]=e=>($P[e[0]]||Error)(e[1],e[2]);const gb=e=>{if(de[K++]!=132){let n=new Error("Packed values structure must be followed by a 4 element array");throw de.length<K&&(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 Yt=Yt?t.concat(Yt.slice(t.length)):t,Yt.prefixes=e(),Yt.suffixes=e(),e()};gb.handlesRead=!0;bt[51]=gb;bt[Fh]=e=>{if(!Yt)if(Pe.getShared)Dc();else return new Wr(e,Fh);if(typeof e=="number")return Yt[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};bt[28]=e=>{pn||(pn=new Map,pn.id=0);let t=pn.id++,n=K,r=de[K],i;r>>5==4?i=[]:i={};let s={target:i};pn.set(t,s);let a=e();return s.used?(Object.getPrototypeOf(i)!==Object.getPrototypeOf(a)&&(K=n,i=a,pn.set(t,{target:i}),a=e()),Object.assign(i,a)):(s.target=a,a)};bt[28].handlesRead=!0;bt[29]=e=>{let t=pn.get(e);return t.used=!0,t.target};bt[258]=e=>new Set(e);(bt[259]=e=>(Pe.mapsAsObjects&&(Pe.mapsAsObjects=!1,Qi=!0),e())).handlesRead=!0;function si(e,t){return typeof e=="string"?e+t:e instanceof Array?e.concat(t):Object.assign({},e,t)}function Or(){if(!Yt)if(Pe.getShared)Dc();else throw new Error("No packed values available");return Yt}const VP=1399353956;fu.push((e,t)=>{if(e>=225&&e<=255)return si(Or().prefixes[e-224],t);if(e>=28704&&e<=32767)return si(Or().prefixes[e-28672],t);if(e>=1879052288&&e<=2147483647)return si(Or().prefixes[e-1879048192],t);if(e>=216&&e<=223)return si(t,Or().suffixes[e-216]);if(e>=27647&&e<=28671)return si(t,Or().suffixes[e-27639]);if(e>=1811940352&&e<=1879048191)return si(t,Or().suffixes[e-1811939328]);if(e==VP)return{packedValues:Yt,structures:ct.slice(0),version:t};if(e==55799)return t});const WP=new Uint8Array(new Uint16Array([1]).buffer)[0]==1,jh=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>"u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"?{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array],YP=[64,68,69,70,71,72,77,78,79,85,86];for(let e=0;e<jh.length;e++)GP(jh[e],YP[e]);function GP(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 s=r==2?1:r==4?2:r==8?3:0;bt[i?t:t-4]=r==1||i==WP?a=>{if(!e)throw new Error("Could not find typed array for code "+t);return!Pe.copyBuffers&&(r===1||r===2&&!(a.byteOffset&1)||r===4&&!(a.byteOffset&3)||r===8&&!(a.byteOffset&7))?new e(a.buffer,a.byteOffset,a.byteLength>>s):new e(Uint8Array.prototype.slice.call(a,0).buffer)}:a=>{if(!e)throw new Error("Could not find typed array for code "+t);let o=new DataView(a.buffer,a.byteOffset,a.byteLength),l=a.length>>s,u=new e(l),d=o[n];for(let c=0;c<l;c++)u[c]=d.call(o,c<<s,i);return u}}}function qP(){let e=di(),t=K+Fe();for(let r=2;r<e;r++){let i=di();K+=i}let n=K;return K=t,yt=[pu(di()),pu(di())],yt.position0=0,yt.position1=0,yt.postBundlePosition=K,K=n,Fe()}function di(){let e=de[K++]&31;if(e>23)switch(e){case 24:e=de[K++];break;case 25:e=Ht.getUint16(K),K+=2;break;case 26:e=Ht.getUint32(K),K+=4;break}return e}function Dc(){if(Pe.getShared){let e=bb(()=>(de=null,Pe.getShared()))||{},t=e.structures||[];Pe.sharedVersion=e.version,Yt=Pe.sharedValues=e.packedValues,ct===!0?Pe.structures=ct=t:ct.splice.apply(ct,[0,t.length].concat(t))}}function bb(e){let t=Fr,n=K,r=eo,i=Os,s=Ja,a=pn,o=yt,l=new Uint8Array(de.slice(0,Fr)),u=ct,d=Pe,c=Ls,h=e();return Fr=t,K=n,eo=r,Os=i,Ja=s,pn=a,yt=o,de=l,Ls=c,ct=u,Pe=d,Ht=new DataView(de.buffer,de.byteOffset,de.byteLength),h}function gu(){de=null,pn=null,ct=null}const Pc=new Array(147);for(let e=0;e<256;e++)Pc[e]=+("1e"+Math.floor(45.15-e*.30103));let Mc=new Ds({useRecords:!1});const zh=Mc.decode;Mc.decodeMultiple;let Na;try{Na=new TextEncoder}catch{}let bu,Eb;const Lo=typeof globalThis=="object"&&globalThis.Buffer,Qs=typeof Lo<"u",ml=Qs?Lo.allocUnsafeSlow:Uint8Array,$h=Qs?Lo:Uint8Array,Vh=256,Wh=Qs?4294967296:2144337920;let gl,V,rt,B=0,lr,Tt=null;const KP=61440,XP=/[\u0080-\uFFFF]/,Zt=Symbol("record-id");class QP extends Ds{constructor(t){super(t),this.offset=0;let n,r,i,s,a;t=t||{};let o=$h.prototype.utf8Write?function(w,L,M){return V.utf8Write(w,L,M)}:Na&&Na.encodeInto?function(w,L){return Na.encodeInto(w,V.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 h,p,m=t.sharedValues,E;if(m){E=Object.create(null);for(let w=0,L=m.length;w<L;w++)E[m[w]]=w}let T=[],b=0,y=0;this.mapEncode=function(w,L){if(this._keyMap&&!this._mapped)switch(w.constructor.name){case"Array":w=w.map(M=>this.encodeKeys(M));break}return this.encode(w,L)},this.encode=function(w,L){if(V||(V=new ml(8192),rt=new DataView(V.buffer,0,8192),B=0),lr=V.length-10,lr-B<2048?(V=new ml(V.length),rt=new DataView(V.buffer,0,V.length),lr=V.length-10,B=0):L===qh&&(B=B+7&2147483640),n=B,l.useSelfDescribedHeader&&(rt.setUint32(B,3654940416),B+=3),a=l.structuredClone?new Map:null,l.bundleStrings&&typeof w!="string"?(Tt=[],Tt.size=1/0):Tt=null,r=l.structures,r){if(r.uninitialized){let H=l.getShared()||{};l.structures=r=H.structures||[],l.sharedVersion=H.version;let U=l.sharedValues=H.packedValues;if(U){E={};for(let G=0,Q=U.length;G<Q;G++)E[U[G]]=G}}let M=r.length;if(M>d&&!c&&(M=d),!r.transitions){r.transitions=Object.create(null);for(let H=0;H<M;H++){let U=r[H];if(!U)continue;let G,Q=r.transitions;for(let _=0,se=U.length;_<se;_++){Q[Zt]===void 0&&(Q[Zt]=H);let te=U[_];G=Q[te],G||(G=Q[te]=Object.create(null)),Q=G}Q[Zt]=H|1048576}}c||(r.nextId=M)}if(i&&(i=!1),s=r||[],p=E,t.pack){let M=new Map;if(M.values=[],M.encoder=l,M.maxValues=t.maxPrivatePackedValues||(E?16:1/0),M.objectMap=E||!1,M.samplingPackedValues=h,Oa(w,M),M.values.length>0){V[B++]=216,V[B++]=51,Mn(4);let H=M.values;k(H),Mn(0),Mn(0),p=Object.create(E||null);for(let U=0,G=H.length;U<G;U++)p[H[U]]=U}}gl=L&El;try{if(gl)return;if(k(w),Tt&&Gh(n,k),l.offset=B,a&&a.idsToInsert){B+=a.idsToInsert.length*2,B>lr&&D(B),l.offset=B;let M=eM(V.subarray(n,B),a.idsToInsert);return a=null,M}return L&qh?(V.start=n,V.end=B,V):V.subarray(n,B)}finally{if(r){if(y<10&&y++,r.length>d&&(r.length=d),b>1e4)r.transitions=null,y=0,b=0,T.length>0&&(T=[]);else if(T.length>0&&!c){for(let M=0,H=T.length;M<H;M++)T[M][Zt]=void 0;T=[]}}if(i&&l.saveShared){l.structures.length>d&&(l.structures=l.structures.slice(0,d));let M=V.subarray(n,B);return l.updateSharedData()===!1?l.encode(w):M}L&nM&&(B=n)}},this.findCommonStringsToPack=()=>(h=new Map,E||(E=Object.create(null)),w=>{let L=w&&w.threshold||4,M=this.pack?w.maxPrivatePackedValues||16:0;m||(m=this.sharedValues=[]);for(let[H,U]of h)U.count>L&&(E[H]=M++,m.push(H),i=!0);for(;this.saveShared&&this.updateSharedData()===!1;);h=null});const k=w=>{B>lr&&(V=D(B));var L=typeof w,M;if(L==="string"){if(p){let Q=p[w];if(Q>=0){Q<16?V[B++]=Q+224:(V[B++]=198,Q&1?k(15-Q>>1):k(Q-16>>1));return}else if(h&&!t.pack){let _=h.get(w);_?_.count++:h.set(w,{count:1})}}let H=w.length;if(Tt&&H>=4&&H<1024){if((Tt.size+=H)>KP){let _,se=(Tt[0]?Tt[0].length*3+Tt[1].length:0)+10;B+se>lr&&(V=D(B+se)),V[B++]=217,V[B++]=223,V[B++]=249,V[B++]=Tt.position?132:130,V[B++]=26,_=B-n,B+=4,Tt.position&&Gh(n,k),Tt=["",""],Tt.size=0,Tt.position=_}let Q=XP.test(w);Tt[Q?0:1]+=w,V[B++]=Q?206:207,k(H);return}let U;H<32?U=1:H<256?U=2:H<65536?U=3:U=5;let G=H*3;if(B+G>lr&&(V=D(B+G)),H<64||!o){let Q,_,se,te=B+U;for(Q=0;Q<H;Q++)_=w.charCodeAt(Q),_<128?V[te++]=_:_<2048?(V[te++]=_>>6|192,V[te++]=_&63|128):(_&64512)===55296&&((se=w.charCodeAt(Q+1))&64512)===56320?(_=65536+((_&1023)<<10)+(se&1023),Q++,V[te++]=_>>18|240,V[te++]=_>>12&63|128,V[te++]=_>>6&63|128,V[te++]=_&63|128):(V[te++]=_>>12|224,V[te++]=_>>6&63|128,V[te++]=_&63|128);M=te-B-U}else M=o(w,B+U,G);M<24?V[B++]=96|M:M<256?(U<2&&V.copyWithin(B+2,B+1,B+1+M),V[B++]=120,V[B++]=M):M<65536?(U<3&&V.copyWithin(B+3,B+2,B+2+M),V[B++]=121,V[B++]=M>>8,V[B++]=M&255):(U<5&&V.copyWithin(B+5,B+3,B+3+M),V[B++]=122,rt.setUint32(B,M),B+=4),B+=M}else if(L==="number")if(!this.alwaysUseFloat&&w>>>0===w)w<24?V[B++]=w:w<256?(V[B++]=24,V[B++]=w):w<65536?(V[B++]=25,V[B++]=w>>8,V[B++]=w&255):(V[B++]=26,rt.setUint32(B,w),B+=4);else if(!this.alwaysUseFloat&&w>>0===w)w>=-24?V[B++]=31-w:w>=-256?(V[B++]=56,V[B++]=~w):w>=-65536?(V[B++]=57,rt.setUint16(B,~w),B+=2):(V[B++]=58,rt.setUint32(B,~w),B+=4);else{let H;if((H=this.useFloat32)>0&&w<4294967296&&w>=-2147483648){V[B++]=250,rt.setFloat32(B,w);let U;if(H<4||(U=w*Pc[(V[B]&127)<<1|V[B+1]>>7])>>0===U){B+=4;return}else B--}V[B++]=251,rt.setFloat64(B,w),B+=8}else if(L==="object")if(!w)V[B++]=246;else{if(a){let U=a.get(w);if(U){if(V[B++]=216,V[B++]=29,V[B++]=25,!U.references){let G=a.idsToInsert||(a.idsToInsert=[]);U.references=[],G.push(U)}U.references.push(B-n),B+=2;return}else a.set(w,{offset:B-n})}let H=w.constructor;if(H===Object)P(w);else if(H===Array){M=w.length,M<24?V[B++]=128|M:Mn(M);for(let U=0;U<M;U++)k(w[U])}else if(H===Map)if((this.mapsAsObjects?this.useTag259ForMaps!==!1:this.useTag259ForMaps)&&(V[B++]=217,V[B++]=1,V[B++]=3),M=w.size,M<24?V[B++]=160|M:M<256?(V[B++]=184,V[B++]=M):M<65536?(V[B++]=185,V[B++]=M>>8,V[B++]=M&255):(V[B++]=186,rt.setUint32(B,M),B+=4),l.keyMap)for(let[U,G]of w)k(l.encodeKey(U)),k(G);else for(let[U,G]of w)k(U),k(G);else{for(let U=0,G=bu.length;U<G;U++){let Q=Eb[U];if(w instanceof Q){let _=bu[U],se=_.tag;se==null&&(se=_.getTag&&_.getTag.call(this,w)),se<24?V[B++]=192|se:se<256?(V[B++]=216,V[B++]=se):se<65536?(V[B++]=217,V[B++]=se>>8,V[B++]=se&255):se>-1&&(V[B++]=218,rt.setUint32(B,se),B+=4),_.encode.call(this,w,k,D);return}}if(w[Symbol.iterator]){if(gl){let U=new Error("Iterable should be serialized as iterator");throw U.iteratorNotHandled=!0,U}V[B++]=159;for(let U of w)k(U);V[B++]=255;return}if(w[Symbol.asyncIterator]||bl(w)){let U=new Error("Iterable/blob should be serialized as iterator");throw U.iteratorNotHandled=!0,U}if(this.useToJSON&&w.toJSON){const U=w.toJSON();if(U!==w)return k(U)}P(w)}}else if(L==="boolean")V[B++]=w?245:244;else if(L==="bigint"){if(w<BigInt(1)<<BigInt(64)&&w>=0)V[B++]=27,rt.setBigUint64(B,w);else if(w>-(BigInt(1)<<BigInt(64))&&w<0)V[B++]=59,rt.setBigUint64(B,-w-BigInt(1));else if(this.largeBigIntToFloat)V[B++]=251,rt.setFloat64(B,Number(w));else{w>=BigInt(0)?V[B++]=194:(V[B++]=195,w=BigInt(-1)-w);let H=[];for(;w;)H.push(Number(w&BigInt(255))),w>>=BigInt(8);Eu(new Uint8Array(H.reverse()),D);return}B+=8}else if(L==="undefined")V[B++]=247;else throw new Error("Unknown type: "+L)},P=this.useRecords===!1?this.variableMapSize?w=>{let L=Object.keys(w),M=Object.values(w),H=L.length;if(H<24?V[B++]=160|H:H<256?(V[B++]=184,V[B++]=H):H<65536?(V[B++]=185,V[B++]=H>>8,V[B++]=H&255):(V[B++]=186,rt.setUint32(B,H),B+=4),l.keyMap)for(let U=0;U<H;U++)k(l.encodeKey(L[U])),k(M[U]);else for(let U=0;U<H;U++)k(L[U]),k(M[U])}:w=>{V[B++]=185;let L=B-n;B+=2;let M=0;if(l.keyMap)for(let H in w)(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(H))&&(k(l.encodeKey(H)),k(w[H]),M++);else for(let H in w)(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(H))&&(k(H),k(w[H]),M++);V[L+++n]=M>>8,V[L+n]=M&255}:(w,L)=>{let M,H=s.transitions||(s.transitions=Object.create(null)),U=0,G=0,Q,_;if(this.keyMap){_=Object.keys(w).map(te=>this.encodeKey(te)),G=_.length;for(let te=0;te<G;te++){let S=_[te];M=H[S],M||(M=H[S]=Object.create(null),U++),H=M}}else for(let te in w)(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(te))&&(M=H[te],M||(H[Zt]&1048576&&(Q=H[Zt]&65535),M=H[te]=Object.create(null),U++),H=M,G++);let se=H[Zt];if(se!==void 0)se&=65535,V[B++]=217,V[B++]=se>>8|224,V[B++]=se&255;else if(_||(_=H.__keys__||(H.__keys__=Object.keys(w))),Q===void 0?(se=s.nextId++,se||(se=0,s.nextId=1),se>=Vh&&(s.nextId=(se=d)+1)):se=Q,s[se]=_,se<d){V[B++]=217,V[B++]=se>>8|224,V[B++]=se&255,H=s.transitions;for(let te=0;te<G;te++)(H[Zt]===void 0||H[Zt]&1048576)&&(H[Zt]=se),H=H[_[te]];H[Zt]=se|1048576,i=!0}else{if(H[Zt]=se,rt.setUint32(B,3655335680),B+=3,U&&(b+=y*U),T.length>=Vh-d&&(T.shift()[Zt]=void 0),T.push(H),Mn(G+2),k(57344+se),k(_),L)return;for(let te in w)(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(te))&&k(w[te]);return}if(G<24?V[B++]=128|G:Mn(G),!L)for(let te in w)(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(te))&&k(w[te])},D=w=>{let L;if(w>16777216){if(w-n>Wh)throw new Error("Encoded buffer would be larger than maximum buffer size");L=Math.min(Wh,Math.round(Math.max((w-n)*(w>67108864?1.25:2),4194304)/4096)*4096)}else L=(Math.max(w-n<<2,V.length-1)>>12)+1<<12;let M=new ml(L);return rt=new DataView(M.buffer,0,L),V.copy?V.copy(M,0,n,w):M.set(V.slice(n,w)),B-=n,n=0,lr=M.length-10,V=M};let v=100,A=1e3;this.encodeAsIterable=function(w,L){return W(w,L,N)},this.encodeAsAsyncIterable=function(w,L){return W(w,L,j)};function*N(w,L,M){let H=w.constructor;if(H===Object){let U=l.useRecords!==!1;U?P(w,!0):Yh(Object.keys(w).length,160);for(let G in w){let Q=w[G];U||k(G),Q&&typeof Q=="object"?L[G]?yield*N(Q,L[G]):yield*z(Q,L,G):k(Q)}}else if(H===Array){let U=w.length;Mn(U);for(let G=0;G<U;G++){let Q=w[G];Q&&(typeof Q=="object"||B-n>v)?L.element?yield*N(Q,L.element):yield*z(Q,L,"element"):k(Q)}}else if(w[Symbol.iterator]&&!w.buffer){V[B++]=159;for(let U of w)U&&(typeof U=="object"||B-n>v)?L.element?yield*N(U,L.element):yield*z(U,L,"element"):k(U);V[B++]=255}else bl(w)?(Yh(w.size,64),yield V.subarray(n,B),yield w,R()):w[Symbol.asyncIterator]?(V[B++]=159,yield V.subarray(n,B),yield w,R(),V[B++]=255):k(w);M&&B>n?yield V.subarray(n,B):B-n>v&&(yield V.subarray(n,B),R())}function*z(w,L,M){let H=B-n;try{k(w),B-n>v&&(yield V.subarray(n,B),R())}catch(U){if(U.iteratorNotHandled)L[M]={},B=n+H,yield*N.call(this,w,L[M]);else throw U}}function R(){v=A,l.encode(null,El)}function W(w,L,M){return L&&L.chunkThreshold?v=A=L.chunkThreshold:v=100,w&&typeof w=="object"?(l.encode(null,El),M(w,l.iterateProperties||(l.iterateProperties={}),!0)):[l.encode(w)]}async function*j(w,L){for(let M of N(w,L,!0)){let H=M.constructor;if(H===$h||H===Uint8Array)yield M;else if(bl(M)){let U=M.stream().getReader(),G;for(;!(G=await U.read()).done;)yield G.value}else if(M[Symbol.asyncIterator])for await(let U of M)R(),U?yield*j(U,L.async||(L.async={})):yield l.encode(U);else yield M}}}useBuffer(t){V=t,rt=new DataView(V.buffer,V.byteOffset,V.byteLength),B=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 Tb(n,this.sharedValues,this.sharedVersion),i=this.saveShared(r,s=>(s&&s.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((s,a)=>this.structures[a]=s),i}}function Yh(e,t){e<24?V[B++]=t|e:e<256?(V[B++]=t|24,V[B++]=e):e<65536?(V[B++]=t|25,V[B++]=e>>8,V[B++]=e&255):(V[B++]=t|26,rt.setUint32(B,e),B+=4)}class Tb{constructor(t,n,r){this.structures=t,this.packedValues=n,this.version=r}}function Mn(e){e<24?V[B++]=128|e:e<256?(V[B++]=152,V[B++]=e):e<65536?(V[B++]=153,V[B++]=e>>8,V[B++]=e&255):(V[B++]=154,rt.setUint32(B,e),B+=4)}const ZP=typeof Blob>"u"?function(){}:Blob;function bl(e){if(e instanceof ZP)return!0;let t=e[Symbol.toStringTag];return t==="Blob"||t==="File"}function Oa(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++)Oa(e[r],t);else{let r=!t.encoder.useRecords;for(var n in e)e.hasOwnProperty(n)&&(r&&Oa(n,t),Oa(e[n],t))}break;case"function":console.log(e)}}const JP=new Uint8Array(new Uint16Array([1]).buffer)[0]==1;Eb=[Date,Set,Error,RegExp,Wr,ArrayBuffer,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>"u"?function(){}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"?function(){}:BigInt64Array,Float32Array,Float64Array,Tb];bu=[{tag:1,encode(e,t){let n=e.getTime()/1e3;(this.useTimestamp32||e.getMilliseconds()===0)&&n>=0&&n<4294967296?(V[B++]=26,rt.setUint32(B,n),B+=4):(V[B++]=251,rt.setFloat64(B,n),B+=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){Eu(e,n)}},{getTag(e){if(e.constructor===Uint8Array&&(this.tagUint8Array||Qs&&this.tagUint8Array!==!1))return 64},encode(e,t,n){Eu(e,n)}},Dn(68,1),Dn(69,2),Dn(70,4),Dn(71,8),Dn(72,1),Dn(77,2),Dn(78,4),Dn(79,8),Dn(85,4),Dn(86,8),{encode(e,t){let n=e.packedValues||[],r=e.structures||[];if(n.values.length>0){V[B++]=216,V[B++]=51,Mn(4);let i=n.values;t(i),Mn(0),Mn(0),packedObjectMap=Object.create(sharedPackedObjectMap||null);for(let s=0,a=i.length;s<a;s++)packedObjectMap[i[s]]=s}if(r){rt.setUint32(B,3655335424),B+=3;let i=r.slice(0);i.unshift(57344),i.push(new Wr(e.version,1399353956)),t(i)}else t(new Wr(e.version,1399353956))}}];function Dn(e,t){return!JP&&t>1&&(e-=4),{tag:e,encode:function(r,i){let s=r.byteLength,a=r.byteOffset||0,o=r.buffer||r;i(Qs?Lo.from(o,a,s):new Uint8Array(o,a,s))}}}function Eu(e,t){let n=e.byteLength;n<24?V[B++]=64+n:n<256?(V[B++]=88,V[B++]=n):n<65536?(V[B++]=89,V[B++]=n>>8,V[B++]=n&255):(V[B++]=90,rt.setUint32(B,n),B+=4),B+n>=V.length&&t(B+n),V.set(e.buffer?e:new Uint8Array(e),B),B+=n}function eM(e,t){let n,r=t.length*2,i=e.length-r;t.sort((s,a)=>s.offset>a.offset?1:-1);for(let s=0;s<t.length;s++){let a=t[s];a.id=s;for(let o of a.references)e[o++]=s>>8,e[o]=s&255}for(;n=t.pop();){let s=n.offset;e.copyWithin(s+r,s,i),r-=2;let a=s+r;e[a++]=216,e[a++]=28,i=s}return e}function Gh(e,t){rt.setUint32(Tt.position+e,B-Tt.position-e+1);let n=Tt;Tt=null,t(n[0]),t(n[1])}let Bc=new QP({useRecords:!1});const tM=Bc.encode;Bc.encodeAsIterable;Bc.encodeAsAsyncIterable;const qh=512,nM=1024,El=2048;async function Ft(e,t){var i;const n=await fetch("/api/rpc",{method:"POST",headers:{"Content-Type":"application/cbor",Accept:"application/cbor"},body:new Uint8Array(tM({method:e,params:t??{}}))});if(!n.ok){try{const s=await n.arrayBuffer(),a=zh(new Uint8Array(s));if((i=a==null?void 0:a.error)!=null&&i.message)throw new Error(a.error.message)}catch(s){if(s instanceof Error&&s.message!==`RPC call ${e} failed`)throw s}throw new Error(`RPC call ${e} failed: ${n.status} ${n.statusText}`)}const r=await n.arrayBuffer();return zh(new Uint8Array(r))}async function HM(e,t){return Ft("fetchRuns",{worldEnv:e,params:t})}async function UM(e,t,n="all"){return Ft("fetchRun",{worldEnv:e,runId:t,resolveData:n})}async function jM(e,t,n,r="all"){return Ft("fetchStep",{worldEnv:e,runId:t,stepId:n,resolveData:r})}async function zM(e,t,n){return Ft("fetchEvents",{worldEnv:e,runId:t,params:n})}async function $M(e,t,n,r="all"){return Ft("fetchEvent",{worldEnv:e,runId:t,eventId:n,resolveData:r})}async function VM(e,t){return Ft("fetchHooks",{worldEnv:e,params:t})}async function WM(e,t,n="all"){return Ft("fetchHook",{worldEnv:e,hookId:t,resolveData:n})}async function YM(e,t){return Ft("cancelRun",{worldEnv:e,runId:t})}async function GM(e,t,n){return Ft("recreateRun",{worldEnv:e,runId:t,deploymentId:n})}async function qM(e,t){return Ft("reenqueueRun",{worldEnv:e,runId:t})}async function KM(e,t,n){return Ft("wakeUpRun",{worldEnv:e,runId:t,options:n})}async function XM(e,t,n){return Ft("resumeHook",{worldEnv:e,token:t,payload:n})}async function QM(e,t){return Ft("fetchStreams",{worldEnv:e,runId:t})}async function ZM(e){return Ft("fetchWorkflowsManifest",{worldEnv:e})}async function JM(e,t,n){return Ft("runHealthCheck",{worldEnv:e,endpoint:t,options:n})}async function e8(e,t){return Ft("getEncryptionKeyForRun",{worldEnv:e,runId:t})}const rM=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:nb},Symbol.toStringTag,{value:"Module"}));export{Pt as $,cT as A,PP as B,dT as C,NM as D,FM as E,UM as F,Ap as G,oM as H,Fd as I,O2 as J,xM as K,uM as L,on as M,m_ as N,Qm as O,Gr as P,ZL as Q,En as R,MM as S,DM as T,hM as U,xT as V,cM as W,dM as X,qy as Y,Bx as Z,a4 as _,PM as a,No as a0,oe as a1,wM as a2,AM as a3,yP as a4,Za as a5,CM as a6,Ro as a7,pr as a8,Ns as a9,Fx as aA,LP as aB,db as aC,WE as aD,GE as aE,qE as aF,XE as aG,QE as aH,JE as aI,ZE as aJ,KE as aK,PE as aL,YM as aM,qM as aN,KM as aO,XM as aP,GM as aQ,ZM as aR,l4 as aa,ma as ab,kM as ac,yM as ad,li as ae,u4 as af,vM as ag,SM as ah,IM as ai,_M as aj,pM as ak,fM as al,WM as am,jM as an,QM as ao,fb as ap,vP as aq,DP as ar,Vu as as,ks as at,sn as au,R2 as av,OM as aw,$M as ax,e8 as ay,RM as az,IP as b,Qp as c,ub as d,mM as e,CT as f,Hr as g,gM as h,HM as i,VM as j,LM as k,zM as l,to as m,Yr as n,bp as o,Jh as p,Xn as q,JM as r,$b as s,Wo as t,BM as u,Cb as v,np as w,bT as x,uT as y,fT as z};
172
+ ${m} ${p}`:`${d} ${u}`,className:Pt(oe.spanNodeEvent,y,a&&oe.boundaryMarker,n.isHighlighted?oe.colorHighlight:Lc(n),n.isHighlighted===!1&&oe.unlit),"data-hovered":t.isHovered,ref:o,style:{left:E,top:T},children:[g.jsx("div",{className:Pt(oe.hoverInfo,b?oe.alignStart:oe.alignEnd),children:a?g.jsxs(g.Fragment,{children:[g.jsx("span",{className:oe.eventName,children:d}),g.jsx("span",{className:oe.eventTimestamp,children:u}),p?g.jsxs(g.Fragment,{children:[g.jsx("span",{className:oe.eventName,children:m}),g.jsx("span",{className:oe.eventTimestamp,children:p})]}):null]}):g.jsxs(g.Fragment,{children:[g.jsx("span",{className:oe.eventName,children:l}),g.jsx("span",{className:oe.eventTimestamp,children:u})]})}),a?g.jsx("div",{className:oe.boundaryLine}):g.jsx("div",{className:oe.eventDiamond})]})}),ob={"gray-700":"var(--ds-gray-700)","gray-900":"var(--ds-gray-900)"};function iP({size:e=16,color:t="gray-700"}){const n={color:ob[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 sP({size:e=16}){return g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,className:oe.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 aP({size:e=16,color:t="gray-900"}){const n={color:ob[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 oP(e){const{as:t,className:n,href:r,children:i,...s}=e;return(t||"a")==="span"||!r?g.jsx("span",{className:n,...s,children:i}):g.jsx("a",{className:n,href:r,...s,children:i})}function lP(e){const{className:t,children:n,size:r,...i}=e;return g.jsx("a",{...i,className:Pt(oe.buttonLink,t),children:n})}function uP({children:e,className:t}){return g.jsx("div",{className:Pt(oe.note,t),children:e})}function Sh({width:e,height:t,rounded:n}){return g.jsx("span",{className:Pt(oe.skeleton,n&&oe.skeletonRounded),style:{width:e,height:t},"aria-hidden":!0})}const Ih=e=>`${(100*e).toFixed(3)}%`,vh=(e,t)=>e<t?-1:e>t?1:0,Rh=e=>{const t={};for(const[r,i]of Object.entries(e)){const s=r.indexOf(".");let a="",o="";s!==-1?(a=r.substring(0,s),o=r.substring(s+1)):o=r;let l=t[a];l||(l={prefix:a,attributes:[]},t[a]=l),l.attributes.push({key:r,suffix:o,value:String(i)})}const n=Array.from(Object.values(t)).sort((r,i)=>vh(r.prefix,i.prefix));for(const r of n)r.attributes.sort((i,s)=>vh(i.suffix,s.suffix));return n},cP=(e,t)=>{const n=[];if(!t)return n;for(let r=t;"parent"in r;r=r.parent)n.unshift(r);return n},dP=()=>{var d;const{state:{root:e,selected:t,resourceMap:n,getQuickLinks:r},dispatch:i}=No(),s=x.useMemo(()=>cP(e,t),[e,t]),a=x.useMemo(()=>Rh((t==null?void 0:t.span.attributes)??{}),[t]),o=x.useMemo(()=>{const c=t==null?void 0:t.span.resource;if(!c)return[];const h=n[c];return h?Rh(h):[]},[n,t]);if(!t)return null;const{span:l}=t,u=lb(t);return g.jsxs(g.Fragment,{children:[t.isVercel?g.jsx(mP,{node:t}):null,t.isInstrumentationHint?g.jsx(TP,{}):null,!t.isInstrumentationHint&&s.length?g.jsx(fr,{className:oe.ancestorGroup,name:"Location",children:s.map(c=>g.jsxs("button",{className:oe.ancestorNode,onClick:()=>i({type:"select",id:c.span.spanId}),type:"button",children:[g.jsxs("div",{className:oe.ancestorText,children:[g.jsx("span",{className:oe.ancestorName,children:c.label||c.span.name}),g.jsx("span",{className:oe.ancestorDuration,children:on(c.duration)})]}),g.jsx("span",{"aria-hidden":!0,className:oe.ancestorLineContainer,children:g.jsx("span",{className:Pt(oe.ancestorLine,Lc(c)),style:{left:Ih((c.startTime-e.startTime)/e.duration),width:Ih(c.duration/e.duration)}})})]},`${t.span.spanId}.${c.span.spanId}`))}):null,u?g.jsx(gP,{getQuickLinks:r,span:t.span}):null,(d=t.events)!=null&&d.length?g.jsx(fr,{name:"Events",children:t.events.map(c=>g.jsxs(x.Fragment,{children:[g.jsxs("dl",{className:oe.spanDetailPanelAttribute,children:[g.jsx("dt",{className:oe.spanDetailPanelAttributeKey,children:c.event.name}),g.jsx("dd",{className:oe.spanDetailPanelAttributeValue,children:on(c.timestamp-e.startTime)})]}),Object.entries(c.event.attributes).map(([h,p])=>g.jsx($i,{name:`${c.event.name}.${h}`,value:p},h))]},c.key))}):null,a.length?g.jsx(fr,{name:"Attributes",children:a.map(c=>g.jsx(x.Fragment,{children:c.attributes.map(({key:h,value:p})=>g.jsx($i,{name:h,value:p},h))},c.prefix))}):null,o.length?g.jsx(fr,{name:"Resource",children:o.map(c=>g.jsx(x.Fragment,{children:c.attributes.map(({key:h,value:p})=>g.jsx($i,{name:h,value:p},h))},c.prefix))}):null,t.isInstrumentationHint?null:g.jsxs(fr,{name:"Library",children:[g.jsx($i,{name:"name",value:l.library.name}),l.library.version?g.jsx($i,{name:"version",value:l.library.version}):null]})]})};function IM({attached:e=!1}){const{state:{selected:t,isMobile:n},dispatch:r}=No(),i=d4();if(!t)return null;const{span:s}=t;return g.jsxs("div",{className:Pt(oe.spanDetailPanel,n&&oe.mobile),children:[e&&!n?g.jsx(xP,{}):null,g.jsx("div",{className:oe.spanDetailPanelTop,children:g.jsxs("div",{className:oe.spanDetailPanelTopInfo,children:[g.jsx("span",{className:oe.spanDetailPanelName,title:s.name,children:s.name}),g.jsxs("div",{className:oe.spanDetailPanelCorner,children:[t.isInstrumentationHint?null:g.jsx("span",{className:oe.spanDetailPanelDuration,children:on(t.duration)}),g.jsx("div",{className:oe.spanDetailPanelCloseVerticalRule}),g.jsx("button",{"aria-label":"Close Span Details",className:oe.spanDetailPanelClose,onClick:()=>r({type:"deselect"}),type:"button",children:g.jsx(iP,{color:"gray-700",size:20})})]})]})}),g.jsx("div",{className:Pt("flex gap-3",oe.spanDetailPanelBody),children:i||g.jsx(dP,{})})]})}const Nh="vc-trace-span-exp:";function fr({name:e,className:t="",children:n}){const[r,i]=x.useState(()=>"localStorage"in globalThis?localStorage.getItem(`${Nh}${e}`)!=="0":!0),s=x.useCallback(()=>{i(a=>{const o=!a;return localStorage.setItem(`${Nh}${e}`,String(Number(o))),o})},[e]);return g.jsxs("div",{className:Pt(oe.detailGroup,r?oe.expanded:oe.collapsed,t),children:[g.jsxs("button",{className:oe.detailHeading,onClick:s,type:"button",children:[g.jsx("span",{children:e}),g.jsx(sP,{})]}),r?n:null]})}const fP=new Set(["OPTIONS","HEAD","GET","PUT","POST","DELETE"]),hP={"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."},Oh=new Set(["Start VM","Spawn Node.js","Spawn Python","Init User Code"]),Lh=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},pP=e=>{const{name:t}=e.span,n=Lh(e),r=Lh(e.parent);return e.span.attributes["vercel.middleware.internal"]==="true"?"The Vercel Toolbar created this middleware.":Oh.has(t)||t==="Invoke Function"&&e.children.some(i=>Oh.has(i.span.name))?"This function encountered a cold start.":n&&r&&n!==r?"This request was routed across regions.":null},lb=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 fP.has(r)};function mP({node:e}){const{name:t}=e.span;let n=hP[t];if(!n&&lb(e)&&(n="How long it took for Vercel to process the request and send the response."),!n)return null;const r=pP(e);return g.jsx(fr,{name:"What is this?",children:g.jsxs("div",{className:oe.infraSpanDescription,children:[g.jsx("span",{children:n}),r&&g.jsx(uP,{children:r})]})})}const gP=x.memo(function({getQuickLinks:t,span:n}){const r=t(n);return r.length?g.jsx(fr,{name:"Links",children:r.map(({key:i,value:s})=>g.jsx(EP,{link:s,name:i},i))}):null});function bP(e){const[t,n]=x.useState({}),r=e.__resolvedValue!==void 0||e.__rejectedValue!==void 0;return x.useEffect(()=>{r||e.then(i=>{e.__resolvedValue=i}).catch(i=>{e.__rejectedValue=i}).finally(()=>n({}))},[e,r]),e.__resolvedValue}function EP({name:e,link:t}){const n=bP(t);return g.jsxs(oP,{as:n?void 0:"span",className:Pt(oe.spanDetailPanelAttribute,oe.spanDetailPanelQuickLink),href:(n==null?void 0:n.href)||"",children:[g.jsx("span",{className:oe.spanDetailPanelAttributeKey,children:e}),g.jsx("span",{className:Pt(oe.spanDetailPanelAttributeValue,oe.spanDetailPanelQuickLinkLabel),children:n?g.jsxs(g.Fragment,{children:[n.label,n.icon||g.jsx(aP,{color:"gray-900"})]}):g.jsxs(g.Fragment,{children:[g.jsx(Sh,{height:18,width:32+e.length*8}),g.jsx(Sh,{height:18,rounded:!0,width:18})]})})]})}function TP(){return g.jsx(fr,{name:"What is this?",children:g.jsxs("div",{className:oe.infraSpanDescription,children:[g.jsx("span",{children:"You can visualize your application's spans alongside Vercel's spans in this viewer."}),g.jsx(lP,{href:"https://vercel.com/docs/session-tracing#adding-custom-spans",size:"small",target:"_blank",children:"Get Started"})]})})}function $i({name:e,value:t}){return g.jsxs("dl",{className:oe.spanDetailPanelAttribute,children:[g.jsx("dt",{className:oe.spanDetailPanelAttributeKey,children:e}),g.jsx("dd",{className:oe.spanDetailPanelAttributeValue,title:String(t),children:String(t)})]})}function xP(){const{state:{panelWidth:e},dispatch:t}=No(),n=x.useRef({start:{x:0,width:e},x:0,width:e,isHeld:!1});n.current.width=e;const r=x.useCallback(s=>{if(s.pointerType!=="mouse")return;s.preventDefault();const a=n.current;a.start.x=s.clientX,a.x=s.clientX,a.start.width=a.width,a.isHeld=!0},[]),i=x.useCallback(()=>{t({type:"setPanelWidth",width:Nc.panelWidth})},[t]);return x.useEffect(()=>{let s=0;const a=()=>{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(s),s=requestAnimationFrame(a))},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:oe.spanDetailPanelResizer,onDoubleClick:i,onPointerDown:r})}function yP(e){const t=x.useRef({});return{setStyle:x.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 _P=()=>"devicePixelRatio"in globalThis&&globalThis.devicePixelRatio||1,kP=()=>{const[e,t]=x.useState(1);return x.useLayoutEffect(()=>{const n=()=>t(_P()),r=matchMedia(`(resolution: ${e}dppx)`);return r.addEventListener("change",n),n(),()=>{r.removeEventListener("change",n)}},[e]),e},Vi=Za,vM=x.memo(function({timelineRef:t,rows:n,scale:r}){const{state:{root:i,baseScale:s,timelineWidth:a,width:o,scrollbarWidth:l}}=No(),u=o+Za*2,d=kP(),c=x.useRef(null),h=x.useRef(null),p=o/(o-l)*Math.min(o/a,s/r),m=Math.min(o,(a-l)*p);x.useEffect(()=>{let y=!1,k=0,P;const D=w=>{var L;return!!((L=c.current)!=null&&L.contains(w))};let v=0;const A=()=>{if(!y||!P)return;const w=t.current;if(!w)return;const L=k-m*.5-P.left;w.scrollLeft=L/p},N=w=>{({clientX:k}=w),cancelAnimationFrame(v),v=requestAnimationFrame(A)},z=w=>{var L;D(w.target)&&(y=!0,P=(L=c.current)==null?void 0:L.getBoundingClientRect(),N(w))},R=()=>{y=!1,P=void 0},W=w=>{D(w.target)&&w.cancelable&&w.preventDefault()},j=w=>{y&&w.cancelable&&w.preventDefault()};return window.addEventListener("pointerdown",z),window.addEventListener("pointermove",N),window.addEventListener("pointerup",R),window.addEventListener("blur",R),window.addEventListener("touchstart",W,{passive:!1}),window.addEventListener("touchmove",j,{passive:!1}),()=>{window.removeEventListener("pointerdown",z),window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",R),window.removeEventListener("blur",R),window.removeEventListener("touchstart",W),window.removeEventListener("touchmove",j),cancelAnimationFrame(v)}},[t,p,m]),x.useEffect(()=>{const y=h.current,k=y==null?void 0:y.getContext("2d");if(!y||!k)return;const D=requestAnimationFrame(()=>{k.resetTransform(),k.clearRect(0,0,y.width,y.height),k.scale(d,d);const v=1,A=3,N=(u-Vi*2)/i.duration;k.fillStyle="#ccc",k.beginPath();for(const z of n)for(const R of z){const W=Vi-v+(v+A)*R.row;if(W>=li-A-Vi)break;const j=Vi+(R.startTime-i.startTime)*N,w=R.duration*N;k.roundRect(j,W,w,A,A)}k.fill()});return()=>cancelAnimationFrame(D)},[d,i,u,n]);const E=x.useRef(null),{style:T,setStyle:b}=yP(E);return x.useLayoutEffect(()=>{const y=t.current;if(!y)return;let k=0;const P=()=>{b("transform",`translateX(${Vi+y.scrollLeft*p}px)`)};P();const D=()=>{cancelAnimationFrame(k),k=requestAnimationFrame(P)};return y.addEventListener("scroll",D),()=>{cancelAnimationFrame(k),y.removeEventListener("scroll",D)}},[t,p,b]),g.jsxs("div",{className:oe.mapContainer,ref:c,style:{width:m>0?u:"100%",height:li},children:[g.jsx("canvas",{className:oe.mapCanvas,height:li*d,ref:h,style:{width:u,height:li},width:u*d}),g.jsx("div",{className:oe.mapThumb,ref:E,style:{transform:T.transform,width:m>0?m:`calc(100% - ${Za*2}px)`,top:2,height:li-4}})]})});function wP(e){try{const t=JSON.parse(e);return typeof t=="string"?t:JSON.stringify(t,null,2)}catch{return e}}function CP(e){try{return JSON.parse(e)}catch{return e}}const AP=F.memo(function({chunk:t,index:n}){const r=CP(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:wP(r)}):g.jsx(m_,{data:r,expandLevel:1})]})});function SP(){return g.jsxs("div",{className:"flex flex-col gap-3 animate-in fade-in",children:[g.jsx(Fd,{style:{width:120,height:16,borderRadius:4}}),[1,2,3,4].map(e=>g.jsx(Fd,{style:{height:56,borderRadius:6}},e))]})}function RM({streamId:e,chunks:t,isLive:n,error:r,isLoading:i,onScrollEnd:s}){const a=x.useRef(null),o=x.useRef(0);return x.useEffect(()=>{var l;t.length>o.current&&t.length>0&&((l=a.current)==null||l.scrollToIndex({index:t.length-1,align:"end"})),o.current=t.length},[t.length]),i&&t.length===0?g.jsx("div",{className:"flex flex-col h-full",children:g.jsx(SP,{})}):g.jsxs("div",{className:"flex flex-col h-full",children:[n&&g.jsxs("div",{className:"flex items-center gap-1.5 mb-2 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.jsx("div",{className:"flex-1 min-h-0",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"}):g.jsx(qy,{ref:a,totalCount:t.length,overscan:10,endReached:()=>s==null?void 0:s(),itemContent:l=>g.jsx("div",{style:{paddingBottom:8},children:g.jsx(AP,{chunk:t[l],index:l})}),style:{flex:1,minHeight:0}})})]})}const NM=10;function ub(...e){return Nu(Pt(e))}const OM=5e3;function LM(e,t,n){return n?`Page ${e} of ${t}+`:`Page ${e} of ${t}`}const DM=UT,PM=jT,IP=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(Dp,{ref:r,sideOffset:t,className:ub("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}));IP.displayName=Dp.displayName;const cb=x.createContext(null);function MM({children:e,serverConfig:t}){const n={serverConfig:t};return g.jsx(cb.Provider,{value:n,children:e})}function BM(){const e=x.useContext(cb);if(!e)throw new Error("useServerConfig must be used within a ServerConfigProvider");return e}function Dh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function db(...e){return t=>{let n=!1;const r=e.map(i=>{const s=Dh(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():Dh(e[i],null)}}}}function FM(...e){return x.useCallback(db(...e),e)}var fb=x.forwardRef((e,t)=>{const{children:n,...r}=e,i=x.Children.toArray(n),s=i.find(RP);if(s){const a=s.props.children,o=i.map(l=>l===s?x.Children.count(a)>1?x.Children.only(null):x.isValidElement(a)?a.props.children:null:l);return g.jsx(cu,{...r,ref:t,children:x.isValidElement(a)?x.cloneElement(a,void 0,o):null})}return g.jsx(cu,{...r,ref:t,children:n})});fb.displayName="Slot";var cu=x.forwardRef((e,t)=>{const{children:n,...r}=e;if(x.isValidElement(n)){const i=OP(n);return x.cloneElement(n,{...NP(r,n.props),ref:t?db(t,i):i})}return x.Children.count(n)>1?x.Children.only(null):null});cu.displayName="SlotClone";var vP=({children:e})=>g.jsx(g.Fragment,{children:e});function RP(e){return x.isValidElement(e)&&e.type===vP}function NP(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...o)=>{s(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function OP(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 Ph=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Mh=Pt,LP=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Mh(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,a=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],c=s==null?void 0:s[u];if(d===null)return null;const h=Ph(d)||Ph(c);return i[u][h]}),o=n&&Object.entries(n).reduce((u,d)=>{let[c,h]=d;return h===void 0||(u[c]=h),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:h,...p}=d;return Object.entries(p).every(m=>{let[E,T]=m;return Array.isArray(T)?T.includes({...s,...o}[E]):{...s,...o}[E]===T})?[...u,c,h]:u},[]);return Mh(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},DP=LP("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"}}),PP=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const a=r?fb:"button";return g.jsx(a,{className:ub(DP({variant:t,size:n,className:e})),ref:s,...i})});PP.displayName="Button";let du;try{du=new TextDecoder}catch{}let de,Fr,K=0;const MP=105,BP=57342,FP=57343,Bh=57337,Fh=6,ii={};let Wi=11281e4,qn=1681e4,Pe={},ct,Ja,eo=0,Os=0,yt,pn,bt=[],fu=[],Yt,Ht,Qi,Hh={useRecords:!1,mapsAsObjects:!0},Ls=!1,hb=2;try{new Function("")}catch{hb=1/0}class Ds{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[mn(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(de)return bb(()=>(gu(),this?this.decode(t,n):Ds.prototype.decode.call(Hh,t,n)));Fr=n>-1?n:t.length,K=0,Os=0,Ja=null,yt=null,de=t;try{Ht=t.dataView||(t.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength))}catch(r){throw de=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 Ds){if(Pe=this,Yt=this.sharedValues&&(this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this.structures)return ct=this.structures,ba();(!ct||ct.length>0)&&(ct=[])}else Pe=Hh,(!ct||ct.length>0)&&(ct=[]),Yt=null;return ba()}decodeMultiple(t,n){let r,i=0;try{let s=t.length;Ls=!0;let a=this?this.decode(t,s):Mc.decode(t,s);if(n){if(n(a)===!1)return;for(;K<s;)if(i=K,n(ba())===!1)return}else{for(r=[a];K<s;)i=K,r.push(ba());return r}}catch(s){throw s.lastPosition=i,s.values=r,s}finally{Ls=!1,gu()}}}function ba(){try{let e=Fe();if(yt){if(K>=yt.postBundlePosition){let t=new Error("Unexpected bundle position");throw t.incomplete=!0,t}K=yt.postBundlePosition,yt=null}if(K==Fr)ct=null,de=null,pn&&(pn=null);else if(K>Fr){let t=new Error("Unexpected end of CBOR data");throw t.incomplete=!0,t}else if(!Ls)throw new Error("Data read, but end of buffer not reached");return e}catch(e){throw gu(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer"))&&(e.incomplete=!0),e}}function Fe(){let e=de[K++],t=e>>5;if(e=e&31,e>23)switch(e){case 24:e=de[K++];break;case 25:if(t==7)return zP();e=Ht.getUint16(K),K+=2;break;case 26:if(t==7){let n=Ht.getFloat32(K);if(Pe.useFloat32>2){let r=Pc[(de[K]&127)<<1|de[K+1]>>7];return K+=4,(r*n+(n>0?.5:-.5)>>0)/r}return K+=4,n}e=Ht.getUint32(K),K+=4;break;case 27:if(t==7){let n=Ht.getFloat64(K);return K+=8,n}if(t>1){if(Ht.getUint32(K)>0)throw new Error("JavaScript does not support arrays, maps, or strings with length over 4294967295");e=Ht.getUint32(K+4)}else Pe.int64AsNumber?(e=Ht.getUint32(K)*4294967296,e+=Ht.getUint32(K+4)):e=Ht.getBigUint64(K);K+=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=Fe())!=ii;){if(i>=Wi)throw new Error(`Array length exceeds ${Wi}`);n[i++]=r}return t==4?n:t==3?n.join(""):Buffer.concat(n);case 5:let s;if(Pe.mapsAsObjects){let a={},o=0;if(Pe.keyMap)for(;(s=Fe())!=ii;){if(o++>=qn)throw new Error(`Property count exceeds ${qn}`);a[mn(Pe.decodeKey(s))]=Fe()}else for(;(s=Fe())!=ii;){if(o++>=qn)throw new Error(`Property count exceeds ${qn}`);a[mn(s)]=Fe()}return a}else{Qi&&(Pe.mapsAsObjects=!0,Qi=!1);let a=new Map;if(Pe.keyMap){let o=0;for(;(s=Fe())!=ii;){if(o++>=qn)throw new Error(`Map size exceeds ${qn}`);a.set(Pe.decodeKey(s),Fe())}}else{let o=0;for(;(s=Fe())!=ii;){if(o++>=qn)throw new Error(`Map size exceeds ${qn}`);a.set(s,Fe())}}return a}case 7:return ii;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 jP(e);case 3:if(Os>=K)return Ja.slice(K-eo,(K+=e)-eo);if(Os==0&&Fr<140&&e<32){let i=e<16?pb(e):UP(e);if(i!=null)return i}return HP(e);case 4:if(e>=Wi)throw new Error(`Array length exceeds ${Wi}`);let n=new Array(e);for(let i=0;i<e;i++)n[i]=Fe();return n;case 5:if(e>=qn)throw new Error(`Map size exceeds ${Wi}`);if(Pe.mapsAsObjects){let i={};if(Pe.keyMap)for(let s=0;s<e;s++)i[mn(Pe.decodeKey(Fe()))]=Fe();else for(let s=0;s<e;s++)i[mn(Fe())]=Fe();return i}else{Qi&&(Pe.mapsAsObjects=!0,Qi=!1);let i=new Map;if(Pe.keyMap)for(let s=0;s<e;s++)i.set(Pe.decodeKey(Fe()),Fe());else for(let s=0;s<e;s++)i.set(Fe(),Fe());return i}case 6:if(e>=Bh){let i=ct[e&8191];if(i)return i.read||(i.read=hu(i)),i.read();if(e<65536){if(e==FP){let s=di(),a=Fe(),o=Fe();mu(a,o);let l={};if(Pe.keyMap)for(let u=2;u<s;u++){let d=Pe.decodeKey(o[u-2]);l[mn(d)]=Fe()}else for(let u=2;u<s;u++){let d=o[u-2];l[mn(d)]=Fe()}return l}else if(e==BP){let s=di(),a=Fe();for(let o=2;o<s;o++)mu(a++,Fe());return Fe()}else if(e==Bh)return qP();if(Pe.getShared&&(Dc(),i=ct[e&8191],i))return i.read||(i.read=hu(i)),i.read()}}let r=bt[e];if(r)return r.handlesRead?r(Fe):r(Fe());{let i=Fe();for(let s=0;s<fu.length;s++){let a=fu[s](e,i);if(a!==void 0)return a}return new Wr(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=(Yt||Or())[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 Uh=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function hu(e){if(!e)throw new Error("Structure is required in record definition");function t(){let n=de[K++];if(n=n&31,n>23)switch(n){case 24:n=de[K++];break;case 25:n=Ht.getUint16(K),K+=2;break;case 26:n=Ht.getUint32(K),K+=4;break;default:throw new Error("Expected array header, but got "+de[K-1])}let r=this.compiledReader;for(;r;){if(r.propertyCount===n)return r(Fe);r=r.next}if(this.slowReads++>=hb){let s=this.length==n?this:this.slice(0,n);return r=Pe.keyMap?new Function("r","return {"+s.map(a=>Pe.decodeKey(a)).map(a=>Uh.test(a)?mn(a)+":r()":"["+JSON.stringify(a)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(a=>Uh.test(a)?mn(a)+":r()":"["+JSON.stringify(a)+"]:r()").join(",")+"}"),this.compiledReader&&(r.next=this.compiledReader),r.propertyCount=n,this.compiledReader=r,r(Fe)}let i={};if(Pe.keyMap)for(let s=0;s<n;s++)i[mn(Pe.decodeKey(this[s]))]=Fe();else for(let s=0;s<n;s++)i[mn(this[s])]=Fe();return i}return e.slowReads=0,t}function mn(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 HP=pu;function pu(e){let t;if(e<16&&(t=pb(e)))return t;if(e>64&&du)return du.decode(de.subarray(K,K+=e));const n=K+e,r=[];for(t="";K<n;){const i=de[K++];if((i&128)===0)r.push(i);else if((i&224)===192){const s=de[K++]&63;r.push((i&31)<<6|s)}else if((i&240)===224){const s=de[K++]&63,a=de[K++]&63;r.push((i&31)<<12|s<<6|a)}else if((i&248)===240){const s=de[K++]&63,a=de[K++]&63,o=de[K++]&63;let l=(i&7)<<18|s<<12|a<<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+=Ct.apply(String,r),r.length=0)}return r.length>0&&(t+=Ct.apply(String,r)),t}let Ct=String.fromCharCode;function UP(e){let t=K,n=new Array(e);for(let r=0;r<e;r++){const i=de[K++];if((i&128)>0){K=t;return}n[r]=i}return Ct.apply(String,n)}function pb(e){if(e<4)if(e<2){if(e===0)return"";{let t=de[K++];if((t&128)>1){K-=1;return}return Ct(t)}}else{let t=de[K++],n=de[K++];if((t&128)>0||(n&128)>0){K-=2;return}if(e<3)return Ct(t,n);let r=de[K++];if((r&128)>0){K-=3;return}return Ct(t,n,r)}else{let t=de[K++],n=de[K++],r=de[K++],i=de[K++];if((t&128)>0||(n&128)>0||(r&128)>0||(i&128)>0){K-=4;return}if(e<6){if(e===4)return Ct(t,n,r,i);{let s=de[K++];if((s&128)>0){K-=5;return}return Ct(t,n,r,i,s)}}else if(e<8){let s=de[K++],a=de[K++];if((s&128)>0||(a&128)>0){K-=6;return}if(e<7)return Ct(t,n,r,i,s,a);let o=de[K++];if((o&128)>0){K-=7;return}return Ct(t,n,r,i,s,a,o)}else{let s=de[K++],a=de[K++],o=de[K++],l=de[K++];if((s&128)>0||(a&128)>0||(o&128)>0||(l&128)>0){K-=8;return}if(e<10){if(e===8)return Ct(t,n,r,i,s,a,o,l);{let u=de[K++];if((u&128)>0){K-=9;return}return Ct(t,n,r,i,s,a,o,l,u)}}else if(e<12){let u=de[K++],d=de[K++];if((u&128)>0||(d&128)>0){K-=10;return}if(e<11)return Ct(t,n,r,i,s,a,o,l,u,d);let c=de[K++];if((c&128)>0){K-=11;return}return Ct(t,n,r,i,s,a,o,l,u,d,c)}else{let u=de[K++],d=de[K++],c=de[K++],h=de[K++];if((u&128)>0||(d&128)>0||(c&128)>0||(h&128)>0){K-=12;return}if(e<14){if(e===12)return Ct(t,n,r,i,s,a,o,l,u,d,c,h);{let p=de[K++];if((p&128)>0){K-=13;return}return Ct(t,n,r,i,s,a,o,l,u,d,c,h,p)}}else{let p=de[K++],m=de[K++];if((p&128)>0||(m&128)>0){K-=14;return}if(e<15)return Ct(t,n,r,i,s,a,o,l,u,d,c,h,p,m);let E=de[K++];if((E&128)>0){K-=15;return}return Ct(t,n,r,i,s,a,o,l,u,d,c,h,p,m,E)}}}}}function jP(e){return Pe.copyBuffers?Uint8Array.prototype.slice.call(de,K,K+=e):de.subarray(K,K+=e)}let mb=new Float32Array(1),Ea=new Uint8Array(mb.buffer,0,4);function zP(){let e=de[K++],t=de[K++],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 Ea[3]=e&128|(n>>1)+56,Ea[2]=(e&7)<<5|t>>3,Ea[1]=t<<5,Ea[0]=0,mb[0]}new Array(4096);class Wr{constructor(t,n){this.value=t,this.tag=n}}bt[0]=e=>new Date(e);bt[1]=e=>new Date(Math.round(e*1e3));bt[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};bt[3]=e=>BigInt(-1)-bt[2](e);bt[4]=e=>+(e[1]+"e"+e[0]);bt[5]=e=>e[1]*Math.exp(e[0]*Math.log(2));const mu=(e,t)=>{e=e-57344;let n=ct[e];n&&n.isShared&&((ct.restoreStructures||(ct.restoreStructures=[]))[e]=n),ct[e]=t,t.read=hu(t)};bt[MP]=e=>{let t=e.length,n=e[1];mu(e[0],n);let r={};for(let i=2;i<t;i++){let s=n[i-2];r[mn(s)]=e[i]}return r};bt[14]=e=>yt?yt[0].slice(yt.position0,yt.position0+=e):new Wr(e,14);bt[15]=e=>yt?yt[1].slice(yt.position1,yt.position1+=e):new Wr(e,15);let $P={Error,RegExp};bt[27]=e=>($P[e[0]]||Error)(e[1],e[2]);const gb=e=>{if(de[K++]!=132){let n=new Error("Packed values structure must be followed by a 4 element array");throw de.length<K&&(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 Yt=Yt?t.concat(Yt.slice(t.length)):t,Yt.prefixes=e(),Yt.suffixes=e(),e()};gb.handlesRead=!0;bt[51]=gb;bt[Fh]=e=>{if(!Yt)if(Pe.getShared)Dc();else return new Wr(e,Fh);if(typeof e=="number")return Yt[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};bt[28]=e=>{pn||(pn=new Map,pn.id=0);let t=pn.id++,n=K,r=de[K],i;r>>5==4?i=[]:i={};let s={target:i};pn.set(t,s);let a=e();return s.used?(Object.getPrototypeOf(i)!==Object.getPrototypeOf(a)&&(K=n,i=a,pn.set(t,{target:i}),a=e()),Object.assign(i,a)):(s.target=a,a)};bt[28].handlesRead=!0;bt[29]=e=>{let t=pn.get(e);return t.used=!0,t.target};bt[258]=e=>new Set(e);(bt[259]=e=>(Pe.mapsAsObjects&&(Pe.mapsAsObjects=!1,Qi=!0),e())).handlesRead=!0;function si(e,t){return typeof e=="string"?e+t:e instanceof Array?e.concat(t):Object.assign({},e,t)}function Or(){if(!Yt)if(Pe.getShared)Dc();else throw new Error("No packed values available");return Yt}const VP=1399353956;fu.push((e,t)=>{if(e>=225&&e<=255)return si(Or().prefixes[e-224],t);if(e>=28704&&e<=32767)return si(Or().prefixes[e-28672],t);if(e>=1879052288&&e<=2147483647)return si(Or().prefixes[e-1879048192],t);if(e>=216&&e<=223)return si(t,Or().suffixes[e-216]);if(e>=27647&&e<=28671)return si(t,Or().suffixes[e-27639]);if(e>=1811940352&&e<=1879048191)return si(t,Or().suffixes[e-1811939328]);if(e==VP)return{packedValues:Yt,structures:ct.slice(0),version:t};if(e==55799)return t});const WP=new Uint8Array(new Uint16Array([1]).buffer)[0]==1,jh=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>"u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"?{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array],YP=[64,68,69,70,71,72,77,78,79,85,86];for(let e=0;e<jh.length;e++)GP(jh[e],YP[e]);function GP(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 s=r==2?1:r==4?2:r==8?3:0;bt[i?t:t-4]=r==1||i==WP?a=>{if(!e)throw new Error("Could not find typed array for code "+t);return!Pe.copyBuffers&&(r===1||r===2&&!(a.byteOffset&1)||r===4&&!(a.byteOffset&3)||r===8&&!(a.byteOffset&7))?new e(a.buffer,a.byteOffset,a.byteLength>>s):new e(Uint8Array.prototype.slice.call(a,0).buffer)}:a=>{if(!e)throw new Error("Could not find typed array for code "+t);let o=new DataView(a.buffer,a.byteOffset,a.byteLength),l=a.length>>s,u=new e(l),d=o[n];for(let c=0;c<l;c++)u[c]=d.call(o,c<<s,i);return u}}}function qP(){let e=di(),t=K+Fe();for(let r=2;r<e;r++){let i=di();K+=i}let n=K;return K=t,yt=[pu(di()),pu(di())],yt.position0=0,yt.position1=0,yt.postBundlePosition=K,K=n,Fe()}function di(){let e=de[K++]&31;if(e>23)switch(e){case 24:e=de[K++];break;case 25:e=Ht.getUint16(K),K+=2;break;case 26:e=Ht.getUint32(K),K+=4;break}return e}function Dc(){if(Pe.getShared){let e=bb(()=>(de=null,Pe.getShared()))||{},t=e.structures||[];Pe.sharedVersion=e.version,Yt=Pe.sharedValues=e.packedValues,ct===!0?Pe.structures=ct=t:ct.splice.apply(ct,[0,t.length].concat(t))}}function bb(e){let t=Fr,n=K,r=eo,i=Os,s=Ja,a=pn,o=yt,l=new Uint8Array(de.slice(0,Fr)),u=ct,d=Pe,c=Ls,h=e();return Fr=t,K=n,eo=r,Os=i,Ja=s,pn=a,yt=o,de=l,Ls=c,ct=u,Pe=d,Ht=new DataView(de.buffer,de.byteOffset,de.byteLength),h}function gu(){de=null,pn=null,ct=null}const Pc=new Array(147);for(let e=0;e<256;e++)Pc[e]=+("1e"+Math.floor(45.15-e*.30103));let Mc=new Ds({useRecords:!1});const zh=Mc.decode;Mc.decodeMultiple;let Na;try{Na=new TextEncoder}catch{}let bu,Eb;const Lo=typeof globalThis=="object"&&globalThis.Buffer,Qs=typeof Lo<"u",ml=Qs?Lo.allocUnsafeSlow:Uint8Array,$h=Qs?Lo:Uint8Array,Vh=256,Wh=Qs?4294967296:2144337920;let gl,V,rt,B=0,lr,Tt=null;const KP=61440,XP=/[\u0080-\uFFFF]/,Zt=Symbol("record-id");class QP extends Ds{constructor(t){super(t),this.offset=0;let n,r,i,s,a;t=t||{};let o=$h.prototype.utf8Write?function(w,L,M){return V.utf8Write(w,L,M)}:Na&&Na.encodeInto?function(w,L){return Na.encodeInto(w,V.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 h,p,m=t.sharedValues,E;if(m){E=Object.create(null);for(let w=0,L=m.length;w<L;w++)E[m[w]]=w}let T=[],b=0,y=0;this.mapEncode=function(w,L){if(this._keyMap&&!this._mapped)switch(w.constructor.name){case"Array":w=w.map(M=>this.encodeKeys(M));break}return this.encode(w,L)},this.encode=function(w,L){if(V||(V=new ml(8192),rt=new DataView(V.buffer,0,8192),B=0),lr=V.length-10,lr-B<2048?(V=new ml(V.length),rt=new DataView(V.buffer,0,V.length),lr=V.length-10,B=0):L===qh&&(B=B+7&2147483640),n=B,l.useSelfDescribedHeader&&(rt.setUint32(B,3654940416),B+=3),a=l.structuredClone?new Map:null,l.bundleStrings&&typeof w!="string"?(Tt=[],Tt.size=1/0):Tt=null,r=l.structures,r){if(r.uninitialized){let H=l.getShared()||{};l.structures=r=H.structures||[],l.sharedVersion=H.version;let U=l.sharedValues=H.packedValues;if(U){E={};for(let G=0,Q=U.length;G<Q;G++)E[U[G]]=G}}let M=r.length;if(M>d&&!c&&(M=d),!r.transitions){r.transitions=Object.create(null);for(let H=0;H<M;H++){let U=r[H];if(!U)continue;let G,Q=r.transitions;for(let _=0,se=U.length;_<se;_++){Q[Zt]===void 0&&(Q[Zt]=H);let te=U[_];G=Q[te],G||(G=Q[te]=Object.create(null)),Q=G}Q[Zt]=H|1048576}}c||(r.nextId=M)}if(i&&(i=!1),s=r||[],p=E,t.pack){let M=new Map;if(M.values=[],M.encoder=l,M.maxValues=t.maxPrivatePackedValues||(E?16:1/0),M.objectMap=E||!1,M.samplingPackedValues=h,Oa(w,M),M.values.length>0){V[B++]=216,V[B++]=51,Mn(4);let H=M.values;k(H),Mn(0),Mn(0),p=Object.create(E||null);for(let U=0,G=H.length;U<G;U++)p[H[U]]=U}}gl=L&El;try{if(gl)return;if(k(w),Tt&&Gh(n,k),l.offset=B,a&&a.idsToInsert){B+=a.idsToInsert.length*2,B>lr&&D(B),l.offset=B;let M=eM(V.subarray(n,B),a.idsToInsert);return a=null,M}return L&qh?(V.start=n,V.end=B,V):V.subarray(n,B)}finally{if(r){if(y<10&&y++,r.length>d&&(r.length=d),b>1e4)r.transitions=null,y=0,b=0,T.length>0&&(T=[]);else if(T.length>0&&!c){for(let M=0,H=T.length;M<H;M++)T[M][Zt]=void 0;T=[]}}if(i&&l.saveShared){l.structures.length>d&&(l.structures=l.structures.slice(0,d));let M=V.subarray(n,B);return l.updateSharedData()===!1?l.encode(w):M}L&nM&&(B=n)}},this.findCommonStringsToPack=()=>(h=new Map,E||(E=Object.create(null)),w=>{let L=w&&w.threshold||4,M=this.pack?w.maxPrivatePackedValues||16:0;m||(m=this.sharedValues=[]);for(let[H,U]of h)U.count>L&&(E[H]=M++,m.push(H),i=!0);for(;this.saveShared&&this.updateSharedData()===!1;);h=null});const k=w=>{B>lr&&(V=D(B));var L=typeof w,M;if(L==="string"){if(p){let Q=p[w];if(Q>=0){Q<16?V[B++]=Q+224:(V[B++]=198,Q&1?k(15-Q>>1):k(Q-16>>1));return}else if(h&&!t.pack){let _=h.get(w);_?_.count++:h.set(w,{count:1})}}let H=w.length;if(Tt&&H>=4&&H<1024){if((Tt.size+=H)>KP){let _,se=(Tt[0]?Tt[0].length*3+Tt[1].length:0)+10;B+se>lr&&(V=D(B+se)),V[B++]=217,V[B++]=223,V[B++]=249,V[B++]=Tt.position?132:130,V[B++]=26,_=B-n,B+=4,Tt.position&&Gh(n,k),Tt=["",""],Tt.size=0,Tt.position=_}let Q=XP.test(w);Tt[Q?0:1]+=w,V[B++]=Q?206:207,k(H);return}let U;H<32?U=1:H<256?U=2:H<65536?U=3:U=5;let G=H*3;if(B+G>lr&&(V=D(B+G)),H<64||!o){let Q,_,se,te=B+U;for(Q=0;Q<H;Q++)_=w.charCodeAt(Q),_<128?V[te++]=_:_<2048?(V[te++]=_>>6|192,V[te++]=_&63|128):(_&64512)===55296&&((se=w.charCodeAt(Q+1))&64512)===56320?(_=65536+((_&1023)<<10)+(se&1023),Q++,V[te++]=_>>18|240,V[te++]=_>>12&63|128,V[te++]=_>>6&63|128,V[te++]=_&63|128):(V[te++]=_>>12|224,V[te++]=_>>6&63|128,V[te++]=_&63|128);M=te-B-U}else M=o(w,B+U,G);M<24?V[B++]=96|M:M<256?(U<2&&V.copyWithin(B+2,B+1,B+1+M),V[B++]=120,V[B++]=M):M<65536?(U<3&&V.copyWithin(B+3,B+2,B+2+M),V[B++]=121,V[B++]=M>>8,V[B++]=M&255):(U<5&&V.copyWithin(B+5,B+3,B+3+M),V[B++]=122,rt.setUint32(B,M),B+=4),B+=M}else if(L==="number")if(!this.alwaysUseFloat&&w>>>0===w)w<24?V[B++]=w:w<256?(V[B++]=24,V[B++]=w):w<65536?(V[B++]=25,V[B++]=w>>8,V[B++]=w&255):(V[B++]=26,rt.setUint32(B,w),B+=4);else if(!this.alwaysUseFloat&&w>>0===w)w>=-24?V[B++]=31-w:w>=-256?(V[B++]=56,V[B++]=~w):w>=-65536?(V[B++]=57,rt.setUint16(B,~w),B+=2):(V[B++]=58,rt.setUint32(B,~w),B+=4);else{let H;if((H=this.useFloat32)>0&&w<4294967296&&w>=-2147483648){V[B++]=250,rt.setFloat32(B,w);let U;if(H<4||(U=w*Pc[(V[B]&127)<<1|V[B+1]>>7])>>0===U){B+=4;return}else B--}V[B++]=251,rt.setFloat64(B,w),B+=8}else if(L==="object")if(!w)V[B++]=246;else{if(a){let U=a.get(w);if(U){if(V[B++]=216,V[B++]=29,V[B++]=25,!U.references){let G=a.idsToInsert||(a.idsToInsert=[]);U.references=[],G.push(U)}U.references.push(B-n),B+=2;return}else a.set(w,{offset:B-n})}let H=w.constructor;if(H===Object)P(w);else if(H===Array){M=w.length,M<24?V[B++]=128|M:Mn(M);for(let U=0;U<M;U++)k(w[U])}else if(H===Map)if((this.mapsAsObjects?this.useTag259ForMaps!==!1:this.useTag259ForMaps)&&(V[B++]=217,V[B++]=1,V[B++]=3),M=w.size,M<24?V[B++]=160|M:M<256?(V[B++]=184,V[B++]=M):M<65536?(V[B++]=185,V[B++]=M>>8,V[B++]=M&255):(V[B++]=186,rt.setUint32(B,M),B+=4),l.keyMap)for(let[U,G]of w)k(l.encodeKey(U)),k(G);else for(let[U,G]of w)k(U),k(G);else{for(let U=0,G=bu.length;U<G;U++){let Q=Eb[U];if(w instanceof Q){let _=bu[U],se=_.tag;se==null&&(se=_.getTag&&_.getTag.call(this,w)),se<24?V[B++]=192|se:se<256?(V[B++]=216,V[B++]=se):se<65536?(V[B++]=217,V[B++]=se>>8,V[B++]=se&255):se>-1&&(V[B++]=218,rt.setUint32(B,se),B+=4),_.encode.call(this,w,k,D);return}}if(w[Symbol.iterator]){if(gl){let U=new Error("Iterable should be serialized as iterator");throw U.iteratorNotHandled=!0,U}V[B++]=159;for(let U of w)k(U);V[B++]=255;return}if(w[Symbol.asyncIterator]||bl(w)){let U=new Error("Iterable/blob should be serialized as iterator");throw U.iteratorNotHandled=!0,U}if(this.useToJSON&&w.toJSON){const U=w.toJSON();if(U!==w)return k(U)}P(w)}}else if(L==="boolean")V[B++]=w?245:244;else if(L==="bigint"){if(w<BigInt(1)<<BigInt(64)&&w>=0)V[B++]=27,rt.setBigUint64(B,w);else if(w>-(BigInt(1)<<BigInt(64))&&w<0)V[B++]=59,rt.setBigUint64(B,-w-BigInt(1));else if(this.largeBigIntToFloat)V[B++]=251,rt.setFloat64(B,Number(w));else{w>=BigInt(0)?V[B++]=194:(V[B++]=195,w=BigInt(-1)-w);let H=[];for(;w;)H.push(Number(w&BigInt(255))),w>>=BigInt(8);Eu(new Uint8Array(H.reverse()),D);return}B+=8}else if(L==="undefined")V[B++]=247;else throw new Error("Unknown type: "+L)},P=this.useRecords===!1?this.variableMapSize?w=>{let L=Object.keys(w),M=Object.values(w),H=L.length;if(H<24?V[B++]=160|H:H<256?(V[B++]=184,V[B++]=H):H<65536?(V[B++]=185,V[B++]=H>>8,V[B++]=H&255):(V[B++]=186,rt.setUint32(B,H),B+=4),l.keyMap)for(let U=0;U<H;U++)k(l.encodeKey(L[U])),k(M[U]);else for(let U=0;U<H;U++)k(L[U]),k(M[U])}:w=>{V[B++]=185;let L=B-n;B+=2;let M=0;if(l.keyMap)for(let H in w)(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(H))&&(k(l.encodeKey(H)),k(w[H]),M++);else for(let H in w)(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(H))&&(k(H),k(w[H]),M++);V[L+++n]=M>>8,V[L+n]=M&255}:(w,L)=>{let M,H=s.transitions||(s.transitions=Object.create(null)),U=0,G=0,Q,_;if(this.keyMap){_=Object.keys(w).map(te=>this.encodeKey(te)),G=_.length;for(let te=0;te<G;te++){let S=_[te];M=H[S],M||(M=H[S]=Object.create(null),U++),H=M}}else for(let te in w)(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(te))&&(M=H[te],M||(H[Zt]&1048576&&(Q=H[Zt]&65535),M=H[te]=Object.create(null),U++),H=M,G++);let se=H[Zt];if(se!==void 0)se&=65535,V[B++]=217,V[B++]=se>>8|224,V[B++]=se&255;else if(_||(_=H.__keys__||(H.__keys__=Object.keys(w))),Q===void 0?(se=s.nextId++,se||(se=0,s.nextId=1),se>=Vh&&(s.nextId=(se=d)+1)):se=Q,s[se]=_,se<d){V[B++]=217,V[B++]=se>>8|224,V[B++]=se&255,H=s.transitions;for(let te=0;te<G;te++)(H[Zt]===void 0||H[Zt]&1048576)&&(H[Zt]=se),H=H[_[te]];H[Zt]=se|1048576,i=!0}else{if(H[Zt]=se,rt.setUint32(B,3655335680),B+=3,U&&(b+=y*U),T.length>=Vh-d&&(T.shift()[Zt]=void 0),T.push(H),Mn(G+2),k(57344+se),k(_),L)return;for(let te in w)(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(te))&&k(w[te]);return}if(G<24?V[B++]=128|G:Mn(G),!L)for(let te in w)(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(te))&&k(w[te])},D=w=>{let L;if(w>16777216){if(w-n>Wh)throw new Error("Encoded buffer would be larger than maximum buffer size");L=Math.min(Wh,Math.round(Math.max((w-n)*(w>67108864?1.25:2),4194304)/4096)*4096)}else L=(Math.max(w-n<<2,V.length-1)>>12)+1<<12;let M=new ml(L);return rt=new DataView(M.buffer,0,L),V.copy?V.copy(M,0,n,w):M.set(V.slice(n,w)),B-=n,n=0,lr=M.length-10,V=M};let v=100,A=1e3;this.encodeAsIterable=function(w,L){return W(w,L,N)},this.encodeAsAsyncIterable=function(w,L){return W(w,L,j)};function*N(w,L,M){let H=w.constructor;if(H===Object){let U=l.useRecords!==!1;U?P(w,!0):Yh(Object.keys(w).length,160);for(let G in w){let Q=w[G];U||k(G),Q&&typeof Q=="object"?L[G]?yield*N(Q,L[G]):yield*z(Q,L,G):k(Q)}}else if(H===Array){let U=w.length;Mn(U);for(let G=0;G<U;G++){let Q=w[G];Q&&(typeof Q=="object"||B-n>v)?L.element?yield*N(Q,L.element):yield*z(Q,L,"element"):k(Q)}}else if(w[Symbol.iterator]&&!w.buffer){V[B++]=159;for(let U of w)U&&(typeof U=="object"||B-n>v)?L.element?yield*N(U,L.element):yield*z(U,L,"element"):k(U);V[B++]=255}else bl(w)?(Yh(w.size,64),yield V.subarray(n,B),yield w,R()):w[Symbol.asyncIterator]?(V[B++]=159,yield V.subarray(n,B),yield w,R(),V[B++]=255):k(w);M&&B>n?yield V.subarray(n,B):B-n>v&&(yield V.subarray(n,B),R())}function*z(w,L,M){let H=B-n;try{k(w),B-n>v&&(yield V.subarray(n,B),R())}catch(U){if(U.iteratorNotHandled)L[M]={},B=n+H,yield*N.call(this,w,L[M]);else throw U}}function R(){v=A,l.encode(null,El)}function W(w,L,M){return L&&L.chunkThreshold?v=A=L.chunkThreshold:v=100,w&&typeof w=="object"?(l.encode(null,El),M(w,l.iterateProperties||(l.iterateProperties={}),!0)):[l.encode(w)]}async function*j(w,L){for(let M of N(w,L,!0)){let H=M.constructor;if(H===$h||H===Uint8Array)yield M;else if(bl(M)){let U=M.stream().getReader(),G;for(;!(G=await U.read()).done;)yield G.value}else if(M[Symbol.asyncIterator])for await(let U of M)R(),U?yield*j(U,L.async||(L.async={})):yield l.encode(U);else yield M}}}useBuffer(t){V=t,rt=new DataView(V.buffer,V.byteOffset,V.byteLength),B=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 Tb(n,this.sharedValues,this.sharedVersion),i=this.saveShared(r,s=>(s&&s.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((s,a)=>this.structures[a]=s),i}}function Yh(e,t){e<24?V[B++]=t|e:e<256?(V[B++]=t|24,V[B++]=e):e<65536?(V[B++]=t|25,V[B++]=e>>8,V[B++]=e&255):(V[B++]=t|26,rt.setUint32(B,e),B+=4)}class Tb{constructor(t,n,r){this.structures=t,this.packedValues=n,this.version=r}}function Mn(e){e<24?V[B++]=128|e:e<256?(V[B++]=152,V[B++]=e):e<65536?(V[B++]=153,V[B++]=e>>8,V[B++]=e&255):(V[B++]=154,rt.setUint32(B,e),B+=4)}const ZP=typeof Blob>"u"?function(){}:Blob;function bl(e){if(e instanceof ZP)return!0;let t=e[Symbol.toStringTag];return t==="Blob"||t==="File"}function Oa(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++)Oa(e[r],t);else{let r=!t.encoder.useRecords;for(var n in e)e.hasOwnProperty(n)&&(r&&Oa(n,t),Oa(e[n],t))}break;case"function":console.log(e)}}const JP=new Uint8Array(new Uint16Array([1]).buffer)[0]==1;Eb=[Date,Set,Error,RegExp,Wr,ArrayBuffer,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>"u"?function(){}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"?function(){}:BigInt64Array,Float32Array,Float64Array,Tb];bu=[{tag:1,encode(e,t){let n=e.getTime()/1e3;(this.useTimestamp32||e.getMilliseconds()===0)&&n>=0&&n<4294967296?(V[B++]=26,rt.setUint32(B,n),B+=4):(V[B++]=251,rt.setFloat64(B,n),B+=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){Eu(e,n)}},{getTag(e){if(e.constructor===Uint8Array&&(this.tagUint8Array||Qs&&this.tagUint8Array!==!1))return 64},encode(e,t,n){Eu(e,n)}},Dn(68,1),Dn(69,2),Dn(70,4),Dn(71,8),Dn(72,1),Dn(77,2),Dn(78,4),Dn(79,8),Dn(85,4),Dn(86,8),{encode(e,t){let n=e.packedValues||[],r=e.structures||[];if(n.values.length>0){V[B++]=216,V[B++]=51,Mn(4);let i=n.values;t(i),Mn(0),Mn(0),packedObjectMap=Object.create(sharedPackedObjectMap||null);for(let s=0,a=i.length;s<a;s++)packedObjectMap[i[s]]=s}if(r){rt.setUint32(B,3655335424),B+=3;let i=r.slice(0);i.unshift(57344),i.push(new Wr(e.version,1399353956)),t(i)}else t(new Wr(e.version,1399353956))}}];function Dn(e,t){return!JP&&t>1&&(e-=4),{tag:e,encode:function(r,i){let s=r.byteLength,a=r.byteOffset||0,o=r.buffer||r;i(Qs?Lo.from(o,a,s):new Uint8Array(o,a,s))}}}function Eu(e,t){let n=e.byteLength;n<24?V[B++]=64+n:n<256?(V[B++]=88,V[B++]=n):n<65536?(V[B++]=89,V[B++]=n>>8,V[B++]=n&255):(V[B++]=90,rt.setUint32(B,n),B+=4),B+n>=V.length&&t(B+n),V.set(e.buffer?e:new Uint8Array(e),B),B+=n}function eM(e,t){let n,r=t.length*2,i=e.length-r;t.sort((s,a)=>s.offset>a.offset?1:-1);for(let s=0;s<t.length;s++){let a=t[s];a.id=s;for(let o of a.references)e[o++]=s>>8,e[o]=s&255}for(;n=t.pop();){let s=n.offset;e.copyWithin(s+r,s,i),r-=2;let a=s+r;e[a++]=216,e[a++]=28,i=s}return e}function Gh(e,t){rt.setUint32(Tt.position+e,B-Tt.position-e+1);let n=Tt;Tt=null,t(n[0]),t(n[1])}let Bc=new QP({useRecords:!1});const tM=Bc.encode;Bc.encodeAsIterable;Bc.encodeAsAsyncIterable;const qh=512,nM=1024,El=2048;async function Ft(e,t){var i;const n=await fetch("/api/rpc",{method:"POST",headers:{"Content-Type":"application/cbor",Accept:"application/cbor"},body:new Uint8Array(tM({method:e,params:t??{}}))});if(!n.ok){try{const s=await n.arrayBuffer(),a=zh(new Uint8Array(s));if((i=a==null?void 0:a.error)!=null&&i.message)throw new Error(a.error.message)}catch(s){if(s instanceof Error&&s.message!==`RPC call ${e} failed`)throw s}throw new Error(`RPC call ${e} failed: ${n.status} ${n.statusText}`)}const r=await n.arrayBuffer();return zh(new Uint8Array(r))}async function HM(e,t){return Ft("fetchRuns",{worldEnv:e,params:t})}async function UM(e,t,n="all"){return Ft("fetchRun",{worldEnv:e,runId:t,resolveData:n})}async function jM(e,t,n,r="all"){return Ft("fetchStep",{worldEnv:e,runId:t,stepId:n,resolveData:r})}async function zM(e,t,n){return Ft("fetchEvents",{worldEnv:e,runId:t,params:n})}async function $M(e,t,n,r="all"){return Ft("fetchEvent",{worldEnv:e,runId:t,eventId:n,resolveData:r})}async function VM(e,t){return Ft("fetchHooks",{worldEnv:e,params:t})}async function WM(e,t,n="all"){return Ft("fetchHook",{worldEnv:e,hookId:t,resolveData:n})}async function YM(e,t){return Ft("cancelRun",{worldEnv:e,runId:t})}async function GM(e,t,n){return Ft("recreateRun",{worldEnv:e,runId:t,deploymentId:n})}async function qM(e,t){return Ft("reenqueueRun",{worldEnv:e,runId:t})}async function KM(e,t,n){return Ft("wakeUpRun",{worldEnv:e,runId:t,options:n})}async function XM(e,t,n){return Ft("resumeHook",{worldEnv:e,token:t,payload:n})}async function QM(e,t){return Ft("fetchStreams",{worldEnv:e,runId:t})}async function ZM(e){return Ft("fetchWorkflowsManifest",{worldEnv:e})}async function JM(e,t,n){return Ft("runHealthCheck",{worldEnv:e,endpoint:t,options:n})}async function e8(e,t){return Ft("getEncryptionKeyForRun",{worldEnv:e,runId:t})}const rM=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:nb},Symbol.toStringTag,{value:"Module"}));export{dM as $,cT as A,PP as B,dT as C,NM as D,FM as E,UM as F,LP as G,Ap as H,oM as I,ZM as J,xM as K,uM as L,Fd as M,O2 as N,on as O,Gr as P,ZL as Q,En as R,MM as S,DM as T,m_ as U,xT as V,Qm as W,hM as X,qy as Y,cM as Z,a4 as _,PM as a,Bx as a0,Pt as a1,No as a2,oe as a3,wM as a4,AM as a5,yP as a6,Za as a7,CM as a8,Ro as a9,e8 as aA,RM as aB,Fx as aC,db as aD,WE as aE,GE as aF,qE as aG,XE as aH,QE as aI,JE as aJ,ZE as aK,KE as aL,PE as aM,YM as aN,qM as aO,KM as aP,XM as aQ,GM as aR,pr as aa,Ns as ab,l4 as ac,ma as ad,kM as ae,yM as af,li as ag,u4 as ah,vM as ai,SM as aj,IM as ak,_M as al,pM as am,fM as an,WM as ao,jM as ap,QM as aq,fb as ar,vP as as,DP as at,Vu as au,ks as av,sn as aw,R2 as ax,OM as ay,$M as az,IP as b,Qp as c,ub as d,mM as e,CT as f,Hr as g,gM as h,HM as i,VM as j,LM as k,zM as l,to as m,Yr as n,bp as o,Jh as p,Xn as q,JM as r,$b as s,Wo as t,BM as u,Cb as v,np as w,bT as x,uT as y,fT as z};